24 services[
"hebiros/"+group_name+
"/size"] =
26 "hebiros/"+group_name+
"/size",
29 services[
"hebiros/"+group_name+
"/set_feedback_frequency"] =
31 SetFeedbackFrequencySrv::Response>(
32 "hebiros/"+group_name+
"/set_feedback_frequency",
35 services[
"hebiros/"+group_name+
"/set_command_lifetime"] =
37 SetCommandLifetimeSrv::Response>(
38 "hebiros/"+group_name+
"/set_command_lifetime",
41 services[
"hebiros/"+group_name+
"/send_command_with_acknowledgement"] =
43 SendCommandWithAcknowledgementSrv::Response>(
44 "hebiros/"+group_name+
"/send_command_with_acknowledgement",
49 EntryListSrv::Request &req, EntryListSrv::Response &res) {
55 AddGroupFromNamesSrv::Request &req, AddGroupFromNamesSrv::Response &res,
56 std::map<std::string, std::string> joint_full_names) {
58 auto& registry = HebirosGroupRegistry::Instance();
60 if (registry.hasGroup(req.group_name)) {
62 ROS_WARN(
"Group [%s] already exists", req.group_name.c_str());
83 AddGroupFromNamesSrv::Request &req, AddGroupFromNamesSrv::Response &res) {
85 std::map<std::string, std::string> joint_full_names;
91 AddGroupFromURDFSrv::Request &req, AddGroupFromURDFSrv::Response &res) {
93 std::string urdf_name(
"robot_description");
97 ROS_WARN(
"Could not load robot_description");
104 std::set<std::string> joint_names;
105 std::set<std::string> family_names;
106 std::map<std::string, std::string> joint_full_names;
109 urdf_model.getRoot().get());
111 AddGroupFromNamesSrv::Request names_req;
112 AddGroupFromNamesSrv::Response names_res;
113 names_req.group_name = req.group_name;
114 names_req.families.insert(names_req.families.end(), family_names.begin(), family_names.end());
115 names_req.names.insert(names_req.names.end(), joint_names.begin(), joint_names.end());
121 AddModelFromURDFSrv::Request &req, AddModelFromURDFSrv::Response &res) {
127 SizeSrv::Request &req, SizeSrv::Response &res, std::string group_name) {
135 SetFeedbackFrequencySrv::Request &req, SetFeedbackFrequencySrv::Response &res,
136 std::string group_name) {
146 SetCommandLifetimeSrv::Request &req, SetCommandLifetimeSrv::Response &res,
147 std::string group_name) {
157 SendCommandWithAcknowledgementSrv::Request &req,
158 SendCommandWithAcknowledgementSrv::Response &res, std::string group_name) {
160 std_srvs::Empty empty_srv;
void command(hebiros::CommandMsg command_msg, std::string group_name)
void registerGroupClients(std::string group_name)
bool addGroup(AddGroupFromNamesSrv::Request &req, AddGroupFromNamesSrv::Response &res, const std::map< std::string, std::string > &joint_full_names, std::unique_ptr< HebirosGroup > group_tmp)
static HebirosPublishersGazebo publishers_gazebo
bool addModelFromURDF(AddModelFromURDFSrv::Request &req, AddModelFromURDFSrv::Response &res)
bool setCommandLifetime(SetCommandLifetimeSrv::Request &req, SetCommandLifetimeSrv::Response &res, std::string group_name)
bool sendCommandWithAcknowledgement(SendCommandWithAcknowledgementSrv::Request &req, SendCommandWithAcknowledgementSrv::Response &res, std::string group_name)
static HebirosSubscribersGazebo subscribers_gazebo
bool addGroupFromNames(AddGroupFromNamesSrv::Request &req, AddGroupFromNamesSrv::Response &res)
bool setFeedbackFrequency(SetFeedbackFrequencySrv::Request &req, SetFeedbackFrequencySrv::Response &res, std::string group_name)
void addJointChildren(std::set< std::string > &names, std::set< std::string > &families, std::map< std::string, std::string > &full_names, const urdf::Link *link)
void registerGroupPublishers(std::string group_name)
void registerNodeServices()
bool addGroup(hebiros::AddGroupFromNamesSrv::Request &req)
bool size(SizeSrv::Request &req, SizeSrv::Response &res, std::string group_name)
bool addGroup(AddGroupFromNamesSrv::Request &req, AddGroupFromNamesSrv::Response &res, std::map< std::string, std::string > joint_full_names)
static std::shared_ptr< ros::NodeHandle > n_ptr
bool addModelFromURDF(AddModelFromURDFSrv::Request &req, AddModelFromURDFSrv::Response &res)
void registerGroupServices(std::string group_name)
bool entryList(EntryListSrv::Request &req, EntryListSrv::Response &res)
URDF_EXPORT bool initParam(const std::string ¶m)
bool setCommandLifetime(hebiros::SetCommandLifetimeSrv::Request &req, std::string group_name)
void registerGroupActions(std::string group_name)
static HebirosServicesGazebo services_gazebo
bool setFeedbackFrequency(hebiros::SetFeedbackFrequencySrv::Request &req, std::string group_name)
void registerGroupSubscribers(std::string group_name)
bool size(SizeSrv::Request &req, SizeSrv::Response &res, std::string group_name)
static HebirosClients clients
static std::map< std::string, ros::ServiceServer > services
static HebirosActions actions
bool setCommandLifetime(SetCommandLifetimeSrv::Request &req, SetCommandLifetimeSrv::Response &res, std::string group_name)
bool addGroupFromURDF(AddGroupFromURDFSrv::Request &req, AddGroupFromURDFSrv::Response &res)
bool setFeedbackFrequency(SetFeedbackFrequencySrv::Request &req, SetFeedbackFrequencySrv::Response &res, std::string group_name)
bool addGroupFromURDF(AddGroupFromURDFSrv::Request &req, AddGroupFromURDFSrv::Response &res)