From 65b75980d4ce6e3e27ea514bc020427f75ede684 Mon Sep 17 00:00:00 2001 From: Kuwagata Date: Fri, 17 Nov 2023 18:27:04 +0900 Subject: [PATCH] =?UTF-8?q?Gazebo=E4=B8=8A=E3=81=AE=E3=82=AB=E3=83=A1?= =?UTF-8?q?=E3=83=A9=E3=81=AE=E6=9C=89=E5=8A=B9=E7=84=A1=E5=8A=B9=E9=81=B8?= =?UTF-8?q?=E6=8A=9E=E3=82=AA=E3=83=97=E3=82=B7=E3=83=A7=E3=83=B3=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../launch/sciurus17_with_table.launch.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sciurus17_gazebo/launch/sciurus17_with_table.launch.py b/sciurus17_gazebo/launch/sciurus17_with_table.launch.py index 9f67b16..70b2661 100644 --- a/sciurus17_gazebo/launch/sciurus17_with_table.launch.py +++ b/sciurus17_gazebo/launch/sciurus17_with_table.launch.py @@ -17,14 +17,28 @@ from ament_index_python.packages import get_package_share_directory from sciurus17_description.robot_description_loader import RobotDescriptionLoader from launch import LaunchDescription +from launch.actions import DeclareLaunchArgument from launch.actions import ExecuteProcess from launch.actions import IncludeLaunchDescription from launch.launch_description_sources import PythonLaunchDescriptionSource from launch_ros.actions import Node from launch_ros.actions import SetParameter +from launch.substitutions import LaunchConfiguration def generate_launch_description(): + declare_use_head_camera = DeclareLaunchArgument( + 'use_head_camera', + default_value='true', + description='Use head camera.' + ) + + declare_use_chest_camera = DeclareLaunchArgument( + 'use_chest_camera', + default_value='true', + description='Use chest camera.' + ) + # PATHを追加で通さないとSTLファイルが読み込まれない env = {'IGN_GAZEBO_SYSTEM_PLUGIN_PATH': os.environ['LD_LIBRARY_PATH'], 'IGN_GAZEBO_RESOURCE_PATH': os.path.dirname( @@ -53,6 +67,8 @@ def generate_launch_description(): description_loader = RobotDescriptionLoader() description_loader.use_gazebo = 'true' + description_loader.use_head_camera = LaunchConfiguration('use_head_camera') + description_loader.use_chest_camera = LaunchConfiguration('use_chest_camera') description_loader.gz_control_config_package = 'sciurus17_control' description_loader.gz_control_config_file_path = 'config/sciurus17_controllers.yaml' description = description_loader.load() @@ -118,6 +134,8 @@ def generate_launch_description(): return LaunchDescription([ SetParameter(name='use_sim_time', value=True), + declare_use_head_camera, + declare_use_chest_camera, ign_gazebo, ignition_spawn_entity, spawn_joint_state_broadcaster,