There is a flaw in the test suite. It tests the values in rpy2r rather than the results rpy from the solver's function. Also, the tolerance needs to be widened a bit.
Actually that's not a flaw, William. Since it is not always possible to determine the exact three original angles. In the second test case for instance, there are infinite solutions due to a singularity. Therefore, he tests the rotation matrix since it will be equal for all possible solutions.
It's interesting that a precision error allows you to recover the original angles: atan2(cos(pi/2)*sin(pi/3),cos(pi/2)*cos(pi/3)) amazingly returns pi/3, which obviously should not be true since atan2(0,0) = 0 (?). The issue seems to be that cos(pi/2) is not zero (due to an approximation error), but just a really small value close to zero.
Multiply 2 numbers
Fill a zeros matrix
Calculate distance travelled when given radius and rotations
02 - Vector Variables 3
02 - Vector Variables 5
Relative pose in 2D: problem 1
Pose from bearing angles in 2D
Composing relative poses in 2D: problem 1
Create a 3D rotation matrix from roll-pitch-yaw angles
Orientation of a 3D coordinate frame
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office