Public Member Functions | |
def | __init__ (self, port='/dev/pcan32') |
def | can_init (self) |
def | can_reset (self) |
def | can_status (self) |
def | can_uninit (self) |
def | check_error (self, connection, result, location_of_error) |
def | clean_read_buffer (self) |
def | close_all (self) |
def | close_finger (self, puckID, autowait=True) |
def | close_finger_step (self, puckID, step=-1, autowait=True) |
def | close_grasp (self) |
def | close_grasp_step (self, step=0) |
def | close_spread (self) |
def | close_spread_step (self, step=-1) |
def | deg_to_enc (self, deg) |
def | detect_breakaway (self, finger) |
def | done_moving (self, motors_to_check=ALL_FINGERS) |
def | enc_to_deg (self, enc) |
def | enc_to_per (self, enc) |
def | enc_to_rad (self, enc, type=BASE_TYPE) |
def | enum (self) |
def | get_16 (self, msgID, propID) |
def | get_32 (self, msgID, propID) |
def | get_fts (self) |
def | get_full_pos_packet (msgID) |
def | get_full_tact (self, msgID) |
def | get_mode (self, msgID) |
def | get_packed_position (self, msgID) |
def | get_position (self, msgID, depth=0) |
def | get_prop_quick (self, msgID, propID, speed) |
def | get_property (self, msgID, propID) |
def | get_role (self, msgID) |
def | get_strain (self, msgID) |
def | get_tact (self, msgID, topOrFull="TOP10") |
def | get_temp (self, msgID) |
def | get_therm (self, msgID) |
def | get_top_tact (self, msgID) |
def | get_velocity (self, msgID) |
def | init_finger (self, msgID) |
def | init_hand (self) |
def | initialize (self) |
def | initialize_fts (self) |
def | load_property (self, msgID, propID) |
def | move (self) |
def | move_grasp (self, position=-1) |
def | move_to (self, puckID, target, autowait=True) |
def | new_temp_mail (self, fingers_to_change) |
def | onescomp (self, binstr) |
def | open_all (self) |
def | open_finger (self, puckID, autowait=True) |
def | open_finger_step (self, puckID, step=-1, autowait=True) |
def | open_grasp (self) |
def | open_grasp_step (self, step=0) |
def | open_spread (self) |
def | open_spread_step (self, step=-1) |
def | per_to_enc (self, per) |
def | process_can_messages (self) |
def | process_force (self, msg) |
def | process_full_tact (self, msg) |
def | process_motor_temp (self, msg) |
def | process_motor_therm (self, msg) |
def | process_packed_position (self, msg) |
def | process_strain (self, msg) |
def | process_tactile_data (self, data_array) |
def | process_torque (self, msg) |
def | rad_to_enc (self, rad, type=BASE_TYPE) |
def | read_full_force_torque (self) |
def | read_full_tact (self, msgID) |
def | read_msg (self) |
def | read_msg_resilient (self, expect_puck, expect_prop, max_recurse=10, counter=0) |
def | read_packed_position (self, msgID) |
def | read_strain (self, msgID) |
def | read_temp (self, msgID) |
def | read_therm (self, msgID) |
def | revert_temp_mail (self, fingers_to_change, former) |
def | save_property (self, msgID, propID) |
def | send_msg (self, msgID, data) |
def | set_16 (self, msgID, propID, value) |
def | set_32 (self, msgID, propID, value) |
def | set_hand_targets (self, f1_target, f2_target, f3_target, sp_target) |
def | set_mode (self, msgID, value) |
def | set_property (self, msgID, propID, value) |
def | set_puck_like (self, puckID, virtID) |
def | set_velocity (self, puckID, velocity) |
def | tare_fts (self) |
def | twoscomp (self, number) |
def | twoscomp2 (self, number, bits) |
def | wait_done_moving (self, motors_to_check=ALL_FINGERS) |
def | write_msg (self, msgID, data, delay=.002) |
Public Attributes | |
ft_sensor | |
motor_positions | |
PCAN | |
strain | |
tactile_sensor | |
temp | |
Definition at line 100 of file pyHand_api.py.
def pyHand_api.pyHand.__init__ | ( | self, | |
port = '/dev/pcan32' |
|||
) |
Creates a PCANBasic object @param port: CAN port used to communicate with the hand @type connection: string
Definition at line 102 of file pyHand_api.py.
def pyHand_api.pyHand.can_init | ( | self | ) |
Initializes the CAN connection. Note that this does not initialize the hand itself.
Definition at line 176 of file pyHand_api.py.
def pyHand_api.pyHand.can_reset | ( | self | ) |
Resets the CAN connection. Note that this may cause a loss of data, but may also clear unwanted data. Utilize as needed.
Definition at line 154 of file pyHand_api.py.
def pyHand_api.pyHand.can_status | ( | self | ) |
Returns the status of the CAN connection as specified in PCANBasic's GetStatus method.
Definition at line 168 of file pyHand_api.py.
def pyHand_api.pyHand.can_uninit | ( | self | ) |
Uninitializes the CAN connection. Rarely used.
Definition at line 185 of file pyHand_api.py.
def pyHand_api.pyHand.check_error | ( | self, | |
connection, | |||
result, | |||
location_of_error | |||
) |
Checks error on the CAN Bus. @param connection: The connection on which the CAN is talking. For example, PCANBasic() @type connection: PCANBasic @param result: The number corresponding to the error returned. @type resulr: int @param location_of_error: A description of where the error occurred. @type location_of_error: str
Definition at line 122 of file pyHand_api.py.
def pyHand_api.pyHand.clean_read_buffer | ( | self | ) |
Definition at line 1699 of file pyHand_api.py.
def pyHand_api.pyHand.close_all | ( | self | ) |
Closes every finger at once. Mainly for use in DEMO. WARNING: can be dangerous because it may cause fingers to collide if the hand is in an unknown position.
Definition at line 918 of file pyHand_api.py.
def pyHand_api.pyHand.close_finger | ( | self, | |
puckID, | |||
autowait = True |
|||
) |
Close finger and wait for completion. @param puckID: Finger to be closed. @type puckID: int @param autowait: calls wait_done_moving if True. Defaults to True. @type autowait: bool
Definition at line 865 of file pyHand_api.py.
def pyHand_api.pyHand.close_finger_step | ( | self, | |
puckID, | |||
step = -1 , |
|||
autowait = True |
|||
) |
Close finger by input decrement. @param puckID: Finger to be closed. @type puckID: int @param step: size of decrement in encoder counts. Defaults to -1. @type step: int @param autowait: calls wait_done_moving if True. Defaults to True. @type autowait: bool
Definition at line 998 of file pyHand_api.py.
def pyHand_api.pyHand.close_grasp | ( | self | ) |
Closes all fingers to the position encoded by Close Target (CT).
Definition at line 811 of file pyHand_api.py.
def pyHand_api.pyHand.close_grasp_step | ( | self, | |
step = 0 |
|||
) |
Close grasp by input decrement. @param step: size of decrement in encoder counts. Defaults to 0. @type step: int
Definition at line 946 of file pyHand_api.py.
def pyHand_api.pyHand.close_spread | ( | self | ) |
Close spread to position determined by Close Target (CT).
Definition at line 841 of file pyHand_api.py.
def pyHand_api.pyHand.close_spread_step | ( | self, | |
step = -1 |
|||
) |
Close spread by input decrement. @param step: size of decrement in encoder counts. Defaults to -1. @type step: int
Definition at line 969 of file pyHand_api.py.
def pyHand_api.pyHand.deg_to_enc | ( | self, | |
deg | |||
) |
Given a degree measure of an angle, return it in encoder counts. @param deg: Degrees @type deg: float @return: Encoder counts @rtype: int
Definition at line 1686 of file pyHand_api.py.
def pyHand_api.pyHand.detect_breakaway | ( | self, | |
finger | |||
) |
@return: True if the finger has broken away, False if it hasn't
Definition at line 780 of file pyHand_api.py.
def pyHand_api.pyHand.done_moving | ( | self, | |
motors_to_check = ALL_FINGERS |
|||
) |
Checks a given list of motors once to see if they have stopped moving, and if so, it returns true @param motors_to_check: A list of motors to check. @type motors_to_check: Array[*int] @rtype: bool @return: Whether or not the motors are done moving.
Definition at line 755 of file pyHand_api.py.
def pyHand_api.pyHand.enc_to_deg | ( | self, | |
enc | |||
) |
Given an angle in encoder counts, return the degree measure of the angle that represents. @param enc: Encoder counts. @type enc: int @return: Degrees @rtype: float
Definition at line 1639 of file pyHand_api.py.
def pyHand_api.pyHand.enc_to_per | ( | self, | |
enc | |||
) |
Given an angle in encoder counts, return the percentage of the angle that represents. @param enc: Encoder counts. @type enc: int @return: Percentage @rtype: float
Definition at line 1604 of file pyHand_api.py.
def pyHand_api.pyHand.enc_to_rad | ( | self, | |
enc, | |||
type = BASE_TYPE |
|||
) |
Given an angle in encoder counts, return the radian measure of the angle that represents. @param enc: Encoder counts. @type enc: int @return: Radians @rtype: float
Definition at line 1616 of file pyHand_api.py.
def pyHand_api.pyHand.enum | ( | self | ) |
Finds and returns all of the pucks that are attached to the bus. @rtype: Array[] @return: An array containing the pucks attached to the bus.
Definition at line 138 of file pyHand_api.py.
def pyHand_api.pyHand.get_16 | ( | self, | |
msgID, | |||
propID | |||
) |
Gets a 16 bit property. Please use get_property instead of this method where applicable. @param msgID: The puck whose property will be read from. @type msgID: int @param propID: The property be read from. @type propID: int @rtype: int @return: The value held in the property.
Definition at line 421 of file pyHand_api.py.
def pyHand_api.pyHand.get_32 | ( | self, | |
msgID, | |||
propID | |||
) |
Gets a 32 bit property. Please use get_property instead of this method where applicable. @param msgID: The puck whose property will be read from. @type msgID: int @param propID: The property be read from. @type propID: int @rtype: int @return: The value held in the property.
Definition at line 401 of file pyHand_api.py.
def pyHand_api.pyHand.get_fts | ( | self | ) |
Returns the FTS values
Definition at line 1585 of file pyHand_api.py.
def pyHand_api.pyHand.get_full_pos_packet | ( | msgID | ) |
Definition at line 1017 of file pyHand_api.py.
def pyHand_api.pyHand.get_full_tact | ( | self, | |
msgID | |||
) |
Unpack all tactile sensor values in an array. @param msgID: The puck or group to get full tactile array sensor data. @type msgID: int @rtype: Array[*data] @return: An array containing the tactile data from a given puck.
self.set_property(msgID, TACT, TACT_FULL) #self.write_msg(msgID, [TACT]) output = [0,0,0,0,0] read_result = self.PCAN.Read(PCAN_USBBUS1) self.check_error(self.PCAN,read_result[0],"reading full tactile data") read_result2 = self.PCAN.Read(PCAN_USBBUS1) self.check_error(self.PCAN,read_result2[0],"reading full tactile data") read_result3 = self.PCAN.Read(PCAN_USBBUS1) self.check_error(self.PCAN,read_result3[0],"reading full tactile data") read_result4 = self.PCAN.Read(PCAN_USBBUS1) self.check_error(self.PCAN,read_result4[0],"reading full tactile data") read_result5 = self.PCAN.Read(PCAN_USBBUS1) self.check_error(self.PCAN,read_result5[0],"reading full tactile data") output[0] = read_result[1].DATA output[1] = read_result2[1].DATA output[2] = read_result3[1].DATA output[3] = read_result4[1].DATA output[4] = read_result5[1].DATA #print 'Init: ID1 = %x, ID2 = %x, ID3 = %x, ID4 = %x, ID5 = %x'%(read_result[1].ID, read_result2[1].ID, read_result3[1].ID, read_result4[1].ID, read_result5[1].ID) tactileVals = range(0,24) index_ = 0 for data in output: index_ = int(data[0]/16) * 5 #print 'index = %d, data[0] = %x'%(index_, data[0]) # Get the bits and then unpack them. tactileVals[index_ + 0] = round(((data[0]%0x10)*0x100 + data[1])/256.0,2) tactileVals[index_ + 1] = round((data[2]*0x10 + int(data[3]/0x10))/256.0,2) tactileVals[index_ + 2] = round(((data[3]%0x10)*0x100 + data[4])/256.0,2) tactileVals[index_ + 3] = round((data[5]*0x10 + int(data[6]/0x10))/256.0,2) if index_ != 20: tactileVals[index_ + 4] = round(((data[6]%0x10)*0x100 + data[7])/256.0,2) #print 'Return OK : %s'%(tactileVals) return tactileVals
Definition at line 1141 of file pyHand_api.py.
def pyHand_api.pyHand.get_mode | ( | self, | |
msgID | |||
) |
Read from MODE property, and return a tuple with the number corresponding to the mode, along with the string name of the mode. @param msgID: The puck from which to get the mode. @type msgID: int @rtype: Tuple(int, str) @return: A tuple with the number and name of the mode.
Definition at line 546 of file pyHand_api.py.
def pyHand_api.pyHand.get_packed_position | ( | self, | |
msgID | |||
) |
Get packed position data and return both P and JP. @param msgID: The puck or group to get position data. @type msgID: int @rtype: (int, int) @return: The position and joint position of the finger in encoder counts. Position in radians
Definition at line 1301 of file pyHand_api.py.
def pyHand_api.pyHand.get_position | ( | self, | |
msgID, | |||
depth = 0 |
|||
) |
Get packed position data and return it. @param msgID: The puck or group to get position data. @type msgID: int @rtype: int @param depth: number of times get message was retried. @return: The position of the finger in encoder counts.
Definition at line 1267 of file pyHand_api.py.
def pyHand_api.pyHand.get_prop_quick | ( | self, | |
msgID, | |||
propID, | |||
speed | |||
) |
Gets a property timed at a certain rate. @param msgID: The puck or group to have its property gotten. @type msgID: int @param propID: The property to be saved. @type propID: int @param speed: The time delay for the get. @type speed: float
Definition at line 466 of file pyHand_api.py.
def pyHand_api.pyHand.get_property | ( | self, | |
msgID, | |||
propID | |||
) |
Get property from pucks in msgID. @param msgID: The puck whose property will be read from. @type msgID: int @param propID: The property be read from. @type propID: int @rtype: int @return: The value held in the property.
Definition at line 381 of file pyHand_api.py.
def pyHand_api.pyHand.get_role | ( | self, | |
msgID | |||
) |
Read from ROLE property and return something that makes sense. Returns an array of holding the following data: [4-bit Product Identifier, Internal Thermistor, 20 MHz (vs 32 MHz), Hall Motor Encoder, Enc Motor Encoder, Strain Gauge, IMU for Force-Torque Sensor, Optical Motor Encoder] @param msgID: The puck to get the ROLE from. @type msgID: int @rtype: Array[int,bool,bool,bool,bool,bool,bool,bool] @return: An array holding the above values.
Definition at line 514 of file pyHand_api.py.
def pyHand_api.pyHand.get_strain | ( | self, | |
msgID | |||
) |
Gets the fingertip torque sensor value. @param msgID: The puck or group to get fingertip torque sensor data. @type msgID: int @rtype: int @return: Strain Gauge Reading
Definition at line 1222 of file pyHand_api.py.
def pyHand_api.pyHand.get_tact | ( | self, | |
msgID, | |||
topOrFull = "TOP10" |
|||
) |
Obtain and interpret tactile sensor data. @param msgID: The puck or group to get full or top 10 tactile array sensor data. @type msgID: int @param topOrFull: To get full data, enter "FULL". To get the top 10 values, enter "TOP10". Or anything else, really. @type topOrFull: str @return
Definition at line 1190 of file pyHand_api.py.
def pyHand_api.pyHand.get_temp | ( | self, | |
msgID | |||
) |
Gets temperature value for all pucks in msgID. @param msgID: The puck or group to get temp. @type msgID: int @rtype: int @return: The value of the TEMP property.
Definition at line 1059 of file pyHand_api.py.
def pyHand_api.pyHand.get_therm | ( | self, | |
msgID | |||
) |
Gets motor temperature value for all pucks in msgID. @param msgID: The puck or group to get motor temperature. @text msgID: int @rtype: int @return: The value of the THERM property.
Definition at line 1082 of file pyHand_api.py.
def pyHand_api.pyHand.get_top_tact | ( | self, | |
msgID | |||
) |
Unpack the top10 values from TACT. Returns a dictionary with 10 items like (sensor number):(tact value). @param msgID: The puck or group to get top 10 tactile data. @type msgID: int @rtype: Dictionary{sensorID:value} @return topVals: Dictionary of the top 10 tactile array sensor values.
Definition at line 1104 of file pyHand_api.py.
def pyHand_api.pyHand.get_velocity | ( | self, | |
msgID | |||
) |
Returns velocity values of finger when in motion. Mostly returns garbage. It's used to help tell when finger is stopped or near to it. @param msgID: The puck or group to get velocity. @type msgID: int @rtype: float @return: A (garbage) value representing the approximate velocity of the finger.
Definition at line 1022 of file pyHand_api.py.
def pyHand_api.pyHand.init_finger | ( | self, | |
msgID | |||
) |
Sends a command to the puck to wake up the motor attatched to the puck. @param msgID: The id of the finger to initialize. @type msgID: int
Definition at line 251 of file pyHand_api.py.
def pyHand_api.pyHand.init_hand | ( | self | ) |
Initialize all pucks in the hand. @rtype: Boolean @return: Succesfully Initialized Hand?
Definition at line 217 of file pyHand_api.py.
def pyHand_api.pyHand.initialize | ( | self | ) |
Wakes up pucks and initializes the CAN. This function must be implemented at the beginning of a program for this library to properly work. @rtype: ROLE @return: First finger's ROLE property if initialization is successful. Otherwise it returns False.
Definition at line 194 of file pyHand_api.py.
def pyHand_api.pyHand.initialize_fts | ( | self | ) |
Wake pucks and tare sensor.
Definition at line 261 of file pyHand_api.py.
def pyHand_api.pyHand.load_property | ( | self, | |
msgID, | |||
propID | |||
) |
Load a property's value for puck's flash memory. @param msgID: The puck or group to have its property loaded. @type msgID: int @param propID: The property to be loaded. @type propID: int
Definition at line 455 of file pyHand_api.py.
def pyHand_api.pyHand.move | ( | self | ) |
Moves all fingers/spread to their default.
Definition at line 897 of file pyHand_api.py.
def pyHand_api.pyHand.move_grasp | ( | self, | |
position = -1 |
|||
) |
Moves all fingers to input argument or default position (50). @param position: position of fingers. Defaults to -1. Valid position range is from 0-195,000 encoder counts. @type position: int
Definition at line 882 of file pyHand_api.py.
def pyHand_api.pyHand.move_to | ( | self, | |
puckID, | |||
target, | |||
autowait = True |
|||
) |
Move the motor to a specific position. @param puckID: The puck to move. @type puckID: int @param target: The end position to move to. @type target: int @param autowait: Does the program wait until the motor is done moving? @type autowait: bool
Definition at line 740 of file pyHand_api.py.
def pyHand_api.pyHand.new_temp_mail | ( | self, | |
fingers_to_change | |||
) |
Definition at line 1591 of file pyHand_api.py.
def pyHand_api.pyHand.onescomp | ( | self, | |
binstr | |||
) |
Definition at line 1247 of file pyHand_api.py.
def pyHand_api.pyHand.open_all | ( | self | ) |
Opens every fingers at once. Mainly used in DEMO. WARNING: can be dangerous because it may cause fingers to collide if the hand is in an unknown position.
Definition at line 904 of file pyHand_api.py.
def pyHand_api.pyHand.open_finger | ( | self, | |
puckID, | |||
autowait = True |
|||
) |
Open finger and wait for completion. @param puckID: Finger to be opened. @type puckID: int @param autowait: calls wait_done_moving if True. Defaults to True. @type autowait: bool
Definition at line 848 of file pyHand_api.py.
def pyHand_api.pyHand.open_finger_step | ( | self, | |
puckID, | |||
step = -1 , |
|||
autowait = True |
|||
) |
Open finger by input increment. @param puckID: Finger to be opened. @type puckID: int @param step: size of increment in encoder counts. Defaults to -1. @type step: int @param autowait: calls wait_done_moving if True. Defaults to True. @type autowait: bool
Definition at line 980 of file pyHand_api.py.
def pyHand_api.pyHand.open_grasp | ( | self | ) |
Opens all fingers to the position encoded by Open Target (OT)
Definition at line 789 of file pyHand_api.py.
def pyHand_api.pyHand.open_grasp_step | ( | self, | |
step = 0 |
|||
) |
Open grasp by input increment. @param step: size of increment in encoder counts. Defaults to 0. @type step: int
Definition at line 934 of file pyHand_api.py.
def pyHand_api.pyHand.open_spread | ( | self | ) |
Open spread to position determined by Open Target (OT).
Definition at line 833 of file pyHand_api.py.
def pyHand_api.pyHand.open_spread_step | ( | self, | |
step = -1 |
|||
) |
Open spread by input increment. @param step: size of increment in encoder counts. Defaults to -1. @type step: int
Definition at line 958 of file pyHand_api.py.
def pyHand_api.pyHand.per_to_enc | ( | self, | |
per | |||
) |
Given a percentage of an angle, return it in encoder counts. @param per: Percentage @type per: float @return: Encoder counts @rtype: int
Definition at line 1651 of file pyHand_api.py.
def pyHand_api.pyHand.process_can_messages | ( | self | ) |
Reads and process all the msgs in the bus Depending on the CAN id, it'll use different methods
Definition at line 1330 of file pyHand_api.py.
def pyHand_api.pyHand.process_force | ( | self, | |
msg | |||
) |
Process the CAN msgs and saves the position depending on the MSG ID
Definition at line 1541 of file pyHand_api.py.
def pyHand_api.pyHand.process_full_tact | ( | self, | |
msg | |||
) |
Process and saves all the messages containing the tactile information
Definition at line 1466 of file pyHand_api.py.
def pyHand_api.pyHand.process_motor_temp | ( | self, | |
msg | |||
) |
Process the msg and extract the temperature of the motor puck on the CAN ID
Definition at line 1426 of file pyHand_api.py.
def pyHand_api.pyHand.process_motor_therm | ( | self, | |
msg | |||
) |
Process the msg and extract the temperature of the motor on the CAN ID
Definition at line 1446 of file pyHand_api.py.
def pyHand_api.pyHand.process_packed_position | ( | self, | |
msg | |||
) |
Process the CAN msgs and saves the position depending on the MSG ID
Definition at line 1370 of file pyHand_api.py.
def pyHand_api.pyHand.process_strain | ( | self, | |
msg | |||
) |
Process the msg and extract the strain value depending on the CAN ID
Definition at line 1410 of file pyHand_api.py.
def pyHand_api.pyHand.process_tactile_data | ( | self, | |
data_array | |||
) |
Process the array of data and returns a tactile array
Definition at line 1522 of file pyHand_api.py.
def pyHand_api.pyHand.process_torque | ( | self, | |
msg | |||
) |
Process the CAN msgs and saves the position depending on the MSG ID
Definition at line 1560 of file pyHand_api.py.
def pyHand_api.pyHand.rad_to_enc | ( | self, | |
rad, | |||
type = BASE_TYPE |
|||
) |
Given the readian measure of an angle, return it in encoder counts. @param rad: Radians @type rad: float @return: Encoder counts @rtype: int
Definition at line 1663 of file pyHand_api.py.
def pyHand_api.pyHand.read_full_force_torque | ( | self | ) |
Read all tactile sensors
Definition at line 1706 of file pyHand_api.py.
def pyHand_api.pyHand.read_full_tact | ( | self, | |
msgID | |||
) |
Read all tactile sensors
Definition at line 1135 of file pyHand_api.py.
def pyHand_api.pyHand.read_msg | ( | self | ) |
Read a general message from PCAN_USBBUS1 Typically, msg[1] (where msg is the thing returned), contains the pertinent information. @rtype: (TPCANStatus, TPCANMsg, TPCANTimestamp) @return: A tuple containing the status, message, and timestamp.
Definition at line 270 of file pyHand_api.py.
def pyHand_api.pyHand.read_msg_resilient | ( | self, | |
expect_puck, | |||
expect_prop, | |||
max_recurse = 10 , |
|||
counter = 0 |
|||
) |
Reads message given the puckID and the propertyID. It will read as normal, until it gets some expected output from the puck. @param expect_puck: The puck to read from. @type expect_puck: int @param expect_prop: The property read from. @type expect_prop: int @param max_recurse: The most number of times to repeat the get. @type max_recurse: int @param counter: Used internally. Do not set. @type counter: int @rtype: int @return: The value held in the property of the given puck.
Definition at line 484 of file pyHand_api.py.
def pyHand_api.pyHand.read_packed_position | ( | self, | |
msgID | |||
) |
Get packed position data and return both P and JP. @param msgID: The puck or group to get position data. @type msgID: int @rtype: (int, int) @return: sends a msg to read the position.
Definition at line 1316 of file pyHand_api.py.
def pyHand_api.pyHand.read_strain | ( | self, | |
msgID | |||
) |
Sends the message to get the fingertip torque sensor value. @param msgID: The puck or group to get fingertip torque sensor data. @type msgID: int @rtype: int @return: CAN status
Definition at line 1234 of file pyHand_api.py.
def pyHand_api.pyHand.read_temp | ( | self, | |
msgID | |||
) |
Sends a message to get the temperature value for all pucks in msgID. @param msgID: The puck or group to get temp. @type msgID: int @rtype: int @return: The value of the TEMP property.
Definition at line 1071 of file pyHand_api.py.
def pyHand_api.pyHand.read_therm | ( | self, | |
msgID | |||
) |
Gets motor temperature value for all pucks in msgID. @param msgID: The puck or group to get motor temperature. @text msgID: int @rtype: int @return: The value of the THERM property.
Definition at line 1093 of file pyHand_api.py.
def pyHand_api.pyHand.revert_temp_mail | ( | self, | |
fingers_to_change, | |||
former | |||
) |
Definition at line 1598 of file pyHand_api.py.
def pyHand_api.pyHand.save_property | ( | self, | |
msgID, | |||
propID | |||
) |
Save a property. @param msgID: The puck or group to have its property saved. @type msgID: int @param propID: The property to be saved. @type propID: int
Definition at line 443 of file pyHand_api.py.
def pyHand_api.pyHand.send_msg | ( | self, | |
msgID, | |||
data | |||
) |
Send a general message to PCAN_USBBUS1. This can be a get, set, or even garbage. It does not apply any sleep @param msgID: The puck or group to which the message will be sent. @type msgID: int @param data: The array containing the data for the TPCANMsg. @type data: Array[] @return the return status after writing in the bus
Definition at line 307 of file pyHand_api.py.
def pyHand_api.pyHand.set_16 | ( | self, | |
msgID, | |||
propID, | |||
value | |||
) |
Set property to a given value for a 16 bit property. Avoid usage of this method. Use self.set_property instead. @param msgID: The puck or group whose property will be set. @type msgID: int @param propID: The number corresponding to the property to be set. @type propID: int @param value: The value to which the property will be set. @type value: int
Definition at line 363 of file pyHand_api.py.
def pyHand_api.pyHand.set_32 | ( | self, | |
msgID, | |||
propID, | |||
value | |||
) |
Set property to a given value for a 32 bit property. Avoid usage of this method. Use self.set_property instead. @param msgID: The puck or group whose property will be set. @type msgID: int @param propID: The number corresponding to the property to be set. @type propID: int @param value: The value to which the property will be set. @type value: int
Definition at line 347 of file pyHand_api.py.
def pyHand_api.pyHand.set_hand_targets | ( | self, | |
f1_target, | |||
f2_target, | |||
f3_target, | |||
sp_target | |||
) |
Given fingers and spread target values, move the hand to that position. Will mainly be used to load user-defined hand positions. Takes Barrett Units as inputs. @param f1_target: The position (in encoder ticks) for finger 1 to move to. @type f1_target: int @param f2_target: The position for finger 2 to move to. @type f2_target: int @param f3_target: The position for finger 3 to move to. @type f3_target: int @param sp_target: The position for spread to move to. @type sp_target: int
Definition at line 714 of file pyHand_api.py.
def pyHand_api.pyHand.set_mode | ( | self, | |
msgID, | |||
value | |||
) |
Set the mode property using either strings or numbers. @param msgID: The puck or group to set the mode. @type msgID: int @param value: The value to which the mode should be set. @type value: int
Definition at line 571 of file pyHand_api.py.
def pyHand_api.pyHand.set_property | ( | self, | |
msgID, | |||
propID, | |||
value | |||
) |
Set property to a given value. @param msgID: The puck or group whose property will be set. @type msgID: int @param propID: The number corresponding to the property to be set. @type propID: int @param value: The value to which the property will be set. @type value: int
Definition at line 330 of file pyHand_api.py.
def pyHand_api.pyHand.set_puck_like | ( | self, | |
puckID, | |||
virtID | |||
) |
Set the puck to have all the default properties of the indicated puck ID. @param puckID: The original puck to change. @type puckID: int @param virtID: The ID of the puck to load defaults from. @type virtID: int
Definition at line 587 of file pyHand_api.py.
def pyHand_api.pyHand.set_velocity | ( | self, | |
puckID, | |||
velocity | |||
) |
Set the velocity and make the motor move. @param puckID: The ID of the puck to set the velocity of. @type puckID: int @param velocity: The velocity (in cts/ms) of the motor. @type velocity: int
Definition at line 1205 of file pyHand_api.py.
def pyHand_api.pyHand.tare_fts | ( | self | ) |
Tare the FTS sensor.
Definition at line 1579 of file pyHand_api.py.
def pyHand_api.pyHand.twoscomp | ( | self, | |
number | |||
) |
Definition at line 1250 of file pyHand_api.py.
def pyHand_api.pyHand.twoscomp2 | ( | self, | |
number, | |||
bits | |||
) |
Returns the two's complement of a number with a certain amount of bits. @param number: The number to take the two's complement of. @type number: int @param bits: The size of the integer in bits. @type bits: int
Definition at line 1255 of file pyHand_api.py.
def pyHand_api.pyHand.wait_done_moving | ( | self, | |
motors_to_check = ALL_FINGERS |
|||
) |
Waits until the given list of motors have all stopped moving. @param motors_to_check: A list of motors to wait for. @type motors_to_check: Array[*int]
Definition at line 770 of file pyHand_api.py.
def pyHand_api.pyHand.write_msg | ( | self, | |
msgID, | |||
data, | |||
delay = .002 |
|||
) |
Send a general message to PCAN_USBBUS1. This can be a get, set, or even garbage. @param msgID: The puck or group to which the message will be sent. @type msgID: int @param data: The array containing the data for the TPCANMsg. @type data: Array[] @param delay: The time delay to wait for the message to be written. @type delay: float @rtype: TPCANStatus @return: Status of the self.PCAN bus.
Definition at line 282 of file pyHand_api.py.
pyHand_api.pyHand.ft_sensor |
Definition at line 120 of file pyHand_api.py.
pyHand_api.pyHand.motor_positions |
Definition at line 112 of file pyHand_api.py.
pyHand_api.pyHand.PCAN |
Definition at line 110 of file pyHand_api.py.
pyHand_api.pyHand.strain |
Definition at line 114 of file pyHand_api.py.
pyHand_api.pyHand.tactile_sensor |
Definition at line 117 of file pyHand_api.py.
pyHand_api.pyHand.temp |
Definition at line 115 of file pyHand_api.py.