Atlas Robotics
Lesson 4/6 · about 20 min

Open simulation in Gazebo and RViz

One command opens the entire simulation world, robot, wheel controller, sensor bridge and RViz. Everything else in the course (SLAM, navigation) runs in its own terminal, on top of this command.

  • Gazebo window: Atlas3D robot standing on the southern circular road of the hill, facing east, surrounded by trees, street lights, and houses.
  • RViz window: robot model, VLP-16 point cloud similar to the scene in lesson 0, color point cloud from the depth camera in front of the robot, and color camera image in the corner.

Run

cd ~/atlas_sim3D
ros2 launch atlas3d_bringup bringup.launch.py

Without passing any parameters, open world terrain.sdf, which has both Gazebo and RViz interfaces. Wait until the terminal prints the line:

[spawner-7] [INFO] [...] [spawner_diff_drive_controller]: Configured and activated diff_drive_controller

From that moment on, the robot receives driving commands. In non-interface mode, the dev machine takes about 4 seconds from typing the command to this line; With an interface, it takes longer because Gazebo has to load and draw the whole hill.

What's in RViz

DisplayTopic
RobotModel/robot_description3D model of robot, built from URDF
TF—Axis systems mounted on robots
VLP-16 Points/velodyne_pointsPoint cloud of LiDAR 3D, rainbow colorization by altitude (Z axis)
Camera Depth Cloud/camera/depth/image_raw + color photo3D point constructed from depth camera (RGB-D), pointing in front of the robot, range 0.2–10 m
Camera RGB/camera/color/image_rawColor photo 640 × 480
Wheel Odometry/odomPosition arrow according to wheel odometry

Fixed Frame of RViz is odom: when the robot runs, the viewport stays still according to the starting point and the robot moves within it.

Parameters of bringup

ParametersDefaultMeaning
world:=terrain.sdfWorld opens, see table below
headless:=truefalseGazebo window not opening. The simulation and sensor still run fine (still using GPU to build LiDAR), just not drawing to the screen. Much lighter
rviz:=falsetrueNot opening RViz. Used when SLAM or navigation opens its own RViz
wheel_odom_tf:=falsetrueTurn off TF of wheel odometry, required when running SLAM (M01, M02 explained)

Example of opening world warehouse, without Gazebo window:

ros2 launch atlas3d_bringup bringup.launch.py world:=warehouse.sdf headless:=true

Six worlds of the course

WorldPurpose
empty.sdfEmpty floor, 4 objectsTest the sensor
warehouse.sdfWarehouse 30 × 20 × 4 m, 4 rows of shelves, 3 floors, columnsloop closure (multiple loops around the shelf)
corridor.sdf60 m featureless hallway, 2 rooms at both endsMaking LiDAR difficult: looks the same all along the hallway
ramp.sdf0.6 m high platform, 2 6° slopesFirst complete lap in M01
terrain.sdf (default)Hill area 140 × 140 m, 239 m loop with 5 m up and down, 5°/10°/15°/20° slope test site, gravel fieldOutdoor 3D terrain, long closed loop
parking.sdf3-storey car park 40 × 24 m, 2 ramps 8°Multiple overlapping floors

Each world has a robot location available when opened (declared in SPAWN_POSES of atlas3d_gazebo/launch/spawn_robot.launch.py). If you want to book another place, transmit x:=, y:=, yaw:=.

Packages are loaded in series

  1. atlas3d_bringupbringup.launch.py: single launch point, add RViz
  2. atlas3d_controlros2_control + diff_drive_controller
  3. atlas3d_gazeboworld, spawn robot, sensor bridge, IMU filter
  4. atlas3d_descriptionURDF/xacro + mesh of robot

The package above only calls the launch of the package immediately below it, without rewriting it. If you want to know how the robot is described, read atlas3d_description. If you want to know how the sensor is configured, read atlas3d_gazebo. M02 will go through this entire diagram.

Disable emulation properly

Press Ctrl+C in the terminal to run bringup, wait for the terminal to return the prompt. Then check that nothing is left:

pgrep -af "ign gazebo|parameter_bridge|imu_filter_node"

Printing nothing is clean. If so, the repo has a script that stops all simulation processes:

bash tools/sim_test/stop_sim.sh
còn 0 tiến trình

Common errors

Gazebo opens but can't find trees, roads, housesGazebo can't find the world mesh. Terminal not yet source install/setup.bash (variable IGN_GAZEBO_RESOURCE_PATH set by workspace).
RViz reports "No transform from [odom]" Running with wheel_odom_tf:=false without SLAM enabled, so no one broadcasts frame odom. Only use this parameter when running SLAM.
Gazebo jerks, robot moves slower than commandlow RTF. Try headless:=true, or smaller world (ramp, warehouse).
The sensor topic has 2 publishersThe simulation from the previous time was not completely turned off, the data was duplicated. Run stop_sim.sh then reopen (lesson 4).
Open the simulation in Gazebo and RViz · Module 0: Install & run the simulation — Atlas Robotics