-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
Refactoring of the MAVLink parameter interface #449
Conversation
7807616
to
f9da1ba
Compare
f9da1ba
to
2ae2c9c
Compare
bf6ea37
to
bbd760a
Compare
Ready for review. |
bbd760a
to
96ca9e2
Compare
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.
Looks good, but I haven't tested the backend yet. Doesn't this break it?
@JonasVautherin I don't think it should break it? Which part would be broken? |
96ca9e2
to
102add7
Compare
@JonasVautherin would be good to get this one in. |
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.
Breaking the public API and, therefore, the backend. We'll need to fix that, too.
102add7
to
cb152bb
Compare
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.
Thx!
static_cast<rpc::action::ActionResult::Result>(action_result)); | ||
// rpc_action_result->set_result_str(action_result_str(action_result)); | ||
response->set_allocated_action_result(rpc_action_result); | ||
if (response != nullptr) { |
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.
Ah!
|
||
actionService.SetMaximumSpeed(nullptr, nullptr, nullptr); | ||
actionService.SetMaximumSpeed(nullptr, nullptr, &response); |
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.
Aaaah!
actionService.SetMaximumSpeed(nullptr, nullptr, &response); | ||
} | ||
|
||
TEST_F(ActionServiceImplTest, setMaxSpeedDoesNotCrashWithNullResponse) |
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.
Nice!
601a2c2
to
3456e9d
Compare
We don't need to store params anymore, they are always auto-saved.
This adds a cache for the params so that when you want to get a parameter, it takes it from the cache if you have received it before. This will only really be beneficial once plugins can require params right when they are instantiated respectively when a vehicle is connected.
We should not assume that the firmware is already set to the default takeoff altitude because it might have been changed in the past.
We can't always be sure if settings via commands work, so we do need to supply a way to check for errors.
Also get rid of some unnecessary comments and move the param get methods so they are together.
Instead of setting a default takeoff altitude just rely on the fact that the drone itself has a takeoff altitude set by a parameter. This should avoid surprises where taking off with the SDK has a different altitude than with other ground stations.
These are not needed anymore because the param system should cache it for us.
This way we can get rid of some future/promise duplication.
Since we now have an API to set params sync instead of async we can simplify the way the configuration is applied. Additionally, it does not really make sense to change the PX4 default without asking every time the plugin connects. We should rather fetch the params in the beginning and have them cached for when we need to change them.
3456e9d
to
2d68e6d
Compare
2d68e6d
to
7f84322
Compare
7f84322
to
29aa760
Compare
Refactoring of the MAVLink parameter interface
This is a refactoring of the MAVLink paramter interface. Solves #440.