Browse Source

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

sbg
mcsauder 6 years ago committed by Beat Küng
parent
commit
8b42045546
  1. 1
      src/modules/simulator/simulator.h
  2. 11
      src/modules/simulator/simulator_mavlink.cpp

1
src/modules/simulator/simulator.h

@ -333,6 +333,7 @@ private: @@ -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();

11
src/modules/simulator/simulator_mavlink.cpp

@ -357,9 +357,7 @@ void Simulator::handle_message(mavlink_message_t *msg, bool publish) @@ -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) @@ -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];

Loading…
Cancel
Save