Are there a way to access Bar30 'depth' data with pymavlink?

Hello dear forumers,
We are currently working on an AUV system. And we have the Bar30 depth sensor. We are using the Pixhawk 2.4.8’s I2C port to access to the Bar30 depth sensor. And we want to access the depth value ,which is coming from the depth sensor, through mavlink messages.

First:
I tried the SCALED_PRESSURE2 message, but i couldn’t see anything such labelled as 'depth' in there. There is only 'press_abs' value looked like it might be helpful to get depth value through it, i am guessing that it might require to make some calculations to get the actual depth value from it however i couldn’t find what calculations i do need.

Second:
I tried the GLOBAL_POSITION_INT message, and again i couldn’t see anything such labelled as'depth' in there. I thought 'hdg' value might be helpful to calculate h from the P=hdg formula. But as much as i know GLOBAL_POSITION_INT message using the internal sensors of Pixhawk2.4.8, not the Bar30 sensor connected from I2C port. So it seemed me useless to implement. Because i want the Bar30 datas, not the Pixhawk’s internal sensor datas.

Third:
I tried the VFR_HUD message. I am currently using VFR_HUD message to access to the 'heading' value of Pixhawk. As i read on the net, a guy says that the message is including 'depth' data, but again i couldn’t see anything such labelled as'depth' in there. And i also think that VFR_HUD message using the internal sensors of Pixhawk2.4.8

Last but not least:
I found some python examples for Bar30 (ms5837-python) i tried to install the library to my Ubuntu system but i failed to install it through terminal, so i also couldn’t get any results from there.

Thanks for your time to reading this, any help will be appreciated.

1 Like

Hi @toosat,

If you’re using ArduSub, VFR_HUD.alt (altitude) should be what you’re after :slight_smile:

1 Like

Hey @EliotBR ,
Thanks for the response. We observed that when we plug in our Bar30 sensor to Pixhawk, the source of 'alt' value at VFR_HUD message switching from Pixhawk’s internal sensors to Bar30 sensor. And we succeeded to get values through VFR_HUD message, thanks for the help :slight_smile:

1 Like

Hi, I get depth data -85 with VFR_HUD.alt, but what is the unit of this data? Thank you.

It’s in meters (m), as specified in the links to the MAVLink specification in @toosat’s comments :slight_smile:

And I get “RAW_IMU” data from Pixhawk2.4.7, I looked up the type and range of accelerometer and gyroscope in Pixhawk2.4.7. It seems that they use a range of 16g ofLSM303D accelermeter AND a range of gyroscope 2000DPS, but I am not sure what is the unit of the RAW_IMU.xacc, do I need to divide raw data by precision to get real accelerate?

Thank you, get it.

Use one of the SCALED_IMU options instead. I believe ArduSub uses SCALED_IMU2 by default.

Thanks a lot, I used SCALED_IMU2 to get data,the obtained value is about the same size as RAW_IMU, but now I know the acceleration unit is mG.