Skip to content

Commit

Permalink
Fix ros2 controller with namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Dec 10, 2024
1 parent 267e678 commit a3b6a17
Showing 4 changed files with 13 additions and 10 deletions.
4 changes: 4 additions & 0 deletions rosbot/rosbot_hardware.repos
Original file line number Diff line number Diff line change
@@ -15,6 +15,10 @@ repositories:
type: git
url: https://github.com/husarion/ros_components_description.git
version: d34d27edb3abc12ee6d197d0d513e00fe9a5604e
ros2_controllers: # Bug: There is no nice way to change `sensor_name` imu_bradcaster param when spawning multiple robots -> ros2_control refer only to single imu entity
type: git
url: https://github.com/husarion/ros2_controllers/
version: 0784c2c7c9bad6566c994fb1cb7efe8a06db1df5
rosbot_hardware_interfaces:
type: git
url: https://github.com/husarion/rosbot_hardware_interfaces.git
9 changes: 4 additions & 5 deletions rosbot/rosbot_simulation.repos
Original file line number Diff line number Diff line change
@@ -11,8 +11,7 @@ repositories:
type: git
url: https://github.com/husarion/ros_components_description.git
version: d34d27edb3abc12ee6d197d0d513e00fe9a5604e
# fix no provided for jazzy
# ros2_controllers: # Bug: There is no nice way to change `sensor_name` imu_bradcaster param when spawning multiple robots -> ros2_control refer only to single imu entity
# type: git
# url: https://github.com/husarion/ros2_controllers/
# version: 9da42a07a83bbf3faf5cad11793fff22f25068af
ros2_controllers: # Bug1: https://github.com/ros-controls/ros2_controllers/pull/1420 Bug2: https://github.com/ros-controls/gz_ros2_control/issues/428
type: git
url: https://github.com/husarion/ros2_controllers/
version: 0784c2c7c9bad6566c994fb1cb7efe8a06db1df5
8 changes: 4 additions & 4 deletions rosbot_description/urdf/rosbot_macro.urdf.xacro
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@

<!-- ROS2 CONTROL -->
<xacro:unless value="$(arg use_sim)">
<ros2_control name="imu" type="sensor">
<ros2_control name="${ns}imu" type="sensor">
<hardware>
<plugin>rosbot_hardware_interfaces/RosbotImuSensor</plugin>
<param name="connection_timeout_ms">30000</param>
<param name="connection_check_period_ms">1000</param>
</hardware>
<sensor name="imu">
<sensor name="${ns}imu">
<state_interface name="orientation.x" />
<state_interface name="orientation.y" />
<state_interface name="orientation.z" />
@@ -84,7 +84,7 @@
</joint>

<xacro:if value="${use_sim}">
<sensor name="imu">
<sensor name="${ns}imu">
<state_interface name="orientation.x" />
<state_interface name="orientation.y" />
<state_interface name="orientation.z" />
@@ -120,7 +120,7 @@
</plugin>
</gazebo>
<gazebo reference="imu_link">
<sensor name="imu" type="imu">
<sensor name="${ns}imu" type="imu">
<always_on>true</always_on>
<update_rate>25</update_rate>
<topic>imu/data_raw</topic>
2 changes: 1 addition & 1 deletion rosbot_gazebo/test/test_mecanum.py
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ def generate_test_description():
)
),
launch_arguments={
"gz_headless_mode": "False",
"gz_headless_mode": "True",
"gz_world": PathJoinSubstitution(
[FindPackageShare("husarion_gz_worlds"), "worlds", "empty_with_plugins.sdf"]
),

0 comments on commit a3b6a17

Please sign in to comment.