Cut case MAVLINK_MSG_ID_HIL_OPTICAL_FLOW content and paste into handle_message_hil_optical_flow() method.

This commit is contained in:
mcsauder 2019-02-28 10:14:21 -07:00 committed by Beat Küng
parent 24e55e4d4d
commit 8b42045546
2 changed files with 9 additions and 3 deletions

View File

@ -333,6 +333,7 @@ private:
void handle_message(mavlink_message_t *msg, bool publish);
void handle_message_distance_sensor(const mavlink_message_t *msg);
void handle_message_landing_target(const mavlink_message_t *msg);
void handle_message_optical_flow(const mavlink_message_t *msg);
void parameters_update(bool force);
void poll_topics();

View File

@ -357,9 +357,7 @@ void Simulator::handle_message(mavlink_message_t *msg, bool publish)
break;
case MAVLINK_MSG_ID_HIL_OPTICAL_FLOW:
mavlink_hil_optical_flow_t flow;
mavlink_msg_hil_optical_flow_decode(msg, &flow);
publish_flow_topic(&flow);
handle_message_optical_flow(msg);
break;
case MAVLINK_MSG_ID_ODOMETRY:
@ -522,6 +520,13 @@ void Simulator::handle_message_landing_target(const mavlink_message_t *msg)
orb_publish_auto(ORB_ID(irlock_report), &_irlock_report_pub, &report, &irlock_multi, ORB_PRIO_HIGH);
}
void Simulator::handle_message_optical_flow(const mavlink_message_t *msg)
{
mavlink_hil_optical_flow_t flow;
mavlink_msg_hil_optical_flow_decode(msg, &flow);
publish_flow_topic(&flow);
}
void Simulator::send_mavlink_message(const mavlink_message_t &aMsg)
{
uint8_t buf[MAVLINK_MAX_PACKET_LEN];