mirror of
https://github.com/bjoernellens1/cps_loki_bringup.git
synced 2024-11-22 23:53:48 +00:00
update: code cleanup and tuning
This commit is contained in:
parent
e063609fd8
commit
676042d333
@ -105,6 +105,4 @@ def generate_launch_description():
|
|||||||
robot_controller_spawner,
|
robot_controller_spawner,
|
||||||
joystick_spawner,
|
joystick_spawner,
|
||||||
teleop_spawner,
|
teleop_spawner,
|
||||||
#cam_node,
|
|
||||||
#lidar_node
|
|
||||||
])
|
])
|
@ -21,70 +21,28 @@ from ament_index_python.packages import get_package_share_directory
|
|||||||
from launch_ros.actions import LifecycleNode
|
from launch_ros.actions import LifecycleNode
|
||||||
from launch_ros.descriptions import ParameterValue
|
from launch_ros.descriptions import ParameterValue
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
robot_description_content = Command(
|
|
||||||
[
|
|
||||||
PathJoinSubstitution([FindExecutable(name="xacro")]),
|
|
||||||
" ",
|
|
||||||
PathJoinSubstitution(
|
|
||||||
[
|
|
||||||
FindPackageShare("cps_loki_description"),
|
|
||||||
"urdf",
|
|
||||||
"odrive_diffbot.urdf.xacro"
|
|
||||||
]
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
robot_description = {"robot_description": ParameterValue(robot_description_content, value_type=str)}
|
|
||||||
|
|
||||||
robot_controllers = PathJoinSubstitution(
|
namespace = LaunchConfiguration('namespace')
|
||||||
[
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
FindPackageShare("cps_loki_bringup"),
|
|
||||||
"config",
|
|
||||||
"diffbot_controllers.yaml",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
control_node = Node(
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
package="controller_manager",
|
'namespace',
|
||||||
executable="ros2_control_node",
|
default_value='',
|
||||||
parameters=[robot_description, robot_controllers],
|
description='Top-level namespace')
|
||||||
output="both",
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_state_pub_node = Node(
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
package="robot_state_publisher",
|
'use_sim_time',
|
||||||
executable="robot_state_publisher",
|
default_value='false',
|
||||||
output="both",
|
description='Use simulation (Gazebo) clock if true')
|
||||||
parameters=[robot_description],
|
|
||||||
)
|
|
||||||
|
|
||||||
joint_state_broadcaster_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["joint_state_broadcaster", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_controller_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
joystick_spawner = Node(
|
|
||||||
package="joy",
|
|
||||||
executable="joy_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
teleop_spawner = Node(
|
|
||||||
package="rmp220_teleop",
|
|
||||||
executable="rmp220_teleop"
|
|
||||||
)
|
|
||||||
|
|
||||||
cam_node = Node(
|
cam_node = Node(
|
||||||
package="ros2_cam_openCV",
|
package="ros2_cam_openCV",
|
||||||
executable="cam_node"
|
executable="cam_node",
|
||||||
|
namespace=namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
lidar_dir = os.path.join(get_package_share_directory('lslidar_driver'), 'params', 'lsx10.yaml')
|
lidar_dir = os.path.join(get_package_share_directory('lslidar_driver'), 'params', 'lsx10.yaml')
|
||||||
@ -99,12 +57,5 @@ def generate_launch_description():
|
|||||||
)
|
)
|
||||||
|
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
#control_node,
|
cam_node
|
||||||
#robot_state_pub_node,
|
|
||||||
#joint_state_broadcaster_spawner,
|
|
||||||
#robot_controller_spawner,
|
|
||||||
#joystick_spawner,
|
|
||||||
#teleop_spawner,
|
|
||||||
cam_node,
|
|
||||||
#lidar_node
|
|
||||||
])
|
])
|
@ -21,8 +21,24 @@ from ament_index_python.packages import get_package_share_directory
|
|||||||
from launch_ros.actions import LifecycleNode
|
from launch_ros.actions import LifecycleNode
|
||||||
from launch_ros.descriptions import ParameterValue
|
from launch_ros.descriptions import ParameterValue
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
|
|
||||||
|
namespace = LaunchConfiguration('namespace')
|
||||||
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
|
|
||||||
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
|
'namespace',
|
||||||
|
default_value='',
|
||||||
|
description='Top-level namespace')
|
||||||
|
|
||||||
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
|
'use_sim_time',
|
||||||
|
default_value='false',
|
||||||
|
description='Use simulation (Gazebo) clock if true')
|
||||||
|
|
||||||
robot_description_content = Command(
|
robot_description_content = Command(
|
||||||
[
|
[
|
||||||
PathJoinSubstitution([FindExecutable(name="xacro")]),
|
PathJoinSubstitution([FindExecutable(name="xacro")]),
|
||||||
@ -42,7 +58,7 @@ def generate_launch_description():
|
|||||||
[
|
[
|
||||||
FindPackageShare("cps_loki_bringup"),
|
FindPackageShare("cps_loki_bringup"),
|
||||||
"config",
|
"config",
|
||||||
"diffbot_controllers.yaml",
|
"controllers.yaml",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,93 +21,30 @@ from ament_index_python.packages import get_package_share_directory
|
|||||||
from launch_ros.actions import LifecycleNode
|
from launch_ros.actions import LifecycleNode
|
||||||
from launch_ros.descriptions import ParameterValue
|
from launch_ros.descriptions import ParameterValue
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
#use_sim_time = LaunchConfiguration('use_sim_time')
|
namespace = LaunchConfiguration('namespace')
|
||||||
use_sim_time = True
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
|
|
||||||
robot_description_content = Command(
|
|
||||||
[
|
|
||||||
PathJoinSubstitution([FindExecutable(name="xacro")]),
|
|
||||||
" ",
|
|
||||||
PathJoinSubstitution(
|
|
||||||
[
|
|
||||||
FindPackageShare("cps_loki_description"),
|
|
||||||
"urdf",
|
|
||||||
"odrive_diffbot.urdf.xacro"
|
|
||||||
]
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
robot_description = {"robot_description": ParameterValue(robot_description_content, value_type=str)}
|
|
||||||
|
|
||||||
robot_controllers = PathJoinSubstitution(
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
[
|
'namespace',
|
||||||
FindPackageShare("cps_loki_bringup"),
|
default_value='',
|
||||||
"config",
|
description='Top-level namespace')
|
||||||
"diffbot_controllers.yaml",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
control_node = Node(
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
package="controller_manager",
|
'use_sim_time',
|
||||||
executable="ros2_control_node",
|
default_value='false',
|
||||||
parameters=[robot_description, robot_controllers],
|
description='Use simulation (Gazebo) clock if true')
|
||||||
output="both",
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_state_pub_node = Node(
|
twist_mux_params = os.path.join(get_package_share_directory('cps_loki_bringup'),'config','mux.yaml')
|
||||||
package="robot_state_publisher",
|
|
||||||
executable="robot_state_publisher",
|
|
||||||
output="both",
|
|
||||||
parameters=[robot_description],
|
|
||||||
)
|
|
||||||
|
|
||||||
joint_state_broadcaster_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["joint_state_broadcaster", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_controller_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
joystick_spawner = Node(
|
|
||||||
package="joy",
|
|
||||||
executable="joy_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
teleop_spawner = Node(
|
|
||||||
package="rmp220_teleop",
|
|
||||||
executable="rmp220_teleop",
|
|
||||||
remappings=[('cmd_vel', 'cmd_vel_joy')],
|
|
||||||
)
|
|
||||||
|
|
||||||
cam_node = Node(
|
|
||||||
package="ros2_cam_openCV",
|
|
||||||
executable="cam_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
lidar_dir = os.path.join(get_package_share_directory('lslidar_driver'), 'params', 'lsx10.yaml')
|
|
||||||
lidar_node = LifecycleNode(
|
|
||||||
package='lslidar_driver',
|
|
||||||
executable='lslidar_driver_node',
|
|
||||||
name='lslidar_driver_node',
|
|
||||||
output='screen',
|
|
||||||
emulate_tty=True,
|
|
||||||
namespace='',
|
|
||||||
parameters=[lidar_dir],
|
|
||||||
)
|
|
||||||
|
|
||||||
twist_mux_params = os.path.join(get_package_share_directory('cps_loki_bringup'),'config','twist_mux.yaml')
|
|
||||||
twist_mux = Node(
|
twist_mux = Node(
|
||||||
package="twist_mux",
|
package="twist_mux",
|
||||||
executable="twist_mux",
|
executable="twist_mux",
|
||||||
parameters=[twist_mux_params, {'use_sim_time': False}],
|
parameters=[twist_mux_params, {'use_sim_time': use_sim_time}],
|
||||||
remappings=[('/cmd_vel_out','/diffbot_base_controller/cmd_vel_unstamped')]
|
remappings=[('/cmd_vel_out','/diffbot_base_controller/cmd_vel_unstamped')]
|
||||||
|
namespace = namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
joy_params = os.path.join(get_package_share_directory('cps_loki_bringup'),'config','joystick.yaml')
|
joy_params = os.path.join(get_package_share_directory('cps_loki_bringup'),'config','joystick.yaml')
|
||||||
@ -115,7 +52,7 @@ def generate_launch_description():
|
|||||||
package='joy',
|
package='joy',
|
||||||
executable='joy_node',
|
executable='joy_node',
|
||||||
parameters=[joy_params, {'use_sim_time': use_sim_time}],
|
parameters=[joy_params, {'use_sim_time': use_sim_time}],
|
||||||
#namespace = namespace
|
namespace = namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
teleop_node = Node(
|
teleop_node = Node(
|
||||||
@ -124,18 +61,10 @@ def generate_launch_description():
|
|||||||
name='teleop_node',
|
name='teleop_node',
|
||||||
parameters=[joy_params, {'use_sim_time': use_sim_time}],
|
parameters=[joy_params, {'use_sim_time': use_sim_time}],
|
||||||
remappings=[('cmd_vel', 'cmd_vel_joy')],
|
remappings=[('cmd_vel', 'cmd_vel_joy')],
|
||||||
#namespace = namespace
|
namespace = namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
#control_node,
|
|
||||||
#robot_state_pub_node,
|
|
||||||
#joint_state_broadcaster_spawner,
|
|
||||||
#robot_controller_spawner,
|
|
||||||
#joystick_spawner,
|
|
||||||
#teleop_spawner,
|
|
||||||
#cam_node,
|
|
||||||
#lidar_node,
|
|
||||||
twist_mux,
|
twist_mux,
|
||||||
joy_node,
|
joy_node,
|
||||||
teleop_node
|
teleop_node
|
||||||
|
@ -21,17 +21,32 @@ from ament_index_python.packages import get_package_share_directory
|
|||||||
from launch_ros.actions import LifecycleNode
|
from launch_ros.actions import LifecycleNode
|
||||||
from launch_ros.descriptions import ParameterValue
|
from launch_ros.descriptions import ParameterValue
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
|
|
||||||
lidar_dir = os.path.join(get_package_share_directory('cps_loki_bringup'), 'config', 'lsx10.yaml')
|
namespace = LaunchConfiguration('namespace')
|
||||||
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
|
|
||||||
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
|
'namespace',
|
||||||
|
default_value='',
|
||||||
|
description='Top-level namespace')
|
||||||
|
|
||||||
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
|
'use_sim_time',
|
||||||
|
default_value='false',
|
||||||
|
description='Use simulation (Gazebo) clock if true')
|
||||||
|
|
||||||
|
lidar_dir = os.path.join(get_package_share_directory('cps_loki_bringup'), 'config', 'lidar.yaml')
|
||||||
lidar_node = LifecycleNode(
|
lidar_node = LifecycleNode(
|
||||||
package='lslidar_driver',
|
package='lslidar_driver',
|
||||||
executable='lslidar_driver_node',
|
executable='lslidar_driver_node',
|
||||||
name='lslidar_driver_node',
|
name='lslidar_driver_node',
|
||||||
output='screen',
|
output='screen',
|
||||||
emulate_tty=True,
|
emulate_tty=True,
|
||||||
namespace='',
|
namespace=namespace,
|
||||||
parameters=[lidar_dir],
|
parameters=[lidar_dir],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -22,101 +22,23 @@ from launch_ros.actions import LifecycleNode
|
|||||||
from launch_ros.descriptions import ParameterValue
|
from launch_ros.descriptions import ParameterValue
|
||||||
from launch.substitutions import LaunchConfiguration
|
from launch.substitutions import LaunchConfiguration
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
robot_description_content = Command(
|
|
||||||
[
|
|
||||||
PathJoinSubstitution([FindExecutable(name="xacro")]),
|
|
||||||
" ",
|
|
||||||
PathJoinSubstitution(
|
|
||||||
[
|
|
||||||
FindPackageShare("cps_loki_description"),
|
|
||||||
"urdf",
|
|
||||||
"odrive_diffbot.urdf.xacro"
|
|
||||||
]
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
robot_description = {"robot_description": ParameterValue(robot_description_content, value_type=str)}
|
|
||||||
|
|
||||||
robot_controllers = PathJoinSubstitution(
|
namespace = LaunchConfiguration('namespace')
|
||||||
[
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
FindPackageShare("cps_loki_bringup"),
|
|
||||||
"config",
|
|
||||||
"diffbot_controllers.yaml",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
control_node = Node(
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
package="controller_manager",
|
'namespace',
|
||||||
executable="ros2_control_node",
|
default_value='',
|
||||||
parameters=[robot_description, robot_controllers],
|
description='Top-level namespace')
|
||||||
output="both",
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_state_pub_node = Node(
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
package="robot_state_publisher",
|
'use_sim_time',
|
||||||
executable="robot_state_publisher",
|
default_value='false',
|
||||||
output="both",
|
description='Use simulation (Gazebo) clock if true')
|
||||||
parameters=[robot_description],
|
|
||||||
)
|
|
||||||
|
|
||||||
joint_state_broadcaster_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["joint_state_broadcaster", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_controller_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
joystick_spawner = Node(
|
|
||||||
package="joy",
|
|
||||||
executable="joy_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
teleop_spawner = Node(
|
|
||||||
package="rmp220_teleop",
|
|
||||||
executable="rmp220_teleop"
|
|
||||||
)
|
|
||||||
|
|
||||||
cam_node = Node(
|
|
||||||
package="ros2_cam_openCV",
|
|
||||||
executable="cam_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
use_sim_time = False
|
|
||||||
slam_params_file = PathJoinSubstitution(
|
|
||||||
[
|
|
||||||
FindPackageShare("cps_loki_bringup"),
|
|
||||||
"config",
|
|
||||||
"mapper_params_online_async.yaml"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
mapper_node = Node(
|
|
||||||
package="slam_toolbox",
|
|
||||||
executable="async_slam_toolbox_node",
|
|
||||||
name='slam_toolbox_node',
|
|
||||||
output='screen',
|
|
||||||
parameters=[
|
|
||||||
slam_params_file,
|
|
||||||
{'use_sim_time': use_sim_time}
|
|
||||||
],
|
|
||||||
)
|
|
||||||
|
|
||||||
lidar_dir = os.path.join(get_package_share_directory('lslidar_driver'), 'params', 'lsx10.yaml')
|
|
||||||
lidar_node = LifecycleNode(
|
|
||||||
package='lslidar_driver',
|
|
||||||
executable='lslidar_driver_node',
|
|
||||||
name='lslidar_driver_node',
|
|
||||||
output='screen',
|
|
||||||
emulate_tty=True,
|
|
||||||
namespace='',
|
|
||||||
parameters=[lidar_dir],
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_localization_node = Node(
|
robot_localization_node = Node(
|
||||||
package='robot_localization',
|
package='robot_localization',
|
||||||
@ -130,19 +52,11 @@ def generate_launch_description():
|
|||||||
"ekf.yaml"
|
"ekf.yaml"
|
||||||
]
|
]
|
||||||
) ,
|
) ,
|
||||||
#{'use_sim_time': LaunchConfiguration('use_sim_time')}
|
{'use_sim_time': LaunchConfiguration('use_sim_time')}
|
||||||
]
|
],
|
||||||
|
namespace=namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
#control_node,
|
|
||||||
#robot_state_pub_node,
|
|
||||||
#joint_state_broadcaster_spawner,
|
|
||||||
#robot_controller_spawner,
|
|
||||||
#joystick_spawner,
|
|
||||||
#teleop_spawner,
|
|
||||||
#cam_node,
|
|
||||||
#lidar_node,
|
|
||||||
#mapper_node,
|
|
||||||
robot_localization_node
|
robot_localization_node
|
||||||
])
|
])
|
@ -22,17 +22,32 @@ from launch_ros.actions import LifecycleNode
|
|||||||
from launch_ros.descriptions import ParameterValue
|
from launch_ros.descriptions import ParameterValue
|
||||||
from launch.substitutions import LaunchConfiguration
|
from launch.substitutions import LaunchConfiguration
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
|
|
||||||
|
namespace = LaunchConfiguration('namespace')
|
||||||
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
|
|
||||||
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
|
'namespace',
|
||||||
|
default_value='',
|
||||||
|
description='Top-level namespace')
|
||||||
|
|
||||||
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
|
'use_sim_time',
|
||||||
|
default_value='false',
|
||||||
|
description='Use simulation (Gazebo) clock if true')
|
||||||
|
|
||||||
slam_params_file = PathJoinSubstitution(
|
slam_params_file = PathJoinSubstitution(
|
||||||
[
|
[
|
||||||
FindPackageShare("cps_loki_bringup"),
|
FindPackageShare("cps_loki_bringup"),
|
||||||
"config",
|
"config",
|
||||||
"mapper_params_online_async.yaml"
|
"slam.yaml"
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
mapper_node = Node(
|
mapper_node = Node(
|
||||||
package="slam_toolbox",
|
package="slam_toolbox",
|
||||||
executable="async_slam_toolbox_node",
|
executable="async_slam_toolbox_node",
|
||||||
@ -42,6 +57,7 @@ def generate_launch_description():
|
|||||||
slam_params_file,
|
slam_params_file,
|
||||||
{'use_sim_time': use_sim_time}
|
{'use_sim_time': use_sim_time}
|
||||||
],
|
],
|
||||||
|
namespace=namespace
|
||||||
)
|
)
|
||||||
|
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
|
@ -83,7 +83,7 @@ def generate_launch_description():
|
|||||||
|
|
||||||
declare_params_file_cmd = DeclareLaunchArgument(
|
declare_params_file_cmd = DeclareLaunchArgument(
|
||||||
'params_file',
|
'params_file',
|
||||||
default_value=os.path.join(bringup_dir, 'config', 'nav2_params.yaml'),
|
default_value=os.path.join(bringup_dir, 'config', 'nav2.yaml'),
|
||||||
description='Full path to the ROS2 parameters file to use for all launched nodes')
|
description='Full path to the ROS2 parameters file to use for all launched nodes')
|
||||||
|
|
||||||
declare_autostart_cmd = DeclareLaunchArgument(
|
declare_autostart_cmd = DeclareLaunchArgument(
|
||||||
|
@ -3,8 +3,24 @@ from launch.substitutions import PathJoinSubstitution
|
|||||||
from launch_ros.actions import Node
|
from launch_ros.actions import Node
|
||||||
from ament_index_python.packages import get_package_share_directory
|
from ament_index_python.packages import get_package_share_directory
|
||||||
|
|
||||||
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
||||||
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
||||||
|
|
||||||
def generate_launch_description():
|
def generate_launch_description():
|
||||||
|
|
||||||
|
namespace = LaunchConfiguration('namespace')
|
||||||
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
||||||
|
|
||||||
|
declare_namespace_cmd = DeclareLaunchArgument(
|
||||||
|
'namespace',
|
||||||
|
default_value='',
|
||||||
|
description='Top-level namespace')
|
||||||
|
|
||||||
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
||||||
|
'use_sim_time',
|
||||||
|
default_value='false',
|
||||||
|
description='Use simulation (Gazebo) clock if true')
|
||||||
|
|
||||||
return LaunchDescription([
|
return LaunchDescription([
|
||||||
Node(
|
Node(
|
||||||
package="laser_filters",
|
package="laser_filters",
|
||||||
@ -14,5 +30,6 @@ def generate_launch_description():
|
|||||||
get_package_share_directory("cps_loki_bringup"),
|
get_package_share_directory("cps_loki_bringup"),
|
||||||
"config", "box_filter.yaml",
|
"config", "box_filter.yaml",
|
||||||
])],
|
])],
|
||||||
|
namespace=namespace
|
||||||
)
|
)
|
||||||
])
|
])
|
@ -1,120 +0,0 @@
|
|||||||
# Copyright 2022 Factor Robotics
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
|
|
||||||
import os
|
|
||||||
from launch import LaunchDescription
|
|
||||||
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
from launch_ros.substitutions import FindPackageShare
|
|
||||||
from ament_index_python.packages import get_package_share_directory
|
|
||||||
from launch_ros.actions import LifecycleNode
|
|
||||||
from launch_ros.descriptions import ParameterValue
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
robot_description_content = Command(
|
|
||||||
[
|
|
||||||
PathJoinSubstitution([FindExecutable(name="xacro")]),
|
|
||||||
" ",
|
|
||||||
PathJoinSubstitution(
|
|
||||||
[
|
|
||||||
FindPackageShare("cps_loki_description"),
|
|
||||||
"urdf",
|
|
||||||
"odrive_diffbot.urdf.xacro"
|
|
||||||
]
|
|
||||||
),
|
|
||||||
]
|
|
||||||
)
|
|
||||||
robot_description = {"robot_description": ParameterValue(robot_description_content, value_type=str)}
|
|
||||||
|
|
||||||
robot_controllers = PathJoinSubstitution(
|
|
||||||
[
|
|
||||||
FindPackageShare("cps_loki_bringup"),
|
|
||||||
"config",
|
|
||||||
"diffbot_controllers.yaml",
|
|
||||||
]
|
|
||||||
)
|
|
||||||
|
|
||||||
control_node = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="ros2_control_node",
|
|
||||||
parameters=[robot_description, robot_controllers],
|
|
||||||
output="both",
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_state_pub_node = Node(
|
|
||||||
package="robot_state_publisher",
|
|
||||||
executable="robot_state_publisher",
|
|
||||||
output="both",
|
|
||||||
parameters=[robot_description],
|
|
||||||
)
|
|
||||||
|
|
||||||
joint_state_broadcaster_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["joint_state_broadcaster", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
robot_controller_spawner = Node(
|
|
||||||
package="controller_manager",
|
|
||||||
executable="spawner",
|
|
||||||
arguments=["diffbot_base_controller", "-c", "/controller_manager"],
|
|
||||||
)
|
|
||||||
|
|
||||||
joystick_spawner = Node(
|
|
||||||
package="joy",
|
|
||||||
executable="joy_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
teleop_spawner = Node(
|
|
||||||
package="rmp220_teleop",
|
|
||||||
executable="rmp220_teleop",
|
|
||||||
remappings=[('/diffbot_base_controller/cmd_vel_unstamped','/cmd_vel_joy')]
|
|
||||||
)
|
|
||||||
|
|
||||||
cam_node = Node(
|
|
||||||
package="ros2_cam_openCV",
|
|
||||||
executable="cam_node"
|
|
||||||
)
|
|
||||||
|
|
||||||
lidar_dir = os.path.join(get_package_share_directory('lslidar_driver'), 'params', 'lsx10.yaml')
|
|
||||||
lidar_node = LifecycleNode(
|
|
||||||
package='lslidar_driver',
|
|
||||||
executable='lslidar_driver_node',
|
|
||||||
name='lslidar_driver_node',
|
|
||||||
output='screen',
|
|
||||||
emulate_tty=True,
|
|
||||||
namespace='',
|
|
||||||
parameters=[lidar_dir],
|
|
||||||
)
|
|
||||||
|
|
||||||
twist_mux_params = os.path.join(get_package_share_directory('cps_loki_bringup'),'config','twist_mux.yaml')
|
|
||||||
twist_mux = Node(
|
|
||||||
package="twist_mux",
|
|
||||||
executable="twist_mux",
|
|
||||||
parameters=[twist_mux_params, {'use_sim_time': False}],
|
|
||||||
remappings=[('/cmd_vel_out','/diffbot_base_controller/cmd_vel_unstamped')]
|
|
||||||
)
|
|
||||||
|
|
||||||
return LaunchDescription([
|
|
||||||
#control_node,
|
|
||||||
#robot_state_pub_node,
|
|
||||||
#joint_state_broadcaster_spawner,
|
|
||||||
#robot_controller_spawner,
|
|
||||||
#joystick_spawner,
|
|
||||||
#teleop_spawner,
|
|
||||||
#cam_node,
|
|
||||||
#lidar_node,
|
|
||||||
twist_mux
|
|
||||||
])
|
|
Loading…
Reference in New Issue
Block a user