12 #include <franka_msgs/ErrorRecoveryAction.h> 17 int main(
int argc,
char** argv) {
18 ros::init(argc, argv,
"franka_control_node");
24 if (!franka_control.
init(public_node_handle, node_handle)) {
25 ROS_ERROR(
"franka_control_node: Failed to initialize FrankaHW class. Shutting down!");
31 std::atomic_bool has_error(
false);
37 node_handle,
"error_recovery",
38 [&](
const franka_msgs::ErrorRecoveryGoalConstPtr&) {
42 recovery_action_server.setSucceeded();
45 recovery_action_server.setAborted(franka_msgs::ErrorRecoveryResult(), ex.what());
55 recovery_action_server.start();
69 control_manager.
update(now, now - last_time);
81 if (period.
toSec() == 0.0) {
83 control_manager.
update(now, period,
true);
85 franka_control.
reset();
87 control_manager.
update(now, period);
virtual void enforceLimits(const ros::Duration &period)
virtual bool controllerActive() const noexcept
virtual void update(const franka::RobotState &robot_state)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
virtual void checkJointLimits()
virtual void control(const std::function< bool(const ros::Time &, const ros::Duration &)> &ros_callback) const
int main(int argc, char **argv)
void setupServices(franka::Robot &robot, ros::NodeHandle &node_handle, ServiceContainer &services)
virtual franka::Robot & robot() const
virtual bool init(ros::NodeHandle &root_nh, ros::NodeHandle &robot_hw_nh) override
void update(const ros::Time &time, const ros::Duration &period, bool reset_controllers=false)
void automaticErrorRecovery()