Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace tier4_planning_msgs with autoware_planning_msgs #9794

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@

#include <autoware_planning_msgs/msg/lanelet_route.hpp>
#include <autoware_planning_msgs/msg/trajectory.hpp>
#include <tier4_planning_msgs/msg/route_state.hpp>
#include <tier4_planning_msgs/srv/clear_route.hpp>
#include <tier4_planning_msgs/srv/set_lanelet_route.hpp>
#include <tier4_planning_msgs/srv/set_waypoint_route.hpp>
#include <autoware_planning_msgs/msg/route_state.hpp>
#include <autoware_planning_msgs/srv/clear_route.hpp>
#include <autoware_planning_msgs/srv/set_lanelet_route.hpp>
#include <autoware_planning_msgs/srv/set_waypoint_route.hpp>

namespace autoware::component_interface_specs::planning
{

struct SetLaneletRoute
{
using Service = tier4_planning_msgs::srv::SetLaneletRoute;
using Service = autoware_planning_msgs::srv::SetLaneletRoute;
static constexpr char name[] = "/planning/mission_planning/route_selector/main/set_lanelet_route";
};

struct SetWaypointRoute
{
using Service = tier4_planning_msgs::srv::SetWaypointRoute;
using Service = autoware_planning_msgs::srv::SetWaypointRoute;
static constexpr char name[] =
"/planning/mission_planning/route_selector/main/set_waypoint_route";
};

struct ClearRoute
{
using Service = tier4_planning_msgs::srv::ClearRoute;
using Service = autoware_planning_msgs::srv::ClearRoute;
static constexpr char name[] = "/planning/mission_planning/route_selector/main/clear_route";
};

struct RouteState
{
using Message = tier4_planning_msgs::msg::RouteState;
using Message = autoware_planning_msgs::msg::RouteState;
static constexpr char name[] = "/planning/mission_planning/route_selector/main/state";
static constexpr size_t depth = 1;
static constexpr auto reliability = RMW_QOS_POLICY_RELIABILITY_RELIABLE;
Expand Down
1 change: 0 additions & 1 deletion common/autoware_component_interface_specs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<depend>rosidl_runtime_cpp</depend>
<depend>tier4_control_msgs</depend>
<depend>tier4_localization_msgs</depend>
<depend>tier4_planning_msgs</depend>
<depend>tier4_system_msgs</depend>
<depend>tier4_vehicle_msgs</depend>

Expand Down
2 changes: 1 addition & 1 deletion common/autoware_motion_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The second function finds the nearest index in the lane whose id is `lane_id`.

```cpp
size_t findNearestIndexFromLaneId(
const tier4_planning_msgs::msg::PathWithLaneId & path,
const autoware_planning_msgs::msg::PathWithLaneId & path,
const geometry_msgs::msg::Point & pos, const int64_t lane_id);
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include <autoware_planning_msgs/msg/path_point.hpp>
#include <autoware_planning_msgs/msg/trajectory_point.hpp>
#include <geometry_msgs/msg/pose.hpp>
#include <tier4_planning_msgs/msg/control_point.hpp>
#include <tier4_planning_msgs/msg/path_point_with_lane_id.hpp>
#include <tier4_planning_msgs/msg/planning_factor.hpp>
#include <tier4_planning_msgs/msg/planning_factor_array.hpp>
#include <tier4_planning_msgs/msg/safety_factor_array.hpp>
#include <autoware_planning_msgs/msg/control_point.hpp>
#include <autoware_planning_msgs/msg/path_point_with_lane_id.hpp>
#include <autoware_planning_msgs/msg/planning_factor.hpp>
#include <autoware_planning_msgs/msg/planning_factor_array.hpp>
#include <autoware_planning_msgs/msg/safety_factor_array.hpp>

#include <string>
#include <vector>
Expand All @@ -34,10 +34,10 @@ namespace autoware::motion_utils
{

using geometry_msgs::msg::Pose;
using tier4_planning_msgs::msg::ControlPoint;
using tier4_planning_msgs::msg::PlanningFactor;
using tier4_planning_msgs::msg::PlanningFactorArray;
using tier4_planning_msgs::msg::SafetyFactorArray;
using autoware_planning_msgs::msg::ControlPoint;
using autoware_planning_msgs::msg::PlanningFactor;
using autoware_planning_msgs::msg::PlanningFactorArray;
using autoware_planning_msgs::msg::SafetyFactorArray;

class PlanningFactorInterface
{
Expand Down Expand Up @@ -124,13 +124,13 @@ class PlanningFactorInterface
const SafetyFactorArray & safety_factors, const bool is_driving_forward = true,
const double velocity = 0.0, const double shift_length = 0.0, const std::string & detail = "")
{
const auto control_point = tier4_planning_msgs::build<ControlPoint>()
const auto control_point = autoware_planning_msgs::build<ControlPoint>()
.pose(control_point_pose)
.velocity(velocity)
.shift_length(shift_length)
.distance(distance);

const auto factor = tier4_planning_msgs::build<PlanningFactor>()
const auto factor = autoware_planning_msgs::build<PlanningFactor>()
.module(name_)
.is_driving_forward(is_driving_forward)
.control_points({control_point})
Expand Down Expand Up @@ -161,19 +161,19 @@ class PlanningFactorInterface
const bool is_driving_forward = true, const double velocity = 0.0,
const double shift_length = 0.0, const std::string & detail = "")
{
const auto control_start_point = tier4_planning_msgs::build<ControlPoint>()
const auto control_start_point = autoware_planning_msgs::build<ControlPoint>()
.pose(start_pose)
.velocity(velocity)
.shift_length(shift_length)
.distance(start_distance);

const auto control_end_point = tier4_planning_msgs::build<ControlPoint>()
const auto control_end_point = autoware_planning_msgs::build<ControlPoint>()
.pose(end_pose)
.velocity(velocity)
.shift_length(shift_length)
.distance(end_distance);

const auto factor = tier4_planning_msgs::build<PlanningFactor>()
const auto factor = autoware_planning_msgs::build<PlanningFactor>()
.module(name_)
.is_driving_forward(is_driving_forward)
.control_points({control_start_point, control_end_point})
Expand Down Expand Up @@ -209,8 +209,8 @@ class PlanningFactorInterface
std::vector<PlanningFactor> factors_;
};

extern template void PlanningFactorInterface::add<tier4_planning_msgs::msg::PathPointWithLaneId>(
const std::vector<tier4_planning_msgs::msg::PathPointWithLaneId> &, const Pose &, const Pose &,
extern template void PlanningFactorInterface::add<autoware_planning_msgs::msg::PathPointWithLaneId>(
const std::vector<autoware_planning_msgs::msg::PathPointWithLaneId> &, const Pose &, const Pose &,
const uint16_t behavior, const SafetyFactorArray &, const bool, const double, const double,
const std::string &);
extern template void PlanningFactorInterface::add<autoware_planning_msgs::msg::PathPoint>(
Expand All @@ -222,8 +222,8 @@ extern template void PlanningFactorInterface::add<autoware_planning_msgs::msg::T
const uint16_t behavior, const SafetyFactorArray &, const bool, const double, const double,
const std::string &);

extern template void PlanningFactorInterface::add<tier4_planning_msgs::msg::PathPointWithLaneId>(
const std::vector<tier4_planning_msgs::msg::PathPointWithLaneId> &, const Pose &, const Pose &,
extern template void PlanningFactorInterface::add<autoware_planning_msgs::msg::PathPointWithLaneId>(
const std::vector<autoware_planning_msgs::msg::PathPointWithLaneId> &, const Pose &, const Pose &,
const Pose &, const uint16_t behavior, const SafetyFactorArray &, const bool, const double,
const double, const std::string &);
extern template void PlanningFactorInterface::add<autoware_planning_msgs::msg::PathPoint>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#include "autoware_planning_msgs/msg/path.hpp"
#include "autoware_planning_msgs/msg/trajectory.hpp"
#include "tier4_planning_msgs/msg/path_with_lane_id.hpp"
#include "autoware_planning_msgs/msg/path_with_lane_id.hpp"

#include <vector>

Expand Down Expand Up @@ -113,8 +113,8 @@ std::vector<geometry_msgs::msg::Pose> resamplePoseVector(
* longitudinal and lateral velocity. Otherwise, it uses linear interpolation
* @return resampled path
*/
tier4_planning_msgs::msg::PathWithLaneId resamplePath(
const tier4_planning_msgs::msg::PathWithLaneId & input_path,
autoware_planning_msgs::msg::PathWithLaneId resamplePath(
const autoware_planning_msgs::msg::PathWithLaneId & input_path,
const std::vector<double> & resampled_arclength, const bool use_akima_spline_for_xy = false,
const bool use_lerp_for_z = true, const bool use_zero_order_hold_for_v = true);

Expand All @@ -136,8 +136,8 @@ tier4_planning_msgs::msg::PathWithLaneId resamplePath(
* @param resample_input_path_stop_point If true, resample closest stop point in input path
* @return resampled path
*/
tier4_planning_msgs::msg::PathWithLaneId resamplePath(
const tier4_planning_msgs::msg::PathWithLaneId & input_path, const double resample_interval,
autoware_planning_msgs::msg::PathWithLaneId resamplePath(
const autoware_planning_msgs::msg::PathWithLaneId & input_path, const double resample_interval,
const bool use_akima_spline_for_xy = false, const bool use_lerp_for_z = true,
const bool use_zero_order_hold_for_v = true, const bool resample_input_path_stop_point = true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "autoware_planning_msgs/msg/detail/trajectory__struct.hpp"
#include "autoware_planning_msgs/msg/detail/trajectory_point__struct.hpp"
#include "std_msgs/msg/header.hpp"
#include "tier4_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"
#include "autoware_planning_msgs/msg/detail/path_with_lane_id__struct.hpp"

#include <vector>

Expand Down Expand Up @@ -58,7 +58,7 @@ autoware_planning_msgs::msg::Path convertToPath([[maybe_unused]] const T & input

template <>
inline autoware_planning_msgs::msg::Path convertToPath(
const tier4_planning_msgs::msg::PathWithLaneId & input)
const autoware_planning_msgs::msg::PathWithLaneId & input)
{
autoware_planning_msgs::msg::Path output{};
output.header = input.header;
Expand All @@ -80,7 +80,7 @@ TrajectoryPoints convertToTrajectoryPoints([[maybe_unused]] const T & input)

template <>
inline TrajectoryPoints convertToTrajectoryPoints(
const tier4_planning_msgs::msg::PathWithLaneId & input)
const autoware_planning_msgs::msg::PathWithLaneId & input)
{
TrajectoryPoints output{};
for (const auto & p : input.points) {
Expand All @@ -95,19 +95,19 @@ inline TrajectoryPoints convertToTrajectoryPoints(
}

template <class T>
tier4_planning_msgs::msg::PathWithLaneId convertToPathWithLaneId([[maybe_unused]] const T & input)
autoware_planning_msgs::msg::PathWithLaneId convertToPathWithLaneId([[maybe_unused]] const T & input)
{
static_assert(sizeof(T) == 0, "Only specializations of convertToPathWithLaneId can be used.");
throw std::logic_error("Only specializations of convertToPathWithLaneId can be used.");
}

template <>
inline tier4_planning_msgs::msg::PathWithLaneId convertToPathWithLaneId(
inline autoware_planning_msgs::msg::PathWithLaneId convertToPathWithLaneId(
const TrajectoryPoints & input)
{
tier4_planning_msgs::msg::PathWithLaneId output{};
autoware_planning_msgs::msg::PathWithLaneId output{};
for (const auto & p : input) {
tier4_planning_msgs::msg::PathPointWithLaneId pp;
autoware_planning_msgs::msg::PathPointWithLaneId pp;
pp.point.pose = p.pose;
pp.point.longitudinal_velocity_mps = p.longitudinal_velocity_mps;
output.points.emplace_back(pp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "autoware/universe_utils/geometry/geometry.hpp"

#include "autoware_planning_msgs/msg/trajectory.hpp"
#include "tier4_planning_msgs/msg/path_with_lane_id.hpp"
#include "autoware_planning_msgs/msg/path_with_lane_id.hpp"

#include <boost/optional.hpp>

Expand Down Expand Up @@ -51,8 +51,8 @@ autoware_planning_msgs::msg::TrajectoryPoint calcInterpolatedPoint(
* twist information
* @return resampled path(poses)
*/
tier4_planning_msgs::msg::PathPointWithLaneId calcInterpolatedPoint(
const tier4_planning_msgs::msg::PathWithLaneId & path,
autoware_planning_msgs::msg::PathPointWithLaneId calcInterpolatedPoint(
const autoware_planning_msgs::msg::PathWithLaneId & path,
const geometry_msgs::msg::Pose & target_pose, const bool use_zero_order_hold_for_twist = false,
const double dist_threshold = std::numeric_limits<double>::max(),
const double yaw_threshold = std::numeric_limits<double>::max());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
#ifndef AUTOWARE__MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_
#define AUTOWARE__MOTION_UTILS__TRAJECTORY__PATH_WITH_LANE_ID_HPP_

#include "tier4_planning_msgs/msg/path_with_lane_id.hpp"
#include "autoware_planning_msgs/msg/path_with_lane_id.hpp"
#include <geometry_msgs/msg/point.hpp>

#include <optional>
#include <utility>
namespace autoware::motion_utils
{
std::optional<std::pair<size_t, size_t>> getPathIndexRangeWithLaneId(
const tier4_planning_msgs::msg::PathWithLaneId & path, const int64_t target_lane_id);
const autoware_planning_msgs::msg::PathWithLaneId & path, const int64_t target_lane_id);

size_t findNearestIndexFromLaneId(
const tier4_planning_msgs::msg::PathWithLaneId & path, const geometry_msgs::msg::Point & pos,
const autoware_planning_msgs::msg::PathWithLaneId & path, const geometry_msgs::msg::Point & pos,
const int64_t lane_id);

size_t findNearestSegmentIndexFromLaneId(
const tier4_planning_msgs::msg::PathWithLaneId & path, const geometry_msgs::msg::Point & pos,
const autoware_planning_msgs::msg::PathWithLaneId & path, const geometry_msgs::msg::Point & pos,
const int64_t lane_id);

// @brief Calculates the path to be followed by the rear wheel center in order to make the vehicle
// center follow the input path
// @param [in] path with position to be followed by the center of the vehicle
// @param [out] PathWithLaneId to be followed by the rear wheel center follow to make the vehicle
// center follow the input path NOTE: rear_to_cog is supposed to be positive
tier4_planning_msgs::msg::PathWithLaneId convertToRearWheelCenter(
const tier4_planning_msgs::msg::PathWithLaneId & path, const double rear_to_cog,
autoware_planning_msgs::msg::PathWithLaneId convertToRearWheelCenter(
const autoware_planning_msgs::msg::PathWithLaneId & path, const double rear_to_cog,
const bool enable_last_point_compensation = true);
} // namespace autoware::motion_utils

Expand Down
Loading
Loading