Added almost working nav2 setup
This commit is contained in:
@ -20,7 +20,6 @@ diff_cont:
|
||||
wheel_separation: 0.215
|
||||
wheel_radius: 0.049338032
|
||||
|
||||
|
||||
use_stamped_vel: false
|
||||
|
||||
joint_limits:
|
||||
|
||||
12
src/dcaiti_control/config/twist_mux.yml
Normal file
12
src/dcaiti_control/config/twist_mux.yml
Normal file
@ -0,0 +1,12 @@
|
||||
twist_mux:
|
||||
ros__parameters:
|
||||
topics:
|
||||
navigation:
|
||||
topic : cmd_vel_nav
|
||||
timeout : 0.5
|
||||
priority: 10
|
||||
|
||||
keyboard:
|
||||
topic : cmd_vel_keyboard
|
||||
timeout : 0.5
|
||||
priority: 100
|
||||
@ -4,6 +4,8 @@ from ament_index_python.packages import get_package_share_directory
|
||||
|
||||
from launch import LaunchDescription
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch.actions import IncludeLaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch_ros.actions import Node
|
||||
from launch.substitutions import Command
|
||||
@ -22,6 +24,12 @@ def generate_launch_description():
|
||||
xacro_file = os.path.join(pkg_path,'description','robot.urdf.xacro')
|
||||
robot_description_config = Command(['xacro ', xacro_file, ' use_ros2_control:=', use_ros2_control, ' use_sim:=', use_sim_time])
|
||||
|
||||
twist_mux_params = os.path.join(
|
||||
get_package_share_directory('dcaiti_control'), # <-- Replace with your package name
|
||||
'config',
|
||||
'twist_mux.yml'
|
||||
)
|
||||
|
||||
# Create a robot_state_publisher node
|
||||
params = {'robot_description': robot_description_config, 'use_sim_time': use_sim_time}
|
||||
node_robot_state_publisher = Node(
|
||||
@ -36,6 +44,14 @@ def generate_launch_description():
|
||||
parameters=[{'use_sim_time': use_sim_time}]
|
||||
)
|
||||
|
||||
twist_mux = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource([os.path.join(
|
||||
get_package_share_directory('twist_mux'),'launch','twist_mux_launch.py'
|
||||
)]),
|
||||
launch_arguments={
|
||||
'cmd_vel_out': '/diff_cont/cmd_vel_unstamped',
|
||||
'config_topics': twist_mux_params}.items()
|
||||
)
|
||||
|
||||
|
||||
# Launch!
|
||||
@ -50,5 +66,6 @@ def generate_launch_description():
|
||||
description='Use ros2_control if true'),
|
||||
|
||||
node_robot_state_publisher,
|
||||
node_joint_state_publisher
|
||||
node_joint_state_publisher,
|
||||
twist_mux,
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user