21#include <lanelet2_core/primitives/Lanelet.h>
22#include <lanelet2_core/primitives/Point.h>
23#include <lanelet2_core/primitives/Polygon.h>
24#include <lanelet2_core/utility/Optional.h>
25#include <geometry_msgs/msg/pose.hpp>
26#include <geometry_msgs/msg/vector3.hpp>
27#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
28#include <tf2/LinearMath/Quaternion.h>
29#include <tf2/LinearMath/Matrix3x3.h>
65TrackPos trackPos(
const lanelet::BasicPoint2d& p,
const lanelet::BasicPoint2d& seg_start,
66 const lanelet::BasicPoint2d& seg_end);
88std::tuple<TrackPos, lanelet::BasicSegment2d>
matchSegment(
const lanelet::BasicPoint2d& p,
89 const lanelet::BasicLineString2d& line_string);
113std::vector<double>
local_curvatures(
const lanelet::BasicLineString2d& centerline_points);
115std::vector<double>
local_curvatures(
const std::vector<lanelet::BasicPoint2d>& centerline_points);
124std::vector<double>
local_curvatures(
const std::vector<lanelet::ConstLanelet>& lanelets);
131 const lanelet::BasicLineString2d& l2);
137lanelet::BasicLineString2d
concatenate_lanelets(
const std::vector<lanelet::ConstLanelet>& lanelets);
176 const std::vector<double>&
y);
196std::vector<Eigen::Vector2d>
normalize_vectors(
const std::vector<Eigen::Vector2d>& vectors);
217[[deprecated(
"computeCurvature is deprecated in favor of using the finite differences-based computeLocalCurvature for "
218 "large curves")]]
double
219computeCurvature(
const lanelet::BasicPoint2d& p1,
const lanelet::BasicPoint2d& p2,
const lanelet::BasicPoint2d& p3);
265lanelet::BasicPolygon2d
objectToMapPolygon(
const geometry_msgs::msg::Pose& pose,
const geometry_msgs::msg::Vector3& size);
276void rpyFromQuaternion(
const tf2::Quaternion& q,
double& roll,
double& pitch,
double& yaw);
287void rpyFromQuaternion(
const geometry_msgs::msg::Quaternion& q_msg,
double& roll,
double& pitch,
double& yaw);
316Eigen::Isometry2d
build2dEigenTransform(
const Eigen::Vector2d& position,
const Eigen::Rotation2Dd& rotation);
329Eigen::Isometry3d
build3dEigenTransform(
const Eigen::Vector3d& position,
const Eigen::Quaterniond& rotation);
331Eigen::Isometry3d
build3dEigenTransform(
const Eigen::Vector3d& position,
const Eigen::AngleAxisd& rotation);
341double point_to_point_yaw(
const lanelet::BasicPoint2d& cur_point,
const lanelet::BasicPoint2d& next_point);
353double circular_arc_curvature(
const lanelet::BasicPoint2d& cur_point,
const lanelet::BasicPoint2d& next_point);
Position in a track based coordinate system where the axis are downtrack and crosstrack....
Eigen::Isometry3d build3dEigenTransform(const Eigen::Vector3d &position, const Eigen::Quaterniond &rotation)
Builds a 3D Eigen coordinate frame transform with not applied scaling (only translation and rotation)...
lanelet::BasicPolygon2d objectToMapPolygon(const geometry_msgs::msg::Pose &pose, const geometry_msgs::msg::Vector3 &size)
Uses the provided pose and size vector of an ExternalObject to compute what the polygon would be of t...
std::vector< double > local_curvatures(const lanelet::BasicLineString2d ¢erline_points)
Returns a list of local (computed by discrete derivative) curvatures for the input centerlines....
void rpyFromQuaternion(const tf2::Quaternion &q, double &roll, double &pitch, double &yaw)
Extract extrinsic roll-pitch-yaw from quaternion.
double safeAcos(double x)
acos method that caps the input x value for 1 or -1 to avoid undefined output. This is meant to preve...
std::vector< Eigen::Vector2d > normalize_vectors(const std::vector< Eigen::Vector2d > &vectors)
Normalize the vectors in the input list such that their magnitudes = 1.
double point_to_point_yaw(const lanelet::BasicPoint2d &cur_point, const lanelet::BasicPoint2d &next_point)
Computes the 2d orientation of the vector from the provided start point to end point.
double circular_arc_curvature(const lanelet::BasicPoint2d &cur_point, const lanelet::BasicPoint2d &next_point)
Computes the curvature of a circular arc that passes through the two provided points....
double compute_euclidean_distance(const Eigen::Vector2d &a, const Eigen::Vector2d &b)
Compute the Euclidean distance between the two points.
Eigen::Isometry2d build2dEigenTransform(const Eigen::Vector2d &position, const Eigen::Rotation2Dd &rotation)
Builds a 2D Eigen coordinate frame transform with not applied scaling (only translation and rotation)...
std::tuple< TrackPos, lanelet::BasicSegment2d > matchSegment(const lanelet::BasicPoint2d &p, const lanelet::BasicLineString2d &line_string)
Get the TrackPos of the provided point along the linestring and the segment of the line string which ...
double safeAsin(double x)
asin method that caps the input x value for 1 or -1 to avoid undefined output. This is meant to preve...
double getAngleBetweenVectors(const Eigen::Vector2d &vec1, const Eigen::Vector2d &vec2)
Calculates the angle between two vectors.
std::vector< double > compute_tangent_orientations(const lanelet::BasicLineString2d ¢erline)
Compute an approximate orientation for the vehicle at each point along the provided centerline.
lanelet::BasicLineString2d concatenate_lanelets(const std::vector< lanelet::ConstLanelet > &lanelets)
Helper function to a list of lanelets together and return the result. Neither LineString is modified ...
std::vector< double > compute_arc_lengths(const std::vector< lanelet::BasicPoint2d > &data)
Compute the arc length at each point around the curve.
lanelet::BasicLineString2d concatenate_line_strings(const lanelet::BasicLineString2d &l1, const lanelet::BasicLineString2d &l2)
Helper function to concatenate 2 linestrings together and return the result. Neither LineString is mo...
double computeCurvature(const lanelet::BasicPoint2d &p1, const lanelet::BasicPoint2d &p2, const lanelet::BasicPoint2d &p3)
Function for computing curvature from 3 points.
TrackPos trackPos(const lanelet::ConstLanelet &lanelet, const lanelet::BasicPoint2d &point)
Returns the TrackPos, computed in 2d, of the provided point relative to the centerline of the provide...
std::vector< double > local_circular_arc_curvatures(const std::vector< lanelet::BasicPoint2d > &points, int lookahead)
Computes the curvature of each point in the provided list by calling circular_arc_curvature using tha...
std::vector< Eigen::Vector2d > compute_finite_differences(const lanelet::BasicLineString2d &data)
Use finite differences methods to compute the derivative of the input data set with respect to index ...
std::vector< double > compute_magnitude_of_vectors(const std::vector< Eigen::Vector2d > &vectors)
Compute the magnitude of each vector in the input list.