12 #include <franka_msgs/SetCartesianImpedance.h> 13 #include <franka_msgs/SetEEFrame.h> 14 #include <franka_msgs/SetForceTorqueCollisionBehavior.h> 15 #include <franka_msgs/SetFullCollisionBehavior.h> 16 #include <franka_msgs/SetJointImpedance.h> 17 #include <franka_msgs/SetKFrame.h> 18 #include <franka_msgs/SetLoad.h> 34 const std::string& name,
35 std::function<
void(
typename T::Request&,
typename T::Response&)> handler) {
36 return node_handle.
advertiseService<
typename T::Request,
typename T::Response>(
37 name, [name, handler](
typename T::Request& request,
typename T::Response& response) {
39 handler(request, response);
40 response.success =
true;
44 response.success =
false;
45 response.error = ex.what();
62 template <
typename T,
typename... TArgs>
90 const franka_msgs::SetCartesianImpedance::Request& req,
91 franka_msgs::SetCartesianImpedance::Response& res);
101 const franka_msgs::SetJointImpedance::Request& req,
102 franka_msgs::SetJointImpedance::Response& res);
112 const franka_msgs::SetEEFrame::Request& req,
113 franka_msgs::SetEEFrame::Response& res);
123 const franka_msgs::SetKFrame::Request& req,
124 franka_msgs::SetKFrame::Response& res);
135 const franka_msgs::SetForceTorqueCollisionBehavior::Request& req,
136 franka_msgs::SetForceTorqueCollisionBehavior::Response& res);
146 const franka_msgs::SetFullCollisionBehavior::Request& req,
147 franka_msgs::SetFullCollisionBehavior::Response& res);
157 const franka_msgs::SetLoad::Request& req,
158 franka_msgs::SetLoad::Response& res);
void setKFrame(franka::Robot &robot, const franka_msgs::SetKFrame::Request &req, franka_msgs::SetKFrame::Response &res)
Callback for the service interface to franka::robot::setKFrame.
This class serves as container that gathers all possible service interfaces to a libfranka robot inst...
void setJointImpedance(franka::Robot &robot, const franka_msgs::SetJointImpedance::Request &req, franka_msgs::SetJointImpedance::Response &res)
Callback for the service interface to franka::robot::setJointImpedance.
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
void setLoad(franka::Robot &robot, const franka_msgs::SetLoad::Request &req, franka_msgs::SetLoad::Response &res)
Callback for the service interface to franka::robot::setLoad.
std::vector< ros::ServiceServer > services_
void setForceTorqueCollisionBehavior(franka::Robot &robot, const franka_msgs::SetForceTorqueCollisionBehavior::Request &req, franka_msgs::SetForceTorqueCollisionBehavior::Response &res)
Callback for the service interface to franka::robot::setForceTorqueCollisionBehavior.
void setupServices(franka::Robot &robot, ros::NodeHandle &node_handle, ServiceContainer &services)
Sets up all services relevant for a libfranka robot inside a service container.
ServiceContainer & advertiseService(TArgs &&...args)
Advertises and adds a service to the container class.
void setFullCollisionBehavior(franka::Robot &robot, const franka_msgs::SetFullCollisionBehavior::Request &req, franka_msgs::SetFullCollisionBehavior::Response &res)
Callback for the service interface to franka::robot::setFullCollisionBehavior.
ros::ServiceServer advertiseService(ros::NodeHandle &node_handle, const std::string &name, std::function< void(typename T::Request &, typename T::Response &)> handler)
Advertises a service that acts according to the handler function which is used in the service callbac...
#define ROS_DEBUG_STREAM(args)
void setCartesianImpedance(franka::Robot &robot, const franka_msgs::SetCartesianImpedance::Request &req, franka_msgs::SetCartesianImpedance::Response &res)
Callback for the service interface to franka::robot::setCartesianImpedance.
#define ROS_ERROR_STREAM(args)
void setEEFrame(franka::Robot &robot, const franka_msgs::SetEEFrame::Request &req, franka_msgs::SetEEFrame::Response &res)
Callback for the service interface to franka::robot::setEEFrame.