Skip to content

Commit

Permalink
use_cameraを引数で切り替えられるように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuwamai committed Nov 28, 2024
1 parent f80f423 commit 2bde1b1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 8 additions & 1 deletion crane_plus_examples/launch/camera_example.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ def load_yaml(package_name, file_path):


def generate_launch_description():
declare_use_camera = DeclareLaunchArgument(
'use_camera',
default_value='true',
description='Use camera.'
)

description_loader = RobotDescriptionLoader()
description_loader.use_camera = 'true'
description_loader.use_camera = LaunchConfiguration('use_camera')

robot_description_semantic_config = load_file(
'crane_plus_moveit_config', 'config/crane_plus.srdf')
Expand Down Expand Up @@ -82,6 +88,7 @@ def generate_launch_description():
output='screen')

return LaunchDescription([
declare_use_camera,
declare_use_sim_time,
SetParameter(name='use_sim_time', value=LaunchConfiguration('use_sim_time')),
detection_node,
Expand Down
8 changes: 8 additions & 0 deletions crane_plus_examples/launch/example.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ def load_yaml(package_name, file_path):


def generate_launch_description():
declare_use_camera = DeclareLaunchArgument(
'use_camera',
default_value='false',
description='Use camera.'
)

description_loader = RobotDescriptionLoader()
description_loader.use_camera = LaunchConfiguration('use_camera')

robot_description_semantic_config = load_file(
'crane_plus_moveit_config', 'config/crane_plus.srdf')
Expand Down Expand Up @@ -76,6 +83,7 @@ def generate_launch_description():
kinematics_yaml])

return LaunchDescription([
declare_use_camera,
declare_use_sim_time,
SetParameter(name='use_sim_time', value=LaunchConfiguration('use_sim_time')),
declare_example_name,
Expand Down

0 comments on commit 2bde1b1

Please sign in to comment.