-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from aica-technology/release/v0.2
Release Version 0.2.0
- Loading branch information
Showing
14 changed files
with
336 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Manual Build and Push | ||
|
||
# Run workflow by manual dispatch | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
cl_branch: | ||
description: 'If set, the desired branch of control libraries' | ||
required: false | ||
default: 'develop' | ||
|
||
jobs: | ||
build-publish: | ||
runs-on: ubuntu-latest | ||
name: Build and publish image | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
run: | | ||
IMAGE_NAME=network-interfaces:latest | ||
docker build . \ | ||
--build-arg CL_BRANCH=${{ inputs.cl_branch }} \ | ||
--tag ${IMAGE_NAME} | ||
shell: bash | ||
|
||
- name: Login to GitHub Container Registry | ||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
shell: bash | ||
|
||
- name: Push image | ||
run: | | ||
IMAGE_NAME=network-interfaces:latest | ||
docker tag ${IMAGE_NAME} ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME} | ||
docker push ghcr.io/${{ github.repository_owner }}/${IMAGE_NAME} | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,36 @@ | ||
ARG ROS_VERSION=foxy | ||
FROM ghcr.io/aica-technology/ros2-control-libraries:${ROS_VERSION} AS core-dependencies | ||
FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies as source-dependencies | ||
|
||
RUN sudo apt-get update && sudo apt-get install -y \ | ||
libmbedtls-dev \ | ||
libsodium-dev \ | ||
libzmq3-dev \ | ||
&& sudo rm -rf /var/lib/apt/lists/* | ||
RUN apt-get update && apt-get install -y libmbedtls-dev libsodium-dev libzmq3-dev \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# install cppzmq bindings | ||
ARG CPPZMQ_VERSION=4.7.1 | ||
WORKDIR /tmp | ||
ARG CPPZMQ_VERSION=4.7.1 | ||
RUN wget https://github.com/zeromq/cppzmq/archive/v${CPPZMQ_VERSION}.tar.gz -O cppzmq-${CPPZMQ_VERSION}.tar.gz | ||
RUN tar -xzf cppzmq-${CPPZMQ_VERSION}.tar.gz | ||
WORKDIR /tmp/cppzmq-${CPPZMQ_VERSION} | ||
RUN mkdir build && cd build && cmake .. -DCPPZMQ_BUILD_TESTS=OFF && make -j install | ||
|
||
WORKDIR /tmp | ||
RUN rm -rf cppzmq* | ||
ARG CONTROL_LIBRARIES_BRANCH=develop | ||
RUN git clone -b ${CONTROL_LIBRARIES_BRANCH} --depth 1 https://github.com/epfl-lasa/control-libraries.git | ||
RUN cd control-libraries/source && sudo ./install.sh --auto --no-controllers --no-dynamical-systems --no-robot-model | ||
RUN cd control-libraries/protocol && sudo ./install.sh --auto | ||
RUN pip3 install control-libraries/python | ||
|
||
RUN rm -rf /tmp/* | ||
|
||
# install pyzmq | ||
RUN pip3 install pyzmq | ||
|
||
WORKDIR ${HOME} | ||
FROM source-dependencies as build-test | ||
|
||
# Clean image | ||
RUN sudo apt-get clean && sudo rm -rf /var/lib/apt/lists/* | ||
WORKDIR ${HOME} | ||
COPY --chown=${USER} ./cpp ./network_interfaces/cpp | ||
COPY --chown=${USER} ./python ./network_interfaces/python | ||
|
||
FROM core-dependencies AS build-test | ||
RUN cd ./network_interfaces/cpp && mkdir build && cd build && cmake -DBUILD_TESTING=ON .. \ | ||
&& make -j && CTEST_OUTPUT_ON_FAILURE=1 make test && make -j install | ||
RUN cd ./network_interfaces/python && pip3 install ./ && python3 -m unittest discover ./test --verbose | ||
|
||
COPY ./ ./ | ||
RUN cd cpp && mkdir build && cd build && cmake -DBUILD_TESTING=ON .. \ | ||
&& make -j all && CTEST_OUTPUT_ON_FAILURE=1 make test | ||
RUN cd python && pip install ./ && python3 -m unittest discover ./network_interfaces/tests --verbose | ||
# Clean image | ||
RUN rm -rf ./network_interfaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <unistd.h> | ||
#include <state_representation/robot/JointState.hpp> | ||
#include <state_representation/space/cartesian/CartesianState.hpp> | ||
|
||
#include "network_interfaces/zmq/network.h" | ||
|
||
int main(int argc, char** argv) { | ||
std::string state_uri, command_uri; | ||
if (argc != 3) { | ||
std::cerr << "Provide two arguments: state_uri command_uri" << std::endl; | ||
return 1; | ||
} else { | ||
state_uri = argv[1]; | ||
command_uri = argv[2]; | ||
} | ||
::zmq::context_t context(1); | ||
::zmq::socket_t subscriber, publisher; | ||
network_interfaces::zmq::configure_subscriber(context, subscriber, command_uri, false); | ||
network_interfaces::zmq::configure_publisher(context, publisher, state_uri, false); | ||
|
||
network_interfaces::zmq::StateMessage state; | ||
state.joint_state = state_representation::JointState::Random("loopback", 7); | ||
state.ee_state = state_representation::CartesianState::Random("loopback_ee"); | ||
network_interfaces::zmq::CommandMessage command; | ||
|
||
while (true) { | ||
network_interfaces::zmq::send(state, publisher); | ||
if (network_interfaces::zmq::receive(command, subscriber)) { | ||
std::cout << command << std::endl; | ||
} | ||
usleep(100000); | ||
} | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include <unistd.h> | ||
#include <state_representation/robot/JointState.hpp> | ||
|
||
#include "network_interfaces/zmq/network.h" | ||
|
||
int main(int argc, char** argv) { | ||
std::string state_uri, command_uri; | ||
if (argc != 3) { | ||
std::cerr << "Provide two arguments: state_uri command_uri" << std::endl; | ||
return 1; | ||
} else { | ||
state_uri = argv[1]; | ||
command_uri = argv[2]; | ||
} | ||
::zmq::context_t context(1); | ||
::zmq::socket_t subscriber, publisher; | ||
network_interfaces::zmq::configure_subscriber(context, subscriber, state_uri, true); | ||
network_interfaces::zmq::configure_publisher(context, publisher, command_uri, true); | ||
|
||
network_interfaces::zmq::StateMessage state; | ||
network_interfaces::zmq::CommandMessage command; | ||
|
||
while (true) { | ||
if (network_interfaces::zmq::receive(state, subscriber)) { | ||
std::cout << state << std::endl; | ||
command.joint_state = state_representation::JointState::Zero(state.joint_state.get_name(), state.joint_state.get_names()); | ||
command.joint_state.set_positions(state.joint_state.get_positions()); | ||
command.control_type = std::vector<int>{3}; | ||
network_interfaces::zmq::send(command, publisher); | ||
} | ||
usleep(100000); | ||
} | ||
|
||
return 0; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
CONTROL_LIBRARIES_BRANCH=develop | ||
REMOTE_SSH_PORT=4420 | ||
|
||
IMAGE_NAME=aica-technology/network-interfaces | ||
IMAGE_STAGE=source-dependencies | ||
|
||
BUILD_FLAGS=() | ||
|
||
HELP_MESSAGE="Usage: ./dev-server.sh [-r] [-v] | ||
Build a Docker container for remote development. | ||
Options: | ||
-r, --rebuild Rebuild the image with no cache. | ||
-v, --verbose Show all the output of the Docker | ||
build process. | ||
-h, --help Show this help message." | ||
|
||
while [ "$#" -gt 0 ]; do | ||
case "$1" in | ||
-r|--rebuild) BUILD_FLAGS+=(--no-cache); shift 1;; | ||
-v|--verbose) BUILD_FLAGS+=(--progress=plain); shift 1;; | ||
-h|--help) echo "${HELP_MESSAGE}"; exit 0;; | ||
*) echo "Unknown option: $1" >&2; echo "${HELP_MESSAGE}"; exit 1;; | ||
esac | ||
done | ||
|
||
BUILD_FLAGS+=(--build-arg CONTROL_LIBRARIES_BRANCH="${CONTROL_LIBRARIES_BRANCH}") | ||
BUILD_FLAGS+=(-t "${IMAGE_NAME}:${IMAGE_STAGE}") | ||
BUILD_FLAGS+=(--target "${IMAGE_STAGE}") | ||
|
||
docker pull ghcr.io/epfl-lasa/control-libraries/development-dependencies || exit 1 | ||
DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . || exit 1 | ||
|
||
aica-docker server "${IMAGE_NAME}:${IMAGE_STAGE}" -u developer -p "${REMOTE_SSH_PORT}" |
Oops, something went wrong.