mavlink: remove unused methods

This commit is contained in:
Julian Oes
2021-11-09 16:05:25 +01:00
committed by Matthias Grob
parent 97aa06cc19
commit e2e908d0fc
2 changed files with 2 additions and 45 deletions
-35
View File
@@ -1954,41 +1954,6 @@ MavlinkReceiver::handle_message_trajectory_representation_waypoints(mavlink_mess
_trajectory_waypoint_pub.publish(trajectory_waypoint);
}
int
MavlinkReceiver::decode_switch_pos_n(uint16_t buttons, unsigned sw)
{
bool on = (buttons & (1 << sw));
if (sw < MOM_SWITCH_COUNT) {
bool last_on = (_mom_switch_state & (1 << sw));
/* first switch is 2-pos, rest is 2 pos */
unsigned state_count = (sw == 0) ? 3 : 2;
/* only transition on low state */
if (!on && (on != last_on)) {
_mom_switch_pos[sw]++;
if (_mom_switch_pos[sw] == state_count) {
_mom_switch_pos[sw] = 0;
}
}
/* state_count - 1 is the number of intervals and 1000 is the range,
* with 2 states 0 becomes 0, 1 becomes 1000. With
* 3 states 0 becomes 0, 1 becomes 500, 2 becomes 1000,
* and so on for more states.
*/
return (_mom_switch_pos[sw] * 1000) / (state_count - 1) + 1000;
} else {
/* return the current state */
return on * 1000 + 1000;
}
}
void
MavlinkReceiver::handle_message_rc_channels(mavlink_message_t *msg)
{