Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial ROS2 humble packages #2474

Merged
merged 45 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7ea1222
add packages converted
MishkaMN Nov 25, 2024
ec2dfe7
Build only specific packages
MishkaMN Nov 25, 2024
fcda0d1
different format
MishkaMN Nov 25, 2024
5bd37ce
fix docker to humble
MishkaMN Nov 25, 2024
494947b
add basic_autonomy
MishkaMN Nov 25, 2024
6ae6b2b
remove motion_computation for now
MishkaMN Nov 25, 2024
e48fdc5
remove motion_computation for now
MishkaMN Nov 25, 2024
07b1545
basic_autonomy fix
MishkaMN Nov 25, 2024
6c8eb80
final fix for basic_autonomy
MishkaMN Nov 25, 2024
97657c8
plugins that build fine
MishkaMN Nov 26, 2024
428f251
update with plugins
MishkaMN Nov 26, 2024
7cc26ab
add more packages that are building fine
MishkaMN Nov 26, 2024
29298b4
revert all cpp and hpp h
MishkaMN Nov 26, 2024
664d527
Apply specific changes
MishkaMN Nov 26, 2024
735f6ac
include correct headers
MishkaMN Nov 26, 2024
da0f853
fix declare_parameter
MishkaMN Nov 26, 2024
dd8ffef
fix headers again
MishkaMN Nov 26, 2024
27a8d1e
add missing buffer headers
MishkaMN Nov 26, 2024
0a5035e
address comments
MishkaMN Nov 27, 2024
6a7d4b5
Fix Dockerfile
MishkaMN Nov 27, 2024
bd55b2c
fix lci_strategic unit test
MishkaMN Nov 27, 2024
c105afc
fix lightbar_manager unit test
MishkaMN Nov 27, 2024
56f3417
turn off roadway_objects as we don't use anymore
MishkaMN Nov 27, 2024
393befc
enable failure report
MishkaMN Nov 27, 2024
dbbf66c
fix CI.yml
MishkaMN Nov 27, 2024
2d5f0ad
fix trajectory_executor unit test
MishkaMN Nov 27, 2024
c879137
more coherent logging CI
MishkaMN Nov 27, 2024
43f1d91
typo
MishkaMN Nov 27, 2024
cee3645
remove wrongt arg from CI
MishkaMN Nov 27, 2024
1a81cba
relax coupling of trajectory_executor unit test from chrono
MishkaMN Nov 27, 2024
9ca4d42
Update test_trajectory_executor.cpp
MishkaMN Nov 30, 2024
44f01d4
Update test_trajectory_executor.cpp
MishkaMN Dec 1, 2024
1534ff6
Update humble-upgraded-packages.txt
MishkaMN Dec 1, 2024
6c572b2
Update humble-upgraded-packages.txt
MishkaMN Dec 1, 2024
a80c6ec
Update CMakeLists.txt to run serial
MishkaMN Dec 1, 2024
bc878fa
Update test_trajectory_executor.cpp to ensure namespace
MishkaMN Dec 1, 2024
d6115a9
Update CMakeLists.txt
MishkaMN Dec 1, 2024
0abd0f4
Update test_trajectory_executor.cpp
MishkaMN Dec 1, 2024
6ff6871
Update test_trajectory_executor.cpp
MishkaMN Dec 1, 2024
d47be84
Update test_trajectory_executor.cpp
MishkaMN Dec 1, 2024
aa7bb00
Update test_trajectory_executor.cpp
MishkaMN Dec 1, 2024
a6034f3
Update CMakeLists.txt
MishkaMN Dec 1, 2024
d590c1e
update turned off code with JIRA
MishkaMN Dec 1, 2024
ea4bab2
Update comment with JIRA ticket
MishkaMN Dec 1, 2024
28d7001
Update lightbar_manager_node.hpp
MishkaMN Dec 2, 2024
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
57 changes: 14 additions & 43 deletions .github/workflows/Ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: [develop, master]
branches: [develop, develop-humble, master]
jobs:
determine_docker_org_and_tag:
runs-on: ubuntu-latest
Expand All @@ -31,7 +31,7 @@ jobs:
image: ${{ needs.determine_docker_org_and_tag.outputs.docker_org }}/autoware.ai:${{ needs.determine_docker_org_and_tag.outputs.docker_tag }}
env:
INIT_ENV: "/home/carma/.base-image/init-env.sh"
ROS_2_ENV: "/opt/ros/foxy/setup.bash"
ROS_2_ENV: "/opt/ros/humble/setup.bash"
TERM: xterm
options: "--user root"

Expand Down Expand Up @@ -66,61 +66,32 @@ jobs:
- name: Install external dependencies
# Install the multiple object tracking deps
run: sudo bash /opt/carma/src/multiple_object_tracking/scripts/install_dependencies.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we no longer need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep this, I just had it turned off, but let me turn them on.


- name: Build ROS1
# Build ROS1 packages
# The skipped ROS 1 packages here should match the ROS 1 packages that are skipped during the build in docker/install.sh
run: |
source "$INIT_ENV"
PACKAGES=$(find . -maxdepth 2 -type f -name package.xml | sed 's/\.\///' | cut -d/ -f1) # maxdepth 2 Limits the search of package.xml to current directory and one level of subdirectories beneath it. find will not search beyond two levels deep from the starting point. Without this option, find would search the starting directory and all subdirectories recursively.
sed -i 's/colcon build /colcon build --packages-skip novatel_oem7_msgs tracetools tracetools_test /' /home/carma/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
make_with_coverage.bash -m -e /opt/carma/ -o ./coverage_reports/gcov

- name: Run ROS1 C++ Tests
# Run ROS1 C++ tests
# The skipped ROS 1 packages here should match the ROS 1 packages that are skipped during the build in docker/install.sh"

# These tests has been temporarily disabled to support Continuous Improvement (CI) processes.
# Related GitHub Issue: <https://github.com/usdot-fhwa-stol/carma-platform/issues/2335>
# some ROS2 packages unit tests are triggered during ROS1 tests, so they are temporarily being skipped.
run: |
source "$INIT_ENV"
sed -i 's/colcon test /colcon test --packages-skip novatel_oem7_msgs tracetools tracetools_test carma_launch_testing carma_message_utilities ros2bag ros2trace tracetools_launch tracetools_read tracetools_trace rosbag2 carma_utils /' /home/carma/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
make_with_coverage.bash -t -e /opt/carma/ -o ./coverage_reports/gcov

- name: Backup ROS1 compile_commands.json
# Backup the ROS1 compile_commands.json file for sonarcloud
# TODO WIP Humble Upgrade: Remove after humble upgrade is done
- name: Read packages from file
run: |
mv /opt/carma/build/compile_commands.json /opt/carma/compile_commands.ros1.json

- name: Cleanup before ROS 2 build
# Clear the build and install folders before building ROS 2
run: |
rm -rf /opt/carma/install
rm -rf /opt/carma/build
PACKAGES=$(cat /opt/carma/src/${{ github.event.repository.name }}/.github/workflows/humble-upgraded-packages.txt)
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV

- name: Build ROS2
# Build ROS2 packages
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
source /opt/autoware.ai/ros/install_ros2/setup.bash
source /opt/autoware.ai/ros/install/setup.bash
COLCON_CMD="colcon build --parallel-workers 4"
NEW_CMD="colcon build --continue-on-error --parallel-workers 16 --packages-up-to \$PACKAGES"
sed -i "s|$COLCON_CMD|$NEW_CMD|" /home/carma/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
make_with_coverage.bash -m -e /opt/carma/ -o ./coverage_reports/gcov

- name: Run ROS2 C++ Tests
# Run ROS2 C++ tests
run: |
source "$INIT_ENV"
source "$ROS_2_ENV"
source /opt/autoware.ai/ros/install_ros2/setup.bash
source /opt/autoware.ai/ros/install/setup.bash
COLCON_CMD="colcon test --return-code-on-test-failure --parallel-workers 4 --event-handlers console_direct+"
NEW_CMD="colcon test --return-code-on-test-failure --parallel-workers 16 --event-handlers console_cohesion+ --packages-select \$PACKAGES --ctest-args --output-on-failure"
sed -i "s|$COLCON_CMD|$NEW_CMD|" /home/carma/.ci-image/engineering_tools/code_coverage/make_with_coverage.bash
make_with_coverage.bash -t -e /opt/carma/ -o ./coverage_reports/gcov

- name: Combine ROS1 and ROS2 compile_commands.json files
# Combine the ROS1 and ROS2 compile_commands.json files for sonarscan
run: |
mv /opt/carma/build/compile_commands.json /opt/carma/compile_commands.ros2.json
jq -s add /opt/carma/compile_commands.ros1.json /opt/carma/compile_commands.ros2.json > /opt/carma/build/compile_commands.json

- name: Run SonarScanner
# Run SonarScanner for code analysis
uses: usdot-fhwa-stol/actions/sonar-scanner@main
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- develop
- master
- develop-humble
- "release/*"
tags:
- "carma-system-*"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/humble-upgraded-packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
approximate_intersection carma motion_prediction_visualizer system_controller object_visualizer mock_controller_driver object_detection_tracking gnss_to_map_convertor mobilitypath_visualizer bsm_generator trajectory_visualizer trajectory_executor lightbar_manager mobilitypath_publisher guidance port_drayage_plugin subsystem_controllers carma_wm roadway_objects basic_autonomy carma_guidance_plugins plan_delegator traffic_incident_parser platooning_tactical_plugin intersection_transit_maneuvering light_controlled_intersection_tactical_plugin stop_and_dwell_strategic_plugin cooperative_lanechange lci_strategic_plugin stop_controlled_intersection_tactical_plugin sci_strategic_plugin inlanecruising_plugin platooning_control trajectory_follower_wrapper approaching_emergency_vehicle_plugin yield_plugin
23 changes: 10 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (C) 2018-2021 LEIDOS.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
Expand All @@ -15,17 +15,17 @@
# CARMA Docker Configuration Script
#
# Performs all necessary tasks related to generation of a generic CARMA docker image
# suitable for deployment to a vehicle. The generic image will still need to be
# suitable for deployment to a vehicle. The generic image will still need to be
# configured for each vehicle by means of volume mapping configuration files and
# networking mapping at run time
#
# Build Arguments:
# SSH_PRIVATE_KEY - If the extra package repository to be used during the build requires
# authentication, please pass in the necessary SSH private key in text
# form here, most likely via "$(cat ~/.ssh/id_rsa)". This data is not
# form here, most likely via "$(cat ~/.ssh/id_rsa)". This data is not
# present in the final output image. Default = none
#
# EXTRA_PACKAGES - The repo to checkout any additional packages from at build time.
# EXTRA_PACKAGES - The repo to checkout any additional packages from at build time.
# Default = none


Expand All @@ -41,19 +41,16 @@ FROM base-image AS source-code
RUN mkdir ~/src
COPY --chown=carma . /home/carma/src/carma-platform/

ARG GIT_BRANCH="develop"
ARG GIT_BRANCH="develop"
RUN ~/src/carma-platform/docker/checkout.bash -b ${GIT_BRANCH}

# /////////////////////////////////////////////////////////////////////////////
# Stage 2 - Build and install the software
# Stage 2 - Build and install the software
# /////////////////////////////////////////////////////////////////////////////


FROM base-image AS install
ARG ROS1_PACKAGES=""
ENV ROS1_PACKAGES=${ROS1_PACKAGES}
ARG ROS2_PACKAGES=""
ENV ROS2_PACKAGES=${ROS2_PACKAGES}
ARG PACKAGES=""
ENV PACKAGES=${PACKAGES}

# Copy the source files from the previous stage and build/install
RUN mkdir ~/carma_ws
Expand Down
14 changes: 10 additions & 4 deletions approaching_emergency_vehicle_plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@
# License for the specific language governing permissions and limitations under
# the License.

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.8)
project(approaching_emergency_vehicle_plugin)

# Declare carma package and check ROS version
find_package(carma_cmake_common REQUIRED)
carma_check_ros_version(2)
carma_package()

# Use C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

## Find dependencies using ament auto
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
Expand All @@ -41,8 +47,8 @@ ament_auto_add_library(${node_lib} SHARED
src/approaching_emergency_vehicle_states.cpp
)

ament_auto_add_executable(${node_exec}
src/main.cpp
ament_auto_add_executable(${node_exec}
src/main.cpp
)

# Register component
Expand All @@ -55,7 +61,7 @@ target_link_libraries(${node_exec}
)

# Testing
if(BUILD_TESTING)
if(BUILD_TESTING)

find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies() # This populates the ${${PROJECT_NAME}_FOUND_TEST_DEPENDS} variable
Expand Down
6 changes: 3 additions & 3 deletions approaching_emergency_vehicle_plugin/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<!--
<!--
Copyright (C) 2022 LEIDOS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -15,13 +15,13 @@

<package format="3">
<name>approaching_emergency_vehicle_plugin</name>
<version>1.0.0</version>
<version>5.0.0</version>
<description>The approaching_emergency_vehicle_plugin package</description>

<maintainer email="carma@dot.gov">carma</maintainer>

<license>Apache 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>carma_cmake_common</build_depend>
<build_depend>ament_auto_cmake</build_depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ namespace approaching_emergency_vehicle_plugin

RCLCPP_ERROR_STREAM(rclcpp::get_logger(logger_name),"maneuver_end_dist: " << maneuver_end_dist << ", maneuver_start_dist: " << maneuver_start_dist << ", sum_start_and_end_speed: " << sum_start_and_end_speed);

maneuver_duration = rclcpp::Duration((maneuver_end_dist - maneuver_start_dist) / (0.5 * sum_start_and_end_speed) * 1e9);
maneuver_duration = rclcpp::Duration::from_nanoseconds((maneuver_end_dist - maneuver_start_dist) / (0.5 * sum_start_and_end_speed) * 1e9);

return maneuver_duration;
}
Expand Down
10 changes: 8 additions & 2 deletions approximate_intersection/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@
# License for the specific language governing permissions and limitations under
# the License.

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.8)
project(approximate_intersection)

# Declare carma package and check ROS version
find_package(carma_cmake_common REQUIRED)
carma_check_ros_version(2)
carma_package()

# Use C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

## Find dependencies using ament auto
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
Expand All @@ -32,7 +38,7 @@ include_directories(
)

# Testing
if(BUILD_TESTING)
if(BUILD_TESTING)

find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies() # This populates the ${${PROJECT_NAME}_FOUND_TEST_DEPENDS} variable
Expand Down
6 changes: 3 additions & 3 deletions approximate_intersection/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<!--
<!--
Copyright (C) 2022 LEIDOS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -15,13 +15,13 @@

<package format="3">
<name>approximate_intersection</name>
<version>1.0.0</version>
<version>5.0.0</version>
<description>The approximate_intersection package</description>

<maintainer email="carma@dot.gov">carma</maintainer>

<license>Apache 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>carma_cmake_common</build_depend>
<build_depend>ament_auto_cmake</build_depend>
Expand Down
13 changes: 9 additions & 4 deletions basic_autonomy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (C) 2022 LEIDOS.
# Copyright (C) 2024 LEIDOS.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
Expand All @@ -13,14 +13,20 @@
# License for the specific language governing permissions and limitations under
# the License.

cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.8)
project(basic_autonomy)

# Declare carma package and check ROS version
find_package(carma_cmake_common REQUIRED)
carma_check_ros_version(2)
carma_package()

# Use C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()

## Find dependencies using ament auto
find_package(ament_cmake_auto REQUIRED)
ament_auto_find_build_dependencies()
Expand Down Expand Up @@ -48,8 +54,7 @@ target_link_libraries(


# Testing
if(BUILD_TESTING)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies() # This populates the ${${PROJECT_NAME}_FOUND_TEST_DEPENDS} variable

Expand Down
14 changes: 9 additions & 5 deletions basic_autonomy/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<!--
Copyright (C) 2021-2022 LEIDOS.
<!--
Copyright (C) 2021-2024 LEIDOS.
Licensed under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
Expand All @@ -15,16 +15,19 @@

<package format="3">
<name>basic_autonomy</name>
<version>4.0.0</version>
<version>5.0.0</version>
<description>The basic_autonomy package</description>

<maintainer email="carma@dot.gov">carma</maintainer>

<license>Apache 2.0</license>


<!-- Build tool dependencies -->
<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>ament_cmake_auto</buildtool_depend>

<!-- Build dependencies -->
<build_depend>carma_cmake_common</build_depend>
<build_depend>ament_auto_cmake</build_depend>

<depend>rclcpp</depend>
<depend>carma_ros2_utils</depend>
Expand All @@ -38,6 +41,7 @@
<depend>tf2</depend>
<depend>autoware_auto_msgs</depend>

<!-- Test dependencies -->
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_cmake_gtest</test_depend>

Expand Down
4 changes: 2 additions & 2 deletions basic_autonomy/src/basic_autonomy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ namespace basic_autonomy
for (size_t i = 0; i < points.size(); i++)
{
carma_planning_msgs::msg::TrajectoryPlanPoint tpp;
rclcpp::Duration relative_time(times[i] * 1e9); // Conversion of times[i] from seconds to nanoseconds
rclcpp::Duration relative_time = rclcpp::Duration::from_nanoseconds(static_cast<int64_t>(times[i] * 1e9)); // Conversion of times[i] from seconds to nanoseconds
tpp.target_time = startTime + relative_time;
tpp.x = points[i].x();
tpp.y = points[i].y();
Expand Down Expand Up @@ -1283,7 +1283,7 @@ namespace basic_autonomy
autoware_point.heading.real = std::cos(yaw/2);
autoware_point.heading.imag = std::sin(yaw/2);

autoware_point.time_from_start = rclcpp::Duration(times[i] * 1e9);
autoware_point.time_from_start = rclcpp::Duration::from_nanoseconds(static_cast<int64_t>(times[i] * 1e9));
RCLCPP_DEBUG_STREAM(rclcpp::get_logger(BASIC_AUTONOMY_LOGGER), "Setting waypoint idx: " << i <<", with planner: << " << trajectory_points[i].planner_plugin_name << ", x: " << trajectory_points[i].x <<
", y: " << trajectory_points[i].y <<
", speed: " << lag_speeds[i]* 2.23694 << "mph");
Expand Down
Loading
Loading