Skip to content

Commit

Permalink
Merge branch 'main' into mau/refactor/sensing/vehicle_velocity_converter
Browse files Browse the repository at this point in the history
  • Loading branch information
YamatoAndo authored Nov 22, 2024
2 parents 81dc890 + 25e7d5d commit e6d5f64
Show file tree
Hide file tree
Showing 273 changed files with 5,706 additions and 1,857 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ common/autoware_test_utils/** kyoichi.sugahara@tier4.jp mamoru.sobue@tier4.jp ta
common/autoware_testing/** adam.dabrowski@robotec.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
common/autoware_time_utils/** christopherj.ho@gmail.com shumpei.wakabayashi@tier4.jp tomoya.kimura@tier4.jp
common/autoware_trajectory/** mamoru.sobue@tier4.jp takayuki.murooka@tier4.jp yukinari.hisaki.2@tier4.jp
common/autoware_traffic_light_utils/** kotaro.uetake@tier4.jp satoshi.ota@tier4.jp shunsuke.miura@tier4.jp
common/autoware_universe_utils/** mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp
common/autoware_vehicle_info_utils/** mamoru.sobue@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp
common/bag_time_manager_rviz_plugin/** taiki.tanaka@tier4.jp
Expand All @@ -41,7 +42,6 @@ common/tier4_system_rviz_plugin/** koji.minoda@tier4.jp
common/tier4_traffic_light_rviz_plugin/** satoshi.ota@tier4.jp
common/tier4_vehicle_rviz_plugin/** yukihiro.saito@tier4.jp
common/traffic_light_recognition_marker_publisher/** shumpei.wakabayashi@tier4.jp takeshi.miura@tier4.jp tomoya.kimura@tier4.jp
common/traffic_light_utils/** kotaro.uetake@tier4.jp satoshi.ota@tier4.jp shunsuke.miura@tier4.jp
control/autoware_autonomous_emergency_braking/** daniel.sanchez@tier4.jp kyoichi.sugahara@tier4.jp mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp tomoya.kimura@tier4.jp
control/autoware_collision_detector/** go.sakayori@tier4.jp kyoichi.sugahara@tier4.jp tomohito.ando@tier4.jp
control/autoware_control_validator/** kyoichi.sugahara@tier4.jp makoto.kurihara@tier4.jp mamoru.sobue@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp
Expand Down Expand Up @@ -97,6 +97,7 @@ localization/yabloc/yabloc_image_processing/** anh.nguyen.2@tier4.jp kento.yabuu
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
localization/yabloc/yabloc_particle_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/yabloc/yabloc_pose_initializer/** 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
map/autoware_lanelet2_map_visualizer/** 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
map/autoware_map_height_fitter/** 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
map/autoware_map_projection_loader/** 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
map/autoware_map_tf_generator/** 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
2 changes: 1 addition & 1 deletion build_depends.repos
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repositories:
core/autoware_adapi_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_adapi_msgs.git
version: 1.3.0
version: beta/1.7.0
core/autoware_internal_msgs:
type: git
url: https://github.com/autowarefoundation/autoware_internal_msgs.git
Expand Down
4 changes: 2 additions & 2 deletions common/.pages
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ nav:
- 'Signal Processing':
- 'Introduction': common/autoware_signal_processing
- 'Butterworth Filter': common/autoware_signal_processing/documentation/ButterworthFilter
- 'autoware_traffic_light_utils': common/autoware_traffic_light_utils
- 'autoware_universe_utils': common/autoware_universe_utils
- 'traffic_light_utils': common/traffic_light_utils
- 'RVIZ2 Plugins':
- 'autoware_perception_rviz_plugin': common/autoware_perception_rviz_plugin
- 'autoware_overlay_rviz_plugin': common/autoware_overlay_rviz_plugin/autoware_overlay_rviz_plugin
Expand All @@ -40,7 +40,7 @@ nav:
- 'tier4_system_rviz_plugin': common/tier4_system_rviz_plugin
- 'tier4_traffic_light_rviz_plugin': common/tier4_traffic_light_rviz_plugin
- 'tier4_vehicle_rviz_plugin': common/tier4_vehicle_rviz_plugin
- 'traffic_light_recognition_marker_publisher': common/traffic_light_recognition_marker_publisher/Readme
- 'autoware_traffic_light_recognition_marker_publisher': common/autoware_traffic_light_recognition_marker_publisher/Readme
- 'Node':
- 'Goal Distance Calculator': common/autoware_goal_distance_calculator/Readme
- 'Path Distance Calculator': common/autoware_path_distance_calculator/Readme
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// 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__MOTION_UTILS__FACTOR__STEERING_FACTOR_INTERFACE_HPP_
#define AUTOWARE__MOTION_UTILS__FACTOR__STEERING_FACTOR_INTERFACE_HPP_

#include <autoware_adapi_v1_msgs/msg/planning_behavior.hpp>
#include <autoware_adapi_v1_msgs/msg/steering_factor.hpp>
#include <geometry_msgs/msg/pose.hpp>

#include <string>

namespace autoware::motion_utils
{

using autoware_adapi_v1_msgs::msg::PlanningBehavior;
using autoware_adapi_v1_msgs::msg::SteeringFactor;
using SteeringFactorBehavior = SteeringFactor::_behavior_type;
using SteeringFactorStatus = SteeringFactor::_status_type;
using geometry_msgs::msg::Pose;

class SteeringFactorInterface
{
public:
[[nodiscard]] SteeringFactor get() const { return steering_factor_; }
void init(const SteeringFactorBehavior & behavior) { behavior_ = behavior; }
void reset() { steering_factor_.behavior = PlanningBehavior::UNKNOWN; }

void set(
const std::array<Pose, 2> & pose, const std::array<double, 2> distance,
const uint16_t direction, const uint16_t status, const std::string & detail = "");

private:
SteeringFactorBehavior behavior_{SteeringFactor::UNKNOWN};
SteeringFactor steering_factor_{};
};

} // namespace autoware::motion_utils

#endif // AUTOWARE__MOTION_UTILS__FACTOR__STEERING_FACTOR_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class VelocityFactorInterface
const std::vector<PointType> & points, const Pose & curr_pose, const Pose & stop_pose,
const VelocityFactorStatus status, const std::string & detail = "");

void set(
const double & distance, const VelocityFactorStatus & status, const std::string & detail = "");

private:
VelocityFactorBehavior behavior_{VelocityFactor::UNKNOWN};
VelocityFactor velocity_factor_{};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// 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.

#include <autoware/motion_utils/factor/steering_factor_interface.hpp>

namespace autoware::motion_utils
{
void SteeringFactorInterface::set(
const std::array<Pose, 2> & pose, const std::array<double, 2> distance, const uint16_t direction,
const uint16_t status, const std::string & detail)
{
steering_factor_.pose = pose;
std::array<float, 2> converted_distance{0.0, 0.0};
for (int i = 0; i < 2; ++i) converted_distance[i] = static_cast<float>(distance[i]);
steering_factor_.distance = converted_distance;
steering_factor_.behavior = behavior_;
steering_factor_.direction = direction;
steering_factor_.status = status;
steering_factor_.detail = detail;
}
} // namespace autoware::motion_utils
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ void VelocityFactorInterface::set(
velocity_factor_.detail = detail;
}

void VelocityFactorInterface::set(
const double & distance, const VelocityFactorStatus & status, const std::string & detail)
{
velocity_factor_.behavior = behavior_;
velocity_factor_.distance = static_cast<float>(distance);
velocity_factor_.status = status;
velocity_factor_.detail = detail;
}

template void VelocityFactorInterface::set<tier4_planning_msgs::msg::PathPointWithLaneId>(
const std::vector<tier4_planning_msgs::msg::PathPointWithLaneId> &, const Pose &, const Pose &,
const VelocityFactorStatus, const std::string &);
Expand Down
3 changes: 3 additions & 0 deletions common/autoware_test_utils/config/sample_topic_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ fields:
- name: dynamic_object
type: PredictedObjects # autoware_perception_msgs::msg::PredictedObjects
topic: /perception/object_recognition/objects
# - name: tracked_object
# type: TrackedObjects # autoware_perception_msgs::msg::TrackedObjects
# topic: /perception/object_recognition/tracking/objects
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,19 @@ void updateNodeOptions(
*/
PathWithLaneId loadPathWithLaneIdInYaml();

/**
* @brief create a straight lanelet from 2 segments defined by 4 points
* @param [in] left0 start of the left segment
* @param [in] left1 end of the left segment
* @param [in] right0 start of the right segment
* @param [in] right1 end of the right segment
* @return a ConstLanelet with the given left and right bounds and a unique lanelet id
*
*/
lanelet::ConstLanelet make_lanelet(
const lanelet::BasicPoint2d & left0, const lanelet::BasicPoint2d & left1,
const lanelet::BasicPoint2d & right0, const lanelet::BasicPoint2d & right1);

/**
* @brief Generates a trajectory with specified parameters.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <autoware_adapi_v1_msgs/msg/operation_mode_state.hpp>
#include <autoware_perception_msgs/msg/predicted_objects.hpp>
#include <autoware_perception_msgs/msg/tracked_objects.hpp>
#include <autoware_perception_msgs/msg/traffic_light_group_array.hpp>
#include <autoware_planning_msgs/msg/lanelet_primitive.hpp>
#include <autoware_planning_msgs/msg/lanelet_route.hpp>
Expand Down Expand Up @@ -47,6 +48,9 @@ using autoware_perception_msgs::msg::PredictedObjectKinematics;
using autoware_perception_msgs::msg::PredictedObjects;
using autoware_perception_msgs::msg::PredictedPath;
using autoware_perception_msgs::msg::Shape;
using autoware_perception_msgs::msg::TrackedObject;
using autoware_perception_msgs::msg::TrackedObjectKinematics;
using autoware_perception_msgs::msg::TrackedObjects;
using autoware_perception_msgs::msg::TrafficLightElement;
using autoware_perception_msgs::msg::TrafficLightGroup;
using autoware_perception_msgs::msg::TrafficLightGroupArray;
Expand Down Expand Up @@ -131,6 +135,9 @@ std::vector<LaneletPrimitive> parse(const YAML::Node & node);
template <>
std::vector<LaneletSegment> parse(const YAML::Node & node);

template <>
LaneletRoute parse(const YAML::Node & node);

template <>
std::vector<PathPointWithLaneId> parse(const YAML::Node & node);

Expand All @@ -155,6 +162,15 @@ PredictedObject parse(const YAML::Node & node);
template <>
PredictedObjects parse(const YAML::Node & node);

template <>
TrackedObjectKinematics parse(const YAML::Node & node);

template <>
TrackedObject parse(const YAML::Node & node);

template <>
TrackedObjects parse(const YAML::Node & node);

template <>
TrafficLightGroupArray parse(const YAML::Node & node);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<launch>
<!-- Essential parameters -->
<arg name="vehicle_model" default="sample_vehicle" description="vehicle model name"/>
<arg name="sensor_model" default="sample_sensor_kit" description="sensor model name"/>
<arg name="sensor_model" default="awsim_sensor_kit" description="sensor model name"/>
<arg name="rviz_config" default="$(find-pkg-share autoware_test_utils)/rviz/psim_test_map.rviz" description="rviz config"/>
<arg name="use_sim_time" default="true"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<launch>
<!-- Essential parameters -->
<arg name="vehicle_model" default="sample_vehicle" description="vehicle model name"/>
<arg name="sensor_model" default="sample_sensor_kit" description="sensor model name"/>
<arg name="sensor_model" default="awsim_sensor_kit" description="sensor model name"/>
<arg name="rviz_config" default="$(find-pkg-share autoware_test_utils)/rviz/psim_test_map.rviz" description="rviz config"/>
<arg name="use_sim_time" default="true"/>

Expand Down
10 changes: 7 additions & 3 deletions common/autoware_test_utils/rviz/psim_test_map.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ Panels:
Name: AutowareStatePanel
- Class: rviz_plugins::SimulatedClockPanel
Name: SimulatedClockPanel
- Class: rviz_plugins::TrafficLightPublishPanel
Name: TrafficLightPublishPanel
Visualization Manager:
Class: ""
Displays:
Expand Down Expand Up @@ -4429,7 +4431,7 @@ Visualization Manager:
Value: /rviz/routing/rough_goal
- Acceleration: 0
Class: rviz_plugins/PedestrianInitialPoseTool
Interactive: true
Interactive: false
Max velocity: 33.29999923706055
Min velocity: -33.29999923706055
Pose Topic: /simulation/dummy_perception_publisher/object_info
Expand All @@ -4443,7 +4445,7 @@ Visualization Manager:
- Acceleration: 0
Class: rviz_plugins/CarInitialPoseTool
H vehicle height: 2
Interactive: true
Interactive: false
L vehicle length: 4
Max velocity: 33.29999923706055
Min velocity: -33.29999923706055
Expand All @@ -4459,7 +4461,7 @@ Visualization Manager:
- Acceleration: 0
Class: rviz_plugins/BusInitialPoseTool
H vehicle height: 3.5
Interactive: true
Interactive: false
L vehicle length: 10.5
Max velocity: 33.29999923706055
Min velocity: -33.29999923706055
Expand Down Expand Up @@ -4558,6 +4560,8 @@ Window Geometry:
collapsed: false
Tool Properties:
collapsed: false
TrafficLightPublishPanel:
collapsed: false
Views:
collapsed: false
Width: 1920
Expand Down
13 changes: 13 additions & 0 deletions common/autoware_test_utils/src/autoware_test_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,19 @@ PathWithLaneId loadPathWithLaneIdInYaml()
return parse<PathWithLaneId>(yaml_path);
}

lanelet::ConstLanelet make_lanelet(
const lanelet::BasicPoint2d & left0, const lanelet::BasicPoint2d & left1,
const lanelet::BasicPoint2d & right0, const lanelet::BasicPoint2d & right1)
{
lanelet::LineString3d left_bound;
left_bound.push_back(lanelet::Point3d(lanelet::InvalId, left0.x(), left0.y(), 0.0));
left_bound.push_back(lanelet::Point3d(lanelet::InvalId, left1.x(), left1.y(), 0.0));
lanelet::LineString3d right_bound;
right_bound.push_back(lanelet::Point3d(lanelet::InvalId, right0.x(), right0.y(), 0.0));
right_bound.push_back(lanelet::Point3d(lanelet::InvalId, right1.x(), right1.y(), 0.0));
return {lanelet::utils::getId(), left_bound, right_bound};
}

std::optional<std::string> resolve_pkg_share_uri(const std::string & uri_path)
{
std::smatch match;
Expand Down
49 changes: 49 additions & 0 deletions common/autoware_test_utils/src/mock_data_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,17 @@ std::vector<LaneletSegment> parse(const YAML::Node & node)
return segments;
}

template <>
LaneletRoute parse(const YAML::Node & node)
{
LaneletRoute route;

route.start_pose = parse<Pose>(node["start_pose"]);
route.goal_pose = parse<Pose>(node["goal_pose"]);
route.segments = parse<std::vector<LaneletSegment>>(node["segments"]);
return route;
}

template <>
std::vector<PathPointWithLaneId> parse<std::vector<PathPointWithLaneId>>(const YAML::Node & node)
{
Expand Down Expand Up @@ -330,6 +341,44 @@ PredictedObjects parse(const YAML::Node & node)
return msg;
}

template <>
TrackedObjectKinematics parse(const YAML::Node & node)
{
TrackedObjectKinematics msg;
msg.pose_with_covariance = parse<PoseWithCovariance>(node["pose_with_covariance"]);
msg.twist_with_covariance = parse<TwistWithCovariance>(node["twist_with_covariance"]);
msg.acceleration_with_covariance =
parse<AccelWithCovariance>(node["acceleration_with_covariance"]);
msg.orientation_availability = node["orientation_availability"].as<uint8_t>();
msg.is_stationary = node["is_stationary"].as<bool>();
return msg;
}

template <>
TrackedObject parse(const YAML::Node & node)
{
TrackedObject msg;
msg.object_id = parse<UUID>(node["object_id"]);
msg.existence_probability = node["existence_probability"].as<float>();
for (const auto & classification_node : node["classification"]) {
msg.classification.push_back(parse<ObjectClassification>(classification_node));
}
msg.kinematics = parse<TrackedObjectKinematics>(node["kinematics"]);
msg.shape = parse<Shape>(node["shape"]);
return msg;
}

template <>
TrackedObjects parse(const YAML::Node & node)
{
TrackedObjects msg;
msg.header = parse<Header>(node["header"]);
for (const auto & object_node : node["objects"]) {
msg.objects.push_back(parse<TrackedObject>(object_node));
}
return msg;
}

template <>
TrafficLightElement parse(const YAML::Node & node)
{
Expand Down
Loading

0 comments on commit e6d5f64

Please sign in to comment.