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

Brick's profile - activity

2016-05-22 04:24:46 -0500 received badge  Famous Question (source)
2015-12-13 16:20:27 -0500 received badge  Notable Question (source)
2015-12-12 15:24:25 -0500 received badge  Popular Question (source)
2015-12-12 09:01:36 -0500 received badge  Editor (source)
2015-12-12 08:39:41 -0500 answered a question Orientate orthogonal to point

I have tried the following but I'm not getting any correct results so far:

tf::Vector3 fwd{1.0, 0.0, 0.0};
tf::Vector3 newFwd{(pointToHere - pointFromHere).normalized()};
tf::Vector3 ax{fwd.cross(newFwd)};
double alpha = acos(fwd.dot(newFwd));
tf::Quaternion newOrientation{ax.normalized(), alpha};

My idea is to construct the orientation with respect to my world frame, so all vectors I am using here have been appropriately transformed into my world coordinate system. My steps (as detailed in the code above) are as follows:

  1. Get the new pointing direction via pointToHere-pointFromHere
  2. Calculate the axis of rotation using the cross product of what I consider my old and new forward vector (which is the x-axis of my manipulator)
  3. Get the corresponding angle using the dot product
  4. Build the quaternion

In most cases where I get a valid pose, the direction of my forward axis is actually completely wrong. It should be pointing the other way...

Any ideas on what I may be missing here? The only thing I can think of right now is that the rotation axis may end up being incorrect..

2015-12-11 13:17:03 -0500 asked a question Orientate orthogonal to point

Hello,

I am having some trouble regarding tf and orientation. I am trying to have one of my manipulators point directly towards another point in space. By this I mean that the new orientation of the manipulator should be such that the given point is on the x-axis of its reference frame.

How would this be accomplished, for example using quaternions? I imagine this could, for example be done by obtaining the Euler angles from the vector in the current reference frame and converting that into a quaternion. But perhaps there is a more elegant solution?

Cheers, Brick