I built a TRex 450 with an APM mounted as suggested by Randy but am thinking about changing it and mounting it in a different way that would result in the APM being upside down. My question is, can I easily correct this by modifying the code? Is it just a matter of changing the sign for a number of the signals? I noticed there is a config parameter for changing the orientation of the magnetometer, but I didn't see anything for the orientation of the APM.
Tags: apm, arduino, ardupilot, mega, orientation, t-rex, trex
Graham,
There's no easy way to do this I'm afraid. It's definitely possible though but you'd need to modify perhaps the AP_IMU_Oilpan.h file in the AP_IMU library or maybe somewhere in the DCM lib when it consumes the accelerometer and gyro data..but I can't tell you exactly what you'd need to change. If the APM is upside-down I think you need to reverse the pitch gyro values and all three (x,y,z) accelerometer values.
Permalink Reply by Graham on August 27, 2011 at 9:11am
Permalink Reply by Graham on August 27, 2011 at 9:30am Ah nicely done. Yes, that makes sense and that might very well be enough. I think normally in the rest of the code we use DCM which has already processed the sensor values.
Permalink Reply by Graham on August 28, 2011 at 10:35am
Permalink Reply by Don Megabyte on June 6, 2012 at 9:06pm Yes, great stuff! Just made this mod to mount an apm1 under my 3DR frame. Works tremendously. :) The filename has changed but grepping on GYROY etc will turn it up.
Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.185 members
51 members
136 members
51 members
24 members
© 2013 Created by Chris Anderson.
Powered by
