-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
How to set custom_mode in HEARTBEAT #2514
Comments
We should implement standard flight modes in MAVSDK which will make this easier/possible. |
Thanks for your reply. I'm trying to implement
So, what I would like to suggest is to change the following functions to public.
|
I want to know how to set the
base_mode
andcustom_mode
in HEARTBEAT.HEARTBEAT (0) Field Name base_mode, custom_mode
I am working on a vehicle side and using Server plugins. I have the following process:
QGC -> Send "Takeoff" command -> Vehicle take off QGC <- Send "Custom_mode" with "AUTO:TAKEOFF" <- Vehicle QGC show "AUTO:TAKEOFF"
But
set_custom_mode()
is private API in MAVSDK.void ServerComponentImpl::send_heartbeat() { … mavlink_address.component_id == MAV_COMP_ID_AUTOPILOT1 ? _base_mode.load() : 0, mavlink_address.component_id == MAV_COMP_ID_AUTOPILOT1 ? _custom_mode.load() : 0, … } class ActionServerImpl : public ServerPluginImplBase { private: void set_base_mode(uint8_t base_mode); void set_custom_mode(uint32_t custom_mode); }
And I tried
mavlink_msg_set_mode_pack_chan()
to send the message but it doesn’t work.So I modified the MAVSDK in
action_server.cpp
.void ActionServer::set_base_mode(uint8_t base_mode) const { _impl->set_base_mode(base_mode); } void ActionServer::set_custom_mode(uint32_t custom_mode) const { _impl->set_custom_mode(custom_mode); }
Additionally,
add_capablilities()
also have the same problem, so I modified them as follows.Sever_component.cpp
void ServerComponent::add_capablilities(uint64_t capablilities) { if (_impl) { impl->add_capabilities(capablilities); } }
I want to use MAVSDK without modifying it. I want to know if there is another way.
The text was updated successfully, but these errors were encountered: