Yes, turtlesim exists in both ROS 1 and ROS 2, but with some differences in implementation and usage. Here's a breakdown:
| Feature | ROS 1 Turtlesim | ROS 2 Turtlesim |
|---|---|---|
| Purpose | Basic 2D simulator for learning ROS 1 | Updated 2D simulator for learning ROS 2 |
| Node Structure | Uses ROS 1 nodes (roscore required) |
Uses ROS 2 nodes (no central roscore) |
| CLI Commands | rosrun turtlesim turtlesim_node |
ros2 run turtlesim turtlesim_node |
| Teleop | rosrun turtlesim turtle_teleop_key |
ros2 run turtlesim turtle_teleop_key |
| Parameters | Accessed via rosparam |
Managed with ros2 param commands |
| Actions | Not natively supported | Includes actions (e.g., rotate_absolute) |
| QoS | N/A | Configurable via DDS QoS policies |
| Domain ID | N/A | Uses domain IDs for network isolation |
/cmd_vel (velocity commands), /pose (turtle position), and /color_sensor (trail color).roscore for node discovery.roscore[^8^]./turtle1/rotate_absolute) and parameters with dynamic reconfiguration[^3^][^6^]./spawn and /kill.ros2 CLI (e.g., ros2 topic pub instead of rostopic pub).rosrun, rostopic, and rosservice.bash*# Start simulator* roscore & rosrun turtlesim turtlesim_node rosrun turtlesim turtle_teleop_key
`bash*# Start simulator* ros2 run turtlesim turtlesim_node ros2 run turtlesim turtle_teleop_key
# Rotate turtle using an action ros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute "{theta: 1.57}" --feedback`