2

From a high level, I am trying to combine my Pixhawk telemetry data (specifically GPS position and vehicle attitude) with other sensor data on my RaspPi 2, that is connected via DroneKit. I have the Pixhawk connected via the GPIO header, at a 115200 baud rate on the Telem 1 port.

-I turned up the SR_1 telemetry rates to 10hz. -Running my logging code at 10hz, but have verified similar results at higher rates. -I am using the 'attributes' function, i.e.

curr_attitude = vehicle.attitude 

The first problem is that I am only seeing updates come through at ~3-4 hz. Is there a reason for the discrepancy between the SR_1* rates and my vehicles attributes?

My seconds question: Is there a better/faster way to get the raw attitude and position information?

Mike Klinker
  • 33
  • 1
  • 3
  • I have been updating the SR1_* parameters via Mission Planner and Mavproxy, neither seem to have an effect on the attitude rate. – Mike Klinker Jul 22 '15 at 18:33

2 Answers2

1

It is possible that there is too much stuff being sent. When the channel is full, ardupilot will start dropping streams, in order to make space for the packets that it thinks are more important. The solution for this is to decrease other stream rates, especially the streams that are sent before it. Streams are sent in this order:

PARAMS //Don't worry about this one.
RAW_SENS
EXT_STAT
POSITION
RAW_CTRL
RC_CHAN
EXTRA1
EXTRA2
EXTRA3

So I would recommend decreasing RAW_SENS and EXT_STAT first. If that doesn't help, then try decreasing all the others.

squilter
  • 400
  • 1
  • 6
0

Looking through the source file for api.py, it appears that it updates the attitude/position for the vehicle as soon as it receives it via MavLink.

To determine if the telemetry rate is as fast as you want, you could edit the api.py file method mavlink_packet() at line 427.

If the telemetry rate is indeed 10 hz, it must be the Pixhawk itself at fault. Perhaps you could use Message Factory to request more frequent updates, assuming that the Pixhawk has them available.

Sorry I couldn't give you a more concrete answer, I hope this helped.

Indeed
  • 139
  • 14