ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Building off the other answers, here's a snipped of runnable code that I wound up with:
import rospy
import tf2_ros
import time
import yaml
rospy.init_node('ipython')
tf_buffer = tf2_ros.Buffer()
tf_listener = tf2_ros.TransformListener(tf_buffer)
time.sleep(5.0)
frames_dict = yaml.safe_load(tf_buffer.all_frames_as_yaml())
frames_list = list(frames_dict.keys())
2 | No.2 Revision |
Building off the other answers, here's a snipped snippet of runnable code that I wound up with:
import rospy
import tf2_ros
import time
import yaml
rospy.init_node('ipython')
tf_buffer = tf2_ros.Buffer()
tf_listener = tf2_ros.TransformListener(tf_buffer)
time.sleep(5.0)
frames_dict = yaml.safe_load(tf_buffer.all_frames_as_yaml())
frames_list = list(frames_dict.keys())
(Tested on Ubuntu 20.04, running noetic)