Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 46 additions & 3 deletions src/bringup/launch/full_system.launch.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import os
import os

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, Shutdown
from launch.conditions import IfCondition
from launch.conditions import UnlessCondition
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node
from launch.actions import Shutdown, IncludeLaunchDescription
from ament_index_python.packages import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource

'''
This file kinda works, but because of the logs of the other packages, it screws up the interface itself, not being able to click
'''
def generate_launch_description():
use_synthetic_actuation_feedback = LaunchConfiguration(
'use_synthetic_actuation_feedback'
)
use_synthetic_odometry = LaunchConfiguration('use_synthetic_odometry')
use_synthetic_perception = LaunchConfiguration('use_synthetic_perception')

# Helper so that a failure in this node takes down all of AP1 instead of just continuing
def CriticalNode(**kwargs):
return Node(on_exit=Shutdown(), **kwargs)
Expand All @@ -26,6 +36,13 @@ def CriticalNode(**kwargs):
csv_file_path
],
)
synthetic_actuation_feedback = Node(
package='ap1_control',
executable='synthetic_actuation_feedback_node',
name='synthetic_actuation_feedback',
output='screen',
condition=IfCondition(use_synthetic_actuation_feedback),
)

# == PLANNER NODE ==
pkg_share = get_package_share_directory('ap1_planning')
Expand All @@ -46,12 +63,14 @@ def CriticalNode(**kwargs):
executable='yolo_node',
name='ap1_yolo',
output='log',
condition=UnlessCondition(use_synthetic_perception),
)
ufld_ground = CriticalNode(
package='ap1_perception',
executable='ufld_ground_node',
name='ap1_ufld_ground',
output='log',
condition=UnlessCondition(use_synthetic_perception),
)

# == CONSOLE NODE ==
Expand All @@ -70,11 +89,35 @@ def CriticalNode(**kwargs):
'launch',
'mapping_pipeline.launch.py'
)
)
),
launch_arguments={
'use_synthetic_perception': use_synthetic_perception,
'use_synthetic_odometry': use_synthetic_odometry,
}.items(),
)

return LaunchDescription([
DeclareLaunchArgument(
'use_synthetic_actuation_feedback',
default_value='false',
description=(
'Publish fake /ap1/actuation feedback for smoke tests.'
),
),
DeclareLaunchArgument(
'use_synthetic_odometry',
default_value='false',
description='Forward synthetic odometry flag to mapping launch.',
),
DeclareLaunchArgument(
'use_synthetic_perception',
default_value='false',
description=(
'Use mapping synthetic perception instead of real YOLO/UFLD.'
),
),
control,
synthetic_actuation_feedback,
planner,
yolo,
ufld_ground,
Expand Down