AP_Gripper: servo gripper not valid unless aux channel assigned
This commit is contained in:
parent
4c320373eb
commit
b4d1d0f918
@ -35,7 +35,7 @@ public:
|
||||
virtual void release() = 0;
|
||||
|
||||
// valid - returns true if the backend should be working
|
||||
bool valid() const { return true; };
|
||||
virtual bool valid() const { return true; };
|
||||
|
||||
// released - returns true if currently in released position
|
||||
virtual bool released() const = 0;
|
||||
|
@ -55,3 +55,14 @@ bool AP_Gripper_Servo::grabbed() const
|
||||
|
||||
// type-specific periodic updates:
|
||||
void AP_Gripper_Servo::update_gripper() { };
|
||||
|
||||
bool AP_Gripper_Servo::valid() const
|
||||
{
|
||||
if (!AP_Gripper_Backend::valid()) {
|
||||
return false;
|
||||
}
|
||||
if (!RC_Channel_aux::function_assigned(RC_Channel_aux::k_gripper)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -36,6 +36,9 @@ public:
|
||||
// released - returns true if gripper in released state
|
||||
bool released() const override;
|
||||
|
||||
// valid - returns true if the backend should be working
|
||||
bool valid() const;
|
||||
|
||||
protected:
|
||||
|
||||
// type-specific intiailisations:
|
||||
|
Loading…
Reference in New Issue
Block a user