diff --git a/README.md b/README.md index 0bedda3b..aafb4726 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Full documentation available [here](https://lbr-fri-ros2-stack-doc.readthedocs.i ```shell mkdir -p lbr-stack/src && cd lbr-stack vcs import src --input https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml - rosdep install --from-paths src --ignore-src -r -y + rosdep install --from-paths src -i -r -y ``` 3. Build @@ -56,6 +56,9 @@ Full documentation available [here](https://lbr-fri-ros2-stack-doc.readthedocs.i moveit:=true # [true, false] ``` +> [!TIP] +> List all arguments for the launch file via `ros2 launch lbr_bringup bringup.launch.py -s` + Now, run the [demos](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/lbr_fri_ros2_stack/lbr_demos/doc/lbr_demos.html). To get started with the real robot, checkout the [Documentation](https://lbr-fri-ros2-stack-doc.readthedocs.io/en/humble/index.html) above. ## Citation diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..d8bed9c5 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,24 @@ +FROM ros:humble-ros-base-jammy + +# change default shell to bash +SHELL ["/bin/bash", "-c"] + +ARG FRI_CLIENT_VERSION=1.15 + +RUN apt update -y + +# create workspace +RUN mkdir -p home/ros2_ws/src +WORKDIR /home/ros2_ws/ + +COPY ./src /home/ros2_ws/src +RUN rosdep install -i --from-paths src --rosdistro ${ROS_DISTRO} -y + +# "--symlink-install" allows the code in the locally mounted volume ./src to be adjusted without rebuilding +RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \ + colcon build --symlink-install --cmake-args -DFRI_CLIENT_VERSION=${FRI_CLIENT_VERSION} --no-warn-unused-cli + +# source the workspace +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc +RUN source /home/ros2_ws/install/local_setup.bash && echo "source /home/ros2_ws/install/local_setup.bash" >> ~/.bashrc +CMD ["/bin/bash"] diff --git a/docker/container_build.sh b/docker/container_build.sh new file mode 100755 index 00000000..edf2ed21 --- /dev/null +++ b/docker/container_build.sh @@ -0,0 +1,18 @@ +# dont forget to chmod +x container_build.sh +xhost + + +docker rm lbr_stack_container + +docker build --build-arg FRI_CLIENT_VERSION=$1 -t lbr_stack_container . + +docker run -it \ + --network host \ + --ipc host \ + --volume ./src:/home/ros2_ws/src \ + --volume /tmp/.X11-unix:/tmp/.X11-unix \ + --volume /dev/shm:/dev/shm \ + --volume /dev:/dev --privileged \ + --env DISPLAY \ + --env QT_X11_NO_MITSHM=1 \ + --name lbr_stack_container \ + lbr_stack_container diff --git a/docker/container_new_console.sh b/docker/container_new_console.sh new file mode 100755 index 00000000..f3e79746 --- /dev/null +++ b/docker/container_new_console.sh @@ -0,0 +1,2 @@ +# dont forget to chmod +x container_new_console.sh +docker exec -it lbr_stack_container bash diff --git a/docker/container_start.sh b/docker/container_start.sh new file mode 100755 index 00000000..ec82fec0 --- /dev/null +++ b/docker/container_start.sh @@ -0,0 +1,4 @@ +# dont forget to chmod +x container_new_console.sh +xhost + + +docker start lbr_stack_container -i diff --git a/docker/doc/docker.rst b/docker/doc/docker.rst new file mode 100644 index 00000000..a676a216 --- /dev/null +++ b/docker/doc/docker.rst @@ -0,0 +1,38 @@ +Docker +====== +To run the ``lbr_fri_ros2_stack`` in a Docker container, follow the instructions below. + +#. Install ROS 2 development tools + +.. code-block:: bash + + sudo apt install ros-dev-tools + +#. Create a workspace and clone + +.. code-block:: bash + + mkdir -p lbr-stack/src && cd lbr-stack + vcs import src --input https://raw.githubusercontent.com/lbr-stack/lbr_fri_ros2_stack/humble/lbr_fri_ros2_stack/repos.yaml + +#. Copy the Dockerfile and the container scripts to the ``lbr-stack`` directory. Build and start the container + +.. code-block:: bash + + cp -r src/lbr_fri_ros2_stack/docker/* . + chmod +x container_build.sh + sudo ./container_build.sh 1.15 # replace by your FRI client version + +#. Inside the container, launch e.g. simulation via (might require re-launch after Gazebo launched first time) + +.. code-block:: bash + + ros2 launch lbr_bringup bringup.launch.py model:=iiwa7 sim:=true moveit:=true + +.. note:: + + List all arguments for the launch file via + + .. code-block:: bash + + ros2 launch lbr_bringup bringup.launch.py -s