ros2lab

#FirstTurtle: seven days, seven small ROS 2 tasks

One task a day, about ten minutes each, all inside free Level 1. You type real ROS 2 Jazzy commands into the Browser Lab and watch a turtle obey. On day 7 the turtle draws your initial.

Start Level 1 free

Lab needs a laptop or desktop. On a phone you can read lessons and keep your progress.

Every command below comes from a Level 1 lesson. The Browser Lab runs the real launch files and JavaScript models of the ROS 2 programs, not the compiled programs. Open lesson 1.3, start the lab, and paste each command into a terminal. Press Ctrl+Shift+E for a second terminal.

  1. Day 1: move the turtle

    Lessons 1.3 and 1.4. In Terminal 1 start the turtle window, then in Terminal 2 send it one speed command.

    ros2 run turtlesim turtlesim_node
    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0}, angular: {z: 1.8}}"
  2. Day 2: ask where the turtle is

    Lessons 1.3 and 1.4. List the running nodes, then read one pose message.

    ros2 node list
    ros2 topic echo /turtle1/pose --once
  3. Day 3: draw a square

    Lesson 1.4, the topic pub command, used twice in a row, four times over. Send the first line, wait until the turtle stops, send the second line, and repeat both three more times.

    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 2.0}}"
    ros2 topic pub --once /turtle1/cmd_vel geometry_msgs/msg/Twist "{angular: {z: 1.5708}}"
  4. Day 4: add a second turtle

    Lesson 1.4. Ask turtlesim for a new turtle through a service.

    ros2 service call /spawn turtlesim/srv/Spawn "{x: 2.0, y: 2.0, theta: 0.0, name: 'turtle2'}"
  5. Day 5: paint the background

    Lesson 1.4. Change a parameter, then ask turtlesim to repaint its window.

    ros2 param set /turtlesim background_r 150
    ros2 service call /clear std_srvs/srv/Empty
  6. Day 6: turn on the spot

    Lesson 1.4. Send the turtle an action goal: face straight up, and watch it report its progress.

    ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: 1.57}" --feedback
  7. Day 7: draw your initial

    Lesson 1.3 lab, with the services from lesson 1.4. The pen goes up, the turtle jumps to the top of the letter, the pen goes down, and the turtle jumps along the strokes. This draws an L. For another letter, change the x and y numbers (the window is about 11 by 11). In the lab, a jump with the pen down draws a line. Write 'off' in quotes: unquoted, YAML reads off as false and ROS 2 refuses the line.

    ros2 service call /turtle1/set_pen turtlesim/srv/SetPen "{r: 255, g: 140, b: 0, width: 4, 'off': 1}"
    ros2 service call /turtle1/teleport_absolute turtlesim/srv/TeleportAbsolute "{x: 3.0, y: 8.0, theta: 0.0}"
    ros2 service call /turtle1/set_pen turtlesim/srv/SetPen "{r: 255, g: 140, b: 0, width: 4, 'off': 0}"
    ros2 service call /turtle1/teleport_absolute turtlesim/srv/TeleportAbsolute "{x: 3.0, y: 3.0, theta: 0.0}"
    ros2 service call /turtle1/teleport_absolute turtlesim/srv/TeleportAbsolute "{x: 7.0, y: 3.0, theta: 0.0}"

    Take a screenshot of your letter and post it with #FirstTurtle.

Share your turtle

Post your screenshot with the tag #FirstTurtle. The buttons only open a pre-filled post; nothing is sent until you press post.

Post on X Share on LinkedIn

After the seven days

The seven days use lessons 1.3 and 1.4. The Level 1 certificate comes when every Level 1 lesson is done. Then open the course map, log in, and press "Request my certificate" on the Level 1 card. Every certificate has a public verification page. Certificates confirm course completion. They are not a job guarantee.

See also Pricing and the changelog.