Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/humble' into update-utils-packag…
Browse files Browse the repository at this point in the history
…e-xml
  • Loading branch information
delihus committed Jan 15, 2024
2 parents ae0b5bb + 65154a9 commit 1bfba40
Show file tree
Hide file tree
Showing 40 changed files with 875 additions and 976 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/industrial_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
ros_industrial_ci:
name: ROS Industrial CI
runs-on: ubuntu-22.04
timeout-minutes: 30 # Set the job timeout to 30 minutes
timeout-minutes: 30
needs:
- black
- spellcheck
Expand All @@ -54,7 +54,8 @@ jobs:
shell: bash
run: |
python3 -m pip install -U vcstool
vcs import src < src/rosbot/rosbot_hardware.repos && vcs import src < src/rosbot/rosbot_simulation.repos
vcs import src < src/rosbot/rosbot_hardware.repos &&
vcs import src < src/rosbot/rosbot_simulation.repos
- name: Copy only diff_drive_controller and imu_sensor_broadcaster, waits for features from ros2-control
shell: bash
Expand All @@ -63,7 +64,7 @@ jobs:
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers
- name: Remove ign_ros2_control demo
- name: Remove ign_ros2_control demo and tests
shell: bash
run: rm -rf src/gazebosim/gz_ros2_control/ign_ros2_control_demos src/gazebosim/gz_ros2_control/gz_ros2_control_tests

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ husarion/husarion_office_gz
gazebosim/gz_ros2_control
diff_drive_controller
imu_sensor_broadcaster
micro-ROS-Agent/
micro_ros_msgs/

# pyspelling
*.dic
1 change: 1 addition & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,4 @@ ttyUSB
subprocess
cbus
Dockerfile
unbuffered
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ rm -r src/rosbot_gazebo
sudo rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
```

> **Prerequisites**
Expand Down Expand Up @@ -100,10 +100,13 @@ vcs import src < src/rosbot/rosbot_simulation.repos
# Build only diff_drive_controller and imu_sensor_broadcaster from ros2_controllers
cp -r src/ros2_controllers/diff_drive_controller src && cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers
# Remove ign_ros2_control demo and test
rm -rf src/gazebosim/gz_ros2_control/ign_ros2_control_demos src/gazebosim/gz_ros2_control/gz_ros2_control_tests
sudo rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
```

Running:
Expand Down
13 changes: 12 additions & 1 deletion ROS_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Use `bringup.launch.py` from `rosbot_bringup` to start all base functionalities
- `/odometry/filtered` (_nav_msgs/Odometry_)


- `controller.launch.py` from `rosbot_controller`, it loads robot model defined in `rosbot_description` as well as ros2 control [rosbot_hardware_interfaces](https://github.com/husarion/rosbot_hardware_interfaces). It also starts controllers:
Use `controller.launch.py` from `rosbot_controller`, it loads robot model defined in `rosbot_description` as well as ros2 control [rosbot_hardware_interfaces](https://github.com/husarion/rosbot_hardware_interfaces). It also starts controllers:
* `joint_state_broadcaster`
* `rosbot_base_controller`
* `imu_broadcaster`
Expand All @@ -29,5 +29,16 @@ Use `bringup.launch.py` from `rosbot_bringup` to start all base functionalities
- `/imu_broadcaster/imu` (_sensor_msgs/Imu_)

Use `simulation.launch.py` from `rosbot_gazebo` to start all base functionalities for ROSbot 2, 2 PRO, 2R in the Gazebo simulator.
If you want to spawn multiple robots use `simulation.launch.py` with the `robots` argument e. g.:
```bash
ros2 launch rosbot_gazebo simulation.launch.py robots:='robot1={x: 0.0, y: -1.0}; robot2={x: 1.0, y: -1.0}; robot3={x: 2.0, y: -1.0}; robot4={x: 3.0, y: -1.0}'
```

If you want to use your own world add to the world's sdf file gazebo sensors plugins inside any `<model>` tag:
```xml
<plugin filename="ignition-gazebo-imu-system" name="gz::sim::systems::Imu"/>
<plugin filename="ignition-gazebo-sensors-system" name="gz::sim::systems::Sensors"/>
```

> **Warning**
> The distance sensors' topics types from Gazebo simulation mismatch with the real ones. The range sensors are not implemented yet in the Gazebo Ignition (for more information look [here](https://github.com/gazebosim/gz-sensors/issues/19)). The real type is [sensor_msgs/msg/Range](https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/Range.msg) but simulated [sensor_msgs/msg/LaserScan](https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/LaserScan.msg). The first value of the `ranges` in [sensor_msgs/msg/LaserScan](https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/LaserScan.msg) is the `range` field of [sensor_msgs/msg/Range](https://github.com/ros2/common_interfaces/blob/rolling/sensor_msgs/msg/Range.msg).
4 changes: 2 additions & 2 deletions rosbot/rosbot_hardware.repos
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repositories:
ros_components_description:
type: git
url: https://github.com/husarion/ros_components_description.git
version: ros2
version: ros2
rosbot_controllers:
type: git
url: https://github.com/husarion/rosbot_controllers
Expand All @@ -17,7 +17,7 @@ repositories:
ros2_controllers:
type: git
url: https://github.com/delihus/ros2_controllers
version: humble-backport
version: humble
micro_ros_msgs:
type: git
url: https://github.com/micro-ROS/micro_ros_msgs.git
Expand Down
2 changes: 1 addition & 1 deletion rosbot/rosbot_simulation.repos
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repositories:
gazebosim/gz_ros2_control:
type: git
url: https://github.com/ros-controls/gz_ros2_control.git
url: https://github.com/ros-controls/gz_ros2_control
version: humble

husarion/husarion_office_gz:
Expand Down
2 changes: 1 addition & 1 deletion rosbot_bringup/config/ekf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## ekf config file ###
/**/ekf_filter_node:
ros__parameters:
frequency: 25.0
frequency: 20.0
sensor_timeout: 0.05
two_d_mode: true

Expand Down
15 changes: 3 additions & 12 deletions rosbot_bringup/launch/bringup.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
from ament_index_python.packages import get_package_share_directory
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution


def generate_launch_description():
namespace = LaunchConfiguration("namespace")
declare_namespace_arg = DeclareLaunchArgument(
"namespace",
default_value="",
default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""),
description="Namespace for all topics and tfs",
)

Expand Down Expand Up @@ -62,13 +62,6 @@ def generate_launch_description():
),
)

use_multirobot_system = LaunchConfiguration("use_multirobot_system")
declare_use_multirobot_system_arg = DeclareLaunchArgument(
"use_multirobot_system",
default_value="false",
description="Enable correct Ignition Gazebo configuration in URDF",
)

controller_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
Expand All @@ -85,7 +78,6 @@ def generate_launch_description():
"use_gpu": use_gpu,
"simulation_engine": simulation_engine,
"namespace": namespace,
"use_multirobot_system": use_multirobot_system,
}.items(),
)

Expand All @@ -94,10 +86,10 @@ def generate_launch_description():
robot_localization_node = Node(
package="robot_localization",
executable="ekf_node",
name="ekf_filter_node",
output="screen",
parameters=[ekf_config],
remappings=[
("/diagnostics", "diagnostics"),
("/tf", "tf"),
("/tf_static", "tf_static"),
],
Expand All @@ -110,7 +102,6 @@ def generate_launch_description():
declare_use_sim_arg,
declare_use_gpu_arg,
declare_simulation_engine_arg,
declare_use_multirobot_system_arg,
SetParameter(name="use_sim_time", value=use_sim),
controller_launch,
robot_localization_node,
Expand Down
11 changes: 4 additions & 7 deletions rosbot_bringup/test/test_multirobot_ekf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, TimerAction
from launch.actions import IncludeLaunchDescription
from launch.substitutions import PathJoinSubstitution
from launch.launch_description_sources import PythonLaunchDescriptionSource
from test_utils import BringupTestNode

robot_names = ["rosbot1", "rosbot2", "rosbot3", "rosbot4"]
robot_names = ["robot1", "robot2", "robot3"]


@launch_pytest.fixture
Expand All @@ -50,11 +50,8 @@ def generate_test_description():
"namespace": robot_names[i],
}.items(),
)
if i > 0:
delayed_bringup_launch = TimerAction(period=i * 10.0, actions=[bringup_launch])
actions.append(delayed_bringup_launch)
else:
actions.append(bringup_launch)

actions.append(bringup_launch)

return LaunchDescription(actions)

Expand Down
2 changes: 1 addition & 1 deletion rosbot_controller/config/diff_drive_controller.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**/controller_manager:
ros__parameters:
use_sim_time: False
update_rate: 20 # Hz

joint_state_broadcaster:
Expand All @@ -13,6 +12,7 @@
/**/imu_broadcaster:
ros__parameters:
tf_frame_prefix_enable: false
use_namespace_as_sensor_name_prefix: true

sensor_name: imu
frame_id: imu_link
Expand Down
7 changes: 3 additions & 4 deletions rosbot_controller/config/mecanum_drive_controller.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/**/controller_manager:
ros__parameters:
use_sim_time: false
update_rate: 20 # Hz

joint_state_broadcaster:
Expand All @@ -13,6 +12,7 @@
/**/imu_broadcaster:
ros__parameters:
tf_frame_prefix_enable: false
use_namespace_as_sensor_name_prefix: true

sensor_name: imu
frame_id: imu_link
Expand All @@ -33,9 +33,8 @@
wheel_separation_y: 0.192
wheel_radius: 0.047


wheel_separation_multiplier_x: 1.0
wheel_separation_multiplier_y: 1.0
wheel_separation_x_multiplier: 1.0
wheel_separation_y_multiplier: 1.0

wheel_radius_multiplier: 1.0

Expand Down
Loading

0 comments on commit 1bfba40

Please sign in to comment.