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
| Display | Topic | |
|---|---|---|
| RobotModel | /robot_description | 3D model of robot, built from URDF |
| TF | — | Axis systems mounted on robots |
| VLP-16 Points | /velodyne_points | Point cloud of LiDAR 3D, rainbow colorization by altitude (Z axis) |
| Camera Depth Cloud | /camera/depth/image_raw + color photo | 3D point constructed from depth camera (RGB-D), pointing in front of the robot, range 0.2–10 m |
| Camera RGB | /camera/color/image_raw | Color photo 640 × 480 |
| Wheel Odometry | /odom | Position 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
| Parameters | Default | Meaning |
|---|---|---|
world:= | terrain.sdf | World opens, see table below |
headless:=true | false | Gazebo 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:=false | true | Not opening RViz. Used when SLAM or navigation opens its own RViz |
wheel_odom_tf:=false | true | Turn 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
| World | Purpose | |
|---|---|---|
empty.sdf | Empty floor, 4 objects | Test the sensor |
warehouse.sdf | Warehouse 30 × 20 × 4 m, 4 rows of shelves, 3 floors, columns | loop closure (multiple loops around the shelf) |
corridor.sdf | 60 m featureless hallway, 2 rooms at both ends | Making LiDAR difficult: looks the same all along the hallway |
ramp.sdf | 0.6 m high platform, 2 6° slopes | First 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 field | Outdoor 3D terrain, long closed loop |
parking.sdf | 3-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
- atlas3d_bringup
bringup.launch.py: single launch point, add RViz - atlas3d_controlros2_control + diff_drive_controller
- atlas3d_gazeboworld, spawn robot, sensor bridge, IMU filter
- 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
install/setup.bash (variable IGN_GAZEBO_RESOURCE_PATH set by workspace).wheel_odom_tf:=false without SLAM enabled, so no one broadcasts frame odom. Only use this parameter when running SLAM.headless:=true, or smaller world (ramp, warehouse).stop_sim.sh then reopen (lesson 4).