Skip to content

Commit

Permalink
fix startup
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Soragna <[email protected]>
  • Loading branch information
alsora committed Jun 15, 2024
1 parent 515804e commit 4c1b57f
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 95 deletions.
59 changes: 1 addition & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ mkdir -p ~/create3_ws/src
```

- Clone this repository into the src directory from above.
- Clone the []`irobot_create_msgs` repository](https://github.com/iRobotEducation/irobot_create_msgs) into the workspace

- Navigate to the workspace and install ROS 2 dependencies with:

Expand All @@ -53,65 +54,12 @@ rosdep install --from-path src -yi
- Build the workspace with:

```bash
export IGNITION_VERSION=fortress
colcon build --symlink-install
source install/local_setup.bash
```

## Run

#### Classic Gazebo

##### Empty world

Create® 3 can be spawned in an empty world in Gazebo and monitored through RViz with:

```bash
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py
```

The spawn point can be changed with the `x`, `y`, `z` and `yaw` launch arguments:

```bash
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py x:=1.0 y:=0.5 yaw:=1.5707
```

##### Namespacing

A namespace can be applied to the robot using the `namespace` launch argument:

```bash
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py namespace:=my_robot
```

Multiple robots can be spawned with unique namespaces:

```bash
ros2 launch irobot_create_gazebo_bringup create3_gazebo.launch.py namespace:=robot1
ros2 launch irobot_create_gazebo_bringup create3_spawn.launch.py namespace:=robot2 x:=1.0
```

> :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.
##### AWS house

Create® 3 can be spawned in the AWS small house in Gazebo and monitored through RViz.
This requires that the package `aws_robomaker_small_house_world` is available.

If you need it, you can build `aws_robomaker_small_house_world` in your ROS 2 workspace by doing:
```bash
vcs import ~/create3_ws/src/ < ~/create3_ws/src/create3_sim/irobot_create_gazebo/demo.repos
cd ~/create3_ws
colcon build --symlink-install
source install/local_setup.bash
```

Then you can run:

```bash
ros2 launch irobot_create_gazebo_bringup create3_gazebo_aws_small.launch.py
```

#### Ignition Gazebo

Create® 3 can be spawned in a demo world in Ignition and monitored through RViz with
Expand Down Expand Up @@ -154,11 +102,6 @@ This repository contains packages for both the Classic and Ignition Gazebo simul
- `irobot_create_nodes` Nodes for simulating robot topics and motion control
- `irobot_create_toolbox` Tools and helpers for creating nodes and plugins

- `irobot_create_gazebo` Packages used for the Classic Gazebo Simulator
- `irobot_create_gazebo_bringup` Launch files and configurations
- `irobot_create_gazebo_plugins` Sensor plugins
- `irobot_create_gazebo_sim` Metapackage

- `irobot_create_ignition` Packages used for the Ignition Gazebo Simulator
- `irobot_create_ignition_bringup` Launch files and configurations
- `irobot_create_ignition_plugins` GUI plugins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

<xacro:if value="${'$(arg gazebo)' == 'ignition'}">
<gazebo>
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::IgnitionROS2ControlPlugin">
<plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<parameters>$(find irobot_create_control)/config/control.yaml</parameters>
<ros>
<remapping>~/odom:=odom</remapping>
Expand Down Expand Up @@ -284,7 +284,7 @@

<xacro:if value="${'$(arg gazebo)' == 'ignition'}">
<gazebo>
<plugin filename="libignition-gazebo-pose-publisher-system.so" name="ignition::gazebo::systems::PosePublisher">
<plugin filename="libgz-sim-pose-publisher-system.so" name="gz::sim::systems::PosePublisher">
<publish_link_pose>true</publish_link_pose>
<publish_nested_model_pose>true</publish_nested_model_pose>
<use_pose_vector_msg>true</use_pose_vector_msg>
Expand All @@ -293,11 +293,11 @@
</gazebo>

<gazebo>
<plugin filename="libignition-gazebo-contact-system.so" name="ignition::gazebo::systems::Contact"></plugin>
<plugin filename="libgz-sim-contact-system.so" name="gz::sim::systems::Contact"></plugin>
</gazebo>

<gazebo>
<plugin filename="libignition-gazebo-sensors-system.so" name="ignition::gazebo::systems::Sensors">
<plugin filename="libgz-sim-sensors-system.so" name="gz::sim::systems::Sensors">
<render_engine>ogre</render_engine>
</plugin>
</gazebo>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
<gazebo>
<static>true</static>
<!-- Ground truth pose-->
<plugin filename="libignition-gazebo-pose-publisher-system.so" name="ignition::gazebo::systems::PosePublisher">
<plugin filename="libgz-sim-pose-publisher-system.so" name="gz::sim::systems::PosePublisher">
<publish_link_pose>true</publish_link_pose>
<publish_nested_model_pose>true</publish_nested_model_pose>
<use_pose_vector_msg>true</use_pose_vector_msg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<xacro:if value="${gazebo == 'ignition'}">
<ros2_control name="${wheel_link_name}_controller" type="system">
<hardware>
<plugin>gz_ros2_control/IgnitionSystem</plugin>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</hardware>
<joint name="${wheel_joint_name}">
<state_interface name="velocity" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<?xml version="1.0" ?>

<!-- 3D scene -->
<plugin filename="GzScene3D" name="3D View">
<gz-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</gz-gui>

<engine>ogre2</engine>
<scene>scene</scene>
<camera_pose>-0.0176 -0.737 0.017 0 -0.135 1.64</camera_pose>
</plugin>
<plugin filename="MinimalScene" name="3D View">
<gz-gui>
<title>3D View</title>
<property type="bool" key="showTitleBar">false</property>
<property type="string" key="state">docked</property>
</gz-gui>
<engine>ogre2</engine>
<scene>scene</scene>
<camera_pose>-0.0176 -0.737 0.017 0 -0.135 1.64</camera_pose>
</plugin>

<!-- Play / pause / step -->
<plugin filename="WorldControl" name="World control">
Expand Down Expand Up @@ -92,6 +91,7 @@
</plugin>

<!-- HMI -->
<!--
<plugin filename="Create3Hmi" name="Create3Hmi">
<gz-gui>
<property type="bool" key="showTitleBar">true</property>
Expand All @@ -100,6 +100,7 @@
<property key="resizable" type="bool">true</property>
</gz-gui>
</plugin>
-->

<!-- Teleop -->
<plugin filename="Teleop">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ def generate_launch_description():
# Directories
pkg_irobot_create_ignition_bringup = get_package_share_directory(
'irobot_create_ignition_bringup')
pkg_irobot_create_ignition_plugins = get_package_share_directory(
'irobot_create_ignition_plugins')
#pkg_irobot_create_ignition_plugins = get_package_share_directory(
# 'irobot_create_ignition_plugins')
pkg_irobot_create_description = get_package_share_directory(
'irobot_create_description')
pkg_ros_gz_sim = get_package_share_directory(
'ros_gz_sim')

# Set Ignition resource path
ign_resource_path = SetEnvironmentVariable(name='IGN_GAZEBO_RESOURCE_PATH',
ign_resource_path = SetEnvironmentVariable(name='GZ_SIM_RESOURCE_PATH',
value=[os.path.join(
pkg_irobot_create_ignition_bringup,
'worlds'), ':' +
str(Path(
pkg_irobot_create_description).
parent.resolve())])

ign_gui_plugin_path = SetEnvironmentVariable(name='IGN_GUI_PLUGIN_PATH',
value=[os.path.join(
pkg_irobot_create_ignition_plugins,
'lib')])
#gz_gui_plugin_path = SetEnvironmentVariable(name='GZ_GUI_PLUGIN_PATH',
# value=[os.path.join(
# pkg_irobot_create_ignition_plugins,
# 'lib')])

# Paths
ign_gazebo_launch = PathJoinSubstitution(
[pkg_ros_gz_sim, 'launch', 'ign_gazebo.launch.py'])
gz_sim_launch = PathJoinSubstitution(
[pkg_ros_gz_sim, 'launch', 'gz_sim.launch.py'])

# Ignition gazebo
ignition_gazebo = IncludeLaunchDescription(
PythonLaunchDescriptionSource([ign_gazebo_launch]),
PythonLaunchDescriptionSource([gz_sim_launch]),
launch_arguments=[
('ign_args', [LaunchConfiguration('world'),
'.sdf',
Expand All @@ -78,7 +78,7 @@ def generate_launch_description():
# Create launch description and add actions
ld = LaunchDescription(ARGUMENTS)
ld.add_action(ign_resource_path)
ld.add_action(ign_gui_plugin_path)
#ld.add_action(gz_gui_plugin_path)
ld.add_action(ignition_gazebo)
ld.add_action(clock_bridge)
return ld
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<exec_depend>irobot_create_description</exec_depend>
<exec_depend>irobot_create_common_bringup</exec_depend>
<exec_depend>irobot_create_ignition_toolbox</exec_depend>
<exec_depend>irobot_create_ignition_plugins</exec_depend>

<!-- ROS IGN -->
<exec_depend>gz_ros2_control</exec_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<max_step_size>0.003</max_step_size>
<real_time_factor>1.0</real_time_factor>
</physics>
<plugin filename="ignition-gazebo-physics-system" name="ignition::gazebo::systems::Physics"></plugin>
<plugin filename="ignition-gazebo-user-commands-system" name="ignition::gazebo::systems::UserCommands"></plugin>
<plugin filename="ignition-gazebo-scene-broadcaster-system" name="ignition::gazebo::systems::SceneBroadcaster"></plugin>
<plugin filename="ignition-gazebo-contact-system" name="ignition::gazebo::systems::Contact"></plugin>
<plugin filename="gz-sim-physics-system" name="gz::sim::systems::Physics"></plugin>
<plugin filename="gz-sim-user-commands-system" name="gz::sim::systems::UserCommands"></plugin>
<plugin filename="gz-sim-scene-broadcaster-system" name="gz::sim::systems::SceneBroadcaster"></plugin>
<plugin filename="gz-sim-contact-system" name="gz::sim::systems::Contact"></plugin>

<include>
<uri>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
</physics>
<plugin name='ignition::gazebo::systems::Physics' filename='ignition-gazebo-physics-system' />
<plugin name='ignition::gazebo::systems::UserCommands' filename='ignition-gazebo-user-commands-system' />
<plugin name='ignition::gazebo::systems::SceneBroadcaster' filename='ignition-gazebo-scene-broadcaster-system' />
<plugin name='ignition::gazebo::systems::Contact' filename='ignition-gazebo-contact-system' />
<plugin name='gz::sim::systems::Physics' filename='gz-sim-physics-system' />
<plugin name='gz::sim::systems::UserCommands' filename='gz-sim-user-commands-system' />
<plugin name='gz::sim::systems::SceneBroadcaster' filename='gz-sim-scene-broadcaster-system' />
<plugin name='gz::sim::systems::Contact' filename='gz-sim-contact-system' />
<light name='sun' type='directional'>
<cast_shadows>1</cast_shadows>
<pose>0 0 10 0 -0 0</pose>
Expand Down

0 comments on commit 4c1b57f

Please sign in to comment.