Cut case MAVLINK_MSG_ID_HIL_GPS content and paste into handle_message_hil_gps() method.

This commit is contained in:
mcsauder
2019-03-05 10:27:57 -07:00
committed by Beat Küng
parent b705bf6b1c
commit 801cbc856e
2 changed files with 14 additions and 8 deletions

View File

@@ -310,14 +310,7 @@ void Simulator::handle_message(mavlink_message_t *msg)
break;
case MAVLINK_MSG_ID_HIL_GPS:
mavlink_hil_gps_t gps_sim;
mavlink_msg_hil_gps_decode(msg, &gps_sim);
if (_publish) {
//PX4_WARN("FIXME: Need to publish GPS topic. Not done yet.");
}
update_gps(&gps_sim);
handle_message_hil_gps(msg);
break;
case MAVLINK_MSG_ID_RC_CHANNELS:
@@ -351,6 +344,18 @@ void Simulator::handle_message_distance_sensor(const mavlink_message_t *msg)
publish_distance_topic(&dist);
}
void Simulator::handle_message_hil_gps(const mavlink_message_t *msg)
{
mavlink_hil_gps_t gps_sim;
mavlink_msg_hil_gps_decode(msg, &gps_sim);
if (_publish) {
//PX4_WARN("FIXME: Need to publish GPS topic. Not done yet.");
}
update_gps(&gps_sim);
}
void Simulator::handle_message_hil_sensor(const mavlink_message_t *msg)
{
mavlink_hil_sensor_t imu;