Skip to content

Commit 0f207fd

Browse files
Merge pull request #63 from clubcapra/add_twist_mux
Implemented twist_mux
2 parents 09a9453 + 5c190c9 commit 0f207fd

File tree

9 files changed

+35
-15
lines changed

9 files changed

+35
-15
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
twist_mux:
2-
ros_parameters:
1+
/twist_mux:
2+
ros__parameters:
33
topics:
44
navigation:
5-
topic: cmd_vel
5+
topic: nav_vel
66
timeout: 0.5
77
priority: 10
88
joystick:
9-
topic: cmd_vel_joy
9+
topic: joy_vel
1010
timeout: 0.5
1111
priority: 20
12+
others:
13+
topic: cmd_vel
14+
timeout: 0.5
15+
priority: 1

src/rove_bringup/launch/common.launch.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,22 @@ def generate_launch_description():
9797
"use_slam3d": "true",
9898
}.items(),
9999
)
100+
101+
twist_mux = Node(
102+
package='twist_mux',
103+
executable='twist_mux',
104+
output='screen',
105+
parameters=[os.path.join(pkg_rove_bringup, 'config/twist_mux.yaml')],
106+
remappings={
107+
('/cmd_vel_out', '/diff_drive_controller/cmd_vel_unstamped')
108+
})
100109

101110
return LaunchDescription([
102111
robot_state_publisher,
103112
robot_localization_node_local,
104-
#robot_localization_node_global,
113+
# robot_localization_node_global,
105114
#navsat_transform,
115+
twist_mux,
106116
rviz,
107117
teleop,
108118
autonomy,

src/rove_bringup/launch/rove_controller_bluetooth.launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def generate_launch_description():
2525
parameters=[teleop_joy_params_file],
2626
remappings=[
2727
('/joy', '/joy'),
28+
('/cmd_vel', '/joy_vel'),
2829
],
2930
),
3031
Node(

src/rove_bringup/launch/rove_controller_usb.launch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def generate_launch_description():
2525
parameters=[teleop_joy_params_file],
2626
remappings=[
2727
('/joy', '/joy'),
28+
('/cmd_vel', '/joy_vel'),
2829
],
2930
),
3031
Node(

src/rove_bringup/package.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99

1010
<build_depend>joy</build_depend>
1111
<build_depend>teleop_twist_joy</build_depend>
12+
<build_depend>twist_mux</build_depend>
1213
<build_depend>std_msgs</build_depend>
1314
<build_depend>geometry_msgs</build_depend>
1415
<build_depend>control_msgs</build_depend>
1516

1617
<exec_depend>joy</exec_depend>
1718
<exec_depend>teleop_twist_joy</exec_depend>
19+
<exec_depend>twist_mux</exec_depend>
1820
<exec_depend>control_msgs</exec_depend>
1921
<exec_depend>foxglove_bridge</exec_depend>
2022

src/rove_description/config/default_bridge.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
direction: GZ_TO_ROS
77

88
# gz topic subscribed to by Tracked Vehicle plugin
9-
- ros_topic_name: "cmd_vel"
9+
- ros_topic_name: "diff_drive_controller/cmd_vel_unstamped"
1010
gz_topic_name: "cmd_vel"
1111
ros_type_name: "geometry_msgs/msg/Twist"
1212
gz_type_name: "gz.msgs.Twist"

src/rove_description/urdf/rove.urdf.xacro

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<!-- <xacro:rove_ros2_control/> -->
4545
<!-- Put these at -1 to mock the motors if working without the motors -->
4646
<xacro:odrive_control fl_id="21" rl_id="22" fr_id="23" rr_id="24"/>
47+
<!-- <xacro:odrive_control fl_id="-1" rl_id="-1" fr_id="-1" rr_id="-1"/> -->
4748

4849

4950
<!-- Insert ovis on top of rove -->

src/rove_navigation/config/rove_nav_params.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ global_costmap:
224224
origin_z: 0.0
225225
z_resolution: 0.05
226226
z_voxels: 16
227-
max_obstacle_height: 2.0
228227
unknown_threshold: 15
229228
mark_threshold: 0
230229
observation_sources: pointcloud
@@ -268,7 +267,6 @@ local_costmap:
268267
height: 3
269268
resolution: 0.05
270269
robot_radius: 0.22 # radius set and used, so no footprint points
271-
resolution: 0.05
272270
plugins: ["obstacle_layer", "voxel_layer", "inflation_layer"]
273271
obstacle_layer:
274272
plugin: "nav2_costmap_2d::ObstacleLayer"
@@ -310,7 +308,6 @@ local_costmap:
310308
origin_z: 0.0
311309
z_resolution: 0.05
312310
z_voxels: 16
313-
max_obstacle_height: 2.0
314311
unknown_threshold: 15
315312
mark_threshold: 0
316313
observation_sources: pointcloud

src/rove_navigation/launch/navigation.launch.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22

33
from ament_index_python.packages import get_package_share_directory
44
from launch import LaunchDescription
5-
from launch.actions import IncludeLaunchDescription
5+
from launch.actions import IncludeLaunchDescription, GroupAction
66
from launch.launch_description_sources import PythonLaunchDescriptionSource
77
from launch.substitutions import PathJoinSubstitution
88
from launch_ros.substitutions import FindPackageShare
9-
9+
from launch_ros.actions import SetRemap
1010

1111
def generate_launch_description():
12-
1312
pkg_rove_navigation = get_package_share_directory('rove_navigation')
1413

1514
navigation_launch_path = PathJoinSubstitution(
@@ -24,9 +23,14 @@ def generate_launch_description():
2423
launch_arguments={
2524
'use_sim_time': 'true',
2625
'params_file': nav2_config_path
27-
}.items()
26+
}.items(),
2827
)
29-
28+
3029
return LaunchDescription([
31-
nav
30+
GroupAction(
31+
actions=[
32+
SetRemap(src='cmd_vel', dst='nav_vel'),
33+
nav,
34+
]
35+
)
3236
])

0 commit comments

Comments
 (0)