mia_hand_driver  rel 1.0.0
ros_driver.h
Go to the documentation of this file.
1 /*********************************************************************************************************
2 Modifyed by Author: Prensilia srl
3 Desc: Ros node of the Mia hand cpp driver.
4 
5 version 1.0
6 
7 **********************************************************************************************************/
8 
9 
10 #ifndef MIA_HAND_ROS_DRIVER_H
11 #define MIA_HAND_ROS_DRIVER_H
12 
14 #include "ros/ros.h"
15 
16 #include "mia_hand_msgs/FingersData.h"
17 #include "mia_hand_msgs/FingersStrainGauges.h"
18 #include "mia_hand_msgs/GraspRef.h"
19 #include "mia_hand_msgs/ConnectSerial.h"
20 
21 #include "std_msgs/Int16.h"
22 
23 #include "std_srvs/Empty.h"
24 #include "std_srvs/SetBool.h"
25 #include "std_srvs/Trigger.h"
26 
27 namespace mia_hand
28 {
29 class ROSDriver
30 {
31 public:
32 
38  ROSDriver(ros::NodeHandle& nh, ros::NodeHandle& nh_priv);
39 
40 private:
41 
45  CppDriver mia_;
46 
47  bool is_connected_;
48  bool was_connected_;
49 
50  ros::WallTimer publish_data_tmr_;
51  ros::WallTimer check_connection_tmr_;
52 
53  ros::NodeHandle& nh_;
54  ros::NodeHandle& nh_priv_;
56 
58  /* Subscribers
59  */
60  ros::Subscriber thu_mot_trgt_pos_;
61  ros::Subscriber ind_mot_trgt_pos_;
62  ros::Subscriber mrl_mot_trgt_pos_;
63 
64  ros::Subscriber thu_mot_trgt_spe_;
65  ros::Subscriber ind_mot_trgt_spe_;
66  ros::Subscriber mrl_mot_trgt_spe_;
67 
68  ros::Subscriber thu_fin_trgt_for_;
69  ros::Subscriber ind_fin_trgt_for_;
70  ros::Subscriber mrl_fin_trgt_for_;
71 
72  ros::Subscriber thu_cyl_grasp_ref_;
73  ros::Subscriber ind_cyl_grasp_ref_;
74  ros::Subscriber mrl_cyl_grasp_ref_;
75 
76  ros::Subscriber thu_pin_grasp_ref_;
77  ros::Subscriber ind_pin_grasp_ref_;
78  ros::Subscriber mrl_pin_grasp_ref_;
79 
80  ros::Subscriber thu_lat_grasp_ref_;
81  ros::Subscriber ind_lat_grasp_ref_;
82  ros::Subscriber mrl_lat_grasp_ref_;
83 
84  ros::Subscriber thu_sph_grasp_ref_;
85  ros::Subscriber ind_sph_grasp_ref_;
86  ros::Subscriber mrl_sph_grasp_ref_;
87 
88  ros::Subscriber thu_tri_grasp_ref_;
89  ros::Subscriber ind_tri_grasp_ref_;
90  ros::Subscriber mrl_tri_grasp_ref_;
91 
92  ros::Subscriber cyl_grasp_percent_;
93  ros::Subscriber pin_grasp_percent_;
94  ros::Subscriber lat_grasp_percent_;
95  ros::Subscriber sph_grasp_percent_;
96  ros::Subscriber tri_grasp_percent_;
97 
98  /* Publishers
99  */
100  ros::Publisher mot_pos_info_;
101  ros::Publisher mot_spe_info_;
102  ros::Publisher mot_cur_info_;
103  ros::Publisher fin_for_info_;
104 
105  /* Services
106  */
107  ros::ServiceServer connect_to_port_;
108  ros::ServiceServer disconnect_;
109 
110  ros::ServiceServer switch_pos_stream_;
111  ros::ServiceServer switch_spe_stream_;
112  ros::ServiceServer switch_ana_stream_;
113  ros::ServiceServer switch_cur_stream_;
114 
115  ros::ServiceServer open_cyl_grasp_;
116  ros::ServiceServer open_pin_grasp_;
117  ros::ServiceServer open_lat_grasp_;
118  ros::ServiceServer open_sph_grasp_;
119  ros::ServiceServer open_tri_grasp_;
120 
121  ros::ServiceServer close_cyl_grasp_;
122  ros::ServiceServer close_pin_grasp_;
123  ros::ServiceServer close_lat_grasp_;
124  ros::ServiceServer close_sph_grasp_;
125  ros::ServiceServer close_tri_grasp_;
126 
127  void publishDataTmrCallback(const ros::WallTimerEvent& event);
128  void checkConnectionTmrCallback(const ros::WallTimerEvent& event);
129 
130  void initPublishers();
132  void initSubscribersInd();
135  void initServices();
136 
137  /* Subscribers Callback Functions
138  */
139 
144  void thuMotTrgtPosCallback(const std_msgs::Int16::ConstPtr& msg);
145 
150  void indMotTrgtPosCallback(const std_msgs::Int16::ConstPtr& msg);
151 
156  void mrlMotTrgtPosCallback(const std_msgs::Int16::ConstPtr& msg);
157 
158 
159 
164  void thuMotTrgtSpeCallback(const std_msgs::Int16::ConstPtr& msg);
165 
170  void indMotTrgtSpeCallback(const std_msgs::Int16::ConstPtr& msg);
171 
176  void mrlMotTrgtSpeCallback(const std_msgs::Int16::ConstPtr& msg);
177 
178 
184  void thuFinTrgtForCallback(const std_msgs::Int16::ConstPtr& msg);
185 
191  void indFinTrgtForCallback(const std_msgs::Int16::ConstPtr& msg);
192 
198  void mrlFinTrgtForCallback(const std_msgs::Int16::ConstPtr& msg);
199 
206  void thuCylGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
207 
214  void thuPinGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
215 
222  void thuLatGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
223 
230  void thuSphGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
231 
238  void thuTriGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
239 
240 
247  void indCylGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
248 
255  void indPinGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
256 
263  void indLatGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
264 
271  void indSphGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
272 
279  void indTriGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
280 
281 
288  void mrlCylGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
289 
296  void mrlPinGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
297 
304  void mrlLatGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
305 
312  void mrlSphGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
313 
320  void mrlTriGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr& msg);
321 
322 
328  void cylGraspPercentCallback(const std_msgs::Int16::ConstPtr& msg);
329 
335  void pinGraspPercentCallback(const std_msgs::Int16::ConstPtr& msg);
336 
342  void latGraspPercentCallback(const std_msgs::Int16::ConstPtr& msg);
343 
349  void sphGraspPercentCallback(const std_msgs::Int16::ConstPtr& msg);
350 
356  void triGraspPercentCallback(const std_msgs::Int16::ConstPtr& msg);
357 
358  /* Services Callback Functions
359  */
360 
368  bool connectToPortCallback(mia_hand_msgs::ConnectSerial::Request& req,
369  mia_hand_msgs::ConnectSerial::Response& resp);
370 
378  bool disconnectCallback(std_srvs::Trigger::Request& req,
379  std_srvs::Trigger::Response& resp);
380 
387  bool switchPosStreamCallback(std_srvs::SetBool::Request& req,
388  std_srvs::SetBool::Response& resp);
389 
390 
397  bool switchSpeStreamCallback(std_srvs::SetBool::Request& req,
398  std_srvs::SetBool::Response& resp);
399 
406  bool switchAnaStreamCallback(std_srvs::SetBool::Request& req,
407  std_srvs::SetBool::Response& resp);
408 
415  bool switchCurStreamCallback(std_srvs::SetBool::Request& req,
416  std_srvs::SetBool::Response& resp);
417 
424  bool openCylGraspCallback(std_srvs::Empty::Request& req,
425  std_srvs::Empty::Response& resp);
426 
433  bool openPinGraspCallback(std_srvs::Empty::Request& req,
434  std_srvs::Empty::Response& resp);
435 
442  bool openLatGraspCallback(std_srvs::Empty::Request& req,
443  std_srvs::Empty::Response& resp);
444 
451  bool openSphGraspCallback(std_srvs::Empty::Request& req,
452  std_srvs::Empty::Response& resp);
453 
460  bool openTriGraspCallback(std_srvs::Empty::Request& req,
461  std_srvs::Empty::Response& resp);
462 
469  bool closeCylGraspCallback(std_srvs::Empty::Request& req,
470  std_srvs::Empty::Response& resp);
471 
478  bool closePinGraspCallback(std_srvs::Empty::Request& req,
479  std_srvs::Empty::Response& resp);
480 
487  bool closeLatGraspCallback(std_srvs::Empty::Request& req,
488  std_srvs::Empty::Response& resp);
489 
496  bool closeSphGraspCallback(std_srvs::Empty::Request& req,
497  std_srvs::Empty::Response& resp);
498 
505  bool closeTriGraspCallback(std_srvs::Empty::Request& req,
506  std_srvs::Empty::Response& resp);
507 };
508 } // namespace
509 
510 #endif // MIA_HAND_ROS_DRIVER_H
mia_hand::ROSDriver::thu_cyl_grasp_ref_
ros::Subscriber thu_cyl_grasp_ref_
Subscriber to receive the parametrs for cylindrical grasp for the thumb flexion motor.
Definition: ros_driver.h:84
mia_hand::ROSDriver::switchPosStreamCallback
bool switchPosStreamCallback(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
Callback of the service switch_pos_stream_.
Definition: ros_driver.cpp:548
mia_hand::ROSDriver::ind_mot_trgt_spe_
ros::Subscriber ind_mot_trgt_spe_
Subscriber to receive the target velocity of the index flexion motor.
Definition: ros_driver.h:77
mia_hand::ROSDriver::indFinTrgtForCallback
void indFinTrgtForCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber ind_fin_trgt_for_.
Definition: ros_driver.cpp:443
mia_hand::ROSDriver::openTriGraspCallback
bool openTriGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service open_tri_grasp_.
Definition: ros_driver.cpp:612
mia_hand::ROSDriver::lat_grasp_percent_
ros::Subscriber lat_grasp_percent_
Subscriber to receive the closure percentage for lateral grasp.
Definition: ros_driver.h:106
mia_hand::ROSDriver::mrlFinTrgtForCallback
void mrlFinTrgtForCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber mrl_fin_trgt_for_.
Definition: ros_driver.cpp:464
mia_hand::ROSDriver::was_connected_
bool was_connected_
True if the Mia hand was connected, False otherwise.
Definition: ros_driver.h:60
mia_hand::ROSDriver::mrlMotTrgtSpeCallback
void mrlMotTrgtSpeCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber mrl_mot_trgt_spe_.
Definition: ros_driver.cpp:457
mia_hand::ROSDriver::thuMotTrgtPosCallback
void thuMotTrgtPosCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber thu_mot_trgt_pos_.
Definition: ros_driver.cpp:288
mia_hand::ROSDriver::ROSDriver
ROSDriver(ros::NodeHandle &nh, ros::NodeHandle &nh_priv)
Class constructor.
Definition: ros_driver.cpp:6
mia_hand::ROSDriver::initServices
void initServices()
Initialize services.
Definition: ros_driver.cpp:209
mia_hand::ROSDriver::checkConnectionTmrCallback
void checkConnectionTmrCallback(const ros::WallTimerEvent &event)
Callback of the check_connection_tmr_ timer.
Definition: ros_driver.cpp:80
mia_hand::ROSDriver::ind_fin_trgt_for_
ros::Subscriber ind_fin_trgt_for_
Subscriber to receive the target force of the index flexion motor.
Definition: ros_driver.h:81
mia_hand::ROSDriver::indLatGraspRefCallback
void indLatGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber ind_lat_grasp_ref_.
Definition: ros_driver.cpp:365
mia_hand::ROSDriver::pin_grasp_percent_
ros::Subscriber pin_grasp_percent_
Subscriber to receive the closure percentage for pinch grasp.
Definition: ros_driver.h:105
mia_hand::ROSDriver::pinGraspPercentCallback
void pinGraspPercentCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber pin_grasp_percent_.
Definition: ros_driver.cpp:478
mia_hand::ROSDriver::closeSphGraspCallback
bool closeSphGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service close_sph_grasp_.
Definition: ros_driver.cpp:644
mia_hand::ROSDriver::is_connected_
bool is_connected_
True if the Mia hand is connected, False otherwise.
Definition: ros_driver.h:59
mia_hand::ROSDriver::openSphGraspCallback
bool openSphGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service open_sph_grasp_.
Definition: ros_driver.cpp:604
mia_hand::ROSDriver::thu_fin_trgt_for_
ros::Subscriber thu_fin_trgt_for_
Subscriber to receive the target force of the tumb flexion motor.
Definition: ros_driver.h:80
mia_hand::ROSDriver::thu_pin_grasp_ref_
ros::Subscriber thu_pin_grasp_ref_
Subscriber to receive the parametrs for pinch grasp for the thumb flexion motor.
Definition: ros_driver.h:88
mia_hand::ROSDriver::mrlLatGraspRefCallback
void mrlLatGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber #mrl_lat_grasp_ref.
Definition: ros_driver.cpp:405
mia_hand::ROSDriver::thu_sph_grasp_ref_
ros::Subscriber thu_sph_grasp_ref_
Subscriber to receive the parametrs for spherical grasp for the thumb flexion motor.
Definition: ros_driver.h:96
mia_hand::ROSDriver::tri_grasp_percent_
ros::Subscriber tri_grasp_percent_
Subscriber to receive the closure percentage for tridigital grasp.
Definition: ros_driver.h:108
mia_hand::ROSDriver::mrl_sph_grasp_ref_
ros::Subscriber mrl_sph_grasp_ref_
Subscriber to receive the parametrs for spherical grasp for the mrl flexion motor.
Definition: ros_driver.h:98
mia_hand::ROSDriver::ind_lat_grasp_ref_
ros::Subscriber ind_lat_grasp_ref_
Subscriber to receive the parametrs for lateral grasp for the index flexion motor.
Definition: ros_driver.h:93
mia_hand::ROSDriver::ind_mot_trgt_pos_
ros::Subscriber ind_mot_trgt_pos_
Subscriber to receive the target pose of the index flexion motor.
Definition: ros_driver.h:73
mia_hand::ROSDriver::indMotTrgtPosCallback
void indMotTrgtPosCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber ind_mot_trgt_pos_.
Definition: ros_driver.cpp:429
mia_hand::ROSDriver::mrlPinGraspRefCallback
void mrlPinGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber #mrl_pin_grasp_ref.
Definition: ros_driver.cpp:397
mia_hand::ROSDriver::switchAnaStreamCallback
bool switchAnaStreamCallback(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
Callback of the service switch_ana_stream_.
Definition: ros_driver.cpp:564
mia_hand::ROSDriver::indCylGraspRefCallback
void indCylGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber ind_cyl_grasp_ref_.
Definition: ros_driver.cpp:349
mia_hand::ROSDriver::openPinGraspCallback
bool openPinGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service open_pin_grasp_.
Definition: ros_driver.cpp:588
mia_hand::ROSDriver::thu_tri_grasp_ref_
ros::Subscriber thu_tri_grasp_ref_
Subscriber to receive the parametrs for tridigital grasp for the thumb flexion motor.
Definition: ros_driver.h:100
mia_hand::ROSDriver::sph_grasp_percent_
ros::Subscriber sph_grasp_percent_
Subscriber to receive the closure percentage for sherical grasp.
Definition: ros_driver.h:107
mia_hand::ROSDriver::mrl_mot_trgt_spe_
ros::Subscriber mrl_mot_trgt_spe_
Subscriber to receive the target velocity of the mrl flexion motor.
Definition: ros_driver.h:78
mia_hand::ROSDriver::mrlCylGraspRefCallback
void mrlCylGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber #mrl_cyl_grasp_ref.
Definition: ros_driver.cpp:389
mia_hand::ROSDriver::thuCylGraspRefCallback
void thuCylGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber thu_cyl_grasp_ref_.
Definition: ros_driver.cpp:309
mia_hand::ROSDriver::indMotTrgtSpeCallback
void indMotTrgtSpeCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber ind_mot_trgt_spe_.
Definition: ros_driver.cpp:436
mia_hand::ROSDriver::mrl_tri_grasp_ref_
ros::Subscriber mrl_tri_grasp_ref_
Subscriber to receive the parametrs for tridigital grasp for the mrl flexion motor.
Definition: ros_driver.h:102
mia_hand::ROSDriver::open_lat_grasp_
ros::ServiceServer open_lat_grasp_
Service to move the Mia hand motors to the rest position of the lateral grasp.
Definition: ros_driver.h:129
mia_hand::ROSDriver::mrl_lat_grasp_ref_
ros::Subscriber mrl_lat_grasp_ref_
Subscriber to receive the parametrs for lateral grasp for the mrl flexion motor.
Definition: ros_driver.h:94
mia_hand::ROSDriver::ind_cyl_grasp_ref_
ros::Subscriber ind_cyl_grasp_ref_
Subscriber to receive the parametrs for cylindrical grasp for the index flexion motor.
Definition: ros_driver.h:85
mia_hand::ROSDriver::fin_for_info_
ros::Publisher fin_for_info_
Publisher of the force data read by the sensors embedded in the Mia hand fingers.
Definition: ros_driver.h:115
mia_hand::ROSDriver::mrlSphGraspRefCallback
void mrlSphGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber #mrl_sph_grasp_ref.
Definition: ros_driver.cpp:413
mia_hand::ROSDriver::mot_pos_info_
ros::Publisher mot_pos_info_
Publisher of the positions data of the Mia hand motors.
Definition: ros_driver.h:112
mia_hand::ROSDriver::thuLatGraspRefCallback
void thuLatGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber thu_lat_grasp_ref_.
Definition: ros_driver.cpp:325
mia_hand::ROSDriver::switch_spe_stream_
ros::ServiceServer switch_spe_stream_
Service to manage a the streaming of motor velocity data sent by the Mia hand.
Definition: ros_driver.h:123
mia_hand::ROSDriver::nh_
ros::NodeHandle & nh_
Reference to public node handle (for topics and services)
Definition: ros_driver.h:65
mia_hand::ROSDriver::triGraspPercentCallback
void triGraspPercentCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber tri_grasp_percent_.
Definition: ros_driver.cpp:500
mia_hand::ROSDriver::mrl_pin_grasp_ref_
ros::Subscriber mrl_pin_grasp_ref_
Subscriber to receive the parametrs for pinch grasp for the mrl flexion motor.
Definition: ros_driver.h:90
mia_hand::ROSDriver::indTriGraspRefCallback
void indTriGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber ind_tri_grasp_ref_.
Definition: ros_driver.cpp:381
mia_hand::ROSDriver::indSphGraspRefCallback
void indSphGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber ind_sph_grasp_ref_.
Definition: ros_driver.cpp:373
mia_hand::ROSDriver::mrl_fin_trgt_for_
ros::Subscriber mrl_fin_trgt_for_
Subscriber to receive the target force of the mrl flexion motor.
Definition: ros_driver.h:82
mia_hand::ROSDriver::cylGraspPercentCallback
void cylGraspPercentCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber cyl_grasp_percent_.
Definition: ros_driver.cpp:471
mia_hand::ROSDriver::mia_
CppDriver mia_
Cpp driver of the Mia hand.
Definition: ros_driver.h:57
mia_hand::ROSDriver::thu_mot_trgt_spe_
ros::Subscriber thu_mot_trgt_spe_
Subscriber to receive the target velocity of the tumb flexion motor.
Definition: ros_driver.h:76
mia_hand::ROSDriver::mrl_cyl_grasp_ref_
ros::Subscriber mrl_cyl_grasp_ref_
Subscriber to receive the parametrs for cylindrical grasp for the mrl flexion motor.
Definition: ros_driver.h:86
mia_hand::ROSDriver::ind_pin_grasp_ref_
ros::Subscriber ind_pin_grasp_ref_
Subscriber to receive the parametrs for pinch grasp for the index flexion motor.
Definition: ros_driver.h:89
mia_hand::ROSDriver::mot_spe_info_
ros::Publisher mot_spe_info_
Publisher of the velocity data of the Mia hand motors.
Definition: ros_driver.h:113
mia_hand::ROSDriver::switch_cur_stream_
ros::ServiceServer switch_cur_stream_
Service to manage a the streaming of the current data (i.e. force sensor outputs) sent by the Mia han...
Definition: ros_driver.h:125
mia_hand::ROSDriver::initSubscribersMrl
void initSubscribersMrl()
Initialize subscribers of the index mrl motor info.
Definition: ros_driver.cpp:160
mia_hand
Definition: cpp_driver.h:16
mia_hand::ROSDriver::closeTriGraspCallback
bool closeTriGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service close_tri_grasp_.
Definition: ros_driver.cpp:652
mia_hand::ROSDriver::thuTriGraspRefCallback
void thuTriGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber thu_sph_grasp_ref_.
Definition: ros_driver.cpp:341
mia_hand::ROSDriver::ind_sph_grasp_ref_
ros::Subscriber ind_sph_grasp_ref_
Subscriber to receive the parametrs for spherical grasp for the index flexion motor.
Definition: ros_driver.h:97
mia_hand::ROSDriver::thuPinGraspRefCallback
void thuPinGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber thu_pin_grasp_ref_.
Definition: ros_driver.cpp:317
mia_hand::ROSDriver::close_cyl_grasp_
ros::ServiceServer close_cyl_grasp_
Service to move the Mia hand motors to the closed position of the cylindrical grasp.
Definition: ros_driver.h:133
mia_hand::ROSDriver::close_lat_grasp_
ros::ServiceServer close_lat_grasp_
Service to move the Mia hand motors to the closed position of the lateral grasp.
Definition: ros_driver.h:135
mia_hand::ROSDriver::check_connection_tmr_
ros::WallTimer check_connection_tmr_
Timer to handle the check of the Mia hand connection status.
Definition: ros_driver.h:63
mia_hand::ROSDriver::sphGraspPercentCallback
void sphGraspPercentCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber sph_grasp_percent_.
Definition: ros_driver.cpp:493
mia_hand::ROSDriver::initSubscribersGrasp
void initSubscribersGrasp()
Initialize subscribers of the automatic grasp info.
Definition: ros_driver.cpp:189
mia_hand::ROSDriver::mrl_mot_trgt_pos_
ros::Subscriber mrl_mot_trgt_pos_
Subscriber to receive the target pose of the mrl flexion motor.
Definition: ros_driver.h:74
mia_hand::ROSDriver::thuMotTrgtSpeCallback
void thuMotTrgtSpeCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber thu_mot_trgt_spe_.
Definition: ros_driver.cpp:295
mia_hand::ROSDriver::initSubscribersInd
void initSubscribersInd()
Initialize subscribers of the index flexion motor info.
Definition: ros_driver.cpp:131
mia_hand::ROSDriver::close_sph_grasp_
ros::ServiceServer close_sph_grasp_
Service to move the Mia hand motors to the closed position of the spherical grasp.
Definition: ros_driver.h:136
mia_hand::ROSDriver::open_sph_grasp_
ros::ServiceServer open_sph_grasp_
Service to move the Mia hand motors to the rest position of the spherical grasp.
Definition: ros_driver.h:130
mia_hand::ROSDriver::publish_data_tmr_
ros::WallTimer publish_data_tmr_
Timer to handle the Mia hand data publishing.
Definition: ros_driver.h:62
mia_hand::ROSDriver::mrlMotTrgtPosCallback
void mrlMotTrgtPosCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber mrl_mot_trgt_pos_.
Definition: ros_driver.cpp:450
mia_hand::ROSDriver::latGraspPercentCallback
void latGraspPercentCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber lat_grasp_percent_.
Definition: ros_driver.cpp:486
mia_hand::ROSDriver::disconnectCallback
bool disconnectCallback(std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &resp)
Callback of the service disconnect_.
Definition: ros_driver.cpp:529
mia_hand::ROSDriver::openCylGraspCallback
bool openCylGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service open_cyl_grasp_.
Definition: ros_driver.cpp:580
mia_hand::ROSDriver::publishDataTmrCallback
void publishDataTmrCallback(const ros::WallTimerEvent &event)
Callback of the publish_data_tmr_ timer.
Definition: ros_driver.cpp:47
mia_hand::ROSDriver::thuSphGraspRefCallback
void thuSphGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber thu_sph_grasp_ref_.
Definition: ros_driver.cpp:333
mia_hand::ROSDriver::connectToPortCallback
bool connectToPortCallback(mia_hand_msgs::ConnectSerial::Request &req, mia_hand_msgs::ConnectSerial::Response &resp)
Callback of the service connect_to_port_.
Definition: ros_driver.cpp:507
mia_hand::ROSDriver::disconnect_
ros::ServiceServer disconnect_
Service to disconnect the Mia hand and close the serial port.
Definition: ros_driver.h:120
mia_hand::ROSDriver::switchCurStreamCallback
bool switchCurStreamCallback(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
Callback of the service switch_cur_stream_.
Definition: ros_driver.cpp:572
mia_hand::ROSDriver::mrlTriGraspRefCallback
void mrlTriGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber #mrl_tri_grasp_ref.
Definition: ros_driver.cpp:421
mia_hand::ROSDriver::cyl_grasp_percent_
ros::Subscriber cyl_grasp_percent_
Subscriber to receive the closure percentage for cylindical grasp.
Definition: ros_driver.h:104
mia_hand::ROSDriver::thu_lat_grasp_ref_
ros::Subscriber thu_lat_grasp_ref_
Subscriber to receive the parametrs for lateral grasp for the thumb flexion motor.
Definition: ros_driver.h:92
mia_hand::ROSDriver::ind_tri_grasp_ref_
ros::Subscriber ind_tri_grasp_ref_
Subscriber to receive the parametrs for tridigital grasp for the index flexion motor.
Definition: ros_driver.h:101
mia_hand::ROSDriver::switch_pos_stream_
ros::ServiceServer switch_pos_stream_
Service to manage a the streaming of motor position data sent by the Mia hand.
Definition: ros_driver.h:122
mia_hand::ROSDriver::nh_priv_
ros::NodeHandle & nh_priv_
Reference to private node handle (for parameters)
Definition: ros_driver.h:67
mia_hand::ROSDriver::open_cyl_grasp_
ros::ServiceServer open_cyl_grasp_
Service to move the Mia hand motors to the rest position of the cylindrical grasp.
Definition: ros_driver.h:127
mia_hand::ROSDriver::initSubscribersThu
void initSubscribersThu()
Initialize subscribers of the thumb flexion motor info.
Definition: ros_driver.cpp:102
mia_hand::ROSDriver::open_tri_grasp_
ros::ServiceServer open_tri_grasp_
Service to move the Mia hand motors to the rest position of the tridigital grasp.
Definition: ros_driver.h:131
mia_hand::ROSDriver::initPublishers
void initPublishers()
Initialize publishers.
Definition: ros_driver.cpp:277
mia_hand::ROSDriver::closeCylGraspCallback
bool closeCylGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service close_cyl_grasp_.
Definition: ros_driver.cpp:620
mia_hand::ROSDriver::closePinGraspCallback
bool closePinGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service close_pin_grasp_.
Definition: ros_driver.cpp:628
cpp_driver.h
mia_hand::ROSDriver::closeLatGraspCallback
bool closeLatGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service close_lat_grasp_.
Definition: ros_driver.cpp:636
mia_hand::ROSDriver::switch_ana_stream_
ros::ServiceServer switch_ana_stream_
Service to manage a the streaming of the analog input data (i.e. force sensor outputs) sent by the Mi...
Definition: ros_driver.h:124
mia_hand::ROSDriver::close_pin_grasp_
ros::ServiceServer close_pin_grasp_
Service to move the Mia hand motors to the closed position of the pinch grasp.
Definition: ros_driver.h:134
mia_hand::ROSDriver::indPinGraspRefCallback
void indPinGraspRefCallback(const mia_hand_msgs::GraspRef::ConstPtr &msg)
Callback of the subscriber ind_pin_grasp_ref_.
Definition: ros_driver.cpp:357
mia_hand::ROSDriver::mot_cur_info_
ros::Publisher mot_cur_info_
Publisher of the current absorbed by the Mia hand motors.
Definition: ros_driver.h:114
mia_hand::ROSDriver::openLatGraspCallback
bool openLatGraspCallback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
Callback of the service open_lat_grasp_.
Definition: ros_driver.cpp:596
mia_hand::ROSDriver::close_tri_grasp_
ros::ServiceServer close_tri_grasp_
Service to move the Mia hand motors to the closed position of the tridigital grasp.
Definition: ros_driver.h:137
mia_hand::ROSDriver::switchSpeStreamCallback
bool switchSpeStreamCallback(std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
Callback of the service switch_spe_stream_.
Definition: ros_driver.cpp:556
mia_hand::ROSDriver::thuFinTrgtForCallback
void thuFinTrgtForCallback(const std_msgs::Int16::ConstPtr &msg)
Callback of the subscriber thu_fin_trgt_for_.
Definition: ros_driver.cpp:302
mia_hand::ROSDriver::thu_mot_trgt_pos_
ros::Subscriber thu_mot_trgt_pos_
Subscriber to receive the target pose of the tumb flexion motor.
Definition: ros_driver.h:72
mia_hand::ROSDriver::open_pin_grasp_
ros::ServiceServer open_pin_grasp_
Service to move the Mia hand motors to the rest position of the pinch grasp.
Definition: ros_driver.h:128
mia_hand::ROSDriver::connect_to_port_
ros::ServiceServer connect_to_port_
Service to open a serial port and connect the Mia hand.
Definition: ros_driver.h:119