123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #pragma once
- #include <AP_Gripper/AP_Gripper_Backend.h>
- #include <SRV_Channel/SRV_Channel.h>
- class AP_Gripper_Servo : public AP_Gripper_Backend {
- public:
- AP_Gripper_Servo(struct AP_Gripper::Backend_Config &_config) :
- AP_Gripper_Backend(_config) { }
-
- void grab() override;
-
- void release() override;
-
- bool grabbed() const override;
-
- bool released() const override;
-
- bool valid() const override;
- protected:
-
- void init_gripper() override;
-
- void update_gripper() override;
- private:
- uint32_t action_timestamp;
- const uint16_t action_time = 3000;
- bool has_state_pwm(const uint16_t pwm) const;
- #if CONFIG_HAL_BOARD == HAL_BOARD_SITL
- bool is_releasing;
- bool is_released;
- #endif
- };
|