The LGDXRobot2 ROS 2 Docker image comes with development tools installed, allowing custom ROS 2 packages to be developed. This tutorial shows how to build custom ROS 2 package. It is based on the ROS 2 documentation.

  1. Create a workspace on the host machine and clone the tutorials
mkdir -p ~/my_ws/src
cd ~/my_ws/src
git clone https://github.com/ros/ros_tutorials.git -b jazzy
  1. Start the Docker container and mount the workspace
docker run -d  \
  --name lgdxrobot2 \
  -e PUID=1000 \
  -e PGID=1000 \
  -v ~/my_ws/src:/config/my_ws/src \
  -p 3000:3000 \
  -p 3001:3001 yukaitung/lgdxrobot2-desktop:latest
  1. The web interface is now accessible at http://localhost:3000.
  2. In the terminal, run the following command to gain access to the workspace. Any error messages can be safely ignored.
sudo chown -R 1000:1000 ~/my_ws
  1. Install dependencies and build the workspace
cd my_ws
rosdep install -i --from-path src --rosdistro jazzy -y
colcon build
  1. Source the workspace
source install/local_setup.bash
  1. Start the example node. It will open a window demonstrating the tutorial package.
ros2 run turtlesim turtlesim_node

Screenshot