Skip to content

Commit

Permalink
added name for ign_ros2_controller
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <[email protected]>
  • Loading branch information
delihus committed Dec 29, 2023
1 parent 712cd9d commit ec1ce0a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 8 deletions.
2 changes: 1 addition & 1 deletion rosbot/rosbot_hardware.repos
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories:
rosbot_controllers:
type: git
url: https://github.com/husarion/rosbot_controllers
version: main
version: update-params
# Waiting for backporting to the humble version
# https://github.com/ros-controls/ros2_controllers/pull/726 and
# https://github.com/ros-controls/ros2_controllers/pull/831
Expand Down
3 changes: 2 additions & 1 deletion rosbot/rosbot_simulation.repos
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
repositories:
gazebosim/gz_ros2_control:
type: git
url: https://github.com/ros-controls/gz_ros2_control.git
# Added feature with control manager name. Waiting on https://github.com/ros-controls/gz_ros2_control/pull/212
url: https://github.com/delihus/gz_ros2_control/tree/humble
version: humble

husarion/husarion_office_gz:
Expand Down
13 changes: 13 additions & 0 deletions rosbot_controller/config/diff_drive_controller.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/**/simulation_controller_manager:
ros__parameters:
use_sim_time: True
update_rate: 20 # Hz

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
rosbot_base_controller:
type: diff_drive_controller/DiffDriveController
imu_broadcaster:
type: imu_sensor_broadcaster/IMUSensorBroadcaster

/**/controller_manager:
ros__parameters:
use_sim_time: False
Expand All @@ -13,6 +25,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
20 changes: 16 additions & 4 deletions rosbot_controller/config/mecanum_drive_controller.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
/**/simulation_controller_manager:
ros__parameters:
use_sim_time: True
update_rate: 20 # Hz

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
rosbot_base_controller:
type: mecanum_drive_controller/MecanumDriveController
imu_broadcaster:
type: imu_sensor_broadcaster/IMUSensorBroadcaster

/**/controller_manager:
ros__parameters:
use_sim_time: false
use_sim_time: False
update_rate: 20 # Hz

joint_state_broadcaster:
Expand All @@ -13,6 +25,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 +46,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
6 changes: 5 additions & 1 deletion rosbot_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,13 @@ def generate_launch_description():
["''", " if '", namespace, "' == '' ", "else ", "'", namespace, "/'"]
)

in_case_simulation_controller_name = PythonExpression(
["'simulation_controller_manager'", " if '", use_sim, "' else 'controller_manager'"]
)

controller_manager_name = LaunchConfiguration(
"controller_manager_name",
default=[namespace_ext, "controller_manager"],
default=[namespace_ext, in_case_simulation_controller_name],
)

# Get URDF via xacro
Expand Down
4 changes: 3 additions & 1 deletion rosbot_description/urdf/rosbot_macro.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<xacro:macro name="rosbot_robot" params="mecanum use_sim use_gpu simulation_engine namespace ">

<xacro:if value="${namespace == 'None'}">
<xacro:property name="namespace_ext" value="/" />
<xacro:property name="namespace_ext" value="" />
<xacro:property name="gz_control_namespace" value="/" />
</xacro:if>
<xacro:unless value="${namespace == 'None'}">
Expand Down Expand Up @@ -132,6 +132,8 @@
<parameters>$(find rosbot_controller)/config/diff_drive_controller.yaml</parameters>
</xacro:unless>

<controller_manager_name>simulation_controller_manager</controller_manager_name>

<ros>
<namespace>${gz_control_namespace}</namespace>
<remapping>rosbot_base_controller/cmd_vel_unstamped:=cmd_vel</remapping>
Expand Down

0 comments on commit ec1ce0a

Please sign in to comment.