Skip to content

Commit

Permalink
added mecanum
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <[email protected]>
  • Loading branch information
delihus committed Nov 13, 2023
1 parent 0d82f27 commit ad2ef7c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
11 changes: 9 additions & 2 deletions rosbot/rosbot_hardware.repos
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ repositories:
rosbot_hardware_interfaces:
type: git
url: https://github.com/husarion/rosbot_hardware_interfaces.git
version: main
version: add-namespace
ros_components_description:
type: git
url: https://github.com/husarion/ros_components_description.git
version: ros2
rosbot_controllers:
type: git
url: https://github.com/husarion/rosbot_controllers
version: main
version: add-namespace
# 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
ros2_controllers:
type: git
url: https://github.com/delihus/ros2_controllers
version: humble-backport
14 changes: 8 additions & 6 deletions rosbot_controller/config/mecanum_drive_controller.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
controller_manager:
/**/controller_manager:
ros__parameters:
use_sim_time: false
update_rate: 20 # Hz
Expand All @@ -12,7 +12,7 @@ controller_manager:

# Separate controller manager used for simulation - only difference is
# the use_sim_time parameter (it is the easiest way to do it with ign ros2 control)
simulation_controller_manager:
/**/simulation_controller_manager:
ros__parameters:
use_sim_time: true
update_rate: 20 # Hz
Expand All @@ -24,16 +24,18 @@ simulation_controller_manager:
imu_broadcaster:
type: imu_sensor_broadcaster/IMUSensorBroadcaster

imu_broadcaster:
/**/imu_broadcaster:
ros__parameters:
sensor_name: "imu"
frame_id: "imu_link"
sensor_name: imu
# All transforms are overwritten in launch file due to the namespace argument
# frame_id: imu_link
static_covariance_orientation: [1.9e-3, 0.0, 0.0, 0.0, 1.9e-3, 0.0, 0.0, 0.0, 1.9e-3] # Values taken from datasheet
static_covariance_angular_velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0e-3] # Values based on diff_drive
static_covariance_linear_acceleration: [6.4e-2, 0.0, 0.0, 2.2e-2, 0.0, 0.0, 0.0, 0.0, 0.0] # Values based on diff_drive

rosbot_base_controller:
/**/rosbot_base_controller:
ros__parameters:
tf_frame_prefix_enable: True
front_left_wheel_name: fl_wheel_joint
front_right_wheel_name: fr_wheel_joint
rear_left_wheel_name: rl_wheel_joint
Expand Down
14 changes: 1 addition & 13 deletions rosbot_controller/launch/controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,19 +136,7 @@ def generate_launch_description():
{"frame_id": LaunchConfiguration("imu_frame", default=[namespace, "_imu_link"])},
{
"tf_frame_prefix": LaunchConfiguration(
"diff_drive_tf_frame_prefix", default=[namespace]
)
},
{
"left_wheel_names": LaunchConfiguration(
"left_wheels_joints",
default=["[", namespace, "_fl_wheel_joint,", namespace, "_rl_wheel_joint]"],
)
},
{
"right_wheel_names": LaunchConfiguration(
"right_wheels_joints",
default=["[", namespace, "_fr_wheel_joint,", namespace, "_rr_wheel_joint]"],
"rosbot_base_tf_frame_prefix", default=[namespace]
)
},
],
Expand Down
9 changes: 5 additions & 4 deletions rosbot_description/urdf/rosbot_macro.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
fr_wheel_joint,
fl_wheel_joint
</param>
<param name="tf_prefix">${tf_prefix_ext}</param>
</xacro:unless>

<xacro:if value="$(arg use_sim)">
Expand All @@ -81,22 +82,22 @@
</hardware>

<!-- Namespaces have not been implemented in microros jet -->
<joint name="fl_wheel_joint">
<joint name="${tf_prefix_ext}fl_wheel_joint">
<command_interface name="velocity" />
<state_interface name="position" />
<state_interface name="velocity" />
</joint>
<joint name="fr_wheel_joint">
<joint name="${tf_prefix_ext}fr_wheel_joint">
<command_interface name="velocity" />
<state_interface name="position" />
<state_interface name="velocity" />
</joint>
<joint name="rl_wheel_joint">
<joint name="${tf_prefix_ext}rl_wheel_joint">
<command_interface name="velocity" />
<state_interface name="position" />
<state_interface name="velocity" />
</joint>
<joint name="rr_wheel_joint">
<joint name="${tf_prefix_ext}rr_wheel_joint">
<command_interface name="velocity" />
<state_interface name="position" />
<state_interface name="velocity" />
Expand Down

0 comments on commit ad2ef7c

Please sign in to comment.