Step 6. Run a ROS 2 Sample Application in the Docker* Container
- Check if your installation has the turtlesim Docker* image.docker images |grep amr-turtlesim #if you have it installed, the result is: amr-turtlesimIf the image is not installed, continuing with these stepstriggers a build that takes longer than an hour(sometimes, a lot longer depending on the system resources and internet connection).
- Go to theAMR_containersfolder:cd <edge_insights_for_amr_path>/Edge_Insights_for_Autonomous_Mobile_Robots_*/AMR_containers
- Prepare the environment setup:source ./01_docker_sdk_env/docker_compose/common/docker_compose.source export CONTAINER_BASE_PATH=`pwd` export ROS_DOMAIN_ID=12The “Access control disabled, clients cannot connect from any host.” message is expected and does not impact functionality.
- Run an automated yml file that opens a ROS 2 sample application inside the EI for AMR Docker* container.CHOOSE_USER=eiforamr docker-compose -f 01_docker_sdk_env/docker_compose/05_tutorials/turtlesim.tutorial.yml up
- Go toPlugins > Services > Service Caller: Choose to move turtle1 by choosing (from the Service drop-down list) /turtle1/teleport_absolute and make sure you changed x and y coordinates for the original values. PressCall. The turtle should move. Close the service caller window by pressingx. Then typeCtrl-c.
- To close this, do one of the following:
CHOOSE_USER=eiforamr docker-compose -f 01_docker_sdk_env/docker_compose/05_tutorials/turtlesim.tutorial.yml down
- TypeCtrl-cin the terminal where you did the up command.
- Close the rqt window.
- Run this command in another terminal:
- For an explanation of what happened, open the yml file:
- The first 23 lines are from the EI for AMR infrastructure.
- Line 26 starts theturtlesimROS 2 node.
- Line 31 starts the rqt so that the turtle can be controlled.