Ask Your Question
0

Getting endpoint states of robot

asked 2014-07-02 13:21:36 -0500

grisam gravatar image

updated 2014-07-02 13:52:37 -0500

I'm using a Baxter and I want to get the endpoint states of my robot. The endpoint states are located in the topic

/robot/limb/left/endpoint_state

and on the terminal I can echo this topic to get the endpoint states. Running this would yield:

pose:
position:
x: some double
y: some double
z: some double
orientation:
...

I only need the pose x y and z position data. My guess is to get this, I need to subscribe to this topic, but I'm not sure how I would subscribe to it to get just that data.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-07-02 14:31:10 -0500

allenh1 gravatar image

There are two ways to do this:

  1. subscribe to the topic. This is the easy way. I highly recommend this method as apposed to the following. You will just take the message and use the parts you need. If you are using C++ or Java, you will use the variables like you would a struct.

  2. Please don't do this to yourself... The other method would be to interpret the echo as a string, and parse through it. This is extremely unnecessary, and will only slow things down.

edit flag offensive delete link more

Comments

I have no intention of doing the latter, and I've been stuck on number 1. for a couple days now. When I subscribe to the topic, how do I only extract the information I need, i.e. the x y and z of the pose? As in how would the callback work?

grisam gravatar image grisam  ( 2014-07-02 14:35:42 -0500 )edit

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-07-02 13:21:36 -0500

Seen: 490 times

Last updated: Jul 02 '14