|
| 1 | +# Gazebo |
| 2 | + |
| 3 | +As Current JetPack 6 is a derived of Ubuntu 22.04, we will stick with Ubuntu 22.04 to minimize compatibility issues. |
| 4 | +In addition, we will use ROS2 Humble as it is a LTS version that supports Ubuntu 22.04. |
| 5 | +With this bundle of environments, it is recommended to use Gazebo Fortress. |
| 6 | +See this [document](https://gazebosim.org/docs/fortress/ros_installation) for ROS2 and Gazebo version pairing. |
| 7 | +Make sure you are looking for the documents with the right version. |
| 8 | +For example, |
| 9 | + |
| 10 | +| Differences | Fortress | Harmonic | |
| 11 | +| ------------ | ------------------ | -------- | |
| 12 | +| sdf version | 1.8 | 1.10 | |
| 13 | +| plug-in name | libignition-gazebo | gz-sim | |
| 14 | + |
| 15 | +## Installation |
| 16 | + |
| 17 | +You must install ROS2 before installing Gazebo. |
| 18 | +Then run this following command. |
| 19 | + |
| 20 | +```bash |
| 21 | + sudo apt install ros-humble-ros-gz |
| 22 | +``` |
| 23 | + |
| 24 | +Noted: if you use other version of ROS, you might need to compile by source |
| 25 | +Check this [document](https://github.com/gazebosim/ros_gz). |
| 26 | + |
| 27 | +## ROS-Gazebo integration |
| 28 | + |
| 29 | +You might see `ros_ign_xxx` in some documents. |
| 30 | +These commands are likely to be missing as the names have been changed to `ros_gz_xxx`. |
| 31 | +If you just copy commands from the tutorial and run into errors, check the command's name. |
| 32 | + |
| 33 | +## Run remote control simulation |
| 34 | + |
| 35 | +First we need to start a remote control node from [base_station](https://github.com/boilerrobotics/base-station/tree/main/src/joystick) repo. |
| 36 | + |
| 37 | +```bash |
| 38 | +ros2 launch joystick diff_drive_launch.yml |
| 39 | +``` |
| 40 | + |
| 41 | +Joy node will read inputs from the joystick then map those inputs into Twist message. |
| 42 | +Then navigate to Gazebo folder and run following command to bridge Twist message from ROS to Gazebo. |
| 43 | +See [ref1](https://gazebosim.org/docs/fortress/ros2_integration) and [ref2](https://index.ros.org/p/ros_gz_bridge/) for more detail about parameters. |
| 44 | + |
| 45 | +```bash |
| 46 | +ros2 run ros_gz_bridge parameter_bridge --ros-args -p config_file:=config.yaml |
| 47 | +``` |
| 48 | + |
| 49 | +Then start Gazebo. |
| 50 | +After you start simulation and click on `play` button (or press space on your keyboard), you will be able to control the robot with the joystick |
| 51 | + |
| 52 | +```bash |
| 53 | +ign gazebo tutorial.sdf |
| 54 | +``` |
| 55 | + |
| 56 | +### Run IMU |
| 57 | + |
| 58 | +```bash |
| 59 | +ign topic -e -t /imu |
| 60 | +``` |
| 61 | + |
| 62 | +# View camera |
| 63 | + |
| 64 | +```bash |
| 65 | +rqt |
| 66 | +``` |
0 commit comments