Skip to content

Commit

Permalink
Implemented twist_mux
Browse files Browse the repository at this point in the history
  • Loading branch information
IliTheButterfly committed Jun 21, 2024
1 parent 81eaafa commit abdac96
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
twist_mux:
ros_parameters:
/twist_mux:
ros__parameters:
topics:
navigation:
topic: cmd_vel
topic: nav_vel
timeout: 0.5
priority: 10
joystick:
topic: cmd_vel_joy
topic: joy_vel
timeout: 0.5
priority: 20
others:
topic: cmd_vel
timeout: 0.5
priority: 1
12 changes: 11 additions & 1 deletion src/rove_bringup/launch/common.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,22 @@ def generate_launch_description():
"use_slam3d": "false",
}.items(),
)

twist_mux = Node(
package='twist_mux',
executable='twist_mux',
output='screen',
parameters=[os.path.join(pkg_rove_bringup, 'config/twist_mux.yaml')],
remappings={
('/cmd_vel_out', '/diff_drive_controller/cmd_vel_unstamped')
})

return LaunchDescription([
robot_state_publisher,
robot_localization_node_local,
#robot_localization_node_global,
# robot_localization_node_global,
#navsat_transform,
twist_mux,
rviz,
teleop,
autonomy,
Expand Down
4 changes: 1 addition & 3 deletions src/rove_bringup/launch/rove_controller_bluetooth.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def generate_launch_description():
parameters=[teleop_joy_params_file],
remappings=[
('/joy', '/joy'),
# Remap needs to happen here since the diff_drive_controller node
# is started via a spawner, thus remappings do not work on it
('/cmd_vel', '/diff_drive_controller/cmd_vel_unstamped')
('/cmd_vel', '/joy_vel')
],
),
Node(
Expand Down
4 changes: 1 addition & 3 deletions src/rove_bringup/launch/rove_controller_usb.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def generate_launch_description():
parameters=[teleop_joy_params_file],
remappings=[
('/joy', '/joy'),
# Remap needs to happen here since the diff_drive_controller node
# is started via a spawner, thus remappings do not work on it
('/cmd_vel', '/diff_drive_controller/cmd_vel_unstamped')
('/cmd_vel', '/joy_vel')
],
),
Node(
Expand Down
2 changes: 2 additions & 0 deletions src/rove_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

<build_depend>joy</build_depend>
<build_depend>teleop_twist_joy</build_depend>
<build_depend>twist_mux</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>

<exec_depend>joy</exec_depend>
<exec_depend>teleop_twist_joy</exec_depend>
<exec_depend>twist_mux</exec_depend>

<buildtool_depend>ament_cmake</buildtool_depend>

Expand Down
2 changes: 1 addition & 1 deletion src/rove_description/config/default_bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
direction: GZ_TO_ROS

# gz topic subscribed to by Tracked Vehicle plugin
- ros_topic_name: "cmd_vel"
- ros_topic_name: "diff_drive_controller/cmd_vel_unstamped"
gz_topic_name: "cmd_vel"
ros_type_name: "geometry_msgs/msg/Twist"
gz_type_name: "gz.msgs.Twist"
Expand Down
1 change: 1 addition & 0 deletions src/rove_description/urdf/rove.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<!-- <xacro:rove_ros2_control/> -->
<!-- Put these at -1 to mock the motors if working without the motors -->
<xacro:odrive_control fl_id="21" rl_id="22" fr_id="23" rr_id="24"/>
<!-- <xacro:odrive_control fl_id="-1" rl_id="-1" fr_id="-1" rr_id="-1"/> -->


<!-- Insert ovis on top of rove -->
Expand Down

0 comments on commit abdac96

Please sign in to comment.