Skip to content

Commit

Permalink
Merge branch 'autowarefoundation:main' into dojo-ros-config-joy_contr…
Browse files Browse the repository at this point in the history
…oller
  • Loading branch information
kaspermeck-arm authored Aug 10, 2023
2 parents 57ed6de + 2b7afb1 commit ee347be
Show file tree
Hide file tree
Showing 431 changed files with 12,868 additions and 4,741 deletions.
11 changes: 1 addition & 10 deletions .cspell-partial.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
{
"ignorePaths": [
"**/common/**",
"**/control/**",
"**/docs/**",
"**/evaluator/**",
"**/launch/**",
"**/localization/**",
"**/perception/**",
"**/planning/**",
"**/sensing/**",
"**/simulator/**",
"**/system/**",
"**/tools/**",
"**/vehicles/**"
"perception/bytetrack/lib/**"
],
"ignoreRegExpList": [],
"words": []
Expand Down
80 changes: 47 additions & 33 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ name: build-and-test-differential

on:
pull_request:
types:
- opened
- synchronize
- labeled

jobs:
prevent-no-label-execution:
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
with:
label: run-build-and-test-differential

build-and-test-differential:
runs-on: ubuntu-latest
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: [self-hosted, linux, X64]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -59,7 +70,7 @@ jobs:
flags: differential

clang-tidy-differential:
runs-on: ubuntu-latest
runs-on: [self-hosted, linux, X64]
container: ghcr.io/autowarefoundation/autoware-universe:humble-latest-cuda
needs: build-and-test-differential
steps:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/openai-pr-reviewer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Code Review By ChatGPT

permissions:
contents: read
pull-requests: write

on:
pull_request_target:
types:
- labeled
pull_request_review_comment:
types: [created]

concurrency:
group: ${{ github.repository }}-${{ github.event.number || github.head_ref ||
github.sha }}-${{ github.workflow }}-${{ github.event_name ==
'pull_request_review_comment' && 'pr_comment' || 'pr' }}
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}

jobs:
prevent-no-label-execution:
uses: autowarefoundation/autoware-github-actions/.github/workflows/prevent-no-label-execution.yaml@v1
with:
label: openai-pr-reviewer
review:
needs: prevent-no-label-execution
if: ${{ needs.prevent-no-label-execution.outputs.run == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: fluxninja/openai-pr-reviewer@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
with:
debug: false
review_simple_changes: false
review_comment_lgtm: false
openai_light_model: gpt-3.5-turbo-0613
openai_heavy_model: gpt-3.5-turbo-0613 # The default is to use GPT4, which needs to be changed to join ChatGPT Plus.
2 changes: 1 addition & 1 deletion .github/workflows/spell-check-partial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
with:
cspell-json-url: https://raw.githubusercontent.com/tier4/autoware-spell-check-dict/main/.cspell.json
local-cspell-json: .cspell-partial.json
incremental-files-only: true
incremental-files-only: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2022 TIER IV, Inc.
//
// 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.

#ifndef AUTOWARE_AD_API_SPECS__PERCEPTION_HPP_
#define AUTOWARE_AD_API_SPECS__PERCEPTION_HPP_

#include <rclcpp/qos.hpp>

#include <autoware_adapi_v1_msgs/msg/dynamic_object_array.hpp>

namespace autoware_ad_api::perception
{

struct DynamicObjectArray
{
using Message = autoware_adapi_v1_msgs::msg::DynamicObjectArray;
static constexpr char name[] = "/api/perception/objects";
static constexpr size_t depth = 1;
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE;
};

} // namespace autoware_ad_api::perception

#endif // AUTOWARE_AD_API_SPECS__PERCEPTION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Covariance2d covariance_2d(const IT begin, const IT end)
/// \param[out] eig_vec1 First eigenvector
/// \param[out] eig_vec2 Second eigenvector
/// \tparam PointT Point type that has at least float members x and y
/// \return A pairt of eigenvalues: The first is the larger eigenvalue
/// \return A pair of eigenvalues: The first is the larger eigenvalue
/// \throw std::runtime error if you would get degenerate covariance
template <typename PointT>
std::pair<float32_t, float32_t> eig_2d(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ TYPED_TEST(BoxTest, Line3)
/_/ <-- first guess is suboptimal
*/
TYPED_TEST(BoxTest, SuboptInit)
TYPED_TEST(BoxTest, SuboptimalInit)
{
this->points.insert(
this->points.begin(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ TYPED_TEST(TypedSpatialHashTest, Oob)
// loop through all points
float32_t r = dr + this->EPS;
const uint32_t n_pts = PTS_PER_RING;
const auto & nbrs = hash.near(this->ref, r);
const auto & neighbors = hash.near(this->ref, r);
uint32_t points_seen = 0U;
for (const auto itd : nbrs) {
for (const auto itd : neighbors) {
const PointT & pt = itd;
const float32_t dist = sqrtf((pt.x * pt.x) + (pt.y * pt.y));
ASSERT_LT(dist, r);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ TYPED_TEST(TypedConvexHullTest, Quadrilateral)
}

// test that things get reordered to ccw
TYPED_TEST(TypedConvexHullTest, Quadhull)
TYPED_TEST(TypedConvexHullTest, QuadHull)
{
std::vector<TypeParam> data(
{this->make(1, 1, 1), this->make(5, 1, 2), this->make(2, 6, 3), this->make(3, 3, 4),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ TYPED_TEST(TypedHullPocketsTest, Box)
// | |
// +------------------------------+
// This should come up with a single box on the top left.
TYPED_TEST(TypedHullPocketsTest, Ushape)
TYPED_TEST(TypedHullPocketsTest, UShape)
{
const auto polygon = std::vector<decltype(this->make(0, 0, 0))>{
this->make(0, 0, 0), this->make(5, 0, 0), this->make(5, 4.5, 0), this->make(4, 5, 0),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright 2022 TIER IV, Inc.
//
// 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.

#ifndef COMPONENT_INTERFACE_SPECS__PERCEPTION_HPP_
#define COMPONENT_INTERFACE_SPECS__PERCEPTION_HPP_

#include <rclcpp/qos.hpp>

#include <autoware_auto_perception_msgs/msg/predicted_objects.hpp>

namespace perception_interface
{

struct ObjectRecognition
{
using Message = autoware_auto_perception_msgs::msg::PredictedObjects;
static constexpr char name[] = "/perception/object_recognition/objects";
static constexpr size_t depth = 1;
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
static constexpr auto durability = RMW_QOS_POLICY_DURABILITY_VOLATILE;
};

} // namespace perception_interface

#endif // COMPONENT_INTERFACE_SPECS__PERCEPTION_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PrimeSynchronizer
const typename PrimeMsgT::ConstSharedPtr, const typename SecondaryMsgT::ConstSharedPtr...)>
callback,
StampT max_delay_t = 0.2, StampT max_wait_t = 0.1)
: node_ptr_(node_ptr), callback_(callback), max_delay_t_(max_delay_t), max_wait_t_(max_wait_t)
: node_ptr_(node_ptr), callback_(callback), max_wait_t_(max_wait_t), max_delay_t_(max_delay_t)
{
assert((topics.size() == sizeof...(SecondaryMsgT) + 1) && "Incorrect topic number");
assert(topics.size() == qos.size() && "topic size not equal to qos size!");
Expand Down Expand Up @@ -158,7 +158,7 @@ class PrimeSynchronizer
* @tparam Idx
* @param argv
* @return true All messages are not nullptr
* @return false At least one message in the tuplc is nullptr
* @return false At least one message in the topic is nullptr
*/
template <std::size_t Idx = 0>
bool isArgvValid(
Expand Down
23 changes: 12 additions & 11 deletions common/tensorrt_common/src/tensorrt_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,20 +273,20 @@ void TrtCommon::printNetworkInfo(const std::string & onnx_file_path)
int total_params = 0;
for (int i = 0; i < num; i++) {
nvinfer1::ILayer * layer = network->getLayer(i);
auto ltype = layer->getType();
auto layer_type = layer->getType();
std::string name = layer->getName();
if (build_config_->profile_per_layer) {
model_profiler_.setProfDict(layer);
}
if (ltype == nvinfer1::LayerType::kCONSTANT) {
if (layer_type == nvinfer1::LayerType::kCONSTANT) {
continue;
}
nvinfer1::ITensor * in = layer->getInput(0);
nvinfer1::Dims dim_in = in->getDimensions();
nvinfer1::ITensor * out = layer->getOutput(0);
nvinfer1::Dims dim_out = out->getDimensions();

if (ltype == nvinfer1::LayerType::kCONVOLUTION) {
if (layer_type == nvinfer1::LayerType::kCONVOLUTION) {
nvinfer1::IConvolutionLayer * conv = (nvinfer1::IConvolutionLayer *)layer;
nvinfer1::Dims k_dims = conv->getKernelSizeNd();
nvinfer1::Dims s_dims = conv->getStrideNd();
Expand All @@ -305,7 +305,7 @@ void TrtCommon::printNetworkInfo(const std::string & onnx_file_path)
std::cout << " weights:" << num_weights;
std::cout << " GFLOPs:" << gflops;
std::cout << std::endl;
} else if (ltype == nvinfer1::LayerType::kPOOLING) {
} else if (layer_type == nvinfer1::LayerType::kPOOLING) {
nvinfer1::IPoolingLayer * pool = (nvinfer1::IPoolingLayer *)layer;
auto p_type = pool->getPoolingType();
nvinfer1::Dims dim_stride = pool->getStrideNd();
Expand All @@ -325,7 +325,7 @@ void TrtCommon::printNetworkInfo(const std::string & onnx_file_path)
std::cout << "pool " << dim_window.d[0] << "x" << dim_window.d[1] << "]";
std::cout << " GFLOPs:" << gflops;
std::cout << std::endl;
} else if (ltype == nvinfer1::LayerType::kRESIZE) {
} else if (layer_type == nvinfer1::LayerType::kRESIZE) {
std::cout << "L" << i << " [resize]" << std::endl;
}
}
Expand Down Expand Up @@ -364,7 +364,7 @@ bool TrtCommon::buildEngineFromOnnx(
if (num_available_dla > 0) {
std::cout << "###" << num_available_dla << " DLAs are supported! ###" << std::endl;
} else {
std::cout << "###Warninig : "
std::cout << "###Warning : "
<< "No DLA is supported! ###" << std::endl;
}
config->setDefaultDeviceType(nvinfer1::DeviceType::kDLA);
Expand Down Expand Up @@ -400,7 +400,7 @@ bool TrtCommon::buildEngineFromOnnx(
network->getInput(0)->setDynamicRange(0, 255.0);
for (int i = 0; i < num; i++) {
nvinfer1::ILayer * layer = network->getLayer(i);
auto ltype = layer->getType();
auto layer_type = layer->getType();
std::string name = layer->getName();
nvinfer1::ITensor * out = layer->getOutput(0);
if (build_config_->clip_value > 0.0) {
Expand All @@ -409,13 +409,14 @@ bool TrtCommon::buildEngineFromOnnx(
out->setDynamicRange(0.0, build_config_->clip_value);
}

if (ltype == nvinfer1::LayerType::kCONVOLUTION) {
if (layer_type == nvinfer1::LayerType::kCONVOLUTION) {
if (first) {
layer->setPrecision(nvinfer1::DataType::kHALF);
std::cout << "Set kHALF in " << name << std::endl;
first = false;
}
if (last) {
// cspell: ignore preds
if (
contain(name, "reg_preds") || contain(name, "cls_preds") ||
contain(name, "obj_preds")) {
Expand All @@ -424,14 +425,14 @@ bool TrtCommon::buildEngineFromOnnx(
}
for (int i = num - 1; i >= 0; i--) {
nvinfer1::ILayer * layer = network->getLayer(i);
auto ltype = layer->getType();
auto layer_type = layer->getType();
std::string name = layer->getName();
if (ltype == nvinfer1::LayerType::kCONVOLUTION) {
if (layer_type == nvinfer1::LayerType::kCONVOLUTION) {
layer->setPrecision(nvinfer1::DataType::kHALF);
std::cout << "Set kHALF in " << name << std::endl;
break;
}
if (ltype == nvinfer1::LayerType::kMATRIX_MULTIPLY) {
if (layer_type == nvinfer1::LayerType::kMATRIX_MULTIPLY) {
layer->setPrecision(nvinfer1::DataType::kHALF);
std::cout << "Set kHALF in " << name << std::endl;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void AccelBrakeMapCalibratorButtonPanel::onInitialize()
&AccelBrakeMapCalibratorButtonPanel::callbackUpdateSuggest, this, std::placeholders::_1));

client_ = raw_node->create_client<tier4_vehicle_msgs::srv::UpdateAccelBrakeMap>(
"/accel_brake_map_calibrator/update_map_dir");
"/vehicle/calibration/accel_brake_map_calibrator/update_map_dir");
}

void AccelBrakeMapCalibratorButtonPanel::callbackUpdateSuggest(
Expand Down Expand Up @@ -118,25 +118,28 @@ void AccelBrakeMapCalibratorButtonPanel::pushCalibrationButton()
status_label_->setText("executing calibration...");

std::thread thread([this] {
auto req = std::make_shared<tier4_vehicle_msgs::srv::UpdateAccelBrakeMap::Request>();
req->path = "";

client_->async_send_request(
req,
[this](
[[maybe_unused]] rclcpp::Client<tier4_vehicle_msgs::srv::UpdateAccelBrakeMap>::SharedFuture
result) {
status_label_->setStyleSheet("QLabel { background-color : lightgreen;}");
status_label_->setText("OK!!!");

// wait 3 second
after_calib_ = true;
rclcpp::Rate(3.0).sleep();
after_calib_ = false;

// unlock button
calibration_button_->setEnabled(true);
});
if (!client_->wait_for_service(std::chrono::seconds(1))) {
status_label_->setStyleSheet("QLabel { background-color : red;}");
status_label_->setText("service server not found");

} else {
auto req = std::make_shared<tier4_vehicle_msgs::srv::UpdateAccelBrakeMap::Request>();
req->path = "";
client_->async_send_request(
req, [this]([[maybe_unused]] rclcpp::Client<
tier4_vehicle_msgs::srv::UpdateAccelBrakeMap>::SharedFuture result) {});

status_label_->setStyleSheet("QLabel { background-color : lightgreen;}");
status_label_->setText("OK!!!");
}

// wait 3 second
after_calib_ = true;
rclcpp::Rate(1.0 / 3.0).sleep();
after_calib_ = false;

// unlock button
calibration_button_->setEnabled(true);
});

thread.detach();
Expand Down
Loading

0 comments on commit ee347be

Please sign in to comment.