Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Introduction On using ROS/Docker

Basic Requirement

Any machine with Docker installed. Learn more about Docker and container here.

Setup ROS in Docker (demo video)

For x64 machine, run make init will download and initalize the container with ROS Foxy/Noetic.

If you don't have make, just copy and run line 6 in the Makefile.

For arm64 machine, run make build before running make init.

A CLI to the container will be granted after this step.

For GUI access, use your broswer to visit this page.

Other operations on the container can be found in the Makefile.

Play a ROS1 Bag File (demo video)

  1. Download a bag file from here and move it to the shared folder rootfs/. Learn more about ROS bag here.

  2. In the container CLI

    • run source ./noetic_setup.sh to initiate ROS 1 environment
    • run roscore & and rviz & to start RViz
    • run rosbag play -r 10 --loop rootfs/16-mcity1.bag to play the downloaded bag file
  3. In the container GUI

    • open config file demo.rviz in folder /root/rootfs/ from RViz, it should show the images and point clouds now

Try Some ROS1 Nodes

  1. Image ROS Node (view code | demo video)

    In the container GUI, open mutiple terminals

    • run source ./noetic_setup.sh; (roscore &); rosbag play -r 10 --loop rootfs/16-mcity1.bag in terminal 1
    • run source ./noetic_setup.sh; (rqt_image_view &); python3 /root/rootfs/image_subscriber.py in terminal 2
    • select image topic /front_camera/image_raw and /img_gray to see the original image and the gray image produced by the ROS node.
  2. PointCloud ROS Node (view code | demo video)

    In the container GUI,

    • run apt install -y python3-pcl; python3 /root/rootfs/point_cloud_subscriber.py in terminal 2
    • pointcloud file will be exported to shared folder rootfs/ by the ROS node

    In the host machine, use CouldCompare or Matlab to view the exported pointcloud file

Create Your ROS Package and Docker Image (ROS1 | ROS2 | Docker Cheat Sheets)

  1. Create a workspace with mkdir -p /root/rootfs/demo_workspace/src and initialize it following the tutorials [ROS 1, ROS 2]

  2. Follow the rest of tutorials to create your ROS package and ROS node [ROS 1, ROS 2]

  3. Add the dependencies of your package to Dockerfile.template and build your image with docker build -f Dockerfile.template --tag=IMAGE_NAME

Trouble shoot

  1. RLException: roscore cannot run as another roscore/master is already running
    • You only need one roscore, you can ignore this error

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages