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:
Junwoo Hwang
2022-09-23 07:41:51 +02:00
committed by Beat Küng
parent e65d48c070
commit 13d565d707
4 changed files with 43 additions and 0 deletions
+23
View File
@@ -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";
}
}