Comments (4)
angle?()
methods return rotation angle around corresponding axis that acts as similar as possible (in l2 sense) on the points from corresponding plane. It is not expected to match with Euler angles in all cases except some degenerate ones (rotations purely around one of the axes).
scipy.spatial.transform.Rotation.from_euler
supports both intrinsic and extrinsic Euler angles denoted by different case of letters (parameter seq
described in https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.transform.Rotation.from_euler.html ). If you try scipy.spatial.transform.Rotation.from_euler('XYZ', ...)
-- you'll get Rorigin
(up to precision of specified values)
from sophus.
Thanks @DmitriyKorchemkin
Using scipy.spatial.transform.Rotation.from_euler('XYZ', ...) with the angles I get from the 'angle?()' functions, I still don't get the original rotation matrix.
Taking the example from my original post:
yaw_rad, pitch_rad, roll_rad = 0.080531626939773560, -0.184074640274047852, -0.106850937008857727
Rangles = R.from_euler('XYZ', [yaw_rad, pitch_rad, roll_rad], degrees=False).as_matrix()
I now get:
array([[ 0.97749926, 0.10484603, -0.18303689],
[-0.12094245, 0.98950412, -0.07908558],
[ 0.17282394, 0.09944303, 0.97991988]])
Which is still not so similar to Rorigin
.
I looked over multiple examples and the results I get are still very different.
Still, do you think it is correct to assume that if I need the Euler angles I should stick to the rotationMatrix() function and extract the euler angles from there?
from sophus.
I've meant that you need to use scipy.spatial.transform.Rotation.from_euler('XYZ', ...)
with the angles you get from Eigen::MatrixBase<...>::eulerAngles(0, 1, 2);
.
Seem to match perfectly:
>>> import scipy.spatial.transform as sst
>>> sst.Rotation.from_euler('XYZ', [0.071102283895015717, -0.187578573822975159, -0.100159876048564911]).as_matrix()
array([[ 0.97753477, 0.09823849, -0.18648049],
[-0.11292146, 0.99114945, -0.06979621],
[ 0.17797336, 0.08928587, 0.97997628]])
Angles that you get from Sophus::SO3<...>::angle?()
will never match Euler angles except some corner-cases, because they're different and somewhat unrelated quantities.
from sophus.
I checked and you are right - they match. Thanks!
from sophus.
Related Issues (20)
- Broken link on landing page README.rst HOT 4
- Compilation Error on Raspberry Pi 4 Buster HOT 2
- Looks like 22.10 and 22.04.1 tags got removed? HOT 3
- How to creating a Sophus::SE3f variable from a Eigen::Matrixf variable? HOT 4
- install erorr issue HOT 1
- Wrong compiler standard in CMakeLists.txt HOT 2
- Documentation link is broken HOT 3
- SOPHUS_USE_BASIC_LOGGING=ON compilation error HOT 1
- FMT warning when not found HOT 1
- CUDA::cublas but the target was not found HOT 1
- Sophus ensure failed in function ..... HOT 2
- Error on building ORB-Slam3 on Debian-12 x86-64 HOT 1
- Sophus ensure calls `abort()` HOT 10
- sophus HOT 2
- Cannot compile sophus_pybind in Ubuntu 20.04 HOT 6
- Add CI for CUDA HOT 1
- Remove `CMAKE_<LANG>_FLAGS`` from CMakeLists.txt
- 404 for site `https://strasdat.github.io/Sophus/latest/` HOT 5
- Build Error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sophus.