Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_rate missing for rawGps #1413

Open
cjffly opened this issue Apr 15, 2021 · 2 comments
Open

set_rate missing for rawGps #1413

cjffly opened this issue Apr 15, 2021 · 2 comments

Comments

@cjffly
Copy link

cjffly commented Apr 15, 2021

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
Copy link
Collaborator

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
Copy link
Collaborator

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:

  • If both subscribe_gps_info and subscribe_raw_gps are active, use the max of both rate values
  • If only one is active, take its rate

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:

  • If both subscribe_gps_info and subscribe_raw_gps are active, use the max of both rate values
  • If only one is active, take its rate
  • If set_rate_ has been called (even if the subscription is inactive), use that rate in the max computation

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 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants