Browse Source

Plane: move sending of WIND message to GCS namespace

c415-sdk
Peter Barker 5 years ago committed by Andrew Tridgell
parent
commit
f17ea78a6c
  1. 6
      ArduPlane/GCS_Mavlink.cpp
  2. 1
      ArduPlane/GCS_Mavlink.h
  3. 1
      ArduPlane/Plane.h

6
ArduPlane/GCS_Mavlink.cpp

@ -304,9 +304,9 @@ void GCS_MAVLINK_Plane::send_simstate() const @@ -304,9 +304,9 @@ void GCS_MAVLINK_Plane::send_simstate() const
#endif
}
void Plane::send_wind(mavlink_channel_t chan)
void GCS_MAVLINK_Plane::send_wind() const
{
Vector3f wind = ahrs.wind_estimate();
const Vector3f wind = AP::ahrs().wind_estimate();
mavlink_msg_wind_send(
chan,
degrees(atan2f(-wind.y, -wind.x)), // use negative, to give
@ -430,7 +430,7 @@ bool GCS_MAVLINK_Plane::try_send_message(enum ap_message id) @@ -430,7 +430,7 @@ bool GCS_MAVLINK_Plane::try_send_message(enum ap_message id)
case MSG_WIND:
CHECK_PAYLOAD_SIZE(WIND);
plane.send_wind(chan);
send_wind();
break;
case MSG_ADSB_VEHICLE:

1
ArduPlane/GCS_Mavlink.h

@ -31,6 +31,7 @@ protected: @@ -31,6 +31,7 @@ protected:
void send_aoa_ssa();
void send_attitude() const override;
void send_simstate() const override;
void send_wind() const;
bool persist_streamrates() const override { return true; }

1
ArduPlane/Plane.h

@ -763,7 +763,6 @@ private: @@ -763,7 +763,6 @@ private:
void update_load_factor(void);
void send_fence_status(mavlink_channel_t chan);
void send_servo_out(mavlink_channel_t chan);
void send_wind(mavlink_channel_t chan);
void Log_Write_Fast(void);
void Log_Write_Attitude(void);

Loading…
Cancel
Save