7 #include <control_msgs/GripperCommandAction.h> 10 #include <franka_gripper/GraspAction.h> 11 #include <franka_gripper/GraspEpsilon.h> 12 #include <franka_gripper/HomingAction.h> 13 #include <franka_gripper/MoveAction.h> 14 #include <franka_gripper/StopAction.h> 20 #include <sensor_msgs/JointState.h> 107 std::unique_ptr<actionlib::SimpleActionServer<franka_gripper::StopAction>>
action_stop_;
108 std::unique_ptr<actionlib::SimpleActionServer<franka_gripper::HomingAction>>
action_homing_;
109 std::unique_ptr<actionlib::SimpleActionServer<franka_gripper::MoveAction>>
action_move_;
110 std::unique_ptr<actionlib::SimpleActionServer<franka_gripper::GraspAction>>
action_grasp_;
111 std::unique_ptr<actionlib::SimpleActionServer<control_msgs::GripperCommandAction>>
action_gc_;
134 void onStopGoal(
const franka_gripper::StopGoalConstPtr& goal);
135 void onHomingGoal(
const franka_gripper::HomingGoalConstPtr& goal);
136 void onMoveGoal(
const franka_gripper::MoveGoalConstPtr& goal);
137 void onGraspGoal(
const franka_gripper::GraspGoalConstPtr& goal);
149 bool grasp(
double width,
double speed,
double force,
const franka_gripper::GraspEpsilon& epsilon);
157 bool move(
double width,
double speed);
control_toolbox::Pid pid2_
void setConfig(const Config &&config)
void starting(const ros::Time &) override
std::unique_ptr< actionlib::SimpleActionServer< franka_gripper::HomingAction > > action_homing_
double force_desired
Desired force with which to grasp objects, if grasps succeed [N].
void control(hardware_interface::JointHandle &joint, control_toolbox::Pid &, double q_d, double dq_d, double f_d, const ros::Duration &period)
const double kDefaultGripperActionWidthTolerance
When width between fingers is below this, the gripper action succeeds [m].
Gripper is not actively controlled, but tracks the other finger to simulate a mimicked joint...
const int kGraspConsecutiveSamples
How many times the speed has to drop below resting threshold before the grasping will be checked...
Simulate the franka_gripper_node.
void waitUntilStateChange()
void onGraspGoal(const franka_gripper::GraspGoalConstPtr &goal)
void onMoveGoal(const franka_gripper::MoveGoalConstPtr &goal)
bool move(double width, double speed)
libfranka-like method to move the gripper to a certain position
std::unique_ptr< actionlib::SimpleActionServer< franka_gripper::GraspAction > > action_grasp_
control_toolbox::Pid pid1_
Gripper is tracking a desired position and velocity.
const double kDefaultGripperActionSpeed
How fast shall the gripper execute gripper command actions? [m/s].
void onHomingGoal(const franka_gripper::HomingGoalConstPtr &goal)
franka_gripper::GraspEpsilon tolerance
Tolerance range to check if grasping succeeds.
realtime_tools::RealtimePublisher< sensor_msgs::JointState > pub_
double width_desired
Desired width between both fingers [m].
double tolerance_gripper_action_
[m] inner + outer position tolerances used during gripper action
bool init(hardware_interface::EffortJointInterface *hw, ros::NodeHandle &nh) override
void update(const ros::Time &now, const ros::Duration &period) override
franka_hw::TriggerRate rate_trigger_
Gripper is holding position and tracking zero velocity while mainting a desired force.
hardware_interface::JointHandle finger1_
void transition(const State &&state, const Config &&config)
double tolerance_move_
[m] inner + outer position tolerances used during grasp
bool grasp(double width, double speed, double force, const franka_gripper::GraspEpsilon &epsilon)
libfranka-like method to grasp an object with the gripper
std::unique_ptr< actionlib::SimpleActionServer< franka_gripper::MoveAction > > action_move_
Gripper is tracking a desired position and velocity.
std::unique_ptr< actionlib::SimpleActionServer< control_msgs::GripperCommandAction > > action_gc_
const double kGraspRestingThreshold
Below which speed the target width should be checked to abort or succeed the grasp action [m/s]...
const double kMaxFingerWidth
void setState(const State &&state)
void interrupt(const std::string &message, const State &except)
Interrupt any running action server unless the gripper is currently in a specific state...
const double kDefaultMoveWidthTolerance
When width between fingers is below this, the move action succeeds [m].
double speed_desired
Desired magnitude of the speed with which fingers should move [m/s].
void onGripperActionGoal(const control_msgs::GripperCommandGoalConstPtr &goal)
void onStopGoal(const franka_gripper::StopGoalConstPtr &goal)
hardware_interface::JointHandle finger2_
std::unique_ptr< actionlib::SimpleActionServer< franka_gripper::StopAction > > action_stop_