X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Ftelemega-v6.0%2Fao_pins.h;h=2518e6ba45785bae1827d60fbfa0fbc0a26032ac;hb=7e69610859e88cacbc5801bcafecaf84b9f7f455;hp=5bc224fe950ac97dde27ef82c8407537ea4e0d11;hpb=b08930aa0f67a445bf2300f3cea07cecf513a2f0;p=fw%2Faltos diff --git a/src/telemega-v6.0/ao_pins.h b/src/telemega-v6.0/ao_pins.h index 5bc224fe..2518e6ba 100644 --- a/src/telemega-v6.0/ao_pins.h +++ b/src/telemega-v6.0/ao_pins.h @@ -327,21 +327,28 @@ struct ao_adc { /* * - * If the board is laying component side up with - * the antenna (nose) pointing north + * Here are the required sensor signs: * - * +along north +roll left up - * +across west +pitch nose down - * +through up +yaw left turn + * +along nose up + * +across USB down + * +through TH down + * + * With the board aligned to have positive accel for the relevant + * axis, looking down from above we have: + * + * +roll counter clockwise (nose up) + * +pitch counter clockwise (USB down) + * +yaw counter clockwise (TH down) */ /* - * bmi088 - * - * pin 1 NE corner of chip + * On TMega v6, bmi088 pin 1 (NE corner of chip) is placed towards the + * USB and antenna edges of the board. Relative to bmi088 specs, to + * get the above values, we need to flip the Y axis, assigning values + * as follows: * - * +along +Y +roll +Y - * +across -X +pitch -X + * +along +X +roll +X + * +across -Y +pitch -Y * +through +Z +yaw +Z */ @@ -353,12 +360,12 @@ struct ao_adc { #define AO_BMI088_GYR_CS_PIN 13 #define HAS_IMU 1 -#define ao_bmi088_along(m) ((m)->acc.y) -#define ao_bmi088_across(m) (-(m)->acc.x) +#define ao_bmi088_along(m) ((m)->acc.x) +#define ao_bmi088_across(m) (-(m)->acc.y) #define ao_bmi088_through(m) ((m)->acc.z) -#define ao_bmi088_roll(m) ((m)->gyr.y) -#define ao_bmi088_pitch(m) (-(m)->gyr.x) +#define ao_bmi088_roll(m) ((m)->gyr.x) +#define ao_bmi088_pitch(m) (-(m)->gyr.y) #define ao_bmi088_yaw(m) ((m)->gyr.z) #define ao_data_along(packet) ao_bmi088_along(&(packet)->bmi088)