extract the time from /tf topic, between two specific
frames
Hii,
I want to extract the time from the following message between frame_id, child_frame_id. would you please help me in writing a python code?
~/catkin_ws$ rosmsg show tf2_msgs/TFMessage
geometry_msgs/TransformStamped[] transforms
std_msgs/Header header
uint32 seq
time stamp
string frame_id
string child_frame_id
geometry_msgs/Transform transform
geometry_msgs/Vector3 translation
float64 x
float64 y
float64 z
geometry_msgs/Quaternion rotation
float64 x
float64 y
float64 z
float64 w
#Example:
transforms:
-
header:
seq: 0
stamp:
secs: 1649243817
nsecs: 881501198
frame_id: "odom"
child_frame_id: "base_link"
transform:
translation:
x: 269.211298755
y: -263.069342463
z: 0.0
rotation:
x: 0.0
y: 0.0
z: -0.175106142185
w: 0.984549561459
---
I want to extract:
secs: 1649243817
nsecs: 881501198
for the time that frame_id is odom and child_frame_id is base_link.
thanks
@hank880907
I have wriiten the upper code. but it is not working!!!
of course it won't work. You are not even initializing the ros node correctly... have you take a look at how to write a node in ros? https://wiki.ros.org/ROS/Tutorials/Wr...