Browse Source

Plane: move sending of POSITION_TARGET_GLOBAL_INT up

master
Peter Barker 7 years ago committed by Peter Barker
parent
commit
cdf4128900
  1. 13
      ArduPlane/GCS_Mavlink.cpp
  2. 2
      ArduPlane/GCS_Mavlink.h
  3. 1
      ArduPlane/Plane.h

13
ArduPlane/GCS_Mavlink.cpp

@ -192,8 +192,12 @@ void Plane::send_nav_controller_output(mavlink_channel_t chan) @@ -192,8 +192,12 @@ void Plane::send_nav_controller_output(mavlink_channel_t chan)
nav_controller->crosstrack_error());
}
void Plane::send_position_target_global_int(mavlink_channel_t chan)
void GCS_MAVLINK_Plane::send_position_target_global_int()
{
if (plane.control_mode == MANUAL) {
return;
}
Location &next_WP_loc = plane.next_WP_loc;
mavlink_msg_position_target_global_int_send(
chan,
AP_HAL::millis(), // time_boot_ms
@ -405,13 +409,6 @@ bool GCS_MAVLINK_Plane::try_send_message(enum ap_message id) @@ -405,13 +409,6 @@ bool GCS_MAVLINK_Plane::try_send_message(enum ap_message id)
}
break;
case MSG_POSITION_TARGET_GLOBAL_INT:
if (plane.control_mode != MANUAL) {
CHECK_PAYLOAD_SIZE(POSITION_TARGET_GLOBAL_INT);
plane.send_position_target_global_int(chan);
}
break;
case MSG_SERVO_OUT:
#if HIL_SUPPORT
if (plane.g.hil_mode == 1) {

2
ArduPlane/GCS_Mavlink.h

@ -32,6 +32,8 @@ protected: @@ -32,6 +32,8 @@ protected:
MAV_RESULT handle_command_preflight_calibration(const mavlink_command_long_t &packet) override;
MAV_RESULT _handle_command_preflight_calibration(const mavlink_command_long_t &packet) override;
void send_position_target_global_int() override;
virtual bool in_hil_mode() const override;
void send_attitude() const override;

1
ArduPlane/Plane.h

@ -772,7 +772,6 @@ private: @@ -772,7 +772,6 @@ private:
void update_sensor_status_flags(void);
void send_extended_status1(mavlink_channel_t chan);
void send_nav_controller_output(mavlink_channel_t chan);
void send_position_target_global_int(mavlink_channel_t chan);
void send_servo_out(mavlink_channel_t chan);
void send_vfr_hud(mavlink_channel_t chan);
void send_simstate(mavlink_channel_t chan);

Loading…
Cancel
Save