Ardupilot: Orientation question

Hello everyone!

After the ardupilot forum is NOT working (I don't get an e-mail for the account approving, of course I checked the spam filter, I actually tried it with two different e-mail adresses) I try it in this forum.

I mounted the ArduPilot on a Quadcopter, but upside down. Front is still facing to the front.

If I set the AHRS_ORIENTATION to Roll180 (which should do it) and check the result in the Mission Planner, the pitch seems to work, just like the yaw, but nick is inversed!!! Whyever... Do I miss something until here?

So I wanted to add a new AHRS Orientation in the 3.2.1 firmware (already cloned the stable branch from git).

The orientations are defined in the rotations.h file and used in the vector3.cpp's function rotate (right?).

I added a new case for my new orientation (obviously I need Roll180Pitch180), but if I flash this to the copter, it only seems to affect the gyros and not the accelerometer (if I nick it first seems to be correct; the nick channel moves up, but if I stay on the position, the orientation slowly drifts to the opposite (I start from nick 0°, move the copter to physically 10°, then the nick angle moves also to 10°, but then drifts to -10°).

Here is my code in the switch/case:

y = -y;
z = -z;
x = -x;
             

I simply swap the angles... The case is definitely executed (I set the EEPROM value of AHRS_ORIENTATION to 39, my new case).

What do I do wrong???

Thanks and regards

Jan

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Ok, does not matter, there was a thinking error of mine. Sorry!

This reply was deleted.

Activity