matthew-brett / transforms3d

3 dimensional spatial transformations
http://matthew-brett.github.io/transforms3d/
Other
467 stars 83 forks source link

add qexp() and test_qexp() #24

Closed MaximeLemonnier-Leddartech closed 5 years ago

MaximeLemonnier-Leddartech commented 6 years ago

I manually checked my unit test.
under python 2.7 py.test --doctest-modules transforms3d failed with E ValueError: no such test method in <class 'unittest.case.TestCase'>: runTest

coveralls commented 6 years ago

Coverage Status

Coverage remained the same at ?% when pulling ccec1878a13a786f7ca3d465a81eb6b865f0ddd6 on MaximeLemonnier-Leddartech:qexp into aee3c5526d6b61ee31ded0ae0956b197ca326312 on matthew-brett:master.

matthew-brett commented 6 years ago

I just did a commit to master - 2b2cc5f - that adds some test values. The file processed_quats.mat in the data directory has variables quats (the input quaternions) and quat_e (the exponential of each quaternion, calculated by MATLAB).

MaximeLemonnier-Leddartech commented 6 years ago

good thing, I don't have matlab, and libraries implementing quaternions exp, ln and power are rare. Speaking of exp, ln and power, I added them for sake of completeness. Will generate a new pull request

matthew-brett commented 6 years ago

Yes, I saw they are rare. I didn't have MATLAB either until about an hour ago ... And I was lucky that our university has the Aerospace toolbox.

MaximeLemonnier-Leddartech commented 6 years ago

you may have to edit your merge a bit. I added the example from matlab documentation (better than nothing)

MaximeLemonnier-Leddartech commented 6 years ago

feel free to rename qln() for qlog() to align with numpy naming

MaximeLemonnier-Leddartech commented 6 years ago

... or ask me to do it

matthew-brett commented 6 years ago

:) - yes, I guess we should follow numpy naming. Would you mind doing it?

MaximeLemonnier-Leddartech commented 6 years ago

yes, will do right now

MaximeLemonnier-Leddartech commented 6 years ago

thanks for the library btw. I think this stuff should be in some numpy module, but it is the best option right now for a very common need. I'm stunned such a set of functionality did not exist since forever in python.

Once people discover this package, it will be used a lot. I agree with some other comment I read here that we should support batch operations (i.e. matrices, with axis syntax), but it is not trivial to add.

MaximeLemonnier-Leddartech commented 6 years ago

whops, just saw an issue reviewing 0e214db. Will fix this tomorrow morning. I check if qnorm == 0, qnorm is a function, meant to check qnorm_ instead

MaximeLemonnier-Leddartech commented 6 years ago

Sorry for the delay, completely forgot for a few days

matthew-brett commented 5 years ago

I added a qexp / qlog round trip test. The Matlab stuff does test the qpow function, you probably saw ...

MaximeLemonnier-Leddartech commented 5 years ago

Sorry did not realized you requested a merge on my fork