MAVLink app: Send messages on average at a more correct rate and send on first call

This patch fixes two issues:
  * It sends the message on the first call, making sure that the first update gets sent out.
  * It improves the rate scheduling. In an experiment with 0.5, 50 and 250 Hz all rates were correct within 0.3% of the intended rate.
This commit is contained in:
Lorenz Meier
2016-12-25 21:30:31 +01:00
parent d6ef137e59
commit 6444988392
3 changed files with 36 additions and 15 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2014 PX4 Development Team. All rights reserved.
* Copyright (c) 2014-2016 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -98,7 +98,7 @@ public:
protected:
Mavlink *_mavlink;
unsigned int _interval;
unsigned int _interval; //<<< if set to zero = unlimited rate
#ifndef __PX4_QURT
virtual void send(const hrt_abstime t) = 0;