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

How to print pose of a robot using robot_state_publisher

asked 2015-11-19 17:05:48 -0500

robo_explorer gravatar image

Hi,

I want to print the pose of my robot using robot_state_publisher. I am adding the following code in my launch file

<include file="$(find
  p2os_urdf)/launch/upload_pioneer3at.xml"/>  <node pkg="robot_state_publisher"
  type="state_publisher"
  name="robot_state_publisher">       <param
  name="publish_frequency" type="double"
  value="30.0"/>  </node>

But, I am not sure, where can I see the pose of the robot? Is there any way I can print it ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2015-11-19 22:30:32 -0500

Fredylucas gravatar image

updated 2015-11-23 21:12:04 -0500

You should create a new node in your workspace, and subscribe to the tf topic, then you can print the values of your coordinates in this new node. I hope this will help you.

edit flag offensive delete link more

Comments

No, I have Rviz setup, I can see the robot. But I want to see the values of the robot's pose. For example: x: 4, y: 5 theta:20

robo_explorer gravatar image robo_explorer  ( 2015-11-20 12:49:40 -0500 )edit

what about printing the coordinates to console, using ROS_INFO (or something like this) inside the robot_state_publisher node?

Fredylucas gravatar image Fredylucas  ( 2015-11-23 15:02:36 -0500 )edit

@Fredylucas That sounds like a good idea to me, but how can I print the values in robot_state_publisher node?

robo_explorer gravatar image robo_explorer  ( 2015-11-23 15:29:14 -0500 )edit
1

I take back what I said before, a better way is: you already have the coordinates in the topic published by robot_state_publisher (the topic is tf), you can subscribe to this topic in a new node in your workspace, and print the information in this new node using ROS_INFO.

Fredylucas gravatar image Fredylucas  ( 2015-11-23 21:00:18 -0500 )edit
0

answered 2015-11-21 11:54:00 -0500

robot_state_publisher builds the tf tree for your robot, you can display it in Rviz by adding a tf visualization.

But it rather sounds like you are looking for something like AMCL or robot_localization.

edit flag offensive delete link more

Comments

Thanks for replying. I dont want to visualize the pose in rviz, I want to print the values in a file. Is there a way I can do that?

robo_explorer gravatar image robo_explorer  ( 2015-11-23 06:58:25 -0500 )edit

Oh, ok. Could you clarify "values"? Are you referring to tf transformations like printed by rosrun tf tf_echo?

Philipp Schillinger gravatar image Philipp Schillinger  ( 2015-11-23 11:47:36 -0500 )edit

Yes, exactly I want the tf_transformations like printed by rosrun td tf_echo. How can I print those? Sorry for the confusing words.

robo_explorer gravatar image robo_explorer  ( 2015-11-23 15:28:34 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-11-19 17:05:48 -0500

Seen: 795 times

Last updated: Nov 23 '15