Best way to tf a non-stamped point.
Hello everyone.
I am currently trying to transforn a Point in C++ from one frame to another.
So I am trying to use the Transform listener and the function transformPoint
. The problem is that all the definitions of transformPoint
expect a PointStamped and not a simple Point.
I have my point, the current frame and the target frame.
Should I create a PointStamped with the current frame then TF it and then get the Point ? It doesn't seem right to do so. I would like something like :
transformPoint(const std::string& current_frame, const std::string& target_frame, const geometry_msgs::Point& in, geometry_msgs::Point& out)
So what do you think ? Thanks !
What would you proposed
transformPoint(..)
do exactly? How would it know which timestamp to retrieve the transform for?@gvdhoorn I just want to get a transformed Point, not PointStamped.
Then we could add the timestamp :
transformPoint(const std::string& current_frame, const std::string& target_frame, const geometry_msgs::Point& in, geometry_msgs::Point& out, const ros::Time& target_time)
So with that
target_time
added, you basically now pass aPointStamped
, but instead of using a single arg, you use 3 (current_frame
,in
andtarget_time
(although you typically don't usetarget
's time, butsource
)).Summarising: wrap your
Point
in aPointStamped
and provide suitable values for theHeader
part of it.Semantically, transforming a plain
Point
is difficult, as you don't have enough information: you don't know when or relative to what. So you have to supply those.@gvdhoorn Thanks for your answer. So the only way is to create a PointStamped ? Thanks