17 #ifndef AUTOWARE_AUTO_TF2__TF2_AUTOWARE_AUTO_MSGS_HPP_ 18 #define AUTOWARE_AUTO_TF2__TF2_AUTOWARE_AUTO_MSGS_HPP_ 20 #include <tf2/convert.h> 22 #include <tf2_geometry_msgs/tf2_geometry_msgs.h> 23 #include <autoware_auto_msgs/msg/bounding_box_array.hpp> 24 #include <autoware_auto_msgs/msg/bounding_box.hpp> 25 #include <geometry_msgs/msg/transform_stamped.hpp> 26 #include <autoware_auto_msgs/msg/quaternion32.hpp> 27 #include <geometry_msgs/msg/point32.hpp> 28 #include <kdl/frames.hpp> 55 const geometry_msgs::msg::Point32 & t_in, geometry_msgs::msg::Point32 & t_out,
58 KDL::Vector v_out = gmTransformToKDL(transform) * KDL::Vector(t_in.x, t_in.y, t_in.z);
59 t_out.x =
static_cast<float>(v_out[0]);
60 t_out.y =
static_cast<float>(v_out[1]);
61 t_out.z =
static_cast<float>(v_out[2]);
77 const autoware_auto_msgs::msg::Quaternion32 & t_in,
78 autoware_auto_msgs::msg::Quaternion32 & t_out,
81 KDL::Rotation r_in = KDL::Rotation::Quaternion(t_in.x, t_in.y, t_in.z, t_in.w);
82 KDL::Rotation out = gmTransformToKDL(transform).M * r_in;
84 double qx, qy, qz, qw;
85 out.GetQuaternion(qx, qy, qz, qw);
110 doTransform(t_in.orientation, t_out.orientation, transform);
111 doTransform(t_in.centroid, t_out.centroid, transform);
112 doTransform(t_in.corners[0], t_out.corners[0], transform);
113 doTransform(t_in.corners[1], t_out.corners[1], transform);
114 doTransform(t_in.corners[2], t_out.corners[2], transform);
115 doTransform(t_in.corners[3], t_out.corners[3], transform);
133 return tf2_ros::fromMsg(t.header.stamp);
159 for (
auto idx = 0U; idx < t_in.boxes.size(); idx++) {
160 doTransform(t_out.boxes[idx], t_out.boxes[idx], transform);
162 t_out.header.stamp = transform.header.stamp;
163 t_out.header.frame_id = transform.header.frame_id;
168 #endif // AUTOWARE_AUTO_TF2__TF2_AUTOWARE_AUTO_MSGS_HPP_ double float64_t
Definition: types.hpp:37
geometry_msgs::msg::TransformStamped TransformStamped
Definition: motion_testing_publisher.hpp:37
float float32_t
Definition: types.hpp:36
Definition: tf2_autoware_auto_msgs.hpp:38
This file includes common type definition.
t
Definition: catr_diff.py:22
autoware_auto_msgs::msg::BoundingBoxArray BoundingBoxArray
Definition: tf2_autoware_auto_msgs.hpp:35
void doTransform(const geometry_msgs::msg::Point32 &t_in, geometry_msgs::msg::Point32 &t_out, const geometry_msgs::msg::TransformStamped &transform)
Apply a geometry_msgs TransformStamped to an geometry_msgs Point32 type. This function is a specializ...
Definition: tf2_autoware_auto_msgs.hpp:54
autoware_auto_msgs::msg::BoundingBox BoundingBox
Definition: tf2_autoware_auto_msgs.hpp:36
std::string getFrameId(const BoundingBoxArray &t)
Extract a frame ID from the header of a BoundingBoxArray message. This function is a specialization o...
Definition: tf2_autoware_auto_msgs.hpp:143
tf2::TimePoint getTimestamp(const BoundingBoxArray &t)
Extract a timestamp from the header of a BoundingBoxArray message. This function is a specialization ...
Definition: tf2_autoware_auto_msgs.hpp:131