Public Member Functions | Public Attributes | List of all members
sr_hand.shadowhand_ros.ShadowHand_ROS Class Reference
Inheritance diagram for sr_hand.shadowhand_ros.ShadowHand_ROS:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self)
 
def activate_etherCAT_hand (self)
 
def callback (self, data)
 
def callback_arm (self, data)
 
def callback_ethercat_states (self, data, jointName)
 
def callVisualisationService (self, callList=0, reset=0)
 
def check_CAN_hand_presence (self)
 
def check_etherCAT_hand_presence (self)
 
def check_gazebo_hand_presence (self)
 
def check_hand_type (self)
 
def create_grasp_interpoler (self, current_step, next_step)
 
def get_tactile_state (self)
 
def get_tactile_type (self)
 
def has_arm (self)
 
def init_actual_joints (self)
 
def joint_states_callback (self, joint_state)
 
def read_all_current_arm_positions (self)
 
def read_all_current_arm_targets (self)
 
def read_all_current_efforts (self)
 
def read_all_current_positions (self)
 
def read_all_current_targets (self)
 
def read_all_current_velocities (self)
 
def record_step_to_file (self, filename, grasp_as_xml)
 
def resend_targets (self)
 
def save_hand_position_to_file (self, filename)
 
def sendupdate (self, jointName, angle=0)
 
def sendupdate_arm (self, jointName, angle=0)
 
def sendupdate_arm_from_dict (self, dicti)
 
def sendupdate_from_dict (self, dicti)
 
def set_sendupdate_topic (self, topic)
 
def set_shadowhand_data_topic (self, topic)
 
def valueof (self, jointName)
 

Public Attributes

 allJoints
 
 armJoints
 
 cyberglove_pub
 
 cyberglove_sub
 
 cybergrasp_pub
 
 dict_arm_pos
 
 dict_arm_tar
 
 dict_ethercat_joints
 
 dict_pos
 
 dict_tar
 
 eth_publishers
 
 eth_subscribers
 
 grasp_interpoler
 
 grasp_parser
 
 hand_effort
 
 hand_type
 
 hand_velocity
 
 handJoints
 
 hasarm
 
 isFirstMessage
 
 isFirstMessageArm
 
 isReady
 
 joint_states_listener
 
 joint_states_lock
 
 lastArmMsg
 
 lastMsg
 
 liste
 
 pub
 
 pub_arm
 
 rootPath
 
 sendupdate_lock
 
 sub
 
 sub_arm
 
 tactile_receiver
 
 topic_ending
 

Detailed Description

This is a python library used to easily access the shadow hand ROS interface.

Definition at line 45 of file shadowhand_ros.py.

Constructor & Destructor Documentation

◆ __init__()

def sr_hand.shadowhand_ros.ShadowHand_ROS.__init__ (   self)
Builds the library, creates the communication node in ROS and
initializes the hand publisher and subscriber to the default
values of shadowhand_data and sendupdate

Definition at line 51 of file shadowhand_ros.py.

Member Function Documentation

◆ activate_etherCAT_hand()

def sr_hand.shadowhand_ros.ShadowHand_ROS.activate_etherCAT_hand (   self)
At the moment we just try to use the mixed position velocity controllers

Definition at line 506 of file shadowhand_ros.py.

◆ callback()

def sr_hand.shadowhand_ros.ShadowHand_ROS.callback (   self,
  data 
)
@param data: The ROS message received which called the callback
If the message is the first received, initializes the dictionnaries
Else, it updates the lastMsg

Definition at line 191 of file shadowhand_ros.py.

◆ callback_arm()

def sr_hand.shadowhand_ros.ShadowHand_ROS.callback_arm (   self,
  data 
)
@param data: The ROS message received which called the callback
If the message is the first received, initializes the dictionnaries
Else, it updates the lastMsg

Definition at line 206 of file shadowhand_ros.py.

◆ callback_ethercat_states()

def sr_hand.shadowhand_ros.ShadowHand_ROS.callback_ethercat_states (   self,
  data,
  jointName 
)
@param data: The ROS message received which called the callback
If the message is the first received, initializes the dictionnaries
Else, it updates the lastMsg
@param joint: a Joint object that contains the name of the joint that we receive data from

Definition at line 156 of file shadowhand_ros.py.

◆ callVisualisationService()

def sr_hand.shadowhand_ros.ShadowHand_ROS.callVisualisationService (   self,
  callList = 0,
  reset = 0 
)
@param callList: dictionnary mapping joint names to information that should be displayed
@param reset: flag used to tell if the parameters should be replaced by the new ones or
just added to the previous ones.
Calls a ROS service to display various information in Rviz

Definition at line 461 of file shadowhand_ros.py.

◆ check_CAN_hand_presence()

def sr_hand.shadowhand_ros.ShadowHand_ROS.check_CAN_hand_presence (   self)
@return : true if the CAN hand is detected

Definition at line 239 of file shadowhand_ros.py.

◆ check_etherCAT_hand_presence()

def sr_hand.shadowhand_ros.ShadowHand_ROS.check_etherCAT_hand_presence (   self)
Only used to check if a real etherCAT hand is detected in the system
check if something is being published to this topic, otherwise
return false
Bear in mind that the gazebo hand also publishes the joint_states topic,
so we need to check for the gazebo hand first

Definition at line 474 of file shadowhand_ros.py.

◆ check_gazebo_hand_presence()

def sr_hand.shadowhand_ros.ShadowHand_ROS.check_gazebo_hand_presence (   self)
Only used to check if a Gazebo simulated (etherCAT protocol) hand is detected in the system
check if something is being published to this topic, otherwise
return false

Definition at line 491 of file shadowhand_ros.py.

◆ check_hand_type()

def sr_hand.shadowhand_ros.ShadowHand_ROS.check_hand_type (   self)
@return : true if some hand is detected

Definition at line 227 of file shadowhand_ros.py.

◆ create_grasp_interpoler()

def sr_hand.shadowhand_ros.ShadowHand_ROS.create_grasp_interpoler (   self,
  current_step,
  next_step 
)

Definition at line 153 of file shadowhand_ros.py.

◆ get_tactile_state()

def sr_hand.shadowhand_ros.ShadowHand_ROS.get_tactile_state (   self)

Definition at line 571 of file shadowhand_ros.py.

◆ get_tactile_type()

def sr_hand.shadowhand_ros.ShadowHand_ROS.get_tactile_type (   self)

Definition at line 568 of file shadowhand_ros.py.

◆ has_arm()

def sr_hand.shadowhand_ros.ShadowHand_ROS.has_arm (   self)
@return : True if an arm is detected on the roscore

Definition at line 357 of file shadowhand_ros.py.

◆ init_actual_joints()

def sr_hand.shadowhand_ros.ShadowHand_ROS.init_actual_joints (   self)
Initializes the library with just the fingers actually connected

Definition at line 218 of file shadowhand_ros.py.

◆ joint_states_callback()

def sr_hand.shadowhand_ros.ShadowHand_ROS.joint_states_callback (   self,
  joint_state 
)
The callback function for the topic joint_states.
It will store the received joint velocity and effort information in two dictionaries
Velocity will be converted to degrees/s.
Effort units are kept as they are (currently ADC units, as no calibration is performed on the strain gauges)

@param joint_state: the message containing the joints data.

Definition at line 545 of file shadowhand_ros.py.

◆ read_all_current_arm_positions()

def sr_hand.shadowhand_ros.ShadowHand_ROS.read_all_current_arm_positions (   self)
@return: dictionnary mapping joint names to actual positions
Read all the positions in the lastMsg

Definition at line 436 of file shadowhand_ros.py.

◆ read_all_current_arm_targets()

def sr_hand.shadowhand_ros.ShadowHand_ROS.read_all_current_arm_targets (   self)
@return: dictionnary mapping joint names to actual targets
Read all the targets in the lastMsg

Definition at line 445 of file shadowhand_ros.py.

◆ read_all_current_efforts()

def sr_hand.shadowhand_ros.ShadowHand_ROS.read_all_current_efforts (   self)
@return: dictionary mapping joint names to current efforts

Definition at line 429 of file shadowhand_ros.py.

◆ read_all_current_positions()

def sr_hand.shadowhand_ros.ShadowHand_ROS.read_all_current_positions (   self)
@return: dictionnary mapping joint names to actual positions
Read all the positions in the lastMsg

Definition at line 402 of file shadowhand_ros.py.

◆ read_all_current_targets()

def sr_hand.shadowhand_ros.ShadowHand_ROS.read_all_current_targets (   self)
@return: dictionnary mapping joint names to current targets
Read all the targets in the lastMsg

Definition at line 413 of file shadowhand_ros.py.

◆ read_all_current_velocities()

def sr_hand.shadowhand_ros.ShadowHand_ROS.read_all_current_velocities (   self)
@return: dictionary mapping joint names to current velocities

Definition at line 422 of file shadowhand_ros.py.

◆ record_step_to_file()

def sr_hand.shadowhand_ros.ShadowHand_ROS.record_step_to_file (   self,
  filename,
  grasp_as_xml 
)
@param filename: name (or path) of the file to save to
@param grasp_as_xml: xml-formatted grasp
Write the grasp at the end of the file, creates the file if does not exist

Definition at line 373 of file shadowhand_ros.py.

◆ resend_targets()

def sr_hand.shadowhand_ros.ShadowHand_ROS.resend_targets (   self)
Resend the targets read in the lastMsg to the hand

Definition at line 454 of file shadowhand_ros.py.

◆ save_hand_position_to_file()

def sr_hand.shadowhand_ros.ShadowHand_ROS.save_hand_position_to_file (   self,
  filename 
)

Definition at line 396 of file shadowhand_ros.py.

◆ sendupdate()

def sr_hand.shadowhand_ros.ShadowHand_ROS.sendupdate (   self,
  jointName,
  angle = 0 
)
@param jointName: Name of the joint to update
@param angle: Target of the joint, 0 if not set
Sends a new target for the specified joint

Definition at line 300 of file shadowhand_ros.py.

◆ sendupdate_arm()

def sr_hand.shadowhand_ros.ShadowHand_ROS.sendupdate_arm (   self,
  jointName,
  angle = 0 
)
@param jointName: Name of the joint to update
@param angle: Target of the joint, 0 if not set
Sends a new target for the specified joint

Definition at line 335 of file shadowhand_ros.py.

◆ sendupdate_arm_from_dict()

def sr_hand.shadowhand_ros.ShadowHand_ROS.sendupdate_arm_from_dict (   self,
  dicti 
)
@param dicti: Dictionnary containing all the targets to send, mapping
the name of the joint to the value of its target.
Sends new targets to the hand from a dictionnary

Definition at line 324 of file shadowhand_ros.py.

◆ sendupdate_from_dict()

def sr_hand.shadowhand_ros.ShadowHand_ROS.sendupdate_from_dict (   self,
  dicti 
)
@param dicti: Dictionnary containing all the targets to send, mapping
the name of the joint to the value of its target.
Sends new targets to the hand from a dictionnary

Definition at line 271 of file shadowhand_ros.py.

◆ set_sendupdate_topic()

def sr_hand.shadowhand_ros.ShadowHand_ROS.set_sendupdate_topic (   self,
  topic 
)
@param topic: The new topic to be set as the hand subscribing topic
Set the library to publish to a new topic

Definition at line 263 of file shadowhand_ros.py.

◆ set_shadowhand_data_topic()

def sr_hand.shadowhand_ros.ShadowHand_ROS.set_shadowhand_data_topic (   self,
  topic 
)
@param topic: The new topic to be set as the hand publishing topic
Set the library to listen to a new topic

Definition at line 255 of file shadowhand_ros.py.

◆ valueof()

def sr_hand.shadowhand_ros.ShadowHand_ROS.valueof (   self,
  jointName 
)
@param jointName: Name of the joint to read the value
@return: 'NaN' if the value is not correct, the actual position of the joint else

Definition at line 344 of file shadowhand_ros.py.

Member Data Documentation

◆ allJoints

sr_hand.shadowhand_ros.ShadowHand_ROS.allJoints

Definition at line 57 of file shadowhand_ros.py.

◆ armJoints

sr_hand.shadowhand_ros.ShadowHand_ROS.armJoints

Definition at line 79 of file shadowhand_ros.py.

◆ cyberglove_pub

sr_hand.shadowhand_ros.ShadowHand_ROS.cyberglove_pub

Definition at line 86 of file shadowhand_ros.py.

◆ cyberglove_sub

sr_hand.shadowhand_ros.ShadowHand_ROS.cyberglove_sub

Definition at line 87 of file shadowhand_ros.py.

◆ cybergrasp_pub

sr_hand.shadowhand_ros.ShadowHand_ROS.cybergrasp_pub

Definition at line 88 of file shadowhand_ros.py.

◆ dict_arm_pos

sr_hand.shadowhand_ros.ShadowHand_ROS.dict_arm_pos

Definition at line 97 of file shadowhand_ros.py.

◆ dict_arm_tar

sr_hand.shadowhand_ros.ShadowHand_ROS.dict_arm_tar

Definition at line 98 of file shadowhand_ros.py.

◆ dict_ethercat_joints

sr_hand.shadowhand_ros.ShadowHand_ROS.dict_ethercat_joints

Definition at line 99 of file shadowhand_ros.py.

◆ dict_pos

sr_hand.shadowhand_ros.ShadowHand_ROS.dict_pos

Definition at line 95 of file shadowhand_ros.py.

◆ dict_tar

sr_hand.shadowhand_ros.ShadowHand_ROS.dict_tar

Definition at line 96 of file shadowhand_ros.py.

◆ eth_publishers

sr_hand.shadowhand_ros.ShadowHand_ROS.eth_publishers

Definition at line 100 of file shadowhand_ros.py.

◆ eth_subscribers

sr_hand.shadowhand_ros.ShadowHand_ROS.eth_subscribers

Definition at line 101 of file shadowhand_ros.py.

◆ grasp_interpoler

sr_hand.shadowhand_ros.ShadowHand_ROS.grasp_interpoler

Definition at line 122 of file shadowhand_ros.py.

◆ grasp_parser

sr_hand.shadowhand_ros.ShadowHand_ROS.grasp_parser

Definition at line 116 of file shadowhand_ros.py.

◆ hand_effort

sr_hand.shadowhand_ros.ShadowHand_ROS.hand_effort

Definition at line 136 of file shadowhand_ros.py.

◆ hand_type

sr_hand.shadowhand_ros.ShadowHand_ROS.hand_type

Definition at line 133 of file shadowhand_ros.py.

◆ hand_velocity

sr_hand.shadowhand_ros.ShadowHand_ROS.hand_velocity

Definition at line 135 of file shadowhand_ros.py.

◆ handJoints

sr_hand.shadowhand_ros.ShadowHand_ROS.handJoints

Definition at line 78 of file shadowhand_ros.py.

◆ hasarm

sr_hand.shadowhand_ros.ShadowHand_ROS.hasarm

Definition at line 94 of file shadowhand_ros.py.

◆ isFirstMessage

sr_hand.shadowhand_ros.ShadowHand_ROS.isFirstMessage

Definition at line 90 of file shadowhand_ros.py.

◆ isFirstMessageArm

sr_hand.shadowhand_ros.ShadowHand_ROS.isFirstMessageArm

Definition at line 91 of file shadowhand_ros.py.

◆ isReady

sr_hand.shadowhand_ros.ShadowHand_ROS.isReady

Definition at line 92 of file shadowhand_ros.py.

◆ joint_states_listener

sr_hand.shadowhand_ros.ShadowHand_ROS.joint_states_listener

Definition at line 139 of file shadowhand_ros.py.

◆ joint_states_lock

sr_hand.shadowhand_ros.ShadowHand_ROS.joint_states_lock

Definition at line 105 of file shadowhand_ros.py.

◆ lastArmMsg

sr_hand.shadowhand_ros.ShadowHand_ROS.lastArmMsg

Definition at line 85 of file shadowhand_ros.py.

◆ lastMsg

sr_hand.shadowhand_ros.ShadowHand_ROS.lastMsg

Definition at line 84 of file shadowhand_ros.py.

◆ liste

sr_hand.shadowhand_ros.ShadowHand_ROS.liste

Definition at line 93 of file shadowhand_ros.py.

◆ pub

sr_hand.shadowhand_ros.ShadowHand_ROS.pub

Definition at line 123 of file shadowhand_ros.py.

◆ pub_arm

sr_hand.shadowhand_ros.ShadowHand_ROS.pub_arm

Definition at line 125 of file shadowhand_ros.py.

◆ rootPath

sr_hand.shadowhand_ros.ShadowHand_ROS.rootPath

Definition at line 118 of file shadowhand_ros.py.

◆ sendupdate_lock

sr_hand.shadowhand_ros.ShadowHand_ROS.sendupdate_lock

Definition at line 103 of file shadowhand_ros.py.

◆ sub

sr_hand.shadowhand_ros.ShadowHand_ROS.sub

Definition at line 130 of file shadowhand_ros.py.

◆ sub_arm

sr_hand.shadowhand_ros.ShadowHand_ROS.sub_arm

Definition at line 128 of file shadowhand_ros.py.

◆ tactile_receiver

sr_hand.shadowhand_ros.ShadowHand_ROS.tactile_receiver

Definition at line 149 of file shadowhand_ros.py.

◆ topic_ending

sr_hand.shadowhand_ros.ShadowHand_ROS.topic_ending

Definition at line 109 of file shadowhand_ros.py.


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


sr_hand
Author(s): Ugo Cupcic
autogenerated on Mon Feb 28 2022 23:52:24