Skip to content

Commit 587a146

Browse files
authored
Merge pull request #137 from boilerrobotics/gazebo
Gazebo
2 parents 0f9cc8a + bb9f923 commit 587a146

File tree

5 files changed

+614
-0
lines changed

5 files changed

+614
-0
lines changed

.vscode/.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false
4+
}

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"ibus",
1919
"Intelli",
2020
"Jetson",
21+
"libignition",
2122
"lsusb",
2223
"odrive",
2324
"odrivelib",

gazebo/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
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+
```

gazebo/config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- ros_topic_name: "/cmd_vel"
2+
gz_topic_name: "/cmd_vel"
3+
ros_type_name: "geometry_msgs/msg/Twist"
4+
gz_type_name: "ignition.msgs.Twist"
5+
direction: ROS_TO_GZ
6+
7+
- ros_topic_name: "/imu"
8+
gz_topic_name: "/imu"
9+
ros_type_name: "sensor_msgs/msg/Imu"
10+
gz_type_name: "ignition.msgs.IMU"
11+
direction: GZ_TO_ROS
12+
13+
- ros_topic_name: "/camera"
14+
gz_topic_name: "/camera"
15+
ros_type_name: "sensor_msgs/msg/Image"
16+
gz_type_name: "ignition.msgs.Image"
17+
direction: GZ_TO_ROS

0 commit comments

Comments
 (0)