Skip to content

Commit

Permalink
Merge branch 'humble-devel' into jazzy-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Dec 5, 2024
2 parents 87a0bee + c15d21b commit 3119040
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 42 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,37 @@ source install/setup.bash
ros2 launch rosbot_gazebo simulation.launch.py
```

### Launch Arguments

| Symbol | Meaning |
| ------ | ---------------------------- |
| 🤖 | Available for physical robot |
| 🖥️ | Available in simulation |

| 🤖 | 🖥️ | Argument | Description <br/> ***Type:*** `Default` |
| --- | --- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
||| `namespace` | Namespace for all topics and tfs. <br/> ***string:*** `env(ROBOT_NAMESPACE)` |
||| `mecanum` | Whether to use mecanum drive controller (otherwise diff drive controller is used). <br/> ***bool:*** `False` |
||| `microros` | Automatically connect with hardware using microros. <br/> ***bool:*** `True` |
||| `serial_baudrate` | Baud rate for serial communication . <br/> ***string:*** `576000` |
||| `serial_port` | Automatically connect with hardware using microros. <br/> ***string:*** `/dev/ttySERIAL` |
||| `fastrtps_profiles` | Path to the Fast RTPS default profiles file for Micro-ROS agent for localhost only setup. <br/> ***string:*** [`microros_localhost_only.xml`](./rosbot_bringup/config/microros_localhost_only.xml) |
||| `gz_gui` | Run simulation with specific GUI layout. <br/> ***string:*** [`teleop.config`](https://github.com/husarion/husarion_gz_worlds/blob/main/config/teleop.config) |
||| `gz_headless_mode` | Run the simulation in headless mode. Useful when a GUI is not needed or to reduce the number of calculations. <br/> ***bool:*** `False` |
||| `gz_log_level` | Adjust the level of console output. <br/> ***int:*** `1` (choices: `0`, `1`, `2`, `3`, `4`) |
||| `gz_world` | Absolute path to SDF world file. <br/> ***string:*** [`husarion_world.sdf`](https://github.com/husarion/husarion_gz_worlds/blob/main/worlds/husarion_world.sdf) |
||| `robots` | Spawning multiple robots at positions with yaw orientations e.g.robots:='robot1={x: 0.0, y: -1.0}; robot2={x: 1.0, y: -1.0};' <br/> ***string:*** `''` |
||| `x` | Initial robot position in the global 'x' axis. <br/> ***float:*** `0.0` |
||| `y` | Initial robot position in the global 'y' axis. <br/> ***float:***`-2.0` |
||| `z` | Initial robot position in the global 'z' axis. <br/> ***float:*** `0.0` |
||| `roll` | Initial robot 'roll' orientation. <br/> ***float:*** `0.0` |
||| `pitch` | Initial robot 'pitch' orientation. <br/> ***float:*** `0.0` |
||| `yaw` | Initial robot 'yaw' orientation. <br/> ***float:*** `0.0` |

> [!TIP]
>
> To read the arguments for individual packages, add the `-s` flag to the `ros2 launch` command (e.g. `ros2 launch rosbot_bringup bringup.launch.py ​​-s`)

## 🕹️ Demo

Explore demos showcasing the capabilities of ROSbots:
Expand Down
32 changes: 0 additions & 32 deletions ROS_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,6 @@ Package that contains launch, which starts all base functionalities with the mic
- `bringup.launch.py` - is responsible for communicating with firmware and activating all logic related to the robot's movement and processing of sensory data.
- `microros.launch.py` - establishes connection with the firmware.

**Launch Params:**

| PARAMETER | DESCRIPTION | VALUE |
| ------------------------ | ----------------------------------------------------------------- | ---------- |
| **camera_model** | Add camera model to the robot URDF | **None**\* |
| **lidar_model** | Add LiDAR model to the robot URDF | **None**\* |
| **include_camera_mount** | Whether to include camera mount to the robot URDF | **False** |
| **mecanum** | Whether to use mecanum drive controller, otherwise use diff drive | **False** |
| **namespace** | Namespace for all topics and tfs | **""** |

```xml
<plugin filename="gz-sim-imu-system" name="gz::sim::systems::Imu"/>
<plugin filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors"/>
```

### `rosbot_controller`

ROS2 hardware controller for ROSbot. It manages inputs and outputs data from ROS2 control, forwarding it via ROS topics to be read by microROS. The controller.launch.py file loads the robot model defined in rosbot_description along with ROS2 control dependencies from [rosbot_hardware_interfaces](https://github.com/husarion/rosbot_hardware_interfaces).
Expand All @@ -55,23 +40,6 @@ Launch files for Ignition Gazebo working with ROS2 control.

- `simulations.launch.py` - running a rosbot in Gazebo simulator and simulate all specified sensors.

**Launch Params:**

| PARAMETER | DESCRIPTION | VALUE |
| ------------------------ | ----------------------------------------------------------------- | ----------------------------------------------------------- |
| **camera_model** | Add camera model to the robot URDF | **None**\* |
| **lidar_model** | Add LiDAR model to the robot URDF | **None**\* |
| **include_camera_mount** | Whether to include camera mount to the robot URDF | **False** |
| **mecanum** | Whether to use mecanum drive controller, otherwise use diff drive | **False** |
| **namespace** | Namespace for all topics and tfs | **""** |
| **world** | Path to SDF world file | **`husarion_gz_worlds/`<br /> `worlds/husarion_world.sdf`** |
| **headless** | Run Gazebo Ignition in the headless mode | **False** |
| **robots** | List of robots that will be spawn in the simulation | **[]**\*\* |

> \*You can check all available options using `-s`/`--show-args` flag. (e.g. `ros2 launch rosbot_bringup bringup.launch.py -s`).
>
> \*\*Example of use: `robots:='robot1={x: 0.0, y: -1.0}; robot2={x: 1.0, y: -1.0};'`
### `rosbot_utils`

This package contains the stable firmware version with the flash script.
Expand Down
17 changes: 7 additions & 10 deletions rosbot_bringup/launch/microros.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,22 @@ def generate_microros_agent_node(context, *args, **kwargs):

serial_port = LaunchConfiguration("serial_port").perform(context)
serial_baudrate = LaunchConfiguration("serial_baudrate").perform(context)
localhost_only_fastrtps_profiles_file = LaunchConfiguration(
"localhost_only_fastrtps_profiles_file"
).perform(context)
fastrtps_profiles = LaunchConfiguration("fastrtps_profiles").perform(context)

if os.environ.get("ROS_LOCALHOST_ONLY") == "1":
env_setup_actions.extend(
[
LogInfo(
msg=[
"ROS_LOCALHOST_ONLY set to 1. Using FASTRTPS_DEFAULT_PROFILES_FILE=",
localhost_only_fastrtps_profiles_file,
fastrtps_profiles,
".",
]
),
SetEnvironmentVariable(name="RMW_IMPLEMENTATION", value="rmw_fastrtps_cpp"),
SetEnvironmentVariable(
name="FASTRTPS_DEFAULT_PROFILES_FILE",
value=localhost_only_fastrtps_profiles_file,
value=fastrtps_profiles,
),
]
)
Expand Down Expand Up @@ -92,20 +90,19 @@ def generate_launch_description():
fastrtps_profiles_file = PathJoinSubstitution(
[FindPackageShare("rosbot_bringup"), "config", "microros_localhost_only.xml"]
)
declare_localhost_only_fastrtps_profiles_file_arg = DeclareLaunchArgument(
"localhost_only_fastrtps_profiles_file",
declare_fastrtps_profiles_arg = DeclareLaunchArgument(
"fastrtps_profiles",
default_value=fastrtps_profiles_file,
description=(
"Path to the Fast RTPS default profiles file for Micro-ROS agent for localhost only"
" setup"
"Path to the Fast RTPS default profiles file for Micro-ROS agent for localhost only setup"
),
)

return LaunchDescription(
[
declare_serial_port_arg,
declare_serial_baudrate_arg,
declare_localhost_only_fastrtps_profiles_file_arg,
declare_fastrtps_profiles_arg,
OpaqueFunction(function=generate_microros_agent_node),
]
)

0 comments on commit 3119040

Please sign in to comment.