mavlink / MAVSDK

API and library for MAVLink compatible systems written in C++17
https://mavsdk.mavlink.io
BSD 3-Clause "New" or "Revised" License
624 stars 507 forks source link

set_rate missing for rawGps #1413

Open cjffly opened 3 years ago

cjffly commented 3 years ago

Hi,

rawGps info now can be accessed with v0.38+, but I found that its missing something like "telemetry.set_rate_rawGps()" as the position can do "telemetry.set_rate_position()". Is this a missing feature or there is another way to set the rawGps access rate?

Best

julianoes commented 3 years ago

Hi, good question. You can actually just use set_rate_gps_info as the underlying mavlink message is the same.

@JonasVautherin should we add it nevertheless or add a comment to clarify this?

JonasVautherin commented 3 years ago

I first was thinking about adding it, and handling the case where somebody does set_rate_gps_info() AND set_rate_raw_gps like this:

The problem is for the polling interface: what if I want to poll gps_info very fast, but subscribed to raw_gps at a slow rate? Or maybe something like:

Which then means that if you do set_rate_gps_info and then only poll raw_gps, you see the effect of the new rate (if that rate was faster than the default). Not sure if that's a problem, though... And we should document the behavior, and maybe add a log line when set_rate_ is being set to the lower value and is therefore ignored.

Not perfect, but that's the best I can think of to have a rather natural way of using both rates :sweat_smile: