Sonar/Baro Transition

All,

 

I am planning on trying out different sonar solutions on my quad and was wondering how the transition between using the sonar and using the barometer for altitude hold is programmed? I am running ArduPiratesNG (rev. 527).


I have looked through the code and it appears it transitions at a fixed altitude, but I can't find where that altitude is set. I would really like the ability to change it, if possible.

 

Also, will ACM use sonar and baro together? Thanks for your help!

 

-Robert

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

Join diydrones

Email me when people reply –

Replies

  • At the moment the Sonar is used until circa 5.6 meters. After thtat Baro gets in.

    To find the relative code follow this:

    In system.pde you have:

     

    1. sonar_threshold = AP_RangeFinder_down.max_distance * 0.8;
      max_distance is defined in the Rangefinder library (eg if you have MXBitx XL: AP_RangeFinder_MaxsonarXL.cpp) and for the XL EZ4 is 700 (in cm.).

       
    2. In sensors.pde you have the test logic to see if sonar value is good or not:
      If( AP_RangeFinder_down.distance > sonar_threshold ) {
            sonar_status = SONAR_STATUS_BAD;
      ...
      }
    3. And finally in the main ArdupiratesNG.pde code you find the logic to decide whether to use sonar or baro starting with this line :
      if (AP_mode == AP_ALTITUDE_HOLD || AP_mode == AP_ALT_GPS_HOLD)
      ...

    Hope this helps.

    Emile

  • transition between these two sensors is actually not implemented yet ;)

    I don't know if this is included in ACM

     

    your forum post is actually on page one in arducopter category (you should wait at least one day to get answers, not everybody is located in the US ;) )

  • Anyone have any ideas about this? Thanks!

     

    **I am shamelessly bumping my own thread, since I can't see it on the regular forums anymore...I think it got pushed back to the second page, but isn't displaying.

This reply was deleted.

Activity