Comments (4)
It looks like the printed isometry matrix is exactly the same as your initialization values?
Can you perhaps detail what value you would expect exactly?
from nalgebra.
It looks like the printed isometry matrix is exactly the same as your initialization values? Can you perhaps detail what value you would expect exactly?
So in the first example, the translation values I used as input are 3.7567515671, 6.8521933723, 3.7328615785
. But after running the inverse twice I get 3.756751227372396, 6.852192677341882, 3.7328610282357473
, here only the first 7 values are the same, ie. 3.756751
which suggest a truncation of f64 -> f32.
For the second example, the same thing is happening but just for the rotation values.
from nalgebra.
This the normal behavior of floating point operations. Inversion, axis_angle
, as well as from_axis_angle
are all subject to rounding errors due to some floating point multiplication and additions (as well as some trigonometry whenever an angle conversion is involved). So what you are seeing are the rounding errors inherent to floats rather than any f64
-> f32
truncation.
from nalgebra.
This the normal behavior of floating point operations. Inversion,
axis_angle
, as well asfrom_axis_angle
are all subject to rounding errors due to some floating point multiplication and additions (as well as some trigonometry whenever an angle conversion is involved). So what you are seeing are the rounding errors inherent to floats rather than anyf64
->f32
truncation.
Hmmm, so when I take the matrix from the isometry matrix and use nalgebra Matrix to inverse I get perfect f64 precision. For example:
let inv_matrix = isometry
.to_matrix()
.try_inverse()
.expect("Pose cannot be inverted.")
.try_inverse()
.expect("Pose cannot be inverted.")
.transpose();
let rotation_matrix: Matrix3<f64> = Matrix3::new(inv_matrix[0], inv_matrix[1], inv_matrix[2], inv_matrix[4], inv_matrix[5], inv_matrix[6], inv_matrix[8], inv_matrix[9], inv_matrix[10]);
let rotation = Rotation3::from_matrix_unchecked(rotation_matrix);
let translation = Translation3::new(inv_matrix[3], inv_matrix[7], inv_matrix[11]);
let isometry = IsometryMatrix3::from_parts(translation, rotation);
println!("isometry matrix {:?}", isometry.to_matrix());
>>> isometry matrix [[0.8137976526999999, 0.46984630819999984, -0.34202012419999994, 0.0], [-0.44096961619999986, 0.8825640677999996, 0.16317591069999998, 0.0], [0.3785222768999999, 0.0180282984, 0.9254165291999996, 0.0], [3.756751567099999, 6.8521933722999995, 3.7328615784999997, 1.0]]
Here is how to easily reproduce https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f9f89bde7b9c87a5c27d2f052013e631
from nalgebra.
Related Issues (20)
- `VectorView?` type alias too restrictive? HOT 1
- nalgebra_glm's Functions Don't Account for Unsigned Integer Types.
- Changed serialization breaks things HOT 3
- Instable Matrix determinants (compared to numpy, online calculator) HOT 18
- assertion at VectorView3::<T>::from(&view3_from_owned3).clone_owned()
- Add a way to get a column slice HOT 2
- Missed minor version bump? HOT 2
- Wrong result of min() and max() in nalgebra::base::min_max::Matrix when f64::NAN is included HOT 4
- CUDA target is unmaintained HOT 1
- lapack qr factorization HOT 1
- When using nalgebra_glm, how to call transform_point?
- Planes and Culling Frustums HOT 1
- Unable to multiply complex matrix with complex scalar from the left HOT 2
- Allow bitshifting matricies if they are integers HOT 3
- SymmetricEigen produces wrong sign of eigenvector values on Matrix6 HOT 4
- Wrong eigenvector sorting in nalgebra::SymmetricEigen, while correct in nalgebra_lapack::SymmetricEigen HOT 1
- Make some RealField functions const HOT 1
- `tr_solve_upper_triangular` proptest failure
- Hash for Matrix doesn't match `Borrow<[[T; R]; C]>` semantics
- Cannot compute the SVD of an empty matrix. 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 nalgebra.