Skip to content

Commit

Permalink
enable stamped cmd_vel for nav2
Browse files Browse the repository at this point in the history
  • Loading branch information
skpawar1305 committed Feb 26, 2024
1 parent b1db544 commit b7b6d7d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions webots_ros2_tiago/launch/robot_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def generate_launch_description():
('map', nav2_map),
('params_file', nav2_params),
('use_sim_time', use_sim_time),
('enable_stamped_cmd_vel', use_twist_stamped),
],
condition=launch.conditions.IfCondition(use_nav)))

Expand Down
7 changes: 6 additions & 1 deletion webots_ros2_turtlebot/launch/robot_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ def generate_launch_description():

robot_description_path = os.path.join(package_dir, 'resource', 'turtlebot_webots.urdf')
ros2_control_params = os.path.join(package_dir, 'resource', 'ros2control.yml')
mappings = [('/diffdrive_controller/cmd_vel_unstamped', '/cmd_vel'), ('/diffdrive_controller/odom', '/odom')]
use_twist_stamped = 'ROS_DISTRO' in os.environ and os.environ['ROS_DISTRO'] == 'rolling'
if use_twist_stamped:
mappings = [('/diffdrive_controller/cmd_vel', '/cmd_vel'), ('/diffdrive_controller/odom', '/odom')]
else:
mappings = [('/diffdrive_controller/cmd_vel_unstamped', '/cmd_vel'), ('/diffdrive_controller/odom', '/odom')]
turtlebot_driver = WebotsController(
robot_name='TurtleBot3Burger',
parameters=[
Expand All @@ -108,6 +112,7 @@ def generate_launch_description():
('map', nav2_map),
('params_file', nav2_params),
('use_sim_time', use_sim_time),
('enable_stamped_cmd_vel', use_twist_stamped),
],
condition=launch.conditions.IfCondition(use_nav))
navigation_nodes.append(turtlebot_navigation)
Expand Down

0 comments on commit b7b6d7d

Please sign in to comment.