-
Notifications
You must be signed in to change notification settings - Fork 993
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write unit tests for transform_frame utilities #321
Comments
Wrote part, got error:
|
@TSC21 Can you please have a look and verify the quaternion order for tranforms? |
Test from c91e395 dont work! @TSC21 what wrong?
|
GTests are failing cause the expected outputs are wrong. For example in https://github.com/mavlink/mavros/blob/master/mavros/test/test_frame_conv.cpp#L160, |
Also you are feeding |
Relatively to
So I think that boost wins in this case, since we already use boost lib in our code. But again, if "like" or "not like" is a valid metric, seems I don't have much of an opinion here. |
Solved with #322 |
Attitude transform are wrong: https://youtu.be/Q1_wX4SEb1A |
why you have the axis upside-down? Are you mistaking ENU and NED representations? |
The same rotation is both applied on rpy and quaternion transformation, and both return exactly the same result. So transform is right, and I have confirmed it with math. Also @BlackCoder was able to flight test this transformation (even with POSCTL), so I don't see where this is wrong. The previous conversion you had was |
Good question to You! I replaced attitude math with xyz and got normal position of axes. |
So simple add 180° to roll DO NOT WORK. If you want do rotation, do rotation matrix and apply it. |
And i'm going to release in current state, without that math. |
Well that's unexpected... I wonder how @BlackCoder got it to work then |
So the current transforms are then x,-y,-z,roll,-pitch,-yaw? |
RULE for me: do not accept patch without wide testing from author. That PR changes all plugins code, instead of do API, test and only after that touching working code. My bad.
Ok now i know the reason why it worked with Tarek: mocap plugin uses quaternions and the rotation on roll is transformed into a quaternion which acts as a rotation to the other one. Multiplying both results on the correct transformation. So my mistake on this, as I thougth summing the rotation was similar to applying the rotation matrix which is obviously wrong. Thanks for finding that out @vooon. |
Why you changed quaternions transform too @vooon? Those are right cause quaternions act as a form of rotation... So th PI on Roll is converted to quaternion, and that math is right! |
Here covariance transform with eigen: https://github.com/ros-perception/imu_pipeline/blob/indigo-devel/imu_transformer/include/imu_transformer/tf2_sensor_msgs.h#L69-L75 @TSC21 math looks exact what you statement :) |
That's exactly what I need :D thanks for pointing that @vooon. Now we need Eigen on business... |
Can you please run imu test that i commited in test_package branch? |
Hi will, but I'm out of bandwidth now :s Note: What imu test are you referring too? Can't see any new commit on test_package... |
APM SITL + mavros: https://youtu.be/mUIptiNbmS4 Here tested base plugins. |
* master: plugin: sys_time, sys_status #266: check that rate is zero test #321: disable tests for broken transforms. lib #321: frame transform are broken. again! revert old math. unittest: added 6x6 Covariance conversion test frame_conversions: update comments; filter covariance by value of element 0 unittests: corrected outputs from conversion tests test: other quaternion transform tests test: UAS::transform_frame_attitude_q() test: test for UAS::transform_frame_attitude_rpy() (ERRORs!) test: test for UAS::transform_frame_xyz() test: Initial import test_frame_conv
We should check what convention used by tf::Matrix to be sure that our method is compatible.
@TSC21 please check. I wrote simple eigen-based transforms. There is no function similar to |
Add test for checking compatibility of tf::quaternionFromRPY() and Eigen based math.
Added a test, and seems that right order is same as in MIRA quaternionFromYawPitchRoll() |
* master: plugin: imu_pub fix #320: move constants outside class, else runtime linkage error. plugin: imu_pub #320: first attempt eigen #319: handy wrappers. eigen #319: add euler-quat function. test #321: remove duplicated test cases, separate by library. test #321: testing eigen-based transforms. mavros #319: Add Eigen dependency and cmake rule. 0.12.0 Prepare release 0.12 test: import launch for imu testing test: apm sitl and imu test reproduction steps test: test for UAS::transform_frame_attitude_rpy() (ERRORs!) test: test for UAS::transform_frame_xyz() test: Initial import test_frame_conv test: Add test_marvros package stub
Almost all test implemented, except |
All used transforms have tests. Closing. |
No description provided.
The text was updated successfully, but these errors were encountered: