This module is layer for communication with the kheperaIII Gripper. It offers simple interface to the user. More...
Go to the source code of this file.
This module is layer for communication with the kheperaIII Gripper. It offers simple interface to the user.
Khepera3 Gripper layer
Definition in file kb_gripper.c.
unsigned char kgripper_Arm_Get_Capacity | ( | knet_dev_t * | dev | ) |
This function return the remaining capacity of the battery
dev | K-Net Device Descriptor |
Definition at line 160 of file kb_gripper.c.
References ARM_CAPACITY, and knet_read8().
Referenced by status().
unsigned short kgripper_Arm_Get_Current | ( | knet_dev_t * | dev | ) |
This function return the actual Current of the Gripper Arm
dev | K-Net Device Descriptor |
Definition at line 107 of file kb_gripper.c.
References ARM_CURRENT, and knet_read16().
Referenced by status().
void kgripper_Arm_Get_Limits | ( | knet_dev_t * | dev, | |
unsigned short * | Min_Position, | |||
unsigned short * | Max_Position | |||
) |
This function return the mechanical limit of the gripper
dev | K-Net Device Descriptor | |
Max_Position | Maximal position of the arm (ground) | |
Min_Position | Minimal position of the arm (position up) |
Definition at line 179 of file kb_gripper.c.
References ARM_MAX_POSITION, ARM_MIN_POSITION, and knet_read16().
Referenced by demo(), get(), searchLimit(), and status().
unsigned char kgripper_Arm_Get_Max_Speed | ( | knet_dev_t * | dev | ) |
This function return the maximal speed of the arm
dev | K-Net Device Descriptor |
Definition at line 217 of file kb_gripper.c.
References ARM_MAX_SPEED, and knet_read8().
Referenced by status().
unsigned short kgripper_Arm_Get_Order | ( | knet_dev_t * | dev | ) |
This function return the Position order of the Arm
dev | K-Net Device Descriptor |
Definition at line 199 of file kb_gripper.c.
References ARM_ORDER, and knet_read16().
Referenced by status().
unsigned short kgripper_Arm_Get_Position | ( | knet_dev_t * | dev | ) |
This function return the actual Position of the Gripper Arm
dev | K-Net Device Descriptor |
Definition at line 72 of file kb_gripper.c.
References ARM_POSITION, and knet_read16().
Referenced by status().
unsigned char kgripper_Arm_Get_Search_Limit | ( | knet_dev_t * | dev | ) |
This function return the search limit flag
dev | K-Net Device Descriptor |
Definition at line 235 of file kb_gripper.c.
References ARM_SEARCH_LIMIT, and knet_read8().
Referenced by searchLimit().
unsigned char kgripper_Arm_Get_Speed | ( | knet_dev_t * | dev | ) |
This function return the actual Speed of the Gripper Arm
dev | K-Net Device Descriptor |
Definition at line 90 of file kb_gripper.c.
References ARM_SPEED, and knet_read8().
Referenced by status().
unsigned char kgripper_Arm_Get_Version | ( | knet_dev_t * | dev | ) |
This function return the revision of the Arm Gripper OS
dev | K-Net Device Descriptor |
Definition at line 52 of file kb_gripper.c.
References ARM_VERSION, and knet_read8().
Referenced by revisionOS().
unsigned short kgripper_Arm_Get_Voltage | ( | knet_dev_t * | dev | ) |
This function return the Battery Voltage
dev | K-Net Device Descriptor |
Definition at line 142 of file kb_gripper.c.
References ARM_VOLTAGE, and knet_read16().
Referenced by status().
unsigned char kgripper_Arm_OnTarget | ( | knet_dev_t * | dev | ) |
This function return if the arm is on the target or not
dev | K-Net Device Descriptor |
Definition at line 125 of file kb_gripper.c.
References ARM_ON_TARGET, and knet_read8().
Referenced by demo(), get(), and status().
void kgripper_Arm_Set_Max_Speed | ( | knet_dev_t * | dev, | |
unsigned char | Max_Speed | |||
) |
This function set the maximum speed that the arm can reach
dev | K-Net Device Descriptor | |
Max_Speed | Maximal speed from 0 to 15 (default = 5) |
Definition at line 270 of file kb_gripper.c.
References ARM_MAX_SPEED, and knet_write8().
Referenced by setMaxSpeed().
void kgripper_Arm_Set_Order | ( | knet_dev_t * | dev, | |
unsigned short | Order | |||
) |
This function set a new Position order to reach. If the value is out of the mechanical limit, the gripper will limit itself automatically
dev | K-Net Device Descriptor | |
Order | Position Order that the arm must reach |
Definition at line 253 of file kb_gripper.c.
References ARM_ORDER, KGRIPPER_ORDER_MASK, knet_set_order(), and knet_write16().
Referenced by demo(), get(), and movearm().
void kgripper_Arm_Set_Search_Limit | ( | knet_dev_t * | dev, | |
unsigned char | Search_Limit | |||
) |
This function start (=1) or stop (=0) the search limit procedure
dev | K-Net Device Descriptor | |
Search_Limit | Flag to start the search limit procedure. reset automatically when the procedure is done |
Definition at line 286 of file kb_gripper.c.
References ARM_SEARCH_LIMIT, and knet_write8().
Referenced by searchLimit().
void kgripper_Gripper_Get_Ambiant_IR_Light | ( | knet_dev_t * | dev, | |
unsigned short * | Amb_IR_Left, | |||
unsigned short * | Amb_IR_Right | |||
) |
This function return the ambiant light value of the two IR sensor in the finger
dev | K-Net Device Descriptor | |
Amb_IR_Left | Ambiant light value of the sensor in the left finger (0 = no light, 1023 = IR satured of IR light) | |
Amb_IR_Right | Ambiant light value of the sensor in the right finger (0 = no light, 1023 = IR satured of IR light) |
Definition at line 433 of file kb_gripper.c.
References GRIPPER_AMB_IR_LEFT, GRIPPER_AMB_IR_RIGHT, and knet_read16().
Referenced by sensor().
unsigned short kgripper_Gripper_Get_Current | ( | knet_dev_t * | dev | ) |
This function return the actual Current of the Gripper Finger
dev | K-Net Device Descriptor |
Definition at line 380 of file kb_gripper.c.
References GRIPPER_CURRENT, and knet_read16().
Referenced by demo(), get(), grip(), and status().
void kgripper_Gripper_Get_Distance_Sensors | ( | knet_dev_t * | dev, | |
unsigned short * | Dist_IR_Left, | |||
unsigned short * | Dist_IR_Right | |||
) |
This function return the Distance value measured by the two IR sensor in the finger
dev | K-Net Device Descriptor | |
Dist_IR_Left | Distance value of the sensor in the left finger (0 = no object, 1023 = Object very close from the left finger) | |
Dist_IR_Right | Distance value of the sensor in the right finger (0 = no object, 1023 = Object very close from the right finger) |
Definition at line 455 of file kb_gripper.c.
References GRIPPER_DIST_IR_LEFT, GRIPPER_DIST_IR_RIGHT, and knet_read16().
Referenced by sensor().
unsigned char kgripper_Gripper_Get_Limits | ( | knet_dev_t * | dev | ) |
This function return the mechanical limit of the gripper finger
dev | K-Net Device Descriptor |
Definition at line 531 of file kb_gripper.c.
References GRIPPER_MAX_POSITION, and knet_read8().
Referenced by demo(), get(), grip(), searchLimit(), and status().
unsigned char kgripper_Gripper_Get_Order | ( | knet_dev_t * | dev | ) |
This function return the Position order of the Gripper finger
dev | K-Net Device Descriptor |
Definition at line 343 of file kb_gripper.c.
References GRIPPER_ORDER, and knet_read8().
Referenced by status().
unsigned char kgripper_Gripper_Get_Position | ( | knet_dev_t * | dev | ) |
This function return the actual Position of the Gripper finger
dev | K-Net Device Descriptor |
Definition at line 326 of file kb_gripper.c.
References GRIPPER_POSITION, and knet_read8().
Referenced by status().
unsigned short kgripper_Gripper_Get_Resistivity | ( | knet_dev_t * | dev | ) |
This function return the Resistivity of the object grip by the Finger
dev | K-Net Device Descriptor |
Definition at line 414 of file kb_gripper.c.
References GRIPPER_RESISTIVITY, and knet_read16().
Referenced by get(), and sensor().
unsigned char kgripper_Gripper_Get_Search_Limit | ( | knet_dev_t * | dev | ) |
This function return the search limit flag of the gripper finger
dev | K-Net Device Descriptor |
Definition at line 514 of file kb_gripper.c.
References GRIPPER_SEARCH_LIMIT, and knet_read8().
Referenced by searchLimit().
unsigned char kgripper_Gripper_Get_Speed | ( | knet_dev_t * | dev | ) |
This function return the actual Speed of the Gripper finger
dev | K-Net Device Descriptor |
Definition at line 362 of file kb_gripper.c.
References GRIPPER_SPEED, and knet_read8().
Referenced by status().
unsigned short kgripper_Gripper_Get_Torque | ( | knet_dev_t * | dev | ) |
This function return the Torque Limit of the Gripper Finger
dev | K-Net Device Descriptor |
Definition at line 397 of file kb_gripper.c.
References GRIPPER_TORQUE, and knet_read16().
Referenced by grip(), and status().
unsigned char kgripper_Gripper_Get_Version | ( | knet_dev_t * | dev | ) |
This function return the revision of the head Gripper OS
dev | K-Net Device Descriptor |
Definition at line 306 of file kb_gripper.c.
References GRIPPER_VERSION, and knet_read8().
Referenced by revisionOS().
unsigned char kgripper_Gripper_Object_Detected | ( | knet_dev_t * | dev | ) |
This function return if an object is between the two finger (use the optical barrier)
dev | K-Net Device Descriptor |
Definition at line 495 of file kb_gripper.c.
References GRIPPER_OPTICAL_BARR, and knet_read8().
Referenced by get(), and sensor().
unsigned char kgripper_Gripper_OnTarget | ( | knet_dev_t * | dev | ) |
This function return if the Gripper Finger is on the target or not
dev | K-Net Device Descriptor |
Definition at line 477 of file kb_gripper.c.
References GRIPPER_ON_TARGET, and knet_read8().
Referenced by demo(), get(), grip(), and status().
void kgripper_Gripper_Set_Order | ( | knet_dev_t * | dev, | |
unsigned char | Order | |||
) |
This function set a new Position order to reach. If the value is out of the mechanical limit, the gripper will limit itself automatically
dev | K-Net Device Descriptor | |
Order | Position Order that the gripper finger must reach |
Definition at line 549 of file kb_gripper.c.
References GRIPPER_ORDER, and knet_write8().
Referenced by demo(), get(), grip(), and movegrip().
void kgripper_Gripper_Set_Torque | ( | knet_dev_t * | dev, | |
unsigned short | Torque | |||
) |
This function set the maximum Torque that the gripper use to grip object
dev | K-Net Device Descriptor | |
Torque | Maximal Torque from 100 to 700 (default = 400) |
Definition at line 562 of file kb_gripper.c.
References GRIPPER_TORQUE, KGRIPPER_ORDER_MASK, knet_set_order(), and knet_write16().
Referenced by demo(), get(), and setTorque().
void kgripper_GripperSet_Search_Limit | ( | knet_dev_t * | dev, | |
unsigned char | Search_Limit | |||
) |
This function start (=1) or stop (=0) the search limit procedure of the gripper
dev | K-Net Device Descriptor | |
Search_Limit | Flag to start the search limit procedure. reset automatically when the procedure is done |
Definition at line 577 of file kb_gripper.c.
References GRIPPER_SEARCH_LIMIT, and knet_write8().
Referenced by searchLimit().
int kgripper_init | ( | void | ) |
kgripper_init initializes the KoreBot library This function needs to be called BEFORE any other functions.
Definition at line 27 of file kb_gripper.c.
References KB_ERROR, KB_ERROR_KH3KBINIT, kb_init(), and KH3_ERROR_KBINIT.
Referenced by initGripper().