Skip to content

Commit

Permalink
Sync develop to master (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 authored Apr 24, 2024
2 parents e88ea80 + 9eac965 commit ca90b2b
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 75 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ version: 2
# Run static code analyzer for SourceCloud
# Upload test results
# Every run command should start with source ${INIT_ENV} to ensure all default dependancies are available
# TODO (CAR-6022) Replace with GitHub action to remove branch coupling (develop/release-candidate/master)
jobs:
build:
# Pull docker image from docker hub
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
name: Docker build

on:
push:
branches-ignore:
- "carma-develop"
- "master"
- "release/*"
pull_request:
types: [opened, synchronize, reopened]

jobs:
docker:
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build
uses: docker/build-push-action@v3
with:
context: .
uses: usdot-fhwa-stol/actions/.github/workflows/docker.yml@main
with:
context: .
30 changes: 11 additions & 19 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,17 @@ name: Docker Hub build
on:
push:
branches:
- "carma-develop"
- "master"
- carma-develop
- carma-master
- "release/*"
tags:
- carma-system-*
jobs:
dockerhub:
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: usdotfhwastoldev/${{ github.event.repository.name }}:develop
uses: usdot-fhwa-stol/actions/.github/workflows/dockerhub.yml@main
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
GH_PAT: ${{ secrets.GH_PAT }}
with:
context: .
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM usdotfhwastoldev/carma-base:develop AS base_image
ARG DOCKER_ORG=usdotfhwastoldev
ARG DOCKER_TAG=develop
FROM ${DOCKER_ORG}/carma-base:${DOCKER_TAG} as base_image

FROM base_image AS build

ARG GIT_BRANCH=develop
ARG ROS1_PACKAGES=""
ENV ROS1_PACKAGES=${ROS1_PACKAGES}
ARG ROS2_PACKAGES=""
ENV ROS2_PACKAGES=${ROS2_PACKAGES}

COPY --chown=carma . /home/carma/autoware.ai
RUN /home/carma/autoware.ai/docker/checkout.bash
RUN /home/carma/autoware.ai/docker/checkout.bash -b ${GIT_BRANCH}
RUN ./home/carma/autoware.ai/docker/install.sh

FROM base_image
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
| CicleCI Build Status | DockerHub Release | DockerHub Release Candidate | DockerHub Develop |
|------|-----|-----|-----|
[![CircleCI](https://img.shields.io/circleci/build/gh/usdot-fhwa-stol/autoware.ai/carma-develop?label=CircleCI)](https://app.circleci.com/pipelines/github/usdot-fhwa-stol/autoware.ai?branch=carma-develop) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastol/autoware.ai?label=Docker%20Build&logo=232496ED)](https://hub.docker.com/repository/docker/usdotfhwastol/autoware.ai) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastolcandidate/autoware.ai?label=Docker%20Build&logo=232496ED)](https://hub.docker.com/repository/docker/usdotfhwastolcandidate/autoware.ai) | [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/usdotfhwastoldev/autoware.ai?label=Docker%20Build&logo=232496ED)](https://hub.docker.com/repository/docker/usdotfhwastoldev/autoware.ai)

[![CircleCI](https://img.shields.io/circleci/build/gh/usdot-fhwa-stol/autoware.ai/carma-develop?label=CircleCI)](https://app.circleci.com/pipelines/github/usdot-fhwa-stol/autoware.ai?branch=carma-develop) | [![Docker Hub build](https://github.com/usdot-fhwa-stol/autoware.ai/actions/workflows/dockerhub.yml/badge.svg?branch=carma-system-4.5.0)](https://github.com/usdot-fhwa-stol/autoware.ai/actions/workflows/dockerhub.yml) | [![Docker Hub build](https://github.com/usdot-fhwa-stol/autoware.ai/actions/workflows/dockerhub.yml/badge.svg?branch=release%2Flavida)](https://github.com/usdot-fhwa-stol/autoware.ai/actions/workflows/dockerhub.yml) | [![Docker Hub build](https://github.com/usdot-fhwa-stol/autoware.ai/actions/workflows/dockerhub.yml/badge.svg?branch=carma-develop)](https://github.com/usdot-fhwa-stol/autoware.ai/actions/workflows/dockerhub.yml)

# Autoware.ai
This is a fork of Autoware containing modifications to support usage with the [CARMAPlatform](https://github.com/usdot-fhwa-stol/carma-platform). This repository contains changes to the Autoware source code and configuration that may not be supported by the Autoware Foundation and may not be consistent with the original design intent of Autoware. All modifications in this repository are licensed under the same Apache License 2.0 as Autoware and all modifications of the source code made will be marked as such in accordance with the terms of the Apache License 2.0. For a list of modifications and their descriptions please see [NOTICE.md](NOTICE.md).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,19 @@ namespace hardcoded_params
namespace control_limits
{
/**
* The maximum allowable longitudinal velocity of the vehicle in m/s
* The maximum allowable longitudinal velocity of the vehicle in m/s
*/
constexpr double MAX_LONGITUDINAL_VELOCITY_MPS = 35.7632;
constexpr double MAX_LONGITUDINAL_ACCEL_MPS2 = 3.5;

/**
* The maximum allowable simulation parameters
* At the time of writing this, platform uses CARLA 0.9.10 as the vehicle's physics simulator.
* CARLA 0.9.10 uses below hardcoded value for its vehicles (so even if increasing this value,
* actual simulation won't support larger values unless forked and compiled)
* https://github.com/carla-simulator/ros-bridge/blob/0.9.10.1/carla_ackermann_control/src/carla_ackermann_control/carla_control_physics.py#L254
*/
constexpr double MAX_SIMULATION_LONGITUDINAL_ACCEL_MPS2 = 8.0;

}
} // namespace hardcoded_params
18 changes: 10 additions & 8 deletions core_planning/twist_filter/include/accel_limiter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
namespace twist_filter{

constexpr double MAX_LONGITUDINAL_ACCEL_HARDCODED_LIMIT_M_S_2 = hardcoded_params::control_limits::MAX_LONGITUDINAL_ACCEL_MPS2;
constexpr double MAX_SIMULATION_LONGITUDINAL_ACCEL_HARDCODED_LIMIT_M_S_2 = hardcoded_params::control_limits::MAX_SIMULATION_LONGITUDINAL_ACCEL_MPS2;


class LongitudinalAccelLimiter
{
public:
public:
/**
* Default constructor, not recommended for use.
*/
Expand All @@ -24,31 +26,31 @@ class LongitudinalAccelLimiter

/**
* \brief Constructor for LongitudinalAccelLimiter
*
*
* \param accel_limit The acceleration limit that should be enforced, in
* units of m/s/s
*/
LongitudinalAccelLimiter(double accel_limit):
_accel_limit(accel_limit),
_initialized(false),
_prev_v(0.0),
_prev_t(0.0) {};
_prev_t(0.0) {};

/**
* Limit the longitudinal acceleration found in the input ControlCommandStamped
*
*
* \param msg The message to be evaluated
* \return A copy of the message with the longitudinal accel limited
* \return A copy of the message with the longitudinal accel limited
* based on params or hardcoded limit
*/
autoware_msgs::msg::ControlCommandStamped
longitudinalAccelLimitCtrl(const autoware_msgs::msg::ControlCommandStamped& msg);

/**
* Limit the longitudinal acceleration found in the input TwistStamped
*
*
* \param msg The message to be evaluated
* \return A copy of the message with the longitudinal accel limited
* \return A copy of the message with the longitudinal accel limited
* based on params or hardcoded limit
*/
geometry_msgs::msg::TwistStamped
Expand All @@ -58,7 +60,7 @@ class LongitudinalAccelLimiter
double _accel_limit;
bool _initialized;
double _prev_v;
rclcpp::Time _prev_t;
rclcpp::Time _prev_t;
};

}
6 changes: 3 additions & 3 deletions core_planning/twist_filter/include/twist_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Modifications:
* - Added limiting for longitudinal velocity per CARMA specifications. Refactored
* namespacing and header as needed to support unit testing.
* - Kyle Rush
* - Kyle Rush
* - 9/11/2020
* - Refactored for ros2
* - 11/16/2022
Expand Down Expand Up @@ -75,12 +75,12 @@ class TwistFilter : public carma_ros2_utils::CarmaLifecycleNode
carma_ros2_utils::PubPtr<std_msgs::msg::Float32> ctrl_lacc_limit_debug_pub_, ctrl_ljerk_limit_debug_pub_;
carma_ros2_utils::PubPtr<std_msgs::msg::Float32> twist_lacc_result_pub_, twist_ljerk_result_pub_;
carma_ros2_utils::PubPtr<std_msgs::msg::Float32> ctrl_lacc_result_pub_, ctrl_ljerk_result_pub_;

//subscribers
carma_ros2_utils::SubPtr<geometry_msgs::msg::TwistStamped> twist_sub_;
carma_ros2_utils::SubPtr<autoware_msgs::msg::ControlCommandStamped> ctrl_sub_;
carma_ros2_utils::SubPtr<autoware_config_msgs::msg::ConfigTwistFilter> config_sub_;

//ros params
double wheel_base_;
double longitudinal_velocity_limit_;
Expand Down
33 changes: 25 additions & 8 deletions core_planning/twist_filter/src/twist_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* Modifications:
* - Added limiting for longitudinal velocity per CARMA specifications. Refactored
* namespacing and header as needed to support unit testing.
* - Kyle Rush
* - Kyle Rush
* - 9/11/2020
*/

Expand Down Expand Up @@ -53,17 +53,34 @@ carma_ros2_utils::CallbackReturn TwistFilter::handle_on_configure(const rclcpp_l
// parameters on private handles
get_parameter<double>("config_speed_limit", longitudinal_velocity_limit_);
longitudinal_velocity_limit_ = longitudinal_velocity_limit_ * 0.44704;

get_parameter<double>("vehicle_acceleration_limit", longitudinal_accel_limit_);

bool use_sim_time = false;
get_parameter<bool>("use_sim_time", use_sim_time);

auto hardcoded_acceleration_limit = MAX_LONGITUDINAL_ACCEL_HARDCODED_LIMIT_M_S_2;

// if simulation
if (use_sim_time)
{
hardcoded_acceleration_limit = MAX_SIMULATION_LONGITUDINAL_ACCEL_HARDCODED_LIMIT_M_S_2;
RCLCPP_INFO_STREAM(get_logger(), "Simulation mode detected. Accounting for hardcoded limit, longitudinal acceleration limit used: " << hardcoded_acceleration_limit);
}
else
{
RCLCPP_INFO_STREAM(get_logger(), "Accounting for hardcoded limit, longitudinal acceleration limit used: " << hardcoded_acceleration_limit);
}

_lon_accel_limiter = LongitudinalAccelLimiter{
std::min(longitudinal_accel_limit_, MAX_LONGITUDINAL_ACCEL_HARDCODED_LIMIT_M_S_2)};
std::min(longitudinal_accel_limit_, hardcoded_acceleration_limit)};

get_parameter<double>("vehicle_lateral_accel_limit", lateral_accel_limit_);
get_parameter<double>("vehicle_lateral_jerk_limit", lateral_jerk_limit_);
get_parameter<double>("lowpass_gain_linear_x", lowpass_gain_linear_x_);
get_parameter<double>("lowpass_gain_angular_x", lowpass_gain_angular_z_);
get_parameter<double>("lowpass_gain_steering_angle", lowpass_gain_steering_angle_);


//Setup subscribers
twist_sub_ = create_subscription<geometry_msgs::msg::TwistStamped>("twist_raw", 1, std::bind(&TwistFilter::TwistCmdCallback, this, std_ph::_1));
Expand All @@ -73,7 +90,7 @@ carma_ros2_utils::CallbackReturn TwistFilter::handle_on_configure(const rclcpp_l
//Setup publishers
twist_pub_ = create_publisher<geometry_msgs::msg::TwistStamped>("twist_cmd", 5);
ctrl_pub_ = create_publisher<autoware_msgs::msg::ControlCommandStamped>("ctrl_cmd", 5);

// Publishers on private handles
twist_lacc_limit_debug_pub_ = create_publisher<std_msgs::msg::Float32>("~/limitation_debug/twist/lateral_accel", 5);
twist_ljerk_limit_debug_pub_ = create_publisher<std_msgs::msg::Float32>("~/limitation_debug/twist/lateral_jerk", 5);
Expand All @@ -83,7 +100,7 @@ carma_ros2_utils::CallbackReturn TwistFilter::handle_on_configure(const rclcpp_l
twist_ljerk_result_pub_ = create_publisher<std_msgs::msg::Float32>("~/result/twist/lateral_jerk", 5);
ctrl_lacc_result_pub_ = create_publisher<std_msgs::msg::Float32>("~/result/ctrl/lateral_accel", 5);
ctrl_ljerk_result_pub_ = create_publisher<std_msgs::msg::Float32>("~/result/ctrl/lateral_jerk", 5);


return CallbackReturn::SUCCESS;

Expand Down Expand Up @@ -413,4 +430,4 @@ void TwistFilter::CtrlCmdCallback(
#include "rclcpp_components/register_node_macro.hpp"

// Register the component with class_loader
RCLCPP_COMPONENTS_REGISTER_NODE(twist_filter::TwistFilter)
RCLCPP_COMPONENTS_REGISTER_NODE(twist_filter::TwistFilter)
30 changes: 15 additions & 15 deletions docker/checkout.bash
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
set -exo pipefail

dir=~
BRANCH=develop
while [[ $# -gt 0 ]]; do
arg="$1"
case $arg in
-d|--develop)
BRANCH=develop
-b|--branch)
BRANCH=$2
shift
shift
;;
-r|--root)
Expand All @@ -31,18 +33,16 @@ while [[ $# -gt 0 ]]; do
;;
esac
done

cd ${dir}/autoware.ai

if [[ "$BRANCH" = "develop" ]]; then
git clone --depth=1 https://github.com/usdot-fhwa-stol/carma-msgs.git --branch $BRANCH
git clone --depth=1 https://github.com/usdot-fhwa-stol/carma-utils.git --branch $BRANCH
git clone --depth=1 https://github.com/usdot-fhwa-stol/autoware.auto.git --branch $BRANCH
else
git clone --depth=1 https://github.com/usdot-fhwa-stol/carma-msgs.git --branch develop
git clone --depth=1 https://github.com/usdot-fhwa-stol/carma-utils.git --branch develop
git clone --depth=1 https://github.com/usdot-fhwa-stol/autoware.auto.git --branch develop
# When branch is carma-develop or carma-master strip carma prefix
if [[ "$BRANCH" == "carma-develop" ]]; then
BRANCH=develop
elif [[ "$BRANCH" == "carma-master" ]]; then
BRANCH=master
fi

cd "${dir}"/autoware.ai
git clone --depth=1 https://github.com/usdot-fhwa-stol/carma-msgs.git --branch "$BRANCH"
git clone --depth=1 https://github.com/usdot-fhwa-stol/carma-utils.git --branch "$BRANCH"
git clone --depth=1 https://github.com/usdot-fhwa-stol/autoware.auto.git --branch "$BRANCH"
# TODO(CAR-6023): Should this external dependencies be moved into install.sh
# Required to build pacmod_msgs
git clone https://github.com/astuff/astuff_sensor_msgs.git ${dir}/src/astuff_sensor_msgs -b 3.0.1
git clone https://github.com/astuff/astuff_sensor_msgs.git "${dir}"/src/astuff_sensor_msgs -b 3.0.1
3 changes: 2 additions & 1 deletion jsk_common_msgs/.gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule ".travis"]
path = .travis
url = git://github.com/jsk-ros-pkg/jsk_travis
url = https://github.com/jsk-ros-pkg/jsk_travis.git
branch = 0.4.26
2 changes: 2 additions & 0 deletions jsk_recognition/.gitmodules
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[submodule "jsk_perception/slic"]
path = jsk_perception/slic
url = https://github.com/garaemon/SLIC-Superpixels.git
branch = master
[submodule ".travis"]
path = .travis
url = https://github.com/jsk-ros-pkg/jsk_travis.git
branch = 0.4.26
[submodule "jsk_perception/node_scripts/deep_sort/deep_sort"]
path = jsk_perception/node_scripts/deep_sort/deep_sort
url = https://github.com/nwojke/deep_sort.git
branch = master

0 comments on commit ca90b2b

Please sign in to comment.