Playing with altitude variables and altitude triggered events

Hi Guys,

 

After loosing my $1000 drone due to an elevator failure, I'm planning on adding a few safety features to the next beast.  One of which will be a parachute.

 

For this I plan on writing a bit of code to trigger events based on altitude.

 

I've been looking at the code and I was hoping someone could point me in the right direction.  I need to know which variables hold the home altitude and the current altitude.

I believe them to be:

home.alt

and

current_loc.alt

Is this correct?

 

-  Also are the values in meters for each variable?

 

-  What do the altitudes indicate?  MSL (Mean Sea Level) or AGL(Above Ground Level)? 

   If it's AGL does the home altitude initialize to 0 meters?

 

Thanks for all the help.

 

Tags: altitude, events, parachute, triggered

Views: 117

Reply to This

Replies to This Discussion

You should look at the update_alt() and adjust_altitude() methods.  This is where everything is done.  From what I can tell, everything is in cm.

 

There's two ways Arducopter measures altitude.  One uses the IMU onboard barometer, which would probably be equivalent to the MSL.  The second method is using an externally mounted ultrasonic sonar, which would be the AGL.   The sonar only comes into effect below 1000 cm.

 

Home altitude depends on what you set as your home altitude is whatever altitude you've set in the ground station as your  home.  Current altitude is the combination of barometer and sonar reading.  There's also a concept waypoint altitudes for each waypoint that you set.

 

Thanks for the reply.  I forgot to mention that I'm using ArduPlane and not Arducopter.

 

I took a look at update_alt().  It seems to be the subroutine which updates the current_loc.alt variable.  Now the question is what is current_loc.alt?  Is it MSL or AGL?  Also what is g.altitude_mix?  I tried looking for it under the other tabs but couldn't find it anywhere.

Hi Rigel, you have a nice idea for saving our drones, i hope you make it with the code. till then Arduplanes measure altitude  A. using GPS signal (MSL) but very innacurate B. using the barometer sensor (relevent to home alt) very accurate. i suppose mix, combines the the ALT deference between 0 and flight ALT with GPS ALT to show as our flight in the real world. so, in my opinion you have to use baro Alt (when pressure increasing the less Alt you have) for you code.

 

All this are wrong if the APM barometer is autocalibrated z=c\;T\;\log(P_o/P),  to sea level using Temp sensor, but i dont think so. 

hope i helped

James

 

RSS

Social Networking

Contests

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.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service