-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ROS1 Bridge ported to ROS2 humble (#248)
<!-- Thanks for the contribution, this is awesome. --> # PR Details ## Description <!--- Describe your changes in detail --> This PR updates the dockerfile for ros1_bridge to support humble inspired by: https://github.com/TommyChangUMD/ros-humble-ros1-bridge-builder/tree/main. Due to base image change from 20.04 to 22.04 because of Humble, ROS1 side of the installation and dependencies needed to be installed "manually" which is captured in this Dockerfile. Also: - It still uses USDOT's fork of the ros1_bridge which is updated to most recent in here: usdot-fhwa-stol/ros1_bridge#27. It needed few more extra functions from above 3rd party repo to successfuly build for CARMA - Currently it uses `ros:humble-ros-base-jammy` as the base image instead of `usdotfhwastoldev/carma-base:develop-humble` image, which I believe is leaner without all the extra dependencies that carma-base has. ## Related GitHub Issue NA <!--- This project only accepts pull requests related to open GitHub issues or Jira Keys --> <!--- If suggesting a new feature or change, please discuss it in an issue first --> <!--- If fixing a bug, there should be an issue describing it with steps to reproduce --> <!--- Please DO NOT name partially fixed issues, instead open an issue specific to this fix --> <!--- Please link to the issue here: --> ## Related Jira Key [ARC-156](https://usdot-carma.atlassian.net/browse/ARC-156) <!-- e.g. CAR-123 --> ## Motivation and Context CARMA migration to ROS2 Humble <!--- Why is this change required? What problem does it solve? --> ## How Has This Been Tested? Built using dockerhub using carma-msgs Dockerifle And tested in cdasim xil carma cloud use case <!--- Please describe in detail how you tested your changes. --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> ## Types of changes <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Defect fix (non-breaking change that fixes an issue) - [X] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [X] I have added any new packages to the sonar-scanner.properties file - [X] My change requires a change to the documentation. - [X] I have updated the documentation accordingly. - [X] I have read the [**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md) document. - [X] I have added tests to cover my changes. - [X] All new and existing tests passed. [ARC-156]: https://usdot-carma.atlassian.net/browse/ARC-156?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
- Loading branch information
Showing
16 changed files
with
135 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,46 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# ROS 1 msgs setup | ||
# Prepare workspace for ROS Noetic dependencies and Autoware messages | ||
mkdir -p /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai | ||
|
||
# Copy Autoware.ai messages into ROS1 workspace | ||
cp -R /home/carma/autoware.ai/messages /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai/ | ||
cp -R /home/carma/autoware.ai/jsk_common_msgs /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai/ | ||
cp -R /home/carma/autoware.ai/jsk_recognition /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai/ | ||
|
||
# ROS 2 msgs setup | ||
mkdir -p ~/.base-image/ros2_msgs_ws/src/autoware.ai | ||
# ROS1 CARMA message and dependency setup | ||
cd /home/carma/.base-image/ros1_msgs_ws | ||
unset ROS_DISTRO | ||
export ROS_VERSION=1 | ||
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to \ | ||
pcl_msgs \ | ||
autoware_msgs cav_msgs cav_srvs j2735_v2x_msgs can_msgs carma_debug_msgs autoware_lanelet2_msgs carma_cooperative_perception_interfaces | ||
|
||
# ROS2 CARMA message setup | ||
mkdir -p /home/carma/.base-image/ros2_msgs_ws/src/autoware.ai | ||
cp -R /home/carma/autoware.ai/messages /home/carma/.base-image/ros2_msgs_ws/src/autoware.ai/ | ||
cp -R /home/carma/autoware.ai/jsk_common_msgs /home/carma/.base-image/ros2_msgs_ws/src/autoware.ai/ | ||
cp -R /home/carma/autoware.ai/jsk_recognition /home/carma/.base-image/ros2_msgs_ws/src/autoware.ai/ | ||
|
||
# Cleanup autoware repo once messages have been moved | ||
# Clean up Autoware repository after moving messages | ||
rm -rf /home/carma/autoware.ai/ | ||
|
||
# ROS1 message setup | ||
cd ~/.base-image/ros1_msgs_ws && source /opt/ros/noetic/setup.bash && colcon build --packages-up-to autoware_msgs cav_msgs cav_srvs j2735_v2x_msgs can_msgs carma_debug_msgs autoware_lanelet2_msgs carma_cooperative_perception_interfaces | ||
|
||
# ROS2 message setup | ||
cd ~/.base-image/ros2_msgs_ws && source /opt/ros/humble/setup.bash && colcon build --packages-up-to autoware_msgs autoware_lanelet2_msgs can_msgs carma_debug_ros2_msgs carma_driver_msgs carma_localization_msgs carma_msgs carma_perception_msgs carma_planning_msgs carma_v2x_msgs j2735_v2x_msgs carma_cooperative_perception_interfaces | ||
cd /home/carma/.base-image/ros2_msgs_ws | ||
source /opt/ros/humble/setup.bash | ||
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to \ | ||
autoware_msgs autoware_lanelet2_msgs can_msgs carma_debug_ros2_msgs carma_driver_msgs carma_localization_msgs \ | ||
carma_msgs carma_perception_msgs carma_planning_msgs carma_v2x_msgs j2735_v2x_msgs carma_cooperative_perception_interfaces | ||
|
||
# Build the bridge | ||
source /opt/ros/noetic/setup.bash | ||
source /opt/ros/humble/setup.bash | ||
source ~/.base-image/ros1_msgs_ws/install/local_setup.bash | ||
source ~/.base-image/ros2_msgs_ws/install/local_setup.bash | ||
cd ~/.base-image/workspace/src | ||
cd ../ | ||
sudo apt-get update | ||
colcon build --event-handlers console_direct+ --packages-select ros1_bridge --cmake-force-configure | ||
sudo chmod -R ugo+x ~/.base-image/workspace/install | ||
source /home/carma/.base-image/ros1_msgs_ws/install/local_setup.bash | ||
source /home/carma/.base-image/ros2_msgs_ws/install/local_setup.bash | ||
cd /home/carma/.base-image/workspace/ | ||
|
||
MEMG=$(printf "%.0f" $(free -g | awk '/^Mem:/{print $2}')); \ | ||
NPROC=$(nproc); MIN=$((MEMG<NPROC ? MEMG : NPROC)); \ | ||
echo "Please wait... running $MIN concurrent jobs to build ros1_bridge"; \ | ||
time MAKEFLAGS="-j $MIN" colcon build --event-handlers console_direct+ \ | ||
--cmake-args -DCMAKE_BUILD_TYPE=Release --packages-select ros1_bridge --cmake-force-configure | ||
sudo chmod -R ugo+x /home/carma/.base-image/workspace/install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
repositories: | ||
pcl_msgs: | ||
type: git | ||
url: https://github.com/ros-perception/pcl_msgs.git | ||
version: noetic-devel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters