mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 03:33:34 +08:00
payload_deliverer: Add gripper state output to "status" CLI output
- Previously it was hard to check which state the gripper was in (GRAB/GRABBED/ etc), not even whether it was correctly initialized, this commit adds that functionality
This commit is contained in:
@@ -127,3 +127,26 @@ void Gripper::publish_gripper_command(const int8_t gripper_command)
|
||||
gripper.command = gripper_command;
|
||||
_gripper_pub.publish(gripper);
|
||||
}
|
||||
|
||||
const char *Gripper::get_state_str() const
|
||||
{
|
||||
switch (_state) {
|
||||
case GripperState::GRABBING:
|
||||
return "GRABBING";
|
||||
|
||||
case GripperState::GRABBED:
|
||||
return "GRABBED";
|
||||
|
||||
case GripperState::RELEASING:
|
||||
return "RELEASING";
|
||||
|
||||
case GripperState::RELEASED:
|
||||
return "RELEASED";
|
||||
|
||||
case GripperState::IDLE:
|
||||
return "IDLE";
|
||||
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user