From 15b3d1818171cf00adc4ac6e54067e474e38e397 Mon Sep 17 00:00:00 2001 From: Huang Zhenbiao Date: Mon, 30 Sep 2024 20:06:20 +0800 Subject: [PATCH] fix launch --- .../b2_description/launch/ocs2_control.launch.py | 2 +- .../go1_description/launch/ocs2_control.launch.py | 10 +++++----- .../go2_description/launch/ocs2_control.launch.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/descriptions/b2_description/launch/ocs2_control.launch.py b/descriptions/b2_description/launch/ocs2_control.launch.py index 69cc141..3a70d43 100644 --- a/descriptions/b2_description/launch/ocs2_control.launch.py +++ b/descriptions/b2_description/launch/ocs2_control.launch.py @@ -103,7 +103,7 @@ def launch_setup(context, *args, **kwargs): def generate_launch_description(): robot_type_arg = DeclareLaunchArgument( 'robot_type', - default_value='aliengo', + default_value='b2', description='Type of the robot' ) diff --git a/descriptions/go1_description/launch/ocs2_control.launch.py b/descriptions/go1_description/launch/ocs2_control.launch.py index 5408983..bcbd6c8 100644 --- a/descriptions/go1_description/launch/ocs2_control.launch.py +++ b/descriptions/go1_description/launch/ocs2_control.launch.py @@ -11,7 +11,7 @@ from launch_ros.substitutions import FindPackageShare from sympy.physics.vector.printing import params package_description = "go1_description" - +package_controller = "ocs2_quadruped_controller" def process_xacro(context): robot_type_value = context.launch_configurations['robot_type'] @@ -75,7 +75,7 @@ def launch_setup(context, *args, **kwargs): "--controller-manager", "/controller_manager"], ) - unitree_guide_controller = Node( + ocs2_controller = Node( package="controller_manager", executable="spawner", arguments=["ocs2_quadruped_controller", "--controller-manager", "/controller_manager"] @@ -94,7 +94,7 @@ def launch_setup(context, *args, **kwargs): RegisterEventHandler( event_handler=OnProcessExit( target_action=imu_sensor_broadcaster, - on_exit=[unitree_guide_controller], + on_exit=[ocs2_controller], ) ), ] @@ -103,11 +103,11 @@ def launch_setup(context, *args, **kwargs): def generate_launch_description(): robot_type_arg = DeclareLaunchArgument( 'robot_type', - default_value='go2', + default_value='go1', description='Type of the robot' ) - rviz_config_file = os.path.join(get_package_share_directory(package_description), "config", "visualize_urdf.rviz") + rviz_config_file = os.path.join(get_package_share_directory(package_controller), "config", "visualize_ocs2.rviz") return LaunchDescription([ robot_type_arg, diff --git a/descriptions/go2_description/launch/ocs2_control.launch.py b/descriptions/go2_description/launch/ocs2_control.launch.py index 43c3064..10b7197 100644 --- a/descriptions/go2_description/launch/ocs2_control.launch.py +++ b/descriptions/go2_description/launch/ocs2_control.launch.py @@ -11,7 +11,7 @@ from launch_ros.substitutions import FindPackageShare from sympy.physics.vector.printing import params package_description = "go2_description" - +package_controller = "ocs2_quadruped_controller" def process_xacro(context): robot_type_value = context.launch_configurations['robot_type'] @@ -75,7 +75,7 @@ def launch_setup(context, *args, **kwargs): "--controller-manager", "/controller_manager"], ) - unitree_guide_controller = Node( + ocs2_controller = Node( package="controller_manager", executable="spawner", arguments=["ocs2_quadruped_controller", "--controller-manager", "/controller_manager"] @@ -94,7 +94,7 @@ def launch_setup(context, *args, **kwargs): RegisterEventHandler( event_handler=OnProcessExit( target_action=imu_sensor_broadcaster, - on_exit=[unitree_guide_controller], + on_exit=[ocs2_controller], ) ), ] @@ -107,7 +107,7 @@ def generate_launch_description(): description='Type of the robot' ) - rviz_config_file = os.path.join(get_package_share_directory(package_description), "config", "visualize_urdf.rviz") + rviz_config_file = os.path.join(get_package_share_directory(package_controller), "config", "visualize_ocs2.rviz") return LaunchDescription([ robot_type_arg,