Home        Store        Docs        Blog

Recive sensor value


(Kenneth) #1

I am making some python code on the RPi on the ROV, but i have a question about sensor readings.

Right now i get the sensor values through this commmand:
autopilot.mav_recv_msg()

and then i search the msg for certain strings like “RAW_IMU”. The problem is that the sensor readings are slow. I need to make a controller for the ROV for a project, but the sensor readings come once every 1-5 sec, but i need like 10 Hz.

And also i use commands from here http://mavlink.org/messages/common and i use COMMAND_LONG and the MAV_CMD id and parameters, those make sense, but how do you use the rest? FX MAV_DATA_STREAM is it a function, or how is it supposed to be used? I have tired looking around in the forums and the internet, but i do not get a clear awnser.


(Patrick José Pereira) #2

Any special motive to get the RAW (≃2Hz) and not the ATTITUDE(≃10Hz) data ?

You can make this kind of question in pymavlink gitter, some messages have special functions to use with, but usually the mavlink commands have a _send suffix, like: master.mav.rc_channels_override_send.


(Jacob) #3

FX MAV_DATA_STREAM is it a function, or how is it supposed to be used?

You were close, it’s an enumeration of possible options to the REQUEST_DATA_STREAM message.

See also:


(Kenneth) #4

Any special motive to get the RAW (≃2Hz) and not the ATTITUDE(≃10Hz) data ?

So instead of looking for the “RAW_IMU” i can look for the “ATTITUDE” which is send more often?
If it is the case it could be a solution


(Jacob) #5

Yes, this is what @patrickelectric is suggesting. In the post I linked it describes how to change the rate of any of the messages.