Skip to content

Commit

Permalink
Merge pull request #59 from jkk-research/58-crp-fix-build-scripts
Browse files Browse the repository at this point in the history
58 crp fix build scripts
  • Loading branch information
AnonymDavid authored Nov 8, 2024
2 parents 40153d5 + f31fb80 commit a24728f
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 98 deletions.
118 changes: 118 additions & 0 deletions launch/crp_launcher/launch/core.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch.conditions import LaunchConfigurationEquals
from launch.launch_description_sources import PythonLaunchDescriptionSource, AnyLaunchDescriptionSource
from ament_index_python.packages import get_package_share_directory
from os.path import join


def generate_launch_description():

# ARGS

# sensor abstraction
vehicle_tire_angle_topic_arg = DeclareLaunchArgument(
'vehicle_tire_angle_topic',
default_value='/sensing/vehicle/tire_angle',
description='Length of the scenario in meters')
local_path_length_arg = DeclareLaunchArgument(
'local_path_length',
default_value='70.0',
description='Length of the scenario in meters')

# NODES

sensor_abstraction = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('prcp_sensor_abstraction'),
'launch',
'sensor_abstraction.launch.py')
)
)

environmental_fusion = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('prcp_situation_analysis'),
'launch',
'environmental_fusion.launch.py')
)
)

behavior_planning = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('plan_behavior_planning'),
'launch',
'behavior_planning.launch.py'
)
)
)

motion_planning = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('plan_motion_planning'),
'launch',
'motion_planning.launch.py'
)
)
)

planner_lat_lane_follow_ldm = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('plan_lat_lane_follow_ldm'),
'launch',
'plan_lat_lane_follow_ldm.launch.py'
)
)
)

vehicle_control = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('ctrl_vehicle_control'),
'launch',
'ctrl_vehicle_control.launch.py')
)
)

vehicle_control_lat = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('ctrl_vehicle_control_lat_compensatory'),
'launch',
'ctrl_vehicle_control_lat_compensatory.launch.py')
)
)

vehicle_control_long = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('ctrl_vehicle_control_long'),
'launch',
'ctrl_vehicle_control_long.launch.py')
)
)

return LaunchDescription([
# args
vehicle_tire_angle_topic_arg,
vehicle_tire_angle_topic_arg,
local_path_length_arg,

# nodes
sensor_abstraction,
environmental_fusion,
behavior_planning,
motion_planning,
vehicle_control,
vehicle_control_lat,
vehicle_control_long,

planner_lat_lane_follow_ldm
])
99 changes: 15 additions & 84 deletions launch/crp_launcher/launch/lexus.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ def generate_launch_description():
default_value='70.0',
description='Length of the scenario in meters')


# CORE

crp_core = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('crp_launcher'),
'launch',
'core.launch.py')
)
)

# NODES

novatel_gps = IncludeLaunchDescription(
Expand Down Expand Up @@ -198,63 +210,6 @@ def generate_launch_description():
)
)

sensor_abstraction = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('prcp_sensor_abstraction'),
'launch',
'sensor_abstraction.launch.py')
)
)

environmental_fusion = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('prcp_situation_analysis'),
'launch',
'environmental_fusion.launch.py')
)
)

behavior_planning = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('plan_behavior_planning'),
'launch',
'behavior_planning.launch.py'
)
)
)

motion_planning = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('plan_motion_planning'),
'launch',
'motion_planning.launch.py'
)
)
)

planner_lat_lane_follow_ldm = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('plan_lat_lane_follow_ldm'),
'launch',
'plan_lat_lane_follow_ldm.launch.py'
)
)
)

vehicle_control = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('ctrl_vehicle_control'),
'launch',
'ctrl_vehicle_control.launch.py')
)
)

lexus_speed_control = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
Expand All @@ -264,24 +219,6 @@ def generate_launch_description():
)
)

vehicle_control_lat = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('ctrl_vehicle_control_lat_compensatory'),
'launch',
'ctrl_vehicle_control_lat_compensatory.launch.py')
)
)

vehicle_control_long = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
join(
get_package_share_directory('ctrl_vehicle_control_long'),
'launch',
'ctrl_vehicle_control_long.launch.py')
)
)

return LaunchDescription([
# args
select_gps_arg,
Expand All @@ -300,6 +237,9 @@ def generate_launch_description():
vehicle_tire_angle_topic_arg,
local_path_length_arg,

# core
crp_core,

# vehicle nodes
novatel_gps,
duro_gps,
Expand All @@ -316,13 +256,4 @@ def generate_launch_description():

# nodes
lanelet_file_loader,
sensor_abstraction,
environmental_fusion,
behavior_planning,
motion_planning,
vehicle_control,
vehicle_control_lat,
vehicle_control_long,

planner_lat_lane_follow_ldm
])
9 changes: 0 additions & 9 deletions launch/crp_launcher/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,13 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<!-- common -->
<depend>novatel_gps_launcher</depend>
<depend>tf2_ros</depend>
<depend>kvaser_interface</depend>
<depend>lanelet_handler</depend>
<depend>prcp_sensor_abstraction</depend>
<depend>prcp_situation_analysis</depend>
<depend>plan_behavior_planning</depend>
<depend>plan_motion_planning</depend>
<depend>plan_lat_lane_follow_ldm</depend>
<depend>ctrl_vehicle_control</depend>
<!-- nissan -->
<depend>nissan_bringup</depend>
<!-- lexus -->
<depend>lexus_bringup</depend>
<depend>pacmod3</depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
34 changes: 32 additions & 2 deletions scripts/build_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,36 @@ cd $script_dir
while [ ! -e "src/" ]; do
cd ../
done
echo $(pwd)
echo "Build location: "$(pwd)

colcon build --symlink-install
# build core
trap 'exit' INT # trap ctrl-c
$script_dir/build_core.sh
trap - INT

# build lexus packages
packages=(
duro_gps_driver
duro_gps_launcher
kvaser_interface
lanelet_handler
lexus_bringup
mcap_rec
mpc_camera_driver
novatel_gps_msgs
novatel_gps_driver
novatel_gps_launcher
pacmod_extender
pacmod_interface
)

packages_string=""
for package in "${packages[@]}"; do
packages_string+="$package "
done

packages_paths=$(colcon list --packages-up-to $packages_string -p)

rosdep install --from-paths $packages_paths --ignore-src -r -y

colcon build --packages-select $packages_string
16 changes: 13 additions & 3 deletions scripts/build_core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@ cd $script_dir
while [ ! -e "src/" ]; do
cd ../
done
echo $(pwd)
echo "Build location: "$(pwd)

colcon build --symlink-install --packages-select \
rosdep install --from-paths $script_dir/../crp_APL $script_dir/../crp_CIL --ignore-src -r -y
colcon build --packages-select \
tier4_planning_msgs \
autoware_common_msgs \
autoware_planning_msgs \
autoware_perception_msgs \
autoware_control_msgs \
autoware_localization_msgs \
autoware_map_msgs \
crp_msgs \
prcp_sensor_abstraction \
prcp_situation_analysis \
Expand All @@ -18,4 +26,6 @@ plan_lon_intelligent_speed_adjust \
plan_motion_planning \
crp_launcher \
ctrl_vehicle_control \
test_node
ctrl_vehicle_control_lat_compensatory \
ctrl_vehicle_control_long \
test_node

0 comments on commit a24728f

Please sign in to comment.