How can I use Gazebo with ROS?

Hello,

I’m a beginner at ROS and Gazebo, so I don’t know how to combine the two of them. Initially, I created a launch file that runs two py files of a mobile differential drive robot. How do I import these files into the gazebo? Where can I find the files that the mobile robot will show because I do not have them? Τhat is the chassis’s dimensions, wheels’ dimensions, and more.

I really appreciate any help you can provide.

Hi @vasileios.tzimas

As a beginner, this site teaches you how to work with ROS, and we use the Gazebo simulator. If you tell us what you want to do exactly (in high level), we can point you to the right course or resource.

Hi @bayodesegun,

I have created on my rosject a package (catkin_ws/src/mobile_robot_diff_drive).

I want to simulate on Gazebo and view how it behaves in the real world.
I recently bought a laptop with Ubuntu and installed ROS and Gazebo and want to do all of this on the computer.
So, I don’t know how to integrate my py files into Gazebo. How to do that?
Was it understood?

I see now. Please try the following resources:

  1. Gazebo : Tutorials (gazebosim.org)
  2. Download free Gazebo simulations (which are used in the courses) on our public simulations repository, after understanding how to add simulations to Gazebo.

In the coming days, we might have a full course on Gazebo.

1 Like

From free Gazebo simulations, I want these which has only py files. What are these;

Could you notice me when this full course will be available?

I found this repo about Gazebo and ROS.

I have created my two py files and a launch file and made two files with this tutorial.

What else will I need to run my files and view them in the Gazebo?

What exactly are these files?

What exactly is the world folder and what does it contain?

Gazebo operates on the concept of models and worlds (and everything in-between). Gazebo itself does not operate on Python files. Your write Python and C++ code to interact with Gazebo.

If you want to learn about Gazebo before we release the course, patiently go through the site I shared earlier until you understand the basic concepts and can at least setup a Gazebo simulation using existing models/worlds (in a repo) and then interact with it with your own custom code in Python or C++ (as thought on this site).

I’m sorry but you can’t learn the basics of Gazebo by asking questions here.

I’m sorry to hear that…I was hoping you could help me.
I know a saying that says by asking questions, you learn! It does not matter at all.

I found this tutorial.
I followed the first two, and I got stuck in the third tutorial because it did not show anything.
In this step when run “roslaunch mobile_robot_ntua_sim spawn.launch” where “mobile_robot_ntua_sim” is my own package. The result of this step is this:

What am I doing wrong;

Hi @vasileios.tzimas ,

I see you refer to a spawn launch file, that is in charge of putting a robot in a running gazebo world. Have you launched a proper gazebo simulation before?

You also must use the argument
<arg name="gui" default="true"/>
to allow the launch file to open gazebo interface.

I see you are running in your local computer, unless you have some custom configuration, gazebo should open as expected.

Do you mean here:

What do you mean?

Hi @vasileios.tzimas ,

That’s correct but you should also have a gazebo simulation running before spawning the robot.

As mentioned before, please checkout the basics of Gazebo and ROS simulations, we have other references in youtube where you can learn how to start using it.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.