Ask Your Question
1

lookupTransform - builtin_interfaces/Time to tf2::TimePoint?

asked 2018-12-04 14:03:53 -0500

lucasw gravatar image

I'd like to use the header stamp in a call to lookupTransform and assume that a conversion would happen automatically, but I'm getting no matching function call build errors. Is there a header to include that will handle this, or is it not implemented yet and I have to convert it manually?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-12-04 18:52:08 -0500

lucasw gravatar image

The manual conversion:

builtin_interfaces::msg::Time time_stamp = msg->header.stamp;
tf2::TimePoint time_point = tf2::TimePoint(
    std::chrono::seconds(time_stamp.sec) +
    std::chrono::nanoseconds(time_stamp.nanosec));
geometry_msgs::msg::TransformStamped tf = buffer_.lookupTransform(
    frame1, frame2, time_point)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2018-12-04 14:03:53 -0500

Seen: 158 times

Last updated: Dec 04 '18