Hello everybody,
I am trying to compute a smooth trajectory between a 6D starting pose and a 6D desired pose. Everything is fine for what concerns the 3D positional component, but I am having issues with the orientation (and the quaternion that describes it).
Trying to look for help online, most of the references pointed to Unity 3D methods and specifically to Quaternion.RotateTowards, which has been deemed to be better than Quaternion.Slerp. Unfortunately, being Unity closed source, I could not find any source code to see what they actually do and why the former is better than the latter.
Unfortunately, the ROS API only provides a comparable method for quaternion.slerp, available here. So, my questions at this point are multiple:
- Does anybody know what "rotateTowards" does and how it is better than the Spherical Linear Interpolation method?
- Would it be possible to implement a similar method (if proven to be more advantageous than "slerp") ?
- Is slerp sufficient for my needs? EDIT: my goal is to simply create a trajectory from one pose to another, i.e. to interpolate both 3D position and 3D orientation to gradually move from the starting pose to the final desired one. For what concerns the quaternion describing the orientation, it is not clear to me if "slerp" would be the method I need for my purposes. In particular, for the position I can easily implement a straight trajectory from one point to another by using the motion equation of a point over time (with a fixed velocity), but I don't understand how can I do it w.r.t. the orientation. Can I use some sort of angular velocity to feed "slerp" with?
Originally posted by alecive on ROS Answers with karma: 3 on 2016-12-05
Post score: 0
Original comments
Comment by gvdhoorn on 2016-12-05:\
Is slerp sufficient for my needs?
I think this particular question will be hard to answer, as only you know what your needs are.
Comment by alecive on 2016-12-05:
Agreed, I updated my question. Thank you!
Comment by Airuno2L on 2016-12-06:
I've never done it, but I seem to remember hearing people call this "tweening". 3D video games use it to move the camera point of view around smoothly while following a person, like in 3rd person point of view games for example. Maybe googleing tweening might lead to some example code.
Comment by Stephen_Z on 2017-07-28:
Did you ever determine how these two methods are different, or did you get slerp to work for your application?