Skip to content

Commit e027fe3

Browse files
roni-kreininAlberto Soragna
authored andcommitted
Multi robot support (#207)
* Working multi robot sim * Use wildcards for param files Added robot name to Create 3 buttons * Dock model is now called <robot_name>/standard_dock Namespaced dock frame id in pose republisher * Added namespacing support to Rviz config Rviz now launches for each robot spawn Added static transform for prefixed odom and base_link frames Added offset launch module in irobot_create_common_bringup Fixed spawning robots with different x, y, and yaw positions * Linter fixes * Added namespace launch arg. Defaults to 'robot_name' in create3_spawn create3_ignition defaults to spawning 'create3' robot without namespace * Frame id fixes * Changed robot name to be <namespace>/create3, rather than using a robot_name arg Changed dock name to be <namespace>/standard_dock Remove robot_name arg, use just namespace for everything * Fixed bumper Use ogre2 as sensor render engine Reduce max_step_size to 3ms * Linter fixes * Fixed import order * Multi robot support for gazebo classic * Updated README * Fixed import order
1 parent 94131b3 commit e027fe3

60 files changed

Lines changed: 1287 additions & 730 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
This is a ROS 2 simulation stack for the [iRobot® Create® 3](https://edu.irobot.com/create3) robot.
66
Both Ignition Gazebo and Classic Gazebo are supported.
77

8-
> :warning: **To run with Ignition Gazebo you must first build and install the [`gz_ros2_control`](https://github.com/ros-controls/gz_ros2_control) package master branch from sources!**
9-
108
Have a look at the [Create® 3 documentation](https://iroboteducation.github.io/create3_docs/) for more details on the ROS 2 interfaces exposed by the robot.
119

1210
## Prerequisites
@@ -25,13 +23,13 @@ Besides the aforementioned dependencies you will also need at least one among Ig
2523

2624
Install [Gazebo 11](http://gazebosim.org/tutorials?tut=install_ubuntu)
2725

28-
#### Ignition Edifice
26+
#### Ignition Fortress
2927

3028
```bash
3129
sudo apt-get update && sudo apt-get install wget
3230
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
3331
wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
34-
sudo apt-get update && sudo apt-get install ignition-edifice
32+
sudo apt-get update && sudo apt-get install ignition-fortress
3533
```
3634

3735
## Build
@@ -55,7 +53,7 @@ rosdep install --from-path src -yi
5553
- Build the workspace with:
5654

5755
```bash
58-
export IGNITION_VERSION=edifice
56+
export IGNITION_VERSION=fortress
5957
colcon build --symlink-install
6058
source install/local_setup.bash
6159
```
@@ -66,12 +64,35 @@ source install/local_setup.bash
6664

6765
##### Empty world
6866

69-
Create® 3 can be spawned in an empty world in Gazebo and monitored through RViz with
67+
Create® 3 can be spawned in an empty world in Gazebo and monitored through RViz with:
7068

7169
```bash
7270
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py
7371
```
7472

73+
The spawn point can be changed with the `x`, `y`, `z` and `yaw` launch arguments:
74+
75+
```bash
76+
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py x:=1.0 y:=0.5 yaw:=1.5707
77+
```
78+
79+
##### Namespacing
80+
81+
A namespace can be applied to the robot using the `namespace` launch argument:
82+
83+
```bash
84+
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py namespace:=my_robot
85+
```
86+
87+
Multiple robots can be spawned with unique namespaces:
88+
89+
```bash
90+
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py namespace:=robot1
91+
ros2 launch irobot_create_gazebo_bringup create3_spawn.launch.py namespace:=robot2 x:=1.0
92+
```
93+
94+
> :warning: `create3_gazebo.launch.py` should only be used once as it launches the Gazebo simulator itself. Additional robots should be spawned with `create3_spawn.launch.py`. Namespaces and spawn points should be unique for each robot.
95+
7596
##### AWS house
7697

7798
Create® 3 can be spawned in the AWS small house in Gazebo and monitored through RViz.
@@ -99,6 +120,29 @@ Create® 3 can be spawned in a demo world in Ignition and monitored through RViz
99120
ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py
100121
```
101122

123+
The spawn point can be changed with the `x`, `y`, `z` and `yaw` launch arguments:
124+
125+
```bash
126+
ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py x:=1.0 y:=0.5 yaw:=1.5707
127+
```
128+
129+
##### Namespacing
130+
131+
A namespace can be applied to the robot using the `namespace` launch argument:
132+
133+
```bash
134+
ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py namespace:=my_robot
135+
```
136+
137+
Multiple robots can be spawned with unique namespaces:
138+
139+
```bash
140+
ros2 launch irobot_create_ignition_bringup create3_ignition.launch.py namespace:=robot1
141+
ros2 launch irobot_create_ignition_bringup create3_spawn.launch.py namespace:=robot2 x:=1.0
142+
```
143+
144+
> :warning: `create3_ignition.launch.py` should only be used once as it launches the Ignition simulator itself. Additional robots should be spawned with `create3_spawn.launch.py`. Namespaces and spawn points should be unique for each robot.
145+
102146
## Package layout
103147

104148
This repository contains packages for both the Classic and Ignition Gazebo simulators:

irobot_create_common/irobot_create_common_bringup/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
1111
endif()
1212

1313
find_package(ament_cmake REQUIRED)
14+
find_package(ament_cmake_python REQUIRED)
1415

1516
install(
1617
DIRECTORY
@@ -21,6 +22,9 @@ install(
2122
share/${PROJECT_NAME}
2223
)
2324

25+
# Install Python modules
26+
ament_python_install_package(${PROJECT_NAME})
27+
2428
if(BUILD_TESTING)
2529
find_package(ament_lint_auto REQUIRED)
2630
ament_lint_auto_find_test_dependencies()
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
---
2-
hazards_vector_publisher:
3-
ros__parameters:
4-
# Hazard detection publisher topic
5-
publisher_topic: /hazard_detection
6-
publish_rate: 62.0
7-
subscription_topics:
8-
# Bumper topic
9-
- _internal/bumper/event
10-
# Cliff topics
11-
- _internal/cliff_front_left/event
12-
- _internal/cliff_front_right/event
13-
- _internal/cliff_side_left/event
14-
- _internal/cliff_side_right/event
15-
# Wheel drop topics
16-
- _internal/wheel_drop/left_wheel/event
17-
- _internal/wheel_drop/right_wheel/event
18-
# Backup limit topic
19-
- _internal/backup_limit
2+
/**:
3+
hazards_vector_publisher:
4+
ros__parameters:
5+
# Hazard detection publisher topic
6+
publisher_topic: hazard_detection
7+
publish_rate: 62.0
8+
subscription_topics:
9+
# Bumper topic
10+
- _internal/bumper/event
11+
# Cliff topics
12+
- _internal/cliff_front_left/event
13+
- _internal/cliff_front_right/event
14+
- _internal/cliff_side_left/event
15+
- _internal/cliff_side_right/event
16+
# Wheel drop topics
17+
- _internal/wheel_drop/left_wheel/event
18+
- _internal/wheel_drop/right_wheel/event
19+
# Backup limit topic
20+
- _internal/backup_limit
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
2-
ir_intensity_vector_publisher:
3-
ros__parameters:
4-
# IR intensity publisher topic
5-
publisher_topic: /ir_intensity
6-
publish_rate: 62.0
7-
subscription_topics:
8-
# IR intensity topics
9-
- _internal/ir_intensity_front_center_left
10-
- _internal/ir_intensity_front_center_right
11-
- _internal/ir_intensity_front_left
12-
- _internal/ir_intensity_front_right
13-
- _internal/ir_intensity_left
14-
- _internal/ir_intensity_right
15-
- _internal/ir_intensity_side_left
2+
/**:
3+
ir_intensity_vector_publisher:
4+
ros__parameters:
5+
# IR intensity publisher topic
6+
publisher_topic: ir_intensity
7+
publish_rate: 62.0
8+
subscription_topics:
9+
# IR intensity topics
10+
- _internal/ir_intensity_front_center_left
11+
- _internal/ir_intensity_front_center_right
12+
- _internal/ir_intensity_front_left
13+
- _internal/ir_intensity_front_right
14+
- _internal/ir_intensity_left
15+
- _internal/ir_intensity_right
16+
- _internal/ir_intensity_side_left
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
2-
kidnap_estimator_publisher:
3-
ros__parameters:
4-
# Kidnap status publisher topic
5-
kidnap_status_topic: /kidnap_status
6-
# Subscription topics
7-
hazard_topic: /hazard_detection
2+
/**:
3+
kidnap_estimator_publisher:
4+
ros__parameters:
5+
# Kidnap status publisher topic
6+
kidnap_status_topic: kidnap_status
7+
# Subscription topics
8+
hazard_topic: hazard_detection
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
2-
mock_publisher:
3-
ros__parameters:
4-
# Mock slip status publisher topic
5-
slip_status_topic: /slip_status
6-
# Publishers rate
7-
slip_status_publish_rate: 62.0
2+
/**:
3+
mock_publisher:
4+
ros__parameters:
5+
# Mock slip status publisher topic
6+
slip_status_topic: slip_status
7+
# Publishers rate
8+
slip_status_publish_rate: 62.0
Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
---
2-
robot_state:
3-
ros__parameters:
4-
# Stop status publisher topic
5-
stop_status_topic: /stop_status
6-
# Mock battery state publisher topic
7-
battery_state_topic: /battery_state
8-
# Publishers rate
9-
kidnap_status_publish_rate: 1.0
10-
stop_status_publish_rate: 62.0
11-
battery_state_publish_rate: 0.1
12-
# Subscription topics
13-
dock_topic: /dock_status
14-
wheel_vels_topic: /odom
15-
# Stop status position difference tolerance
16-
linear_velocity_tolerance: 0.01
17-
angular_velocity_tolerance: 0.1
18-
# Battery parameters
19-
full_charge_percentage: 1.0
20-
battery_high_percentage: 0.9
21-
# Dock Parameters
22-
undocked_charge_limit: 0.03
2+
/**:
3+
robot_state:
4+
ros__parameters:
5+
# Stop status publisher topic
6+
stop_status_topic: stop_status
7+
# Mock battery state publisher topic
8+
battery_state_topic: battery_state
9+
# Publishers rate
10+
kidnap_status_publish_rate: 1.0
11+
stop_status_publish_rate: 62.0
12+
battery_state_publish_rate: 0.1
13+
# Subscription topics
14+
dock_topic: dock_status
15+
wheel_vels_topic: odom
16+
# Stop status position difference tolerance
17+
linear_velocity_tolerance: 0.01
18+
angular_velocity_tolerance: 0.1
19+
# Battery parameters
20+
full_charge_percentage: 1.0
21+
battery_high_percentage: 0.9
22+
# Dock Parameters
23+
undocked_charge_limit: 0.03
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
ui_mgr:
3-
ros__parameters:
4-
# Buttons publisher topic
5-
button_topic: /interface_buttons
6-
# Publishers rate
7-
buttons_publish_rate: 1.0
8-
# Subscription topics
9-
lightring_topic: /cmd_lightring
10-
audio_topic: /cmd_audio
2+
/**:
3+
ui_mgr:
4+
ros__parameters:
5+
# Buttons publisher topic
6+
button_topic: interface_buttons
7+
# Publishers rate
8+
buttons_publish_rate: 1.0
9+
# Subscription topics
10+
lightring_topic: cmd_lightring
11+
audio_topic: cmd_audio
Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
---
2-
wheel_status_publisher:
3-
ros__parameters:
4-
# Publish rate
5-
publish_rate: 62.0
6-
# Encoder resolution
7-
encoder_resolution: 508.8
8-
# Wheel radius
9-
wheel_radius: 0.03575
10-
# Wheels angular velocity topic
11-
velocity_topic: /wheel_vels
12-
# Wheels' net encoder ticks topic
13-
ticks_topic: /wheel_ticks
2+
/**:
3+
wheel_status_publisher:
4+
ros__parameters:
5+
# Publish rate
6+
publish_rate: 62.0
7+
# Encoder resolution
8+
encoder_resolution: 508.8
9+
# Wheel radius
10+
wheel_radius: 0.03575
11+
# Wheels angular velocity topic
12+
velocity_topic: wheel_vels
13+
# Wheels' net encoder ticks topic
14+
ticks_topic: wheel_ticks

irobot_create_common/irobot_create_common_bringup/irobot_create_common_bringup/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)