Comments (7)
This is not supposed to work :
def test_rt_mean(rt, seq="xyz"):
rt_mean = Rototrans.from_averaged_rototrans(rt)
angles_mean = Angles.from_rototrans(rt_mean, seq).isel(time=0)
angles_mean_ref = Angles.from_rototrans(rt, seq).mean(dim="time")
np.testing.assert_array_almost_equal(angles_mean, angles_mean_ref, decimal=2)
If it was that easy to mean a matrix, we would not need to have a proper function.
The reason the first one works, is by chance (probably that using random directly from Euler creates matrices that are near from each other).
The intended behavior is that meaning the angles is not equal to meaning the matrices
from pyomeca.
And the reason they behave differently, which seems surprising at first, is that
angles = Angles(np.random.rand(*size))
does not produce the same as this:
Angles.from_random_data(distribution, size=(3, 1, size[-1]), **kwargs)
which is in the from_random_data
from Rototrans
from pyomeca.
This is not supposed to work.
I made the implementation based on this test. What is the difference here?
from pyomeca.
And the reason they behave differently, which seems surprising at first, is that
does not produce the same as this:
Yes, I am aware of that, but in the end it's just random angles and it should work both ways?
from pyomeca.
As I said, meaning Euler angles will get wronger as angles grow.
angles = Angles(np.random.rand(*size))
np.min(angles, axis=2)
np.max(angles, axis=2)
will return values between 0-1 while the random constructor of Rototrans:
angles = Angles.from_random_data(distribution, size=(3, 1, size[-1]))
np.min(angles, axis=2)
np.max(angles, axis=2)
will return values apparently ranging from -20 to 20 (from a quick simulation I made printing the values).
from pyomeca.
Ah ok gotcha @pariterre!
The cumsum
in the from_random_data
increases the angles too much.
So, as I understand it, our implementation may be good but not the test?
from pyomeca.
That is correct. I don't think there is error in the implementation, but the test won't work as is... A test with know values would do the trick or to use the first implementation (with much smaller angles)
from pyomeca.
Related Issues (20)
- Review: Running EMG Example HOT 2
- Review: Additional examples for other data HOT 2
- Marker visualization HOT 3
- Pyomeca on Google Colab? HOT 2
- derivative method in newest version
- latest supported python version HOT 1
- troubles with xarrays and findpeaks HOT 3
- Slicing data using the square brackets HOT 1
- How to install Pyomeca from the Pycharm Terminal for Win 10. HOT 11
- Dependencies error HOT 5
- Unable to import ezc3d HOT 1
- Problem With Google Colab Import HOT 4
- `conda install -c conda-forge bioviz` fails in Python3.10 with error `ResolvePackageNotFound: - python=3.1` HOT 1
- Import 3d positional data for conversion to other file formats HOT 2
- . HOT 3
- delsys c3d HOT 6
- rototrans matmul HOT 2
- accessing Subject Properties in c3d files HOT 3
- resultant velocity - trubles with calling xarrays with same commands as in older pyomeca version. HOT 4
- Recover the trajectory color HOT 4
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 pyomeca.