mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-05 07:28:29 -04:00
Rover: send PID to GCS regardless of mode
Also add some comments
This commit is contained in:
parent
7f61734b4d
commit
a190d62813
@ -222,7 +222,8 @@ void Rover::send_rangefinder(mavlink_channel_t chan)
|
|||||||
void Rover::send_pid_tuning(mavlink_channel_t chan)
|
void Rover::send_pid_tuning(mavlink_channel_t chan)
|
||||||
{
|
{
|
||||||
const DataFlash_Class::PID_Info *pid_info;
|
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();
|
pid_info = &g2.attitude_control.get_steering_rate_pid().get_pid_info();
|
||||||
mavlink_msg_pid_tuning_send(chan, PID_TUNING_STEER,
|
mavlink_msg_pid_tuning_send(chan, PID_TUNING_STEER,
|
||||||
degrees(pid_info->desired),
|
degrees(pid_info->desired),
|
||||||
@ -235,7 +236,8 @@ void Rover::send_pid_tuning(mavlink_channel_t chan)
|
|||||||
return;
|
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();
|
pid_info = &g2.attitude_control.get_throttle_speed_pid().get_pid_info();
|
||||||
float speed = 0.0f;
|
float speed = 0.0f;
|
||||||
g2.attitude_control.get_forward_speed(speed);
|
g2.attitude_control.get_forward_speed(speed);
|
||||||
|
@ -42,9 +42,6 @@ public:
|
|||||||
// return if in non-manual mode : AUTO, GUIDED, RTL
|
// return if in non-manual mode : AUTO, GUIDED, RTL
|
||||||
virtual bool is_autopilot_mode() const { return false; }
|
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
|
// returns true if the throttle is controlled automatically
|
||||||
virtual bool auto_throttle() { return is_autopilot_mode(); }
|
virtual bool auto_throttle() { return is_autopilot_mode(); }
|
||||||
|
|
||||||
@ -309,9 +306,6 @@ public:
|
|||||||
// methods that affect movement of the vehicle in this mode
|
// methods that affect movement of the vehicle in this mode
|
||||||
void update() override;
|
void update() override;
|
||||||
|
|
||||||
// attributes of the mode
|
|
||||||
bool manual_steering() const override { return true; }
|
|
||||||
|
|
||||||
// attributes for mavlink system status reporting
|
// attributes for mavlink system status reporting
|
||||||
bool has_manual_input() const override { return true; }
|
bool has_manual_input() const override { return true; }
|
||||||
bool attitude_stabilized() const override { return false; }
|
bool attitude_stabilized() const override { return false; }
|
||||||
|
Loading…
Reference in New Issue
Block a user