mia_hand_driver  rel 1.0.0
mia_hand::ROSDriver Class Reference

#include <ros_driver.h>

Collaboration diagram for mia_hand::ROSDriver:

Public Member Functions

 ROSDriver (ros::NodeHandle &nh, ros::NodeHandle &nh_priv)
 Class constructor. More...
 

Private Member Functions

void publishDataTmrCallback (const ros::WallTimerEvent &event)
 Callback of the publish_data_tmr_ timer. More...
 
void checkConnectionTmrCallback (const ros::WallTimerEvent &event)
 Callback of the check_connection_tmr_ timer. More...
 
void initPublishers ()
 Initialize publishers. More...
 
void initSubscribersThu ()
 Initialize subscribers of the thumb flexion motor info. More...
 
void initSubscribersInd ()
 Initialize subscribers of the index flexion motor info. More...
 
void initSubscribersMrl ()
 Initialize subscribers of the index mrl motor info. More...
 
void initSubscribersGrasp ()
 Initialize subscribers of the automatic grasp info. More...
 
void initServices ()
 Initialize services. More...
 
void thuMotTrgtPosCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber thu_mot_trgt_pos_. More...
 
void indMotTrgtPosCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber ind_mot_trgt_pos_. More...
 
void mrlMotTrgtPosCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber mrl_mot_trgt_pos_. More...
 
void thuMotTrgtSpeCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber thu_mot_trgt_spe_. More...
 
void indMotTrgtSpeCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber ind_mot_trgt_spe_. More...
 
void mrlMotTrgtSpeCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber mrl_mot_trgt_spe_. More...
 
void thuFinTrgtForCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber thu_fin_trgt_for_. More...
 
void indFinTrgtForCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber ind_fin_trgt_for_. More...
 
void mrlFinTrgtForCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber mrl_fin_trgt_for_. More...
 
void thuCylGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber thu_cyl_grasp_ref_. More...
 
void thuPinGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber thu_pin_grasp_ref_. More...
 
void thuLatGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber thu_lat_grasp_ref_. More...
 
void thuSphGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber thu_sph_grasp_ref_. More...
 
void thuTriGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber thu_sph_grasp_ref_. More...
 
void indCylGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber ind_cyl_grasp_ref_. More...
 
void indPinGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber ind_pin_grasp_ref_. More...
 
void indLatGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber ind_lat_grasp_ref_. More...
 
void indSphGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber ind_sph_grasp_ref_. More...
 
void indTriGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber ind_tri_grasp_ref_. More...
 
void mrlCylGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber #mrl_cyl_grasp_ref. More...
 
void mrlPinGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber #mrl_pin_grasp_ref. More...
 
void mrlLatGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber #mrl_lat_grasp_ref. More...
 
void mrlSphGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber #mrl_sph_grasp_ref. More...
 
void mrlTriGraspRefCallback (const mia_hand_msgs::GraspRef::ConstPtr &msg)
 Callback of the subscriber #mrl_tri_grasp_ref. More...
 
void cylGraspPercentCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber cyl_grasp_percent_. More...
 
void pinGraspPercentCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber pin_grasp_percent_. More...
 
void latGraspPercentCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber lat_grasp_percent_. More...
 
void sphGraspPercentCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber sph_grasp_percent_. More...
 
void triGraspPercentCallback (const std_msgs::Int16::ConstPtr &msg)
 Callback of the subscriber tri_grasp_percent_. More...
 
bool connectToPortCallback (mia_hand_msgs::ConnectSerial::Request &req, mia_hand_msgs::ConnectSerial::Response &resp)
 Callback of the service connect_to_port_. More...
 
bool disconnectCallback (std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &resp)
 Callback of the service disconnect_. More...
 
bool switchPosStreamCallback (std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
 Callback of the service switch_pos_stream_. More...
 
bool switchSpeStreamCallback (std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
 Callback of the service switch_spe_stream_. More...
 
bool switchAnaStreamCallback (std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
 Callback of the service switch_ana_stream_. More...
 
bool switchCurStreamCallback (std_srvs::SetBool::Request &req, std_srvs::SetBool::Response &resp)
 Callback of the service switch_cur_stream_. More...
 
bool openCylGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service open_cyl_grasp_. More...
 
bool openPinGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service open_pin_grasp_. More...
 
bool openLatGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service open_lat_grasp_. More...
 
bool openSphGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service open_sph_grasp_. More...
 
bool openTriGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service open_tri_grasp_. More...
 
bool closeCylGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service close_cyl_grasp_. More...
 
bool closePinGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service close_pin_grasp_. More...
 
bool closeLatGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service close_lat_grasp_. More...
 
bool closeSphGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service close_sph_grasp_. More...
 
bool closeTriGraspCallback (std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
 Callback of the service close_tri_grasp_. More...
 

Private Attributes

CppDriver mia_
 Cpp driver of the Mia hand. More...
 
bool is_connected_
 True if the Mia hand is connected, False otherwise. More...
 
bool was_connected_
 True if the Mia hand was connected, False otherwise. More...
 
ros::WallTimer publish_data_tmr_
 Timer to handle the Mia hand data publishing. More...
 
ros::WallTimer check_connection_tmr_
 Timer to handle the check of the Mia hand connection status. More...
 
ros::NodeHandle & nh_
 Reference to public node handle (for topics and services) More...
 
ros::NodeHandle & nh_priv_
 Reference to private node handle (for parameters) More...
 
ros::Subscriber thu_mot_trgt_pos_
 Subscriber to receive the target pose of the tumb flexion motor. More...
 
ros::Subscriber ind_mot_trgt_pos_
 Subscriber to receive the target pose of the index flexion motor. More...
 
ros::Subscriber mrl_mot_trgt_pos_
 Subscriber to receive the target pose of the mrl flexion motor. More...
 
ros::Subscriber thu_mot_trgt_spe_
 Subscriber to receive the target velocity of the tumb flexion motor. More...
 
ros::Subscriber ind_mot_trgt_spe_
 Subscriber to receive the target velocity of the index flexion motor. More...
 
ros::Subscriber mrl_mot_trgt_spe_
 Subscriber to receive the target velocity of the mrl flexion motor. More...
 
ros::Subscriber thu_fin_trgt_for_
 Subscriber to receive the target force of the tumb flexion motor. More...
 
ros::Subscriber ind_fin_trgt_for_
 Subscriber to receive the target force of the index flexion motor. More...
 
ros::Subscriber mrl_fin_trgt_for_
 Subscriber to receive the target force of the mrl flexion motor. More...
 
ros::Subscriber thu_cyl_grasp_ref_
 Subscriber to receive the parametrs for cylindrical grasp for the thumb flexion motor. More...
 
ros::Subscriber ind_cyl_grasp_ref_
 Subscriber to receive the parametrs for cylindrical grasp for the index flexion motor. More...
 
ros::Subscriber mrl_cyl_grasp_ref_
 Subscriber to receive the parametrs for cylindrical grasp for the mrl flexion motor. More...
 
ros::Subscriber thu_pin_grasp_ref_
 Subscriber to receive the parametrs for pinch grasp for the thumb flexion motor. More...
 
ros::Subscriber ind_pin_grasp_ref_
 Subscriber to receive the parametrs for pinch grasp for the index flexion motor. More...
 
ros::Subscriber mrl_pin_grasp_ref_
 Subscriber to receive the parametrs for pinch grasp for the mrl flexion motor. More...
 
ros::Subscriber thu_lat_grasp_ref_
 Subscriber to receive the parametrs for lateral grasp for the thumb flexion motor. More...
 
ros::Subscriber ind_lat_grasp_ref_
 Subscriber to receive the parametrs for lateral grasp for the index flexion motor. More...
 
ros::Subscriber mrl_lat_grasp_ref_
 Subscriber to receive the parametrs for lateral grasp for the mrl flexion motor. More...
 
ros::Subscriber thu_sph_grasp_ref_
 Subscriber to receive the parametrs for spherical grasp for the thumb flexion motor. More...
 
ros::Subscriber ind_sph_grasp_ref_
 Subscriber to receive the parametrs for spherical grasp for the index flexion motor. More...
 
ros::Subscriber mrl_sph_grasp_ref_
 Subscriber to receive the parametrs for spherical grasp for the mrl flexion motor. More...
 
ros::Subscriber thu_tri_grasp_ref_
 Subscriber to receive the parametrs for tridigital grasp for the thumb flexion motor. More...
 
ros::Subscriber ind_tri_grasp_ref_
 Subscriber to receive the parametrs for tridigital grasp for the index flexion motor. More...
 
ros::Subscriber mrl_tri_grasp_ref_
 Subscriber to receive the parametrs for tridigital grasp for the mrl flexion motor. More...
 
ros::Subscriber cyl_grasp_percent_
 Subscriber to receive the closure percentage for cylindical grasp. More...
 
ros::Subscriber pin_grasp_percent_
 Subscriber to receive the closure percentage for pinch grasp. More...
 
ros::Subscriber lat_grasp_percent_
 Subscriber to receive the closure percentage for lateral grasp. More...
 
ros::Subscriber sph_grasp_percent_
 Subscriber to receive the closure percentage for sherical grasp. More...
 
ros::Subscriber tri_grasp_percent_
 Subscriber to receive the closure percentage for tridigital grasp. More...
 
ros::Publisher mot_pos_info_
 Publisher of the positions data of the Mia hand motors. More...
 
ros::Publisher mot_spe_info_
 Publisher of the velocity data of the Mia hand motors. More...
 
ros::Publisher mot_cur_info_
 Publisher of the current absorbed by the Mia hand motors. More...
 
ros::Publisher fin_for_info_
 Publisher of the force data read by the sensors embedded in the Mia hand fingers. More...
 
ros::ServiceServer connect_to_port_
 Service to open a serial port and connect the Mia hand. More...
 
ros::ServiceServer disconnect_
 Service to disconnect the Mia hand and close the serial port. More...
 
ros::ServiceServer switch_pos_stream_
 Service to manage a the streaming of motor position data sent by the Mia hand. More...
 
ros::ServiceServer switch_spe_stream_
 Service to manage a the streaming of motor velocity data sent by the Mia hand. More...
 
ros::ServiceServer switch_ana_stream_
 Service to manage a the streaming of the analog input data (i.e. force sensor outputs) sent by the Mia hand. More...
 
ros::ServiceServer switch_cur_stream_
 Service to manage a the streaming of the current data (i.e. force sensor outputs) sent by the Mia hand. More...
 
ros::ServiceServer open_cyl_grasp_
 Service to move the Mia hand motors to the rest position of the cylindrical grasp. More...
 
ros::ServiceServer open_pin_grasp_
 Service to move the Mia hand motors to the rest position of the pinch grasp. More...
 
ros::ServiceServer open_lat_grasp_
 Service to move the Mia hand motors to the rest position of the lateral grasp. More...
 
ros::ServiceServer open_sph_grasp_
 Service to move the Mia hand motors to the rest position of the spherical grasp. More...
 
ros::ServiceServer open_tri_grasp_
 Service to move the Mia hand motors to the rest position of the tridigital grasp. More...
 
ros::ServiceServer close_cyl_grasp_
 Service to move the Mia hand motors to the closed position of the cylindrical grasp. More...
 
ros::ServiceServer close_pin_grasp_
 Service to move the Mia hand motors to the closed position of the pinch grasp. More...
 
ros::ServiceServer close_lat_grasp_
 Service to move the Mia hand motors to the closed position of the lateral grasp. More...
 
ros::ServiceServer close_sph_grasp_
 Service to move the Mia hand motors to the closed position of the spherical grasp. More...
 
ros::ServiceServer close_tri_grasp_
 Service to move the Mia hand motors to the closed position of the tridigital grasp. More...
 

Detailed Description

Definition at line 35 of file ros_driver.h.

Constructor & Destructor Documentation

◆ ROSDriver()

mia_hand::ROSDriver::ROSDriver ( ros::NodeHandle &  nh,
ros::NodeHandle &  nh_priv 
)

Class constructor.

Parameters
nhreference to public node handle
nh_privreference to private node handle

Definition at line 6 of file ros_driver.cpp.

Member Function Documentation

◆ checkConnectionTmrCallback()

void mia_hand::ROSDriver::checkConnectionTmrCallback ( const ros::WallTimerEvent &  event)
private

Callback of the check_connection_tmr_ timer.

Definition at line 80 of file ros_driver.cpp.

◆ closeCylGraspCallback()

bool mia_hand::ROSDriver::closeCylGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service close_cyl_grasp_.

Move the Mia hand motors to the closed position of the cylindrical grasp.

Parameters
reqUnused.
respUnused

Definition at line 620 of file ros_driver.cpp.

◆ closeLatGraspCallback()

bool mia_hand::ROSDriver::closeLatGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service close_lat_grasp_.

Move the Mia hand motors to the closed position of the lateral grasp.

Parameters
reqUnused.
respUnused

Definition at line 636 of file ros_driver.cpp.

◆ closePinGraspCallback()

bool mia_hand::ROSDriver::closePinGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service close_pin_grasp_.

Move the Mia hand motors to the closed position of the pinch grasp.

Parameters
reqUnused.
respUnused

Definition at line 628 of file ros_driver.cpp.

◆ closeSphGraspCallback()

bool mia_hand::ROSDriver::closeSphGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service close_sph_grasp_.

Move the Mia hand motors to the closed position of the spherical grasp.

Parameters
reqUnused.
respUnused

Definition at line 644 of file ros_driver.cpp.

◆ closeTriGraspCallback()

bool mia_hand::ROSDriver::closeTriGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service close_tri_grasp_.

Move the Mia hand motors to the closed position of the tridigital grasp.

Parameters
reqUnused.
respUnused

Definition at line 652 of file ros_driver.cpp.

◆ connectToPortCallback()

bool mia_hand::ROSDriver::connectToPortCallback ( mia_hand_msgs::ConnectSerial::Request &  req,
mia_hand_msgs::ConnectSerial::Response &  resp 
)
private

Callback of the service connect_to_port_.

Connect the Mia hand opening a serial port.

Parameters
reqmia_hand_msgs containing the number of the port to open.
respmia_hand_msgs containing the success of the operation (true or false) and a string message.

Definition at line 507 of file ros_driver.cpp.

◆ cylGraspPercentCallback()

void mia_hand::ROSDriver::cylGraspPercentCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber cyl_grasp_percent_.

Set the target closure percentage of the cylindrical grasp.

Parameters
msgstandard message containing the target closure percentage [0, 100].

Definition at line 471 of file ros_driver.cpp.

◆ disconnectCallback()

bool mia_hand::ROSDriver::disconnectCallback ( std_srvs::Trigger::Request &  req,
std_srvs::Trigger::Response &  resp 
)
private

Callback of the service disconnect_.

Disconnect the Mia hand and close the serial port.

Parameters
requnused.
respcontaining the success of the operation (true or false) and a string message.

Definition at line 529 of file ros_driver.cpp.

◆ indCylGraspRefCallback()

void mia_hand::ROSDriver::indCylGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber ind_cyl_grasp_ref_.

Set the parameter of the cylindrical grasp for the index flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 349 of file ros_driver.cpp.

◆ indFinTrgtForCallback()

void mia_hand::ROSDriver::indFinTrgtForCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber ind_fin_trgt_for_.

Parameters
msgstandard message containing the target force [0, +1024] to be applied by the finger (and thus to be read by the finger sensor).

Definition at line 443 of file ros_driver.cpp.

◆ indLatGraspRefCallback()

void mia_hand::ROSDriver::indLatGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber ind_lat_grasp_ref_.

Set the parameter of the lateral grasp for the index flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 365 of file ros_driver.cpp.

◆ indMotTrgtPosCallback()

void mia_hand::ROSDriver::indMotTrgtPosCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber ind_mot_trgt_pos_.

Parameters
msgstandard message containing the target position [-255, 255] of the motor

Definition at line 429 of file ros_driver.cpp.

◆ indMotTrgtSpeCallback()

void mia_hand::ROSDriver::indMotTrgtSpeCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber ind_mot_trgt_spe_.

Parameters
msgstandard message containing the target velocity [-90, 90] of the motor.

Definition at line 436 of file ros_driver.cpp.

◆ indPinGraspRefCallback()

void mia_hand::ROSDriver::indPinGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber ind_pin_grasp_ref_.

Set the parameter of the pinch grasp for the index flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 357 of file ros_driver.cpp.

◆ indSphGraspRefCallback()

void mia_hand::ROSDriver::indSphGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber ind_sph_grasp_ref_.

Set the parameter of the spherical grasp for the index flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 373 of file ros_driver.cpp.

◆ indTriGraspRefCallback()

void mia_hand::ROSDriver::indTriGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber ind_tri_grasp_ref_.

Set the parameter of the tridigital grasp for the index flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 381 of file ros_driver.cpp.

◆ initPublishers()

void mia_hand::ROSDriver::initPublishers ( )
private

Initialize publishers.

Definition at line 277 of file ros_driver.cpp.

◆ initServices()

void mia_hand::ROSDriver::initServices ( )
private

Initialize services.

Definition at line 209 of file ros_driver.cpp.

◆ initSubscribersGrasp()

void mia_hand::ROSDriver::initSubscribersGrasp ( )
private

Initialize subscribers of the automatic grasp info.

Definition at line 189 of file ros_driver.cpp.

◆ initSubscribersInd()

void mia_hand::ROSDriver::initSubscribersInd ( )
private

Initialize subscribers of the index flexion motor info.

Definition at line 131 of file ros_driver.cpp.

◆ initSubscribersMrl()

void mia_hand::ROSDriver::initSubscribersMrl ( )
private

Initialize subscribers of the index mrl motor info.

Definition at line 160 of file ros_driver.cpp.

◆ initSubscribersThu()

void mia_hand::ROSDriver::initSubscribersThu ( )
private

Initialize subscribers of the thumb flexion motor info.

Definition at line 102 of file ros_driver.cpp.

◆ latGraspPercentCallback()

void mia_hand::ROSDriver::latGraspPercentCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber lat_grasp_percent_.

Set the target closure percentage of the lateral grasp.

Parameters
msgstandard message containing the target closure percentage [0, 100].

Definition at line 486 of file ros_driver.cpp.

◆ mrlCylGraspRefCallback()

void mia_hand::ROSDriver::mrlCylGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber #mrl_cyl_grasp_ref.

Set the parameter of the cylindrical grasp for the mrl flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 389 of file ros_driver.cpp.

◆ mrlFinTrgtForCallback()

void mia_hand::ROSDriver::mrlFinTrgtForCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber mrl_fin_trgt_for_.

Parameters
msgstandard message containing the target force [0, +1024] to be applied by the finger (and thus to be read by the finger sensor).

Definition at line 464 of file ros_driver.cpp.

◆ mrlLatGraspRefCallback()

void mia_hand::ROSDriver::mrlLatGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber #mrl_lat_grasp_ref.

Set the parameter of the lateral grasp for the mrl flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 405 of file ros_driver.cpp.

◆ mrlMotTrgtPosCallback()

void mia_hand::ROSDriver::mrlMotTrgtPosCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber mrl_mot_trgt_pos_.

Parameters
msgstandard message containing the target position [0, 255] of the motor.

Definition at line 450 of file ros_driver.cpp.

◆ mrlMotTrgtSpeCallback()

void mia_hand::ROSDriver::mrlMotTrgtSpeCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber mrl_mot_trgt_spe_.

Parameters
msgstandard message containing the target velocity [-90, 90] of the motor.

Definition at line 457 of file ros_driver.cpp.

◆ mrlPinGraspRefCallback()

void mia_hand::ROSDriver::mrlPinGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber #mrl_pin_grasp_ref.

Set the parameter of the pinch grasp for the mrl flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 397 of file ros_driver.cpp.

◆ mrlSphGraspRefCallback()

void mia_hand::ROSDriver::mrlSphGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber #mrl_sph_grasp_ref.

Set the parameter of the spherical grasp for the mrl flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 413 of file ros_driver.cpp.

◆ mrlTriGraspRefCallback()

void mia_hand::ROSDriver::mrlTriGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber #mrl_tri_grasp_ref.

Set the parameter of the tridigital grasp for the mrl flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters (rest position, closure position and dely) to be set for the specific motor.

Definition at line 421 of file ros_driver.cpp.

◆ openCylGraspCallback()

bool mia_hand::ROSDriver::openCylGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service open_cyl_grasp_.

Move the Mia hand motors to the rest position of the cylindrical grasp.

Parameters
reqUnused.
respUnused

Definition at line 580 of file ros_driver.cpp.

◆ openLatGraspCallback()

bool mia_hand::ROSDriver::openLatGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service open_lat_grasp_.

Move the Mia hand motors to the rest position of the lateral grasp.

Parameters
reqUnused.
respUnused

Definition at line 596 of file ros_driver.cpp.

◆ openPinGraspCallback()

bool mia_hand::ROSDriver::openPinGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service open_pin_grasp_.

Move the Mia hand motors to the rest position of the pinch grasp.

Parameters
reqUnused.
respUnused

Definition at line 588 of file ros_driver.cpp.

◆ openSphGraspCallback()

bool mia_hand::ROSDriver::openSphGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service open_sph_grasp_.

Move the Mia hand motors to the rest position of the spherical grasp.

Parameters
reqUnused.
respUnused

Definition at line 604 of file ros_driver.cpp.

◆ openTriGraspCallback()

bool mia_hand::ROSDriver::openTriGraspCallback ( std_srvs::Empty::Request &  req,
std_srvs::Empty::Response &  resp 
)
private

Callback of the service open_tri_grasp_.

Move the Mia hand motors to the rest position of the tridigital grasp.

Parameters
reqUnused.
respUnused

Definition at line 612 of file ros_driver.cpp.

◆ pinGraspPercentCallback()

void mia_hand::ROSDriver::pinGraspPercentCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber pin_grasp_percent_.

Set the target closure percentage of the pinch grasp.

Parameters
msgstandard message containing the target closure percentage [0, 100].

Definition at line 478 of file ros_driver.cpp.

◆ publishDataTmrCallback()

void mia_hand::ROSDriver::publishDataTmrCallback ( const ros::WallTimerEvent &  event)
private

Callback of the publish_data_tmr_ timer.

Definition at line 47 of file ros_driver.cpp.

◆ sphGraspPercentCallback()

void mia_hand::ROSDriver::sphGraspPercentCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber sph_grasp_percent_.

Set the target closure percentage of the spherical grasp.

Parameters
msgstandard message containing the target closure percentage [0, 100].

Definition at line 493 of file ros_driver.cpp.

◆ switchAnaStreamCallback()

bool mia_hand::ROSDriver::switchAnaStreamCallback ( std_srvs::SetBool::Request &  req,
std_srvs::SetBool::Response &  resp 
)
private

Callback of the service switch_ana_stream_.

Manage the streaming of the analog input data (i.e. force sensor outputs) sent by the Mia hand.

Parameters
reqTrue to enable the data streaming, False to disable it.
respUnused

Definition at line 564 of file ros_driver.cpp.

◆ switchCurStreamCallback()

bool mia_hand::ROSDriver::switchCurStreamCallback ( std_srvs::SetBool::Request &  req,
std_srvs::SetBool::Response &  resp 
)
private

Callback of the service switch_cur_stream_.

Manage the streaming of the analog input data (i.e. force sensor outputs) sent by the Mia hand.

Parameters
reqTrue to enable the data streaming, False to disable it.
respUnused

Definition at line 572 of file ros_driver.cpp.

◆ switchPosStreamCallback()

bool mia_hand::ROSDriver::switchPosStreamCallback ( std_srvs::SetBool::Request &  req,
std_srvs::SetBool::Response &  resp 
)
private

Callback of the service switch_pos_stream_.

Manage the streaming of motor position data sent by the Mia hand.

Parameters
reqTrue to enable the data streaming, False to disable it.
respUnused

Definition at line 548 of file ros_driver.cpp.

◆ switchSpeStreamCallback()

bool mia_hand::ROSDriver::switchSpeStreamCallback ( std_srvs::SetBool::Request &  req,
std_srvs::SetBool::Response &  resp 
)
private

Callback of the service switch_spe_stream_.

Manage the streaming of motor velocity data sent by the Mia hand.

Parameters
reqTrue to enable the data streaming, False to disable it.
respUnused

Definition at line 556 of file ros_driver.cpp.

◆ thuCylGraspRefCallback()

void mia_hand::ROSDriver::thuCylGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber thu_cyl_grasp_ref_.

Set the parameter of the cylindrical grasp for the thumb flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 309 of file ros_driver.cpp.

◆ thuFinTrgtForCallback()

void mia_hand::ROSDriver::thuFinTrgtForCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber thu_fin_trgt_for_.

Parameters
msgstandard message containing the target force [0, +1024] to be applied by the finger (and thus to be read by the finger sensor).

Definition at line 302 of file ros_driver.cpp.

◆ thuLatGraspRefCallback()

void mia_hand::ROSDriver::thuLatGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber thu_lat_grasp_ref_.

Set the parameter of the lateral grasp for the thumb flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 325 of file ros_driver.cpp.

◆ thuMotTrgtPosCallback()

void mia_hand::ROSDriver::thuMotTrgtPosCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber thu_mot_trgt_pos_.

Parameters
msgstandard message containing the target position [0, 255] of the motor.

Definition at line 288 of file ros_driver.cpp.

◆ thuMotTrgtSpeCallback()

void mia_hand::ROSDriver::thuMotTrgtSpeCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber thu_mot_trgt_spe_.

Parameters
msgstandard message containing the target velocity [-90, 90] of the motor.

Definition at line 295 of file ros_driver.cpp.

◆ thuPinGraspRefCallback()

void mia_hand::ROSDriver::thuPinGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber thu_pin_grasp_ref_.

Set the parameter of the pinch grasp for the thumb flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 317 of file ros_driver.cpp.

◆ thuSphGraspRefCallback()

void mia_hand::ROSDriver::thuSphGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber thu_sph_grasp_ref_.

Set the parameter of the spherical grasp for the thumb flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 333 of file ros_driver.cpp.

◆ thuTriGraspRefCallback()

void mia_hand::ROSDriver::thuTriGraspRefCallback ( const mia_hand_msgs::GraspRef::ConstPtr &  msg)
private

Callback of the subscriber thu_sph_grasp_ref_.

Set the parameter of the tridigital grasp for the thumb flexion motor.

Parameters
msgmia_hand_msgs containing the grasp parameters ( rest position, closure position and dely) to be set for the specific motor.

Definition at line 341 of file ros_driver.cpp.

◆ triGraspPercentCallback()

void mia_hand::ROSDriver::triGraspPercentCallback ( const std_msgs::Int16::ConstPtr &  msg)
private

Callback of the subscriber tri_grasp_percent_.

Set the target closure percentage of the tridigital grasp.

Parameters
msgstandard message containing the target closure percentage [0, 100].

Definition at line 500 of file ros_driver.cpp.

Member Data Documentation

◆ check_connection_tmr_

ros::WallTimer mia_hand::ROSDriver::check_connection_tmr_
private

Timer to handle the check of the Mia hand connection status.

Definition at line 63 of file ros_driver.h.

◆ close_cyl_grasp_

ros::ServiceServer mia_hand::ROSDriver::close_cyl_grasp_
private

Service to move the Mia hand motors to the closed position of the cylindrical grasp.

Definition at line 133 of file ros_driver.h.

◆ close_lat_grasp_

ros::ServiceServer mia_hand::ROSDriver::close_lat_grasp_
private

Service to move the Mia hand motors to the closed position of the lateral grasp.

Definition at line 135 of file ros_driver.h.

◆ close_pin_grasp_

ros::ServiceServer mia_hand::ROSDriver::close_pin_grasp_
private

Service to move the Mia hand motors to the closed position of the pinch grasp.

Definition at line 134 of file ros_driver.h.

◆ close_sph_grasp_

ros::ServiceServer mia_hand::ROSDriver::close_sph_grasp_
private

Service to move the Mia hand motors to the closed position of the spherical grasp.

Definition at line 136 of file ros_driver.h.

◆ close_tri_grasp_

ros::ServiceServer mia_hand::ROSDriver::close_tri_grasp_
private

Service to move the Mia hand motors to the closed position of the tridigital grasp.

Definition at line 137 of file ros_driver.h.

◆ connect_to_port_

ros::ServiceServer mia_hand::ROSDriver::connect_to_port_
private

Service to open a serial port and connect the Mia hand.

Definition at line 119 of file ros_driver.h.

◆ cyl_grasp_percent_

ros::Subscriber mia_hand::ROSDriver::cyl_grasp_percent_
private

Subscriber to receive the closure percentage for cylindical grasp.

Definition at line 104 of file ros_driver.h.

◆ disconnect_

ros::ServiceServer mia_hand::ROSDriver::disconnect_
private

Service to disconnect the Mia hand and close the serial port.

Definition at line 120 of file ros_driver.h.

◆ fin_for_info_

ros::Publisher mia_hand::ROSDriver::fin_for_info_
private

Publisher of the force data read by the sensors embedded in the Mia hand fingers.

Definition at line 115 of file ros_driver.h.

◆ ind_cyl_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::ind_cyl_grasp_ref_
private

Subscriber to receive the parametrs for cylindrical grasp for the index flexion motor.

Definition at line 85 of file ros_driver.h.

◆ ind_fin_trgt_for_

ros::Subscriber mia_hand::ROSDriver::ind_fin_trgt_for_
private

Subscriber to receive the target force of the index flexion motor.

Definition at line 81 of file ros_driver.h.

◆ ind_lat_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::ind_lat_grasp_ref_
private

Subscriber to receive the parametrs for lateral grasp for the index flexion motor.

Definition at line 93 of file ros_driver.h.

◆ ind_mot_trgt_pos_

ros::Subscriber mia_hand::ROSDriver::ind_mot_trgt_pos_
private

Subscriber to receive the target pose of the index flexion motor.

Definition at line 73 of file ros_driver.h.

◆ ind_mot_trgt_spe_

ros::Subscriber mia_hand::ROSDriver::ind_mot_trgt_spe_
private

Subscriber to receive the target velocity of the index flexion motor.

Definition at line 77 of file ros_driver.h.

◆ ind_pin_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::ind_pin_grasp_ref_
private

Subscriber to receive the parametrs for pinch grasp for the index flexion motor.

Definition at line 89 of file ros_driver.h.

◆ ind_sph_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::ind_sph_grasp_ref_
private

Subscriber to receive the parametrs for spherical grasp for the index flexion motor.

Definition at line 97 of file ros_driver.h.

◆ ind_tri_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::ind_tri_grasp_ref_
private

Subscriber to receive the parametrs for tridigital grasp for the index flexion motor.

Definition at line 101 of file ros_driver.h.

◆ is_connected_

bool mia_hand::ROSDriver::is_connected_
private

True if the Mia hand is connected, False otherwise.

Definition at line 59 of file ros_driver.h.

◆ lat_grasp_percent_

ros::Subscriber mia_hand::ROSDriver::lat_grasp_percent_
private

Subscriber to receive the closure percentage for lateral grasp.

Definition at line 106 of file ros_driver.h.

◆ mia_

CppDriver mia_hand::ROSDriver::mia_
private

Cpp driver of the Mia hand.

Definition at line 57 of file ros_driver.h.

◆ mot_cur_info_

ros::Publisher mia_hand::ROSDriver::mot_cur_info_
private

Publisher of the current absorbed by the Mia hand motors.

Definition at line 114 of file ros_driver.h.

◆ mot_pos_info_

ros::Publisher mia_hand::ROSDriver::mot_pos_info_
private

Publisher of the positions data of the Mia hand motors.

Definition at line 112 of file ros_driver.h.

◆ mot_spe_info_

ros::Publisher mia_hand::ROSDriver::mot_spe_info_
private

Publisher of the velocity data of the Mia hand motors.

Definition at line 113 of file ros_driver.h.

◆ mrl_cyl_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::mrl_cyl_grasp_ref_
private

Subscriber to receive the parametrs for cylindrical grasp for the mrl flexion motor.

Definition at line 86 of file ros_driver.h.

◆ mrl_fin_trgt_for_

ros::Subscriber mia_hand::ROSDriver::mrl_fin_trgt_for_
private

Subscriber to receive the target force of the mrl flexion motor.

Definition at line 82 of file ros_driver.h.

◆ mrl_lat_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::mrl_lat_grasp_ref_
private

Subscriber to receive the parametrs for lateral grasp for the mrl flexion motor.

Definition at line 94 of file ros_driver.h.

◆ mrl_mot_trgt_pos_

ros::Subscriber mia_hand::ROSDriver::mrl_mot_trgt_pos_
private

Subscriber to receive the target pose of the mrl flexion motor.

Definition at line 74 of file ros_driver.h.

◆ mrl_mot_trgt_spe_

ros::Subscriber mia_hand::ROSDriver::mrl_mot_trgt_spe_
private

Subscriber to receive the target velocity of the mrl flexion motor.

Definition at line 78 of file ros_driver.h.

◆ mrl_pin_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::mrl_pin_grasp_ref_
private

Subscriber to receive the parametrs for pinch grasp for the mrl flexion motor.

Definition at line 90 of file ros_driver.h.

◆ mrl_sph_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::mrl_sph_grasp_ref_
private

Subscriber to receive the parametrs for spherical grasp for the mrl flexion motor.

Definition at line 98 of file ros_driver.h.

◆ mrl_tri_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::mrl_tri_grasp_ref_
private

Subscriber to receive the parametrs for tridigital grasp for the mrl flexion motor.

Definition at line 102 of file ros_driver.h.

◆ nh_

ros::NodeHandle& mia_hand::ROSDriver::nh_
private

Reference to public node handle (for topics and services)

Definition at line 65 of file ros_driver.h.

◆ nh_priv_

ros::NodeHandle& mia_hand::ROSDriver::nh_priv_
private

Reference to private node handle (for parameters)

Definition at line 67 of file ros_driver.h.

◆ open_cyl_grasp_

ros::ServiceServer mia_hand::ROSDriver::open_cyl_grasp_
private

Service to move the Mia hand motors to the rest position of the cylindrical grasp.

Definition at line 127 of file ros_driver.h.

◆ open_lat_grasp_

ros::ServiceServer mia_hand::ROSDriver::open_lat_grasp_
private

Service to move the Mia hand motors to the rest position of the lateral grasp.

Definition at line 129 of file ros_driver.h.

◆ open_pin_grasp_

ros::ServiceServer mia_hand::ROSDriver::open_pin_grasp_
private

Service to move the Mia hand motors to the rest position of the pinch grasp.

Definition at line 128 of file ros_driver.h.

◆ open_sph_grasp_

ros::ServiceServer mia_hand::ROSDriver::open_sph_grasp_
private

Service to move the Mia hand motors to the rest position of the spherical grasp.

Definition at line 130 of file ros_driver.h.

◆ open_tri_grasp_

ros::ServiceServer mia_hand::ROSDriver::open_tri_grasp_
private

Service to move the Mia hand motors to the rest position of the tridigital grasp.

Definition at line 131 of file ros_driver.h.

◆ pin_grasp_percent_

ros::Subscriber mia_hand::ROSDriver::pin_grasp_percent_
private

Subscriber to receive the closure percentage for pinch grasp.

Definition at line 105 of file ros_driver.h.

◆ publish_data_tmr_

ros::WallTimer mia_hand::ROSDriver::publish_data_tmr_
private

Timer to handle the Mia hand data publishing.

Definition at line 62 of file ros_driver.h.

◆ sph_grasp_percent_

ros::Subscriber mia_hand::ROSDriver::sph_grasp_percent_
private

Subscriber to receive the closure percentage for sherical grasp.

Definition at line 107 of file ros_driver.h.

◆ switch_ana_stream_

ros::ServiceServer mia_hand::ROSDriver::switch_ana_stream_
private

Service to manage a the streaming of the analog input data (i.e. force sensor outputs) sent by the Mia hand.

Definition at line 124 of file ros_driver.h.

◆ switch_cur_stream_

ros::ServiceServer mia_hand::ROSDriver::switch_cur_stream_
private

Service to manage a the streaming of the current data (i.e. force sensor outputs) sent by the Mia hand.

Definition at line 125 of file ros_driver.h.

◆ switch_pos_stream_

ros::ServiceServer mia_hand::ROSDriver::switch_pos_stream_
private

Service to manage a the streaming of motor position data sent by the Mia hand.

Definition at line 122 of file ros_driver.h.

◆ switch_spe_stream_

ros::ServiceServer mia_hand::ROSDriver::switch_spe_stream_
private

Service to manage a the streaming of motor velocity data sent by the Mia hand.

Definition at line 123 of file ros_driver.h.

◆ thu_cyl_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::thu_cyl_grasp_ref_
private

Subscriber to receive the parametrs for cylindrical grasp for the thumb flexion motor.

Definition at line 84 of file ros_driver.h.

◆ thu_fin_trgt_for_

ros::Subscriber mia_hand::ROSDriver::thu_fin_trgt_for_
private

Subscriber to receive the target force of the tumb flexion motor.

Definition at line 80 of file ros_driver.h.

◆ thu_lat_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::thu_lat_grasp_ref_
private

Subscriber to receive the parametrs for lateral grasp for the thumb flexion motor.

Definition at line 92 of file ros_driver.h.

◆ thu_mot_trgt_pos_

ros::Subscriber mia_hand::ROSDriver::thu_mot_trgt_pos_
private

Subscriber to receive the target pose of the tumb flexion motor.

Definition at line 72 of file ros_driver.h.

◆ thu_mot_trgt_spe_

ros::Subscriber mia_hand::ROSDriver::thu_mot_trgt_spe_
private

Subscriber to receive the target velocity of the tumb flexion motor.

Definition at line 76 of file ros_driver.h.

◆ thu_pin_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::thu_pin_grasp_ref_
private

Subscriber to receive the parametrs for pinch grasp for the thumb flexion motor.

Definition at line 88 of file ros_driver.h.

◆ thu_sph_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::thu_sph_grasp_ref_
private

Subscriber to receive the parametrs for spherical grasp for the thumb flexion motor.

Definition at line 96 of file ros_driver.h.

◆ thu_tri_grasp_ref_

ros::Subscriber mia_hand::ROSDriver::thu_tri_grasp_ref_
private

Subscriber to receive the parametrs for tridigital grasp for the thumb flexion motor.

Definition at line 100 of file ros_driver.h.

◆ tri_grasp_percent_

ros::Subscriber mia_hand::ROSDriver::tri_grasp_percent_
private

Subscriber to receive the closure percentage for tridigital grasp.

Definition at line 108 of file ros_driver.h.

◆ was_connected_

bool mia_hand::ROSDriver::was_connected_
private

True if the Mia hand was connected, False otherwise.

Definition at line 60 of file ros_driver.h.


The documentation for this class was generated from the following files: