ardupilot/libraries/AP_Winch/AP_Winch_PWM.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.5 KiB
C
Raw Permalink Normal View History

/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <AP_Winch/AP_Winch_Backend.h>
2023-03-02 20:48:38 -04:00
#if AP_WINCH_PWM_ENABLED
2020-08-06 22:37:36 -03:00
class AP_Winch_PWM : public AP_Winch_Backend {
public:
using AP_Winch_Backend::AP_Winch_Backend;
// true if winch is healthy
bool healthy() const override;
// control the winch
void update() override;
// returns current length of line deployed
float get_current_length() const override { return line_length; }
// send status to ground station
void send_status(const GCS_MAVLINK &channel) override;
#if HAL_LOGGING_ENABLED
// write log
void write_log() override;
#endif
private:
// update pwm outputs to control winch
void control_winch();
uint32_t control_update_ms; // last time control_winch was called
float line_length; // estimated length of line in meters
};
2023-03-02 20:48:38 -04:00
#endif // AP_WINCH_PWM_ENABLED