MPU6000: Gyro / Accelerometer data rate MAVLINK <-> ROS

Hi Community!

I am using the Ardupilot Mega 2650 and the Ardupilot to control an RC-Car based Rover in comibination with ROS (robot operating system, ros.org/).

Everything is working quite fine and I am using the MAVLINK protocol for communication. It is possible to teleop the rover over ROS and MAVLINK and to read the sensor data provided by the arduino board (gyro, accelerometer, gps,…).

The bad thing is, that the gyro and accelerometer data, that i can read from MAVLINK, only comes out at about 2 Hz, which is really slow… I want to speed this up to 10 or 20 Hz, which would be sufficient for my needs.

Since i was told, that the gyroscope of the MPU 6000 can deliver data at rates from 4 - 8000hz , can anyone give me a hint where and what I have to change to speed it up?

Thx
psei

You can set the desired frequency in the MAVLink request stream function. However, the APM has it’s limits somewhere and so does serial data transmission.

Hi Stefan,

Thank you very much for your answer. I did some research and I found this code example, which seems to do exactly what I want:

github.com/mavlink/pymavlink/bl … setrate.py

But since my pymavlink installation on my rover does not find a module “mavlink” (ImportError: No module named mavlink) to import, I cannot run it.

My Guess was that I would have to generate this module using the “mavgenerate.py” tool, and so I did. Now i have got a file named “mavlink.py” in my mavlink folder, but I wonder where to put it, since it still cannot be included. Any hints for that?

Thx
psei