Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MishkaMN committed Nov 27, 2024
1 parent 27a8d1e commit 0a5035e
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 80 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/Ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@ jobs:
source "$INIT_ENV"
./src/${{ github.event.repository.name }}/docker/checkout.bash -r /opt/carma/ -b ${{ steps.determine-base-branch.outputs.git_branch }}
# TODO: WIP Humble Upgrade: Enable when carma_cooperative_perception is ready
#- name: Install external dependencies
# # Install the multiple object tracking deps
# run: sudo bash /opt/carma/src/multiple_object_tracking/scripts/install_dependencies.sh
- name: Install external dependencies
# Install the multiple object tracking deps
run: sudo bash /opt/carma/src/multiple_object_tracking/scripts/install_dependencies.sh
# TODO WIP Humble Upgrade: Remove after humble upgrade is done
- name: Read packages from file
run: |
Expand Down
9 changes: 5 additions & 4 deletions .sonarqube/sonar-scanner.properties
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ sonar.modules= bsm_generator, \
carma_wm, \
carma_wm_ctrl, \
roadway_objects, \
platooning_strategic_IHP, \
platooning_tactical_plugin, \
port_drayage_plugin, \
mobilitypath_publisher, \
Expand Down Expand Up @@ -90,7 +91,7 @@ carma_wm.sonar.projectBaseDir = /opt/carma/src/carma-platform/c
carma_wm_ctrl.sonar.projectBaseDir = /opt/carma/src/carma-platform/carma_wm_ctrl
#mpc_follower_wrapper.sonar.projectBaseDir = /opt/carma/src/carma-platform/mpc_follower_wrapper
roadway_objects.sonar.projectBaseDir = /opt/carma/src/carma-platform/roadway_objects
platooning_strategic_ihp.sonar.projectBaseDir = /opt/carma/src/carma-platform/platooning_strategic_ihp
platooning_strategic_IHP.sonar.projectBaseDir = /opt/carma/src/carma-platform/platooning_strategic_IHP
platooning_tactical_plugin.sonar.projectBaseDir = /opt/carma/src/carma-platform/platooning_tactical_plugin
platooning_control_plugin.sonar.projectBaseDir = /opt/carma/src/carma-platform/platooning_control
mobilitypath_publisher.sonar.projectBaseDir = /opt/carma/src/carma-platform/mobilitypath_publisher
Expand Down Expand Up @@ -149,8 +150,8 @@ carma_wm_ctrl.sonar.sources = src
carma_wm_ctrl.sonar.exclusions =test/**
roadway_objects.sonar.sources = src
roadway_objects.sonar.exclusions =test/**
platooning_strategic_ihp.sonar.sources = src
platooning_strategic_ihp.sonar.exclusions =test/**
platooning_strategic_IHP.sonar.sources = src
platooning_strategic_IHP.sonar.exclusions =test/**
platooning_tactical_plugin.sonar.sources = src
platooning_tactical_plugin.sonar.exclusions =test/**
platooning_control_plugin.sonar.sources = src
Expand Down Expand Up @@ -223,7 +224,7 @@ arbitrator.sonar.tests = test
carma_wm.sonar.tests = test
carma_wm_ctrl.sonar.tests = test
roadway_objects.sonar.tests = test
platooning_strategic_ihp.sonar.tests = test
platooning_strategic_IHP.sonar.tests = test
platooning_tactical_plugin.sonar.tests = test
platooning_control_plugin.sonar.tests = test
mobilitypath_publisher.sonar.tests = test
Expand Down
31 changes: 14 additions & 17 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 @@ -34,26 +34,23 @@
# /////////////////////////////////////////////////////////////////////////////
ARG DOCKER_ORG="usdotfhwastoldev"
ARG DOCKER_TAG="develop"
FROM ${DOCKER_ORG}/autoware.ai:${DOCKER_TAG} as base-image
FROM 5f061b925f05 as base-image

FROM base-image AS source-code
FROM 5f061b925f05 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}
FROM 5f061b925f05 AS install
ARG PACKAGES=""
ENV PACKAGES=${PACKAGES}

# Copy the source files from the previous stage and build/install
RUN mkdir ~/carma_ws
Expand All @@ -66,7 +63,7 @@ RUN ~/carma_ws/src/carma-platform/docker/install.sh
# /////////////////////////////////////////////////////////////////////////////


FROM base-image
FROM 5f061b925f05

ARG BUILD_DATE="NULL"
ARG VCS_REF="NULL"
Expand Down
14 changes: 7 additions & 7 deletions carma/launch/plugins.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def generate_launch_description():
cooperative_lanechange_param_file = os.path.join(
get_package_share_directory('cooperative_lanechange'), 'config/parameters.yaml')

platooning_strategic_ihp_param_file = os.path.join(
get_package_share_directory('platooning_strategic_ihp'), 'config/parameters.yaml')
platoon_strategic_ihp_param_file = os.path.join(
get_package_share_directory('platoon_strategic_ihp'), 'config/parameters.yaml')

sci_strategic_plugin_file_path = os.path.join(
get_package_share_directory('sci_strategic_plugin'), 'config/parameters.yaml')
Expand Down Expand Up @@ -559,12 +559,12 @@ def generate_launch_description():
namespace=GetCurrentNamespace(),
composable_node_descriptions=[
ComposableNode(
package='platooning_strategic_ihp',
plugin='platooning_strategic_ihp::Node',
name='platooning_strategic_ihp_node',
package='platoon_strategic_ihp',
plugin='platoon_strategic_ihp::Node',
name='platoon_strategic_ihp_node',
extra_arguments=[
{'use_intra_process_comms': True},
{'--log-level' : GetLogLevel('platooning_strategic_ihp', env_log_levels) }
{'--log-level' : GetLogLevel('platoon_strategic_ihp', env_log_levels) }
],
remappings = [
("semantic_map", [ EnvironmentVariable('CARMA_ENV_NS', default_value=''), "/semantic_map" ] ),
Expand All @@ -586,7 +586,7 @@ def generate_launch_description():
("current_pose", [ EnvironmentVariable('CARMA_LOCZ_NS', default_value=''), "/current_pose" ] ),
],
parameters=[
platooning_strategic_ihp_param_file,
platoon_strategic_ihp_param_file,
vehicle_config_param_file
]
),
Expand Down
56 changes: 20 additions & 36 deletions docker/build-image.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/bash

# 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 @@ -24,78 +24,63 @@ echo ""
echo "##### $IMAGE Docker Image Build Script #####"
echo ""

ROS1_PACKAGES=""
ROS2_PACKAGES=""
ROS1_PACKAGES_COLLECT=false
ROS2_PACKAGES_COLLECT=false
PACKAGES=""
PACKAGES_COLLECT=false

while [[ $# -gt 0 ]]; do
arg="$1"
case $arg in
-v|--version)
ROS1_PACKAGES_COLLECT=false
ROS2_PACKAGES_COLLECT=false
PACKAGES_COLLECT=false

COMPONENT_VERSION_STRING="$2"
shift
shift
;;
--system-release)
ROS1_PACKAGES_COLLECT=false
ROS2_PACKAGES_COLLECT=false
PACKAGES_COLLECT=false

SYSTEM_RELEASE=true
shift
;;
-p|--push)
ROS1_PACKAGES_COLLECT=false
ROS2_PACKAGES_COLLECT=false
PACKAGES_COLLECT=false

PUSH=true
shift
;;
-d|--develop)
ROS1_PACKAGES_COLLECT=false
ROS2_PACKAGES_COLLECT=false
PACKAGES_COLLECT=false

USERNAME=usdotfhwastoldev
COMPONENT_VERSION_STRING=develop
shift
;;
--ros-1-packages|--ros1)
ROS1_PACKAGES_COLLECT=true
ROS2_PACKAGES_COLLECT=false

shift
;;
--ros-2-packages|--ros2)
ROS1_PACKAGES_COLLECT=false
ROS2_PACKAGES_COLLECT=true
--select-packages|--packages)
PACKAGES_COLLECT=true

shift
;;
*)
# Var test based on Stack Overflow question: https://stackoverflow.com/questions/5406858/difference-between-unset-and-empty-variables-in-bash
# Asker: green69
# Answerer: geekosaur
if $ROS1_PACKAGES_COLLECT; then
ROS1_PACKAGES="$ROS1_PACKAGES $arg"
elif $ROS2_PACKAGES_COLLECT; then
ROS2_PACKAGES="$ROS2_PACKAGES $arg"
if $PACKAGES_COLLECT; then
PACKAGES="$PACKAGES $arg"
else
echo "Unknown argument $arg..."
exit -1
fi
fi
shift
;;
esac
done

if [[ ! -z "$ROS1_PACKAGES$ROS2_PACKAGES" ]]; then
echo "Performing incremental build of image to rebuild packages: ROS1>> $ROS1_PACKAGES ROS2>> $ROS2_PACKAGES..."
if [[ ! -z "$PACKAGES" ]]; then
echo "Performing incremental build of image to rebuild packages: $PACKAGES..."

echo "Updating Dockerfile references to use most recent image as base image"
# Trim of docker image LS command sourced from
# Trim of docker image LS command sourced from
# https://stackoverflow.com/questions/50625619/why-doesnt-the-cut-command-work-for-a-docker-image-ls-command
# Question Asker: Chris F
# Question Answerer: Arount
Expand Down Expand Up @@ -135,14 +120,13 @@ if [[ $COMPONENT_VERSION_STRING = "develop" ]]; then
--build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` .
elif [[ $COMPONENT_VERSION_STRING = "SNAPSHOT" ]]; then
docker build --network=host --no-cache -t $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING \
--build-arg ROS1_PACKAGES="$ROS1_PACKAGES" \
--build-arg ROS2_PACKAGES="$ROS2_PACKAGES" \
--build-arg PACKAGES="$PACKAGES" \
--build-arg VERSION="$COMPONENT_VERSION_STRING" \
--build-arg VCS_REF=`git rev-parse --short HEAD` \
--build-arg BUILD_DATE=`date -u +”%Y-%m-%dT%H:%M:%SZ”` .
else
#The addition of --network=host was a fix for a DNS resolution error that occured
#when running the platform inside an Ubuntu 20.04 virtual machine. The error and possible soliutions are
#The addition of --network=host was a fix for a DNS resolution error that occured
#when running the platform inside an Ubuntu 20.04 virtual machine. The error and possible soliutions are
# discussed here: https://github.com/moby/moby/issues/41003
docker build --network=host --no-cache -t $USERNAME/$IMAGE:$COMPONENT_VERSION_STRING \
--build-arg VERSION="$COMPONENT_VERSION_STRING" \
Expand Down
18 changes: 7 additions & 11 deletions docker/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sudo chgrp carma /opt/carma # Set group to expose permissions for build

# Source the autoware installation

if [[ ! -z "$ROS1_PACKAGES$ROS2_PACKAGES" ]]; then
if [[ ! -z "$PACKAGES" ]]; then
echo "Sourcing previous build for incremental build start point..."
source /opt/carma/install/setup.bash
else
Expand All @@ -39,18 +39,14 @@ fi

cd ~/carma_ws

echo "Building ROS2 CARMA Components"
echo "Building Selected CARMA Components"

if [[ ! -z "$ROS1_PACKAGES$ROS2_PACKAGES" ]]; then
if [[ ! -z "$ROS2_PACKAGES" ]]; then
echo "Incrementally building ROS2 packages: $ROS2_PACKAGES"
colcon build --install-base /opt/carma/install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-above $ROS2_PACKAGES
else
echo "Build type is incremental but no ROS2 packages specified, skipping ROS2 build..."
fi
if [[ ! -z "$PACKAGES" ]]; then
echo "Incrementally building following packages and those dependent on them: $PACKAGES"
colcon build --install-base /opt/carma/install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-above $PACKAGES
else
echo "Building all ROS2 components..."
echo "Building all CARMA components..."
colcon build --install-base /opt/carma/install --build-base build --cmake-args -DCMAKE_BUILD_TYPE=Release
fi

echo "Build of ROS 2 CARMA Components Complete"
echo "Build of CARMA Components Complete"
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@
- /guidance/plugins/stop_and_wait_plugin
- /guidance/plugins/sci_strategic_plugin
- /guidance/plugins/stop_controlled_intersection_tactical_plugin
- /guidance/plugins/platooning_strategic_ihp
- /guidance/plugins/platoon_strategic_ihp
- /guidance/plugins/platooning_tactical_plugin_node
- /guidance/plugins/yield_plugin

0 comments on commit 0a5035e

Please sign in to comment.