dronekit / dronekit-python

DroneKit-Python library for communicating with Drones via MAVLink.
https://readthedocs.org/projects/dronekit-python/
Apache License 2.0
1.62k stars 1.44k forks source link

ATT_POS_MOCAP Message #698

Open andersonn opened 7 years ago

andersonn commented 7 years ago

Hi everyone,

We're trying to send the att_pos_mocap message to a drone with a pixhawk rpi combination. We have from a motion capture system the xyz and attitude values of the drone. We've tried using the message_factory.att_pos_mocap.encode to send these messages but it doesn't seem to be working. Pixhawk seems to support this mavlink message. Any tips on how to get it to work?

lalal321 commented 7 years ago

Hello , How are you doing now with the att_pos_mocap , I am doing this too. Have you solving it ?

pietrodn commented 6 years ago

The problem you have is probably related to timestamps. If the ATT_POS_MOCAP message has a timestamp "too old" relative to the autopilot's time, the PX4 firmware considers it as invalid.

So, you must sync the Pixhawk's clock with the RPI's clock (e.g., by using the MAVLink TIMESYNC messages) and make sure that the timestamps in the ATT_POS_MOCAP messages are "not too old" w.r.t. that clock.