Skip to content

Commit

Permalink
Merge branch 'main' into fix/autoware_multi_object_tracker_output_to_…
Browse files Browse the repository at this point in the history
…both
  • Loading branch information
kminoda authored Aug 8, 2024
2 parents 6beb006 + 147403f commit 590229f
Show file tree
Hide file tree
Showing 252 changed files with 5,502 additions and 3,015 deletions.
6 changes: 0 additions & 6 deletions .cppcheck_suppressions
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
*:*/test/*

checkersReport
constParameterReference
funcArgNamesDifferent
functionConst
functionStatic
missingInclude
missingIncludeSystem
noConstructor
passedByValue
redundantInitialization
// cspell: ignore uninit
uninitMemberVar
unknownMacro
unmatchedSuppression
unreadVariable
Expand Down
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ common/autoware_grid_map_utils/** maxime.clement@tier4.jp
common/autoware_motion_utils/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp mamoru.sobue@tier4.jp satoshi.ota@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp
common/autoware_overlay_rviz_plugin/autoware_mission_details_overlay_rviz_plugin/** ahmed.ebrahim@leodrive.ai
common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin/** khalil@leodrive.ai
common/autoware_path_distance_calculator/** isamu.takagi@tier4.jp
common/autoware_perception_rviz_plugin/** opensource@apex.ai shunsuke.miura@tier4.jp taiki.tanaka@tier4.jp takeshi.miura@tier4.jp yoshi.ri@tier4.jp
common/autoware_point_types/** david.wong@tier4.jp max.schmeller@tier4.jp
common/autoware_test_utils/** kyoichi.sugahara@tier4.jp mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp zulfaqar.azmi@tier4.jp
Expand All @@ -24,7 +25,6 @@ common/interpolation/** fumiya.watanabe@tier4.jp takayuki.murooka@tier4.jp
common/kalman_filter/** koji.minoda@tier4.jp takeshi.ishita@tier4.jp yukihiro.saito@tier4.jp
common/object_recognition_utils/** shunsuke.miura@tier4.jp takayuki.murooka@tier4.jp yoshi.ri@tier4.jp
common/osqp_interface/** fumiya.watanabe@tier4.jp maxime.clement@tier4.jp satoshi.ota@tier4.jp takayuki.murooka@tier4.jp
common/path_distance_calculator/** isamu.takagi@tier4.jp
common/perception_utils/** shunsuke.miura@tier4.jp yoshi.ri@tier4.jp
common/polar_grid/** yukihiro.saito@tier4.jp
common/qp_interface/** fumiya.watanabe@tier4.jp maxime.clement@tier4.jp satoshi.ota@tier4.jp takayuki.murooka@tier4.jp
Expand Down Expand Up @@ -83,17 +83,17 @@ localization/autoware_landmark_based_localizer/autoware_ar_tag_based_localizer/*
localization/autoware_landmark_based_localizer/autoware_landmark_manager/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/autoware_pose_covariance_modifier/** melike@leodrive.ai
localization/autoware_stop_filter/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/autoware_twist2accel/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/ekf_localizer/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp takamasa.horibe@tier4.jp takeshi.ishita@tier4.jp yamato.ando@tier4.jp
localization/geo_pose_projector/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/gyro_odometer/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/localization_error_monitor/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/localization_util/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/ndt_scan_matcher/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/pose2twist/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/autoware_pose2twist/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/pose_estimator_arbiter/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/pose_initializer/** anh.nguyen.2@tier4.jp isamu.takagi@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/pose_instability_detector/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/twist2accel/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/yabloc/yabloc_common/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/yabloc/yabloc_image_processing/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
localization/yabloc/yabloc_monitor/** anh.nguyen.2@tier4.jp kento.yabuuchi.2@tier4.jp masahiro.sakamoto@tier4.jp ryu.yamamoto@tier4.jp shintaro.sakoda@tier4.jp taiki.yamada@tier4.jp yamato.ando@tier4.jp
Expand Down Expand Up @@ -131,7 +131,7 @@ perception/autoware_radar_object_clustering/** satoshi.tanaka@tier4.jp shunsuke.
perception/autoware_radar_object_tracker/** taekjin.lee@tier4.jp yoshi.ri@tier4.jp yukihiro.saito@tier4.jp
perception/autoware_radar_tracks_msgs_converter/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp taekjin.lee@tier4.jp yoshi.ri@tier4.jp
perception/autoware_raindrop_cluster_filter/** dai.nguyen@tier4.jp yoshi.ri@tier4.jp yukihiro.saito@tier4.jp
perception/autoware_shape_estimation/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp
perception/autoware_shape_estimation/** kcolak@leodrive.ai yoshi.ri@tier4.jp yukihiro.saito@tier4.jp
perception/autoware_simple_object_merger/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp yoshi.ri@tier4.jp
perception/autoware_tensorrt_classifier/** kotaro.uetake@tier4.jp shunsuke.miura@tier4.jp
perception/autoware_tensorrt_yolox/** dan.umeda@tier4.jp manato.hirabayashi@tier4.jp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
build-and-test-daily:
runs-on: [self-hosted, linux, X64]
runs-on: [self-hosted, linux, X64, gpu]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-and-test-differential.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
build-and-test-differential:
needs: make-sure-label-is-present
if: ${{ needs.make-sure-label-is-present.outputs.result == 'true' }}
runs-on: ubuntu-latest
runs-on: ${{ matrix.runner }}
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand All @@ -35,6 +35,10 @@ jobs:
- rosdistro: humble
container: ghcr.io/autowarefoundation/autoware:latest-autoware-universe
build-depends-repos: build_depends.repos
- container-suffix: -cuda
runner: [self-hosted, linux, X64, cpu]
- container-suffix: ""
runner: ubuntu-latest
steps:
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
build-and-test:
runs-on: [self-hosted, linux, X64]
runs-on: [self-hosted, linux, X64, gpu]
container: ${{ matrix.container }}${{ matrix.container-suffix }}
strategy:
fail-fast: false
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Autoware Universe

[![codecov](https://codecov.io/github/autowarefoundation/autoware.universe/graph/badge.svg?token=KQP68YQ65D)](https://codecov.io/github/autowarefoundation/autoware.universe)

## Welcome to Autoware Universe

Autoware Universe serves as a foundational pillar within the Autoware ecosystem, playing a critical role in enhancing the core functionalities of autonomous driving technologies.
Expand Down
4 changes: 4 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ flag_management:
type: patch
target: 0% # Make CI always succeed
threshold: 100% # Make CI always succeed

ignore:
- "**/test/*"
- "**/test/**/*"
2 changes: 1 addition & 1 deletion common/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ nav:
- 'traffic_light_recognition_marker_publisher': common/traffic_light_recognition_marker_publisher/Readme
- 'Node':
- 'Goal Distance Calculator': common/goal_distance_calculator/Readme
- 'Path Distance Calculator': common/path_distance_calculator/Readme
- 'Path Distance Calculator': common/autoware_path_distance_calculator/Readme
- 'Others':
- 'autoware_ad_api_specs': common/autoware_ad_api_specs
- 'component_interface_specs': common/component_interface_specs
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_common/test/test_template_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct FalseType

struct Foo
{
CorrectType bar(CorrectType, const CorrectType &, CorrectType *) { return CorrectType{}; }
static CorrectType bar(CorrectType, const CorrectType &, CorrectType *) { return CorrectType{}; }
};

template <template <typename> class Expression, typename... Ts>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(path_distance_calculator)
project(autoware_path_distance_calculator)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand All @@ -9,7 +9,7 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "PathDistanceCalculator"
PLUGIN "autoware::path_distance_calculator::PathDistanceCalculator"
EXECUTABLE ${PROJECT_NAME}_node
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# path_distance_calculator
# autoware_path_distance_calculator

## Purpose

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<launch>
<arg name="path" default="/planning/scenario_planning/lane_driving/behavior_planning/path"/>
<arg name="distance" default="~/distance"/>
<node pkg="path_distance_calculator" exec="path_distance_calculator_node" name="path_distance_calculator">
<node pkg="autoware_path_distance_calculator" exec="autoware_path_distance_calculator_node" name="path_distance_calculator">
<remap from="~/input/path" to="$(var path)"/>
<remap from="~/output/distance" to="$(var distance)"/>
</node>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>path_distance_calculator</name>
<name>autoware_path_distance_calculator</name>
<version>0.0.0</version>
<description>The path_distance_calculator package</description>
<description>The autoware_path_distance_calculator package</description>
<maintainer email="isamu.takagi@tier4.jp">Takagi, Isamu</maintainer>
<license>Apache License 2.0</license>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <utility>
#include <vector>

namespace autoware::path_distance_calculator
{
PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & options)
: Node("path_distance_calculator", options), self_pose_listener_(this)
{
Expand Down Expand Up @@ -54,6 +56,6 @@ PathDistanceCalculator::PathDistanceCalculator(const rclcpp::NodeOptions & optio
pub_dist_->publish(msg);
});
}

} // namespace autoware::path_distance_calculator
#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(PathDistanceCalculator)
RCLCPP_COMPONENTS_REGISTER_NODE(autoware::path_distance_calculator::PathDistanceCalculator)
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
#include <autoware_planning_msgs/msg/path.hpp>
#include <tier4_debug_msgs/msg/float64_stamped.hpp>

namespace autoware::path_distance_calculator
{

class PathDistanceCalculator : public rclcpp::Node
{
public:
Expand All @@ -35,4 +38,6 @@ class PathDistanceCalculator : public rclcpp::Node
autoware::universe_utils::SelfPoseListener self_pose_listener_;
};

} // namespace autoware::path_distance_calculator

#endif // PATH_DISTANCE_CALCULATOR_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ get_2d_shape_marker_ptr(
AUTOWARE_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_label_marker_ptr(
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std::string label, const std_msgs::msg::ColorRGBA & color_rgba);
const std::string & label, const std_msgs::msg::ColorRGBA & color_rgba);

AUTOWARE_PERCEPTION_RVIZ_PLUGIN_PUBLIC visualization_msgs::msg::Marker::SharedPtr
get_existence_probability_marker_ptr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ visualization_msgs::msg::Marker::SharedPtr get_uuid_marker_ptr(

visualization_msgs::msg::Marker::SharedPtr get_label_marker_ptr(
const geometry_msgs::msg::Point & centroid, const geometry_msgs::msg::Quaternion & orientation,
const std::string label, const std_msgs::msg::ColorRGBA & color_rgba)
const std::string & label, const std_msgs::msg::ColorRGBA & color_rgba)
{
auto marker_ptr = std::make_shared<Marker>();
marker_ptr->type = visualization_msgs::msg::Marker::TEXT_VIEW_FACING;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// Copyright 2024 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__UNIVERSE_UTILS__ROS__STATIC_TRANSFORM_BUFFER_HPP_
#define AUTOWARE__UNIVERSE_UTILS__ROS__STATIC_TRANSFORM_BUFFER_HPP_

#include "autoware/universe_utils/ros/transform_listener.hpp"

#include <eigen3/Eigen/Core>
#include <pcl_ros/transforms.hpp>
#include <rclcpp/rclcpp.hpp>

#include <sensor_msgs/point_cloud2_iterator.hpp>

#include <pcl_conversions/pcl_conversions.h>

#include <chrono>
#include <functional>
#include <memory>
#include <string>
#include <unordered_map>
#include <utility>

namespace std
{
template <>
struct hash<std::pair<std::string, std::string>>
{
size_t operator()(const std::pair<std::string, std::string> & p) const
{
size_t h1 = std::hash<std::string>{}(p.first);
size_t h2 = std::hash<std::string>{}(p.second);
return h1 ^ (h2 << 1u);
}
};
} // namespace std

namespace autoware::universe_utils
{
using std::chrono_literals::operator""ms;
using Key = std::pair<std::string, std::string>;
struct PairEqual
{
bool operator()(const Key & p1, const Key & p2) const
{
return p1.first == p2.first && p1.second == p2.second;
}
};
using TFMap = std::unordered_map<Key, Eigen::Matrix4f, std::hash<Key>, PairEqual>;

class StaticTransformBuffer
{
public:
StaticTransformBuffer() = default;

/**
* @brief Retrieves a transform between two static frames.
*
* This function attempts to retrieve a transform between the target frame and the source frame.
* If success, the transform matrix is set to the output parameter and the function returns true.
* Otherwise, transform matrix is set to identity and the function returns false. Transform
* Listener is destroyed after function call.
*
* @param node A pointer to the ROS node.
* @param target_frame The target frame.
* @param source_frame The source frame.
* @param eigen_transform The output Eigen transform matrix. Is set to identity if the transform
* is not found.
* @return True if the transform was successfully retrieved, false otherwise.
*/
bool getTransform(
rclcpp::Node * node, const std::string & target_frame, const std::string & source_frame,
Eigen::Matrix4f & eigen_transform)
{
auto key = std::make_pair(target_frame, source_frame);
auto key_inv = std::make_pair(source_frame, target_frame);

// Check if the transform is already in the buffer
auto it = buffer_.find(key);
if (it != buffer_.end()) {
eigen_transform = it->second;
return true;
}

// Check if the inverse transform is already in the buffer
auto it_inv = buffer_.find(key_inv);
if (it_inv != buffer_.end()) {
eigen_transform = it_inv->second.inverse();
buffer_[key] = eigen_transform;
return true;
}

// Check if transform is needed
if (target_frame == source_frame) {
eigen_transform = Eigen::Matrix4f::Identity();
buffer_[key] = eigen_transform;
return true;
}

// Get the transform from the TF tree
auto tf_listener = std::make_unique<autoware::universe_utils::TransformListener>(node);
auto tf = tf_listener->getTransform(
target_frame, source_frame, rclcpp::Time(0), rclcpp::Duration(1000ms));
RCLCPP_DEBUG(
node->get_logger(), "Trying to enqueue %s -> %s transform to static TFs buffer...",
target_frame.c_str(), source_frame.c_str());
if (tf == nullptr) {
eigen_transform = Eigen::Matrix4f::Identity();
return false;
}
pcl_ros::transformAsMatrix(*tf, eigen_transform);
buffer_[key] = eigen_transform;
return true;
}

/**
* Transforms a point cloud from one frame to another.
*
* @param node A pointer to the ROS node.
* @param target_frame The target frame to transform the point cloud to.
* @param cloud_in The input point cloud to be transformed.
* @param cloud_out The transformed point cloud.
* @return True if the transformation is successful, false otherwise.
*/
bool transformPointcloud(
rclcpp::Node * node, const std::string & target_frame,
const sensor_msgs::msg::PointCloud2 & cloud_in, sensor_msgs::msg::PointCloud2 & cloud_out)
{
if (
pcl::getFieldIndex(cloud_in, "x") == -1 || pcl::getFieldIndex(cloud_in, "y") == -1 ||
pcl::getFieldIndex(cloud_in, "z") == -1) {
RCLCPP_ERROR(node->get_logger(), "Input pointcloud does not have xyz fields");
return false;
}
if (target_frame == cloud_in.header.frame_id) {
cloud_out = cloud_in;
return true;
}
Eigen::Matrix4f eigen_transform;
if (!getTransform(node, target_frame, cloud_in.header.frame_id, eigen_transform)) {
return false;
}
pcl_ros::transformPointCloud(eigen_transform, cloud_in, cloud_out);
cloud_out.header.frame_id = target_frame;
return true;
}

private:
TFMap buffer_;
};

} // namespace autoware::universe_utils

#endif // AUTOWARE__UNIVERSE_UTILS__ROS__STATIC_TRANSFORM_BUFFER_HPP_
Loading

0 comments on commit 590229f

Please sign in to comment.