Baro:get_pressure() from 3rd Baro only?

Hi, i just added a BMP280 barometer onto my Qiotek Zealot Flight controller via the i2c interface.
Its working fine and identifies as the 3rd barometer, mavlink inspector shows realtime pressure from it.

My question - how do i reference the pressure from this specific barometer (its not for altitude) ?
baro:get_pressure() seems to only return the first barometer. baro:get_pressure(2) didnt work :frowning:

update:
I checked the docs.lua reference - looks like there is no instance reference (i think) so i set the bmp280 barometer as the primary device to use for pressure/altitude via parameter BARO_PRIMARY = 2

Its a rover, so altitude is not so important (cliff?) and it will get me moving. Something more elegant would be awesome however.

Thanks in advance and much appreciated.

Looks like your assessment is correct. If you’re comfortable working with the source code, you could look at how the baro:healthy binding is crafted and create similar instance arguments for the get bindings, and then make a PR for the updated bindings.

Thanks Yuri.

The BMP280 is attached to a hose on the front of the mower. If it bumps into anything, pressure goes up - and watchdog code hit the brakes and cries for help. Im hoping to test it out and share it as a bigger rover safety feature if it works out, if so - then more demand for scripting accessing baro:get_pressure(n). I’ll look at the PR.

Related - while testing today i had my first two crashes. 1) a sandpit 2) my old WRX. Both at full speed (0.7m/s or 1.5mph !!) . No damage. Mower stopped moving forwards, but put a lot of force into the cars bumper. A pressure sensor bumper is another Swiss cheese layer of safety worth persueing i think.

Interesting concept for a physical bumper. Why not a momentary switch or two, instead?

Our mower is skid steer - so lots of potential sideways impacts during the pivot turns.

Contact switches need a bit of mechanical movement in the bumper to shift. The pneumatic solution is sensitive to any squeeze and location or direction. Bench testing is looking promising with triggering being quick and repeatable.

I like the idea of bmp280’s being mounted in the computer box out of the elements rather than contact switches getting rained on, bashed or corroded. My thinking is run the pipe around the mower and back into the computer cabinet, so only hosepipe outside.

More testing (including high and low pressure weather systems) needed. Part of the pre-flight test will be to give the pipe a kick and test mode-> hold

Didn’t mean to insinuate it’s a bad idea. Just curious about the design/thought process. If reliable, it’s simple enough!