Remote buttons on Vision-hub or MAVlink-server
-
I want to get information from the remote controller for the state of each channel (the idea is to trigger some functionalities when a certain button is pressed) I managed to get some data from the MPA "mavlink_to_gcs".. But I believe this is probably low frequency.. I wonder if vision-hub outputs this kind of data or do I have to connect directly to mavlink-server? (the documentation says to avoid connecting to mavlink-server directly) Maybe via "mavlink_onboard" or "mavlink_sys_status"
Thank You
-
@Caio-Licínio-Vasconcelos-Pantarotto What kind of remote controller are you using? What platform are you on (e.g. Which drone or development board)? What software release are you using on that platform?
-
@Eric-Katzfey Hi I have an out of the box Starling.. voxl2(up-to-date), ELRS 915MHz. I was currently trying to subscribe to "mavlink_onboard".. following the Portal Header source code I managed to get
if (msg->msgid == MAVLINK_MSG_ID_HEARTBEAT){
bool armed = (mavlink_msg_heartbeat_get_base_mode(msg) & MAV_MODE_FLAG_SAFETY_ARMED);
uint8_t main_mode = (mavlink_msg_heartbeat_get_custom_mode(msg) & 0x00FF0000) >> 16;
uint32_t sub_mode = (mavlink_msg_heartbeat_get_custom_mode(msg) & 0xFF000000) >> 24;sub_mode its always 0.. I don't know what sub_mode is supposed to be.. but I would like for example to when I press the right button I wanna trigger something like snapshot. I also wonder if the best way to do this is to use the send-command hires snapshot or maybe get the camera feed directly. I want to make a client pipe that will receive the photo and some other info from other pipes, like vio, and tof.. it would be great to find a way where when I press the button all this info is captured and saved on disk.. and would be good that all of this happens at same time (or the closest as possible). Thank You for the reply.
-
@Caio-Licínio-Vasconcelos-Pantarotto You need to look for MAVLINK_MSG_ID_RC_CHANNELS. That contains the raw channel values for all of the RC channels (including the switches, buttons, etc.)
-
@Eric-Katzfey Thank You! it worked great.