Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
mobility_path_to_external_object_helpers.hpp
Go to the documentation of this file.
1// Copyright 2020-2023 Leidos
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef MOTION_COMPUTATION__IMPL__MOBILITY_PATH_TO_EXTERNAL_OBJECT_HELPERS_HPP_
16#define MOTION_COMPUTATION__IMPL__MOBILITY_PATH_TO_EXTERNAL_OBJECT_HELPERS_HPP_
17
18#include <lanelet2_extension/projection/local_frame_projector.h>
19#include <tf2/LinearMath/Quaternion.h>
20#include <tf2/LinearMath/Vector3.h>
21
22#include <tuple>
23#include <utility>
24
25#include <rclcpp/time.hpp>
26
27#include <carma_perception_msgs/msg/external_object.hpp>
28#include <carma_perception_msgs/msg/predicted_state.hpp>
29#include <geometry_msgs/msg/quaternion.hpp>
30
32{
33namespace conversion
34{
35namespace impl
36{
50std::pair<carma_perception_msgs::msg::PredictedState, double> composePredictedState(
51 const tf2::Vector3 & curr_pt, const tf2::Vector3 & prev_pt, const rclcpp::Time & prev_time_stamp,
52 const rclcpp::Time & curr_time_stamp, double prev_yaw);
57void calculateAngVelocityOfPredictedStates(carma_perception_msgs::msg::ExternalObject & object);
58
65double getYawFromQuaternionMsg(const geometry_msgs::msg::Quaternion & quaternion);
66
73tf2::Vector3 transform_to_map_frame(
74 const tf2::Vector3 & ecef_point, const lanelet::projection::LocalFrameProjector & map_projector);
75
76} // namespace impl
77} // namespace conversion
78} // namespace motion_computation
79
80#endif // MOTION_COMPUTATION__IMPL__MOBILITY_PATH_TO_EXTERNAL_OBJECT_HELPERS_HPP_
double getYawFromQuaternionMsg(const geometry_msgs::msg::Quaternion &quaternion)
Gets the yaw angle in degrees described by the provided quaternion.
tf2::Vector3 transform_to_map_frame(const tf2::Vector3 &ecef_point, const lanelet::projection::LocalFrameProjector &map_projector)
Transforms ecef point to map frame using internally saved map transform.
void calculateAngVelocityOfPredictedStates(carma_perception_msgs::msg::ExternalObject &object)
Helper function to fill in the angular velocity of the external object.
std::pair< carma_perception_msgs::msg::PredictedState, double > composePredictedState(const tf2::Vector3 &curr_pt, const tf2::Vector3 &prev_pt, const rclcpp::Time &prev_time_stamp, const rclcpp::Time &curr_time_stamp, double prev_yaw)
Composes a PredictedState message form a provided current point and previous point....