How to add Controllers for Robotic Arm to Work with MoveIt in Gazebo Simulation


This tutorial is created by Rosbotics Ambassador 020 Muhammad

Rosbotics Ambassador Program

What are we going to Learn?

  1. How to create ROS2 Package
  2. How to compile ROS2 workspace
  3. How to create node in Python to spawn new object in Gazebo Simulation

List of Resources in this Post

  1. ROSJect Link:
  2. Robotics Discourse Link:
  3. The Construct App:


ROS (Robot Operating System) is a de facto standard for Robotics. In order to program Robots, simulation of Real world systems is very important to test and debug the systems. For simulations of Robotics systems, Gazebo is used commonly in ROS. In this post we will learn how to add new objects in simulation scene without terminating the simulation entirely.

In general, if we want to add new object in simulation scene, we have to terminate all running nodes in simulation, edit the World file (description file for simulation in Gazebo). In order to add new objects, without terminating nodes, we can use Gazebo API in Python to spawn new objects in simulation dynamically.

Opening the ROSJect:

To follow along the post, we need to have ROS2 installed in our system. To make things easier, we have created ROSJect to follow along:

Just open the ROSJect in your browser

Click on “FORK”

Next, Click on “RUN”

Open the new Web Shell


Go to the ROS2 Workspace

cd ros2_ws

Then, source the workspace

source install/setup.bash

In one web shell, run Gazebo

gazebo –verbose -s

In another web shell, run the ROS2 Node

ros2 run robot_spawner_pkg spawn_turtlebot the_robot_name robot_namespace 0.0 0.0 0.1


Keep pushing your ROS Learning.

Video Tutorial


Topics: gazebo | python | ROS
Masterclass 2023 batch2 blog banner

Check Out These Related Posts

129. ros2ai

129. ros2ai

I would like to dedicate this episode to all the ROS Developers who believe that ChatGPT or...

read more


Submit a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Pin It on Pinterest

Share This