Ask Your Question

turtle_tf_demo.launch goes wrong when replaced with c++ compiled nodes

asked 2012-10-12 19:15:07 -0500

Albert K gravatar image

I tried to run the TF tutorial and fist launch:

roslaunch turtle_tf turtle_tf_demo.launch

and it worked fine.

And then I noticed that the launch file would run nodes written in python. So I replaced them with the C++ ones and launched it again. However, turtle2 got frantic....

I've checked the C++ code of the broadcaster and listener in turtle_tf, as long as the Python ones. In terms of their functionality, there weren't any difference between the C++ and Python ones, but the demo results turned out to be a lot different.

How can I solve this problem? Thanks~

edit retag flag offensive close merge delete


Can you post the launch file you edited?

Po-Jen Lai gravatar image Po-Jen Lai  ( 2012-11-08 01:34:58 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-09 03:10:53 -0500

tbh gravatar image

@Tones answered this same issue over at this question.

Basically, the API appears to have changed in the tf::Quaternion constructor with RPY as parameters to YPR as parameters. So the broadcaster is broadcasting the wrong rotation in its transform.

You shouldn't use that constructor anymore, though, as it's been deprecated. Use something else from the API to set your rotation, and make sure the order is right, and it should work fine.

edit flag offensive delete link more


Thanks. It looks exactly the same problem. I'll try it.

Albert K gravatar image Albert K  ( 2012-11-12 18:25:32 -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


Asked: 2012-10-12 19:15:07 -0500

Seen: 316 times

Last updated: Nov 09 '12