Permalink
Browse files

Rover: send PID to GCS regardless of mode

Also add some comments
  • Loading branch information...
rmackay9 committed Jan 1, 2018
1 parent d3d46a7 commit 5167ec7708d5152797c95367a8ff2a4835df61ac
Showing with 4 additions and 8 deletions.
  1. +4 −2 APMrover2/GCS_Mavlink.cpp
  2. +0 −6 APMrover2/mode.h
@@ -222,7 +222,8 @@ void Rover::send_rangefinder(mavlink_channel_t chan)
void Rover::send_pid_tuning(mavlink_channel_t chan)
{
const DataFlash_Class::PID_Info *pid_info;
if ((g.gcs_pid_mask & 1) && (!control_mode->manual_steering())) {
// steering PID
if (g.gcs_pid_mask & 1) {
pid_info = &g2.attitude_control.get_steering_rate_pid().get_pid_info();
mavlink_msg_pid_tuning_send(chan, PID_TUNING_STEER,
degrees(pid_info->desired),
@@ -235,7 +236,8 @@ void Rover::send_pid_tuning(mavlink_channel_t chan)
return;
}
}
if ((g.gcs_pid_mask & 2) && (control_mode->auto_throttle())) {
// speed to throttle PID
if (g.gcs_pid_mask & 2) {
pid_info = &g2.attitude_control.get_throttle_speed_pid().get_pid_info();
float speed = 0.0f;
g2.attitude_control.get_forward_speed(speed);
View
@@ -42,9 +42,6 @@ class Mode
// return if in non-manual mode : AUTO, GUIDED, RTL
virtual bool is_autopilot_mode() const { return false; }
// returns true if steering is directly controlled by RC
virtual bool manual_steering() const { return false; }
// returns true if the throttle is controlled automatically
virtual bool auto_throttle() { return is_autopilot_mode(); }
@@ -309,9 +306,6 @@ class ModeManual : public Mode
// methods that affect movement of the vehicle in this mode
void update() override;
// attributes of the mode
bool manual_steering() const override { return true; }
// attributes for mavlink system status reporting
bool has_manual_input() const override { return true; }
bool attitude_stabilized() const override { return false; }

0 comments on commit 5167ec7

Please sign in to comment.