One thing you’ll need to do is increase the maximum number of range finders to 4.
https://github.com/diydrones/ardupilot/blob/master/libraries/AP_RangeFinder/RangeFinder.h#L26
Also increase the list of parameters to support storing params for all four. Hopefully you can figure this out by seeing how the parameters are added for the 2nd range finder here:
https://github.com/diydrones/ardupilot/blob/master/libraries/AP_RangeFinder/RangeFinder.cpp#L110
Next the challenge of actually connecting 4 sonar to the pixhawk. If it were me I would probably try using the pwm inputs to the Pixhawk. I’ve never tried this myself but it seems some of the AUX pins can be changed to be pwm-in by setting the BRD_PWM_COUNT to a lower number (like 2).
http://copter.ardupilot.com/wiki/common-autopilots/common-pixhawk-overview/
Connecting the sonar to an Arduino first is ok but then you still need to get that info to the Pixhawk somehow which would likely mean writing a new AP_RangeFinder class. That’s very possible but not sure how much you want to do that.
-Randy
--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.