-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
eliminate global static GCS_MAVLINK::send_home_all #6554
Conversation
LGTM, but I'll make two notes before merging:
|
847cbd9
to
ba32893
Compare
@OXINARF a const function returning a reference must return a const reference, which is unfortunate if you would like to fiddle with the returned value.... I've changed the GCS_MAVLink patch to take into account the active channel mask. That mask is going to die in future, replaced with a |
Sorry, I do not get the advantage of this PR. Can you elaborate Please ? |
@peterbarker has had this task in the queue for a long time. We've been wanting to change the whole GCS messaging system to use a singleton instead of all the libraries and vehicles reaching back and forth over the GCS_MAVLink:: const reference which is a bit ugly. He has a series of PRs lined up to totally remove the GCS const refs which were held off to make sure it doesn't conflict with the copter release |
@peterbarker Ah you are right and it makes sense, you can't mark the method const if you give the caller the chance to change the internal state of the object. Learning every day! 🙂 @magicrub Why was this marked as DevCallTopic? This looks ready to go in, there is no change in behavior I can see. |
libraries/GCS_MAVLink/GCS_Common.cpp
Outdated
} \ | ||
} while (0); | ||
|
||
void GCS::send_home(const Location &home) const |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we already have a GCS.cpp file should this go there? I think it would be better, easier to find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep! Hadn't been created when I originally made this PR, I think.
Moved!
ba32893
to
dfd5ba8
Compare
Merged, thanks! I've changed the commit message of the last commit here by adding "to GCS_Dummy". |
No description provided.