humble turtlesim – DEV Community
ros2 turtlesim
the humble turtlesim is a beginer level simulation tool
Hey everyone 👋 I’m Nagu, and this is my first blog post on the DEV Community!
In this post, we’ll explore Turtlesim, a fun and simple simulator in ROS 2 (Robot Operating System 2) — perfect for beginners who want to start learning robotics and ROS commands.
🚀 What is ROS 2 Humble?
ROS 2 Humble Hawksbill is a popular Long-Term Support (LTS) version of ROS 2.
It’s widely used for building and simulating robots — from simple mobile bots to advanced AI-driven systems.
🐢 What is Turtlesim?
Turtlesim is a lightweight simulator that shows a small turtle in a 2D world.
It’s often the first step to understanding ROS concepts such as:
Nodes 🧩 (independent programs)
Topics 🗣️ (communication channels)
Services ⚙️ (request/response system)
Parameters ⚡ (settings and configurations)
⚙️ Step 1: Install ROS 2 Humble
If you haven’t installed ROS 2 yet, open your terminal and run:
sudo apt update && sudo apt upgrade -y
sudo apt install ros-humble-desktop
Then source it:
source
/opt/ros/humble/setup.bash
(Tip: Add this line to your .bashrc so it auto-loads every time you open a terminal)
🧩 Step 2: Install Turtlesim
sudo apt install ros-humble-turtlesim
Check if it’s installed:
ros2 pkg list | grep turtlesim
note :sometimes ros2 command not found in terminal
in that case it better to switch to root terminal by the below command
sudo su
🖥️ Step 3: Run Turtlesim
Launch the turtlesim window:
ros2 run turtlesim turtlesim_node
A blue window will appear with a turtle in the center 🐢💙
🎮 Step 4: Control the Turtle
Open another terminal and run:
ros2 run turtlesim turtle_teleop_key
after clicks of some keys
⬆️➡️⬇️⬅️
Now use your arrow keys to move the turtle around.
Congrats — you just published your first commands in ROS 2!
🧠 Step 5: Explore Basic Commands
List all active topics:
ros2 topic list
See messages being published: while you are controling the turtle by arrow keys
ros2 topic echo /turtle1/cmd_vel
---
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: -2.0
---
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 2.0
---
WHEN YOU TOUCH THE EDGE OF THE WINDOW it publish to the
turtlesim_node
terminal[WARN] [1761550426.649414936] [turtlesim]: Oh no! I hit the wall! (Clamping from [x=11.120421, y=4.634281])
Clear the screen:
ros2 service call /clear std_srvs/srv/Empty
Change the background color:
ros2 param set /turtlesim background_r 200
ros2 param set /turtlesim background_g 100
ros2 param set /turtlesim background_b 150
ros2 service call /clear std_srvs/srv/Empty
💡 What You Learned
✅ How to install and run ROS 2 Humble
✅ How to launch and control Turtlesim
✅ How to explore topics, services, and parameters
This is just the beginning of your ROS 2 journey — next, we’ll write a Python node to move the turtle automatically!
✍️ Final Words
Thanks for reading!
If you enjoyed this post or found it helpful, leave a ❤️ and follow me for more tutorials on ROS 2, Ubuntu, and Ethical Hacking.
and since it is my first ever blog please support me for more info
“Don’t prove, just improve.” — Nagu
Would you like me to write your next post script — the one about controlling Turtlesim using Python code
see you soon guys

