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_