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.

1 Like

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.

1 Like

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

1 Like

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

2 Likes

this is a very cool idea for a bumper.

Thanks - when we get the bumper working, i’ll put up a video and some scripts. Went with contact switches in the end.

I really like the pneumatic bumper, and i got it working well. Like an old garage road strip thing.

One of the bugs was that when the weather changed, it changed behaviour, i had coded absolute pressure ie when pressure > 1020 hpa = beep. With the high and low pressure systems rolling over the country, it would become more or less sensitive. Fixed with a code change :slight_smile:

1 Like

In yuris lua scripting video, at the end a script is created to look for sudden changes to a value to detect rough terrain, that script could probably be used with the barometer so it looks for changes in pressure over a short time rather than limits.

1 Like

Yep - that was the change i made. I went from “if pressure high” to “if pressure higher than normal”, and checking the initial pressure on startup. That accounted for weather patterns.

The unit was as ESP8266 with a BMP280 barometer and a buzzer. Squeeze the tube anywhere, it buzzes. The electronics fitted inside the tube. Just needed 5v which i provided via a usb onto the Wemos D1 mini.

The code was spitting out presssure readings via the usb. Fun - but the new electric contact bumpers save a chunk of plumbing and any air pressure problems or leaks.

Not too hard to include a battery and serve the pressure readings via a web page (esplink!) for a magic tube solution, until the battery fails at least.

1 Like