Skip to content

Commit

Permalink
カメラ起動オプション追加
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuwamai committed Nov 21, 2023
1 parent c8e9c22 commit 7d2207c
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion sciurus17_examples/launch/demo.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import IncludeLaunchDescription
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration

Expand All @@ -36,6 +37,18 @@ def generate_launch_description():
description='Set baudrate.'
)

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.'
)

config_file_path = os.path.join(
get_package_share_directory('sciurus17_control'),
'config',
Expand Down Expand Up @@ -66,9 +79,27 @@ def generate_launch_description():
launch_arguments={'loaded_description': description}.items()
)

head_camera_node = IncludeLaunchDescription(
PythonLaunchDescriptionSource([
get_package_share_directory('sciurus17_vision'),
'/launch/head_camera.launch.py']),
condition=IfCondition(LaunchConfiguration('use_head_camera')),
)

chest_camera_node = IncludeLaunchDescription(
PythonLaunchDescriptionSource([
get_package_share_directory('sciurus17_vision'),
'/launch/chest_camera.launch.py']),
condition=IfCondition(LaunchConfiguration('use_chest_camera')),
)

return LaunchDescription([
declare_port_name,
declare_baudrate,
declare_use_head_camera,
declare_use_chest_camera,
move_group,
control_node
control_node,
head_camera_node,
chest_camera_node
])

0 comments on commit 7d2207c

Please sign in to comment.