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

Arpa 28 humble #8

Merged
merged 23 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1c16347
Arpa 4 cpp message (#1)
radishco Dec 20, 2024
606b179
Created dev container
radishco Dec 24, 2024
17cbc69
Added builder file and install script
radishco Dec 24, 2024
be10a6c
Permission denied error when trying to add STOL APT repo
radishco Dec 26, 2024
17d8b64
Able to add STOL apt repo, getting errors when running apt-get update
radishco Dec 27, 2024
8d20988
Humble version works
radishco Jan 6, 2025
46ea576
Forgot to delete lib-asn1 files
radishco Jan 6, 2025
1c460af
Refactored repo, also edited dockerfile and cmakelist to use carma_j2…
radishco Jan 28, 2025
c216dc7
Unit tests pass and roslaunch works
radishco Jan 28, 2025
63fda6f
Included source /carma/install/setup.bash
radishco Jan 28, 2025
0696b5c
Updated gitignore
radishco Jan 28, 2025
5a9c96b
Added builder file and install script
radishco Dec 24, 2024
00a7538
Updated merge conflicts
radishco Jan 31, 2025
046d351
Merge branch 'develop' into arpa-18-humble
radishco Jan 31, 2025
9811cbe
addressed pr comments
radishco Jan 31, 2025
0a8ca28
Updated CI to include adding stol_j2735 package
radishco Jan 31, 2025
dc62f9b
Removed generated code
radishco Jan 31, 2025
832897a
Updated name for stol-j2735
radishco Jan 31, 2025
57467bb
Updated sonar scanner to remove lib_asn1c
radishco Jan 31, 2025
7988646
addressed comments, still unable to build
radishco Feb 3, 2025
359b669
Updated v2x-ros cmake, build works
radishco Feb 3, 2025
dc908b2
Addressed comments
radishco Feb 3, 2025
4b80c42
Added check ros version to v2x-ros cmake
radishco Feb 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "V2X-ROS Conversion",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created.
// "postCreateCommand": "cat /etc/os-release",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools",
"twxs.cmake"
]
}
}

// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
else
echo git_branch="$GITHUB_REF_NAME" >> $GITHUB_OUTPUT
fi
- name: Install stol-j2735 package from STOL APT repo
run: ./src/${{ github.event.repository.name }}/docker/install_dependencies.sh
- name: Checkout dependencies
run: |
source "$INIT_ENV"
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.vscode
/build
/install
/log
2 changes: 0 additions & 2 deletions .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ sonar.sourceEncoding=UTF-8
# Modules, C++ packages
sonar.modules= j2735_convertor, \
cpp_message, \
lib_asn1c, \
v2x-ros-conversion

j2735_convertor.sonar.projectBaseDir=/opt/carma/src/v2x-ros-conversion/ros-conversion/j2735_convertor
cpp_message.sonar.projectBaseDir=/opt/carma/src/v2x-ros-conversion/ros-conversion/cpp_message
lib_asn1c.sonar.projectBaseDir=/opt/carma/src/v2x-ros-conversion/ros-conversion/lib_asn1c
v2x-ros-conversion.sonar.projectBaseDir=/opt/carma/src/v2x-ros-conversion/ros-conversion/v2x-ros-conversion

# C++ Package differences
Expand Down
16 changes: 9 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2018-2024 LEIDOS.
# Copyright (C) 2018-2025 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 @@ -11,19 +11,22 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.

ARG DOCKER_ORG="usdotfhwastoldev"
ARG DOCKER_TAG="develop-humble"
FROM ${DOCKER_ORG}/carma-base:${DOCKER_TAG} as base_image
COPY --chown=carma . /home/carma/src/

RUN ~/src/docker/install_dependencies.sh

FROM base_image as setup
ARG GIT_BRANCH="develop-humble"

RUN mkdir ~/src
COPY --chown=carma . /home/carma/src/
RUN ~/src/docker/checkout.bash -b ${GIT_BRANCH}

RUN ~/src/docker/install.sh

FROM base_image
RUN rm -rf /home/carma/src/

ARG BUILD_DATE="NULL"
ARG VERSION="NULL"
Expand All @@ -39,9 +42,8 @@ LABEL org.label-schema.vcs-url="https://github.com/usdot-fhwa-stol/carma-messeng
LABEL org.label-schema.vcs-ref=${VCS_REF}
LABEL org.label-schema.build-date=${BUILD_DATE}

COPY --from=setup /opt/carma/install /opt/carma/install
RUN sudo chmod -R +x /opt/carma/install

RUN pip install future

CMD [ "wait-for-it", "localhost:11311", "--", "ros2", "v2x-ros-conversion", "v2x-ros-conversion.launch.py" ]

CMD [ "wait-for-it", "localhost:11311", "--", "source", "/opt/carma/install/setup.bash", "&&", "ros2", "v2x-ros-conversion", "v2x-ros-conversion.launch.py"]
18 changes: 18 additions & 0 deletions docker/get-repo-name.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
#!/bin/bash

# Copyright (C) 2018-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
#
# 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
# License for the specific language governing permissions and limitations under
# the License.

basename -s .git `git config --get remote.origin.url`

#!/bin/bash

# Copyright (C) 2018-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 Down
1 change: 0 additions & 1 deletion docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@

# Build ros2
cd ~/
source /home/carma/catkin/setup.bash
source /opt/ros/humble/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --install-base /opt/carma/install
15 changes: 15 additions & 0 deletions docker/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

# exit on errors
set -e

# Get ubuntu distribution code name. All STOL APT debian packages are pushed to S3 bucket based on distribution codename.
. /etc/lsb-release

# add the STOL APT repository
echo "deb [trusted=yes] http://s3.amazonaws.com/stol-apt-repository ${DISTRIB_CODENAME} main" | sudo tee /etc/apt/sources.list.d/stol-apt-repository.list

sudo apt-get update

# install all things needed for deployment, always done
sudo apt-get install -y stol-j2735-1
59 changes: 30 additions & 29 deletions ros-conversion/cpp_message/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# Copyright (C) 2022-2023 LEIDOS.
# Copyright (C) 2022-2025 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 @@ -16,11 +16,14 @@
cmake_minimum_required(VERSION 3.5)
project(cpp_message)

set(ros_environment_DIR "usr/local/lib/cmake")

# Declare carma package and check ROS version
find_package(carma_cmake_common REQUIRED)
find_package(asn1c REQUIRED)

# STOL Debian package CMake install path
list(APPEND CMAKE_PREFIX_PATH "/opt/carma/cmake/")
set(CMAKE_INSTALL_RPATH "/opt/carma/lib")

find_package(stol-j2735 REQUIRED)

carma_check_ros_version(2)
carma_package()
Expand All @@ -36,7 +39,9 @@ set(node_lib cpp_message_node)
# Includes
include_directories(
include
include/generated
)
link_directories(
/opt/carma/lib
)

ament_export_include_directories(include)
Expand All @@ -57,38 +62,29 @@ ament_auto_add_library(${node_lib} SHARED
src/SDSM_Message.cpp
)

target_link_libraries(${node_lib} ::stol-j2735)
target_include_directories(${node_lib}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
/opt/carma/include/stol-j2735
)

add_library(testlib SHARED IMPORTED)

# Following is asn1c library install path outside the container, which is usually fixed as /opt/carma/install/
set(ASN1C_INSTALL_PATH ${asn1c_DIR}/../../../)

set_target_properties(testlib PROPERTIES
IMPORTED_LOCATION ${ASN1C_INSTALL_PATH}/lib/libasn1c.so
)

target_link_libraries(${node_lib} testlib)

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

# Register component
rclcpp_components_register_nodes(${node_lib} "cpp_message::Node")

# All locally created targets will need to be manually linked
# ament auto will handle linking of external dependencies
target_link_libraries(${node_exec}
${node_lib}
)

# Testing
if(BUILD_TESTING)
# # 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

ament_add_gtest(test_cpp_message_node
ament_add_gtest(test_cpp_message_node
test/test_MobilityOperations.cpp
test/test_EmergencyVehicleAck.cpp
test/test_EmergencyVehicleResponse.cpp
Expand All @@ -104,13 +100,18 @@ if(BUILD_TESTING)
test/test_SDSM.cpp
)

ament_target_dependencies(test_cpp_message_node ${${PROJECT_NAME}_FOUND_TEST_DEPENDS})
ament_target_dependencies(test_cpp_message_node ${${PROJECT_NAME}_FOUND_TEST_DEPENDS} )

target_link_libraries(test_cpp_message_node ${node_lib})
target_include_directories(test_cpp_message_node
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

endif()

# Install
ament_auto_package(
INSTALL_TO_SHARE launch
)
)
84 changes: 0 additions & 84 deletions ros-conversion/cpp_message/include/generated/ANY.h

This file was deleted.

This file was deleted.

Loading