ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How can I get a certern link's position not in rviz?

asked 2017-03-23 06:30:06 -0500

Ddj gravatar image

I want write a certern link position(x,y,z) to a txt file.Which function do i need? Where does the date of link's position store?THX!!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-03-23 08:03:41 -0500

updated 2017-03-23 08:05:25 -0500

If you have joint state information being published, you have a URDF, and you have the robot_state_publisher running then you should be able to visualize the pose of the robot in rviz. If all of that is working, to obtain the position of a particular link, all you need to do is create a tf listener and lookup the transform between some inertial frame and a frame on the link that you are interested in. This can easily be done in Python (tutorial here) or C++ (tutorial here).

The robot_state_publisher subscribes to joint state information and looks at a robot's URDF on the parameter server. With those two pieces of information, it can publish the relevant /tf data so that the full pose of the robot can be known by any ROS node (including rviz and your own listener).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2017-03-23 06:30:06 -0500

Seen: 768 times

Last updated: Mar 23 '17