Automatize automatic error recovery
ROS kinetic, Ubuntu 16.04, kernel 4.8.15-rt10, libfranka 0.5.0, franka_ros 0.6.0
I'm working with a Franka Emika Panda (docs) and trying to setup a way for the robot to automatically recover from an error state. I implemented a simple action client to call the service for automatic error recovery and I would like to send the goal automatically if the robot is in an error state.
Being an error, I can't try-catch it like I would with an exception. I found that robot_state.current_errors (from franka::RobotState) is an array that's either empty or has the name of the errors at that moment and thought to use that for an if condition to trigger the service call. I have two issues here:
- I want to iterate through the list of errors for cosmetic purposes to print them and coming from python I thought of a for-in-loop like for (const franka::Errors& e : robot_state.current_errors.iterator()) but I can't manage use it. Is it because it's not implemented for the franka::Errors class?
- I can't figure out where to get the robot state from: I can't instantiate a franka::Robot because that is already controlled by the franka_control_node; this node doens't seem to provide a way to get the state or something, however franka_hw::FrankaStateInterface does have a getRobotState() from the FrankaStateHandle, which I don't know how to get.