Staging checkin

Moved to mechanum controller
Use a single URDF from the robot description
TODO: Wheel physics is not yet correct for mecanum movement.
This commit is contained in:
Matt Spencer committed 2026-07-16 09:28:07 +00:00
1 parent 9d62ca663f
commit ecdbe00d07
19 files changed
+435 -773

No files matched your search

@@ -36,7 +36,7 @@ def generate_launch_description():
urdf_file = os.path.join(
get_package_share_directory('agv_pro_description'),
'urdf',
'agv_pro.urdf'
'agv_pro.urdf.xacro'
)
# Pass both namespace and port_name into the xacro processor so that the
@@ -117,9 +117,12 @@ def generate_launch_description():
output='screen',
)
# mecanum_drive_controller subscribes to ~/reference (TwistStamped).
# --controller-ros-args remaps it to /cmd_vel so nav2 and teleop work
# without extra flags (teleop still needs stamped:=true).
# mecanum_drive_controller subscribes to ~/reference (TwistStamped). Remap it
# to the standard /cmd_vel so nav2 and teleop work without extra flags
# (teleop still needs stamped:=true).
# NOTE: the remap key MUST be the private name '~/reference' — a bare
# 'reference:=/cmd_vel' is silently ignored and the controller stays on
# /mecanum_drive_controller/reference.
# Delayed slightly so controller_manager is ready before spawning.
mecanum_drive_controller_spawner = TimerAction(
period=2.0,
@@ -130,29 +133,13 @@ def generate_launch_description():
arguments=[
'mecanum_drive_controller',
'--controller-manager', 'controller_manager',
'--controller-ros-args', '-r reference:=/cmd_vel',
'--controller-ros-args', '-r ~/reference:=/cmd_vel',
],
output='screen',
)
]
)
# Relay /cmd_vel (TwistStamped) → /mecanum_drive_controller/reference.
# This bridges the standard nav2/teleop topic to the controller's
# internal subscription, which ros2_control does not remap at load time.
# lazy:=false ensures the subscription exists before any publisher appears.
cmd_vel_relay = Node(
package='topic_tools',
executable='relay',
name='cmd_vel_relay',
parameters=[{
'input_topic': '/cmd_vel',
'output_topic': '/mecanum_drive_controller/reference',
'lazy': False,
}],
output='screen',
)
lidar_launchs = [
include_lidar('lslidar_driver', 'lsn10p_launch.py', enable_lidar, lidar_type, 'n10p'),
include_lidar('agv_pro_bringup', 'MID360_launch.py', enable_lidar, lidar_type, 'mid360'),
@@ -170,7 +157,6 @@ def generate_launch_description():
robot_state_pub,
joint_state_broadcaster_spawner,
mecanum_drive_controller_spawner,
cmd_vel_relay,
*lidar_launchs,
]
)
@@ -12,7 +12,6 @@
<exec_depend>controller_manager</exec_depend>
<exec_depend>mecanum_drive_controller</exec_depend>
<exec_depend>joint_state_broadcaster</exec_depend>
<exec_depend>topic_tools</exec_depend>
<exec_depend>agv_pro_hardware</exec_depend>
<exec_depend>agv_pro_description</exec_depend>
<exec_depend>rviz2</exec_depend>