Simulation
Last updated
Was this helpful?
Last updated
Was this helpful?
is a 3D simulator. It makes it possible to rapidly test algorithms, design robots, perform regression testing, and train AI systems using realistic scenarios. Gazebo is integrated with ROS and supports various robots out of the box.
Gazebo is heavily used by the DARPA challenges (cf. ). You can see videos online () and even load the maps and robot model that are available.
Verify that Gazebo is installed using:
You should have at least the following packages:
Install missing packages using:
If $ROS_WORKSPACE/pkg-tsim
is not installed:
Then, you can launch a preconfigured simulation:
While the challenge 1 simulation is running:
Question: which topics are available i.e published by Gazebo?
Question: In which topic are laser scans published?
rviz2
is a versatile and powerful tool to display data published in topics. Launch it:
Question: How to configure
rviz2
to visualize the laser scans?
Be carreful, ensure that Global Option
/ Fixed frame
is correctly set to base_link
.
Question: why is this important? (hint: check your
tf
usingros2 run tf2_tools view_frames
)
You can also display the tf
in rviz2
directly.
Question: How to visualize camera images using
rqt
?
Launch a simple node to control the simulated robot using keyboard:
Create a launch file that starts the apropriate configration: the challenge-1
, a configured rviz2
displaying laser scans and the teleop
. We will prefer YAML format for launch file.
All the information you need are in the tutorials :
Create $ROS_WORKSPACE/pkg-tsim/tbot_sim/launch/tutosim_launch.yaml
Add this code into this file to:
Exercise: modify this launch file so that rviz
loads a saved configuration file when it starts. This configuration file should add the laser data, ...
Look at the content of this launch file . We can see that Gazebo/ROS supports loading a world file describing the simulation environment and spawn elements such as robots. This simulation spawns a robot configured like a tbot
i.e. it is equipped with a laser range finder and a camera (kinect). The interaction with the simulation will operate through ROS topics as it would be with a real robot with real equipments.
Hint: use rqt_graph
to see the graph of all ROS nodes and topics ().