Commit Graph

49 Commits

Author SHA1 Message Date
Mathieu Bresciani 6a58f6c7dc Enable arbitrary euler angle for Mag rotation CAL_MAGx_{ROLL,PITCH,YAW}
- Enable arbitrary euler angle for Mag rotation
  - new CUSTOM rotation enum out of the normal enum range
 - mag_rot: automatically change to custom if euler rot is set
 - sensor_calibration: Magnetometer save custom rotation parameters
 - mag_cal: cross mention rotation parameters
  - This allows the user to see the RPY options when searching for the rotation parameter

---------

Co-authored-by: Junwoo Hwang <junwoo@auterion.com>
Co-authored-by: bresch <[brescianimathieu@gmail.com](mailto:brescianimathieu@gmail.com)>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2023-08-26 14:52:39 -04:00
Daniel Agar e57aaaaa5e rotate accel/gyro FIFO before publish and fix angular velocity filter resets
- rotates accel & gyro FIFO data before publication both to simplify downstream usage (including log review) and fix other issues
     - to best handle int16_t data rotations are now either performed with swaps if possible, otherwise promoted to float, rotated using the full rotation matrix, then rounded back to int16_t
 - fix sensors/vehicle_angular_velocity filter reset both with proper rotation and new calibration uncorrect helper
      - in FIFO case filtering is done before calibration is applied, but we need to handle a possible reset from a completely different sensor (vehicle body angular velocity -> sensor frame uncorrected data)
2021-03-22 12:01:12 -04:00
Daniel Agar 70e503cb91 rotation: use Dcmf for all rotations that aren't direct swaps
- increase optimization to ${MAX_CUSTOM_OPT_LEVEL} (max per board)
2021-01-10 18:08:41 -05:00
Daniel Agar 9f57df75e8 remove rotation 41 (ROLL_270_YAW_180)
- duplicate of 31 (ROLL_90_PITCH_180)
2020-12-28 11:07:08 +01:00
Daniel Agar 00e955cc3e rotations: sync rotation enum, SENS_BOARD_ROT, CAL_MAGx_ROT with MAV_SENSOR_ORIENTATION 2020-09-22 11:10:31 -04:00
Daniel Agar 08ad7850fc rotation: combine duplicates 2020-08-28 18:29:09 -04:00
Daniel Agar 08cfea0b6f commander: mag calibration auto rotation skip all duplicates
- add simple rotation test with corresponding blacklist
2020-08-28 18:29:09 -04:00
baumanta 200d905b63 delete ROTATION_YAW_293_PITCH_68_ROLL_90 as usage implies it is the same as ROTATION_ROLL_90_PITCH_68_YAW_293 2020-05-01 21:00:55 -04:00
baumanta 38a6304d53 cleanup unneccessary complicated formulations 2020-05-01 21:00:55 -04:00
baumanta c758da2391 add test for rotations, add new rotations, fix old rotations 2020-05-01 21:00:55 -04:00
baumanta c37424aff2 sort enum by mavlink MAV_SENSOR_ORIENTATION 2020-05-01 21:00:55 -04:00
Matthias Grob 81e576b63a rotation conversion: deconfuse roll 90 yaw 90 2020-04-29 10:12:50 +02:00
Jin Chengde e82880d6d7 add new rotation (#14512)
* add new rotation  ROLL_270_YAW_180

fix compile error

fix rotation

modify roatation

* modify enum to 41
2020-04-22 09:03:55 +02:00
Beat Küng 3198610f85 src/platforms: move all headers to platforms/common/include/px4_platform_common
and remove the px4_ prefix, except for px4_config.h.

command to update includes:
for k in app.h atomic.h cli.h console_buffer.h defines.h getopt.h i2c.h init.h log.h micro_hal.h module.h module_params.h param.h param_macros.h posix.h sem.h sem.hpp shmem.h shutdown.h tasks.h time.h workqueue.h; do for i in $(grep -rl 'include <px4_'$k src platforms boards); do sed -i 's/#include <px4_'$k'/#include <px4_platform_common\/'$k/ $i; done; done
for in $(grep -rl 'include <px4_config.h' src platforms boards); do sed -i 's/#include <px4_config.h/#include <px4_platform_common\/px4_config.h'/ $i; done

Transitional headers for submodules are added (px4_{defines,log,time}.h)
2019-10-30 11:48:47 +01:00
Julien Lecoeur 8f910f8435 ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters (#13249)
* Conversions lib: add quaternion getter

* vehicle_status: add flag is_vtol_tailsitter

* ATTITUDE_QUATERNION: fill repr_offset_q for tailsitters
2019-10-28 09:27:53 +01:00
Julien Lecoeur 7bea81f02c Add board orientation ROLL_90_YAW_270 2019-09-05 20:41:32 -07:00
Beat Küng c659d2bcc2 mixer: minor refactoring to reduce header include dependencies
- avoid including <px4_defines.h> from the math headers
- avoid driver include <drivers/drv_mixer.h> from the mixer
2018-12-13 09:50:07 +01:00
Daniel Agar 222a91c6be mathlib delete Matrix, Quaternion, Vector 2018-05-23 17:27:09 -04:00
Daniel Agar ea3acb7121 cmake remove circular linking and reorganize
- px4_add_module now requires MAIN
 - px4_add_library doesn't automatically link
2018-04-29 21:48:54 -04:00
Daniel Agar 1b174eeca2 drivers replace math::Vector<3> with matrix::Vector3f 2018-03-21 13:48:45 -04:00
Andreas Antener ab9ee3aa6c conversion: added -45 deg pitch rotation 2018-02-28 10:08:58 +01:00
Andreas Antener add20389f6 conversion: added rotation +45 degree in pitch 2018-02-28 10:08:58 +01:00
Michael Schaeuble 6bb03f3665 Add pitch angle to AK8963 for Bebop 2016-10-05 09:56:54 +02:00
Julian Oes 8ff237c69f Remove size optimization for individual modules
It makes more sense to set the optimization flags on a platform basis
instead of individually for each module. This allows for different
optimization options for SITL, NuttX, Snapdragon, etc.
2016-09-30 08:11:51 +02:00
Daniel Agar 69c1ce1714 WIP logger serialization 2016-05-14 11:27:07 +02:00
Daniel Agar eb29b33620 use gcc attributes to align and pack 2016-05-14 11:27:07 +02:00
Andreas Antener 3b88937594 added ROTATION_PITCH_90_ROLL_270 2016-05-10 09:29:06 +02:00
Andreas Antener 6c04ab970b fixed formatting 2015-12-28 15:23:20 +01:00
Andreas Antener bd3d53902a readded missing rotation 2015-12-28 15:23:20 +01:00
Andreas Antener 94bfad5057 added rotation for solos external mag 2015-12-28 15:21:50 +01:00
Lorenz Meier 8515326176 Fixed rotation code style 2015-12-24 10:19:21 +01:00
Mark Whitehorn f36669723d add rotation for stryker vtol 2015-12-24 10:14:58 +01:00
Lorenz Meier 2b8e981a7d conversion lib: Update code style 2015-10-19 13:51:47 +02:00
Lorenz Meier fa5071b3c5 Remove module.mk files to prevent confusion of adopters upgrading 2015-10-06 11:23:20 +02:00
James Goppert 1d6b31d196 Switch to cmake build system. 2015-09-07 20:37:45 -04:00
Mark Whitehorn db7d0ef51f add a new rotation to lib/conversion 2015-05-26 15:28:25 -06:00
Ban Siesta 2d19726ee7 rotation: added another missing rotation 2015-03-29 20:17:09 +01:00
Daniel Agar c2abb0f82a fix code style if trivial one line difference 2015-03-19 23:49:36 +01:00
Daniel Agar d14fdf896b rotate_3f() implement missing ROTATION_ROLL_270_YAW_270 2014-12-23 11:18:30 -05:00
Daniel Agar d511e39ea7 turn on -Werror and fix resulting errors 2014-12-22 17:56:59 -05:00
Thomas Gubler 25df841118 Merge pull request #1429 from tumbili/board_rot
new_sensor_rotation_option
2014-11-04 22:50:33 +01:00
tumbili cbd20f48d6 fixed style 2014-11-04 20:57:09 +01:00
tumbili f5dbfe63b3 added new sensor board rotation option (roll 270, yaw 270) 2014-11-04 20:52:29 +01:00
Lorenz Meier 47dcf88271 Flash optimization 2014-09-30 15:18:30 +02:00
Andrew Tridgell f56724f7df lib/conversion: added rotate_3f()
will be used for user specified rotations in sensor drivers
2014-07-08 11:46:40 +02:00
Anton Babushkin ba612c3ee8 mathlib fixes 2013-12-19 14:10:25 +04:00
Anton Babushkin a83e3cd222 New mathlib, WIP 2013-12-18 19:33:47 +04:00
Anton Babushkin 0dc9c9ac26 accelerometer_calibration: code style fixed, lib/conversion copyright fix 2013-10-20 23:28:09 +02:00
Anton Babushkin ef6f1f6f80 get_rot_matrix() moved to separate library, accel calibration of rotated board fixed 2013-10-20 19:36:42 +02:00