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

What is w in orientation doing ?

asked 2017-08-11 20:40:43 -0500

rozoalex gravatar image

Hi Guys, I am trying to send a goal to navigation stack, however I just if I set the goal pose as Location x=5 y=5 z=0 orientation x=0 y=0 z=0 w=0 It wouldn't generate a path.

If I put z as 1 and w as 0, it works sometimes and doesn't work sometime. The weirdest is that sometimes it's spinning to the goal like a fresbee...

My understanding about the goal pose is that z is just the yaw, since we are moving in 2d space there is no pitch and roll. So the question is : is my understanding right? And what is w? What it is doing?


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-12 01:01:32 -0500

jayess gravatar image

updated 2017-08-12 11:09:58 -0500

The way that ROS defines orientation is with a mathematical concept called a quaternion. They're a good way to represent orientation as they're less ambiguous than roll, pitch, and yaw. But, they have the drawback of being a little difficult to understand. Here's a tutorial that someone wrote to help you understand them.

Now, on to the meat of your question. The reason that you can't generate a path with those components is because if you want to send an orientation equivalent of roll = 0, pitch = 0, and yaw = 0 you need to have the w = 1, not 0. The way that you have the quaternion is not valid.

Many people choose to generate an orientation in roll, pitch, and yaw and convert it to a quaternion. That tutorial will show you how to do this.

Here's another question that should help.

edit flag offensive delete link more


The way that ROS defines orientation is with something called a quaternion.

This phrasing seemed a little ambiguous to me: it could almost be understood to mean that we 'invented' something new to represent orientation. Quaternions are obviously just a generic mathematical concept.

gvdhoorn gravatar image gvdhoorn  ( 2017-08-12 02:57:46 -0500 )edit

@gvdhoorn I updated the answer with your comment in mind.

jayess gravatar image jayess  ( 2017-08-12 11:10:57 -0500 )edit

Thank you so much! But even after I always set the quaternion to 0 0 0 1, the robot is still spinning toward the goal. I If I use the 2D nav goal on rviz, sometimes it still spins. Why is that? How can I avoid that?

rozoalex gravatar image rozoalex  ( 2017-08-12 13:36:36 -0500 )edit

@rozoalex, no problem, happy to help. You should create a new question that includes (preformatted) terminal output, what you've done, what you expect, and any (preformatted) parameters/configurations that you have for help with your other questions.

jayess gravatar image jayess  ( 2017-08-12 14:48:06 -0500 )edit

Question Tools

1 follower


Asked: 2017-08-11 20:40:43 -0500

Seen: 8,795 times

Last updated: Aug 12 '17