Turtlesim#

Run a ROS 2 simulation sample application in the Docker* container.

  1. Check if your installation has the turtlesim Docker* image.

    docker images |grep amr-turtlesim
    #if you have it installed, the result is:
    amr-turtlesim
    

    Note

    If the image is not installed, continuing with these steps triggers a build that takes longer than an hour (sometimes, a lot longer depending on the system resources and internet connection).

  2. If the image is not installed, Intel® recommends installing the Robot Complete Kit (see Get Started Guide for Robots Step 3).

  3. Check that EI for AMR environment is set:

    echo $AMR_TUTORIALS
    # should output the path to EI for AMR tutorials
    /home/user/edge_insights_for_amr/Edge_Insights_for_Autonomous_Mobile_Robots_2023.1/AMR_containers/01_docker_sdk_env/docker_compose/05_tutorials
    

    If nothing is output, refer to Get Started Guide for Robots Step 5 for information on how to configure the environment.

  4. Run an automated yml file that opens a ROS 2 sample application inside the EI for AMR Docker* container.

    docker compose -f $AMR_TUTORIALS/turtlesim.tutorial.yml up
    
  5. Go to Plugins > 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. Press Call. The turtle should move. Close the service caller window by pressing x. Then type Ctrl-c.

    ../_images/23D9D8D8-AFB8-43EF-98A3-995EE956EF5B-low.png
  6. To close this, do the following:

    • Type Ctrl-c in the terminal where you did the up command.

    • Run this command in another terminal:

    docker compose -f $AMR_TUTORIALS/turtlesim.tutorial.yml down
    
  7. For an explanation of what happened, open the yml file:

    • The first 23 lines are from the EI for AMR infrastructure.

    • Line 26 starts the turtlesim ROS 2 node.

    • Line 31 starts the rqt so that the turtle can be controlled.