#include <uarm_library.h>
Public Member Functions | |
uArmClass () | |
double | read_servo_offset (byte servo_num) |
Read Servo Offset from EEPROM. From OFFSET_START_ADDRESS, each offset occupy 4 bytes in rom. More... | |
void | read_linear_offset (byte servo_num, double &intercept_val, double &slope_val) |
read Linear Offset from EEPROM, From LINEAR_INTERCEPT_START_ADDRESS & LINEAR_SLOPE_START_ADDRESS, each offset occupy 4 bytes in rom More... | |
void | alert (byte times, byte runt_time, byte stop_time) |
Use BUZZER for Alert. More... | |
void | write_servo_angle (byte servo_num, double servo_angle, boolean with_offset) |
Write the angle to Servo. More... | |
void | write_left_right_servo_angle (double servo_left_angle, double servo_right_angle, boolean with_offset) |
Write the left Servo & Right Servo in the same time (Avoid demage the Servo) More... | |
double | read_servo_angle (byte servo_num) |
read Angle by servo_num without offset More... | |
double | read_servo_angle (byte servo_num, boolean with_offset) |
read Angle by servo_num More... | |
double | analog_to_angle (int input_angle, byte servo_num, boolean with_offset) |
Convert the Analog to Servo Angle, by this formatter, angle = intercept + slope * analog. More... | |
int | move_to (double x, double y, double z, double hand_angle, byte relative_flags, double time, byte path_type, byte ease_type, boolean enable_hand) |
Move To, Action Control Core Function. More... | |
void | move_to (double x, double y, double z) |
void | move_to (double x, double y, double z, double hand_angle) |
void | move_to (double x, double y, double z, int relative, double time) |
void | move_to (double x, double y, double z, int relative, double time, double servo_4_angle) |
void | move_to (double x, double y, double z, int relative, double time, int servo_4_relative, double servo_4_angle) |
void | move_to_at_once (double x, double y, double z) |
void | move_to_at_once (double x, double y, double z, int relative, double servo_4_angle) |
void | write_stretch_height (double stretch, double height) |
Write Sretch & Height. This is an old control method to uArm. Using uarm's Stretch and height, , Height from -180 to 150. More... | |
double | get_current_x () |
double | get_current_y () |
double | get_current_z () |
void | get_current_xyz () |
Calculate X,Y,Z to g_current_x,g_current_y,g_current_z. More... | |
void | get_current_xyz (double theta_1, double theta_2, double theta_3) |
Calculate X,Y,Z to g_current_x,g_current_y,g_current_z. More... | |
void | angle_to_coordinate (double &x, double &y, double &z) |
void | angle_to_coordinate (double theta_1, double theta_2, double theta_3, double &x, double &y, double &z) |
void | coordinate_to_angle (double x, double y, double z, double &theta_1, double &theta_2, double &theta_3) |
Calculate the angles from given coordinate x, y, z to theta_1, theta_2, theta_3. More... | |
void | gripper_catch () |
Close Gripper. More... | |
void | gripper_release () |
Release Gripper. More... | |
void | interpolate (double start_val, double end_val, double *interp_vals, byte ease_type) |
"Genernate the position array" More... | |
void | pump_on () |
Turn on Pump. More... | |
void | pump_off () |
Turn off Pump. More... | |
int | write_servo_angle (byte servo_rot_angle, byte servo_left_angle, byte servo_right_angle, byte servo_hand_rot_angle, byte trigger) |
int | write_servo_angle (double servo_rot_angle, double servo_left_angle, double servo_right_angle, double servo_hand_rot_angle) |
Write 4 Servo Angles, servo_rot, servo_left, servo_right, servo_hand_rot. More... | |
int | write_servo_angle (double servo_rot_angle, double servo_left_angle, double servo_right_angle) |
Write 3 Servo Angles, servo_rot, servo_left, servo_right. More... | |
boolean | set_servo_status (boolean attach_state, byte servo_num) |
Attach Servo, if servo has not been attached, attach the servo, and read the current Angle. More... | |
void | init () |
Public Attributes | |
unsigned int | INTERP_INTVLS |
Protected Member Functions | |
double | angle_to_coordinate_y (double theta_1, double theta_2, double theta_3) |
Calculate Y. More... | |
Protected Attributes | |
double | cur_rot |
double | cur_left |
double | cur_right |
double | cur_hand |
double | g_current_x |
double | g_current_y |
double | g_current_z |
boolean | g_gripper_reset |
Constructor & Destructor Documentation
uArmClass::uArmClass | ( | ) |
Member Function Documentation
void uArmClass::alert | ( | byte | times, |
byte | runTime, | ||
byte | stopTime | ||
) |
Use BUZZER for Alert.
- Parameters
-
times Beep Times runTime How Long from High to Low stopTime How Long from Low to High
- Examples:
- movement.ino, and UArmProtocol.ino.
double uArmClass::analog_to_angle | ( | int | input_analog, |
byte | servo_num, | ||
boolean | withOffset | ||
) |
|
inline |
|
inline |
|
protected |
Calculate Y.
- Parameters
-
theta_1 theta_2 theta_3
- Returns
- Y Axis Value
void uArmClass::coordinate_to_angle | ( | double | x, |
double | y, | ||
double | z, | ||
double & | theta_1, | ||
double & | theta_2, | ||
double & | theta_3 | ||
) |
Calculate the angles from given coordinate x, y, z to theta_1, theta_2, theta_3.
Calculate the angles from given coordinate x, y, z to theta_1, theta_2, theta_3
- Parameters
-
x X axis y Y axis z Z axis theta_1 SERVO_ROT_NUM servo angles theta_2 SERVO_LEFT_NUM servo angles theta_3 SERVO_RIGHT_NUM servo angles
|
inline |
- Examples:
- GettingStarted.ino, and UArmProtocol.ino.
void uArmClass::get_current_xyz | ( | ) |
Calculate X,Y,Z to g_current_x,g_current_y,g_current_z.
- Examples:
- GettingStarted.ino, and UArmProtocol.ino.
void uArmClass::get_current_xyz | ( | double | theta_1, |
double | theta_2, | ||
double | theta_3 | ||
) |
Calculate X,Y,Z to g_current_x,g_current_y,g_current_z.
|
inline |
- Examples:
- GettingStarted.ino, and UArmProtocol.ino.
|
inline |
- Examples:
- GettingStarted.ino, and UArmProtocol.ino.
void uArmClass::gripper_catch | ( | ) |
Close Gripper.
- Examples:
- UArmProtocol.ino.
void uArmClass::gripper_release | ( | ) |
Release Gripper.
- Examples:
- UArmProtocol.ino.
void uArmClass::init | ( | ) |
- Examples:
- UArmProtocol.ino.
void uArmClass::interpolate | ( | double | start_val, |
double | end_val, | ||
double * | interp_vals, | ||
byte | ease_type | ||
) |
"Genernate the position array"
- Parameters
-
start_val Start Position end_val End Position interp_vals interpolation array ease_type INTERP_EASE_INOUT_CUBIC, INTERP_LINEAR, INTERP_EASE_INOUT, INTERP_EASE_IN, INTERP_EASE_OUT
int uArmClass::move_to | ( | double | x, |
double | y, | ||
double | z, | ||
double | hand_angle, | ||
byte | relative_flags, | ||
double | time, | ||
byte | path_type, | ||
byte | ease_type, | ||
boolean | enable_hand | ||
) |
Move To, Action Control Core Function.
- Parameters
-
x X Axis Value y Y Axis Value z Z Axis Value hand_angle Hand Axis relative_flags ABSOLUTE, RELATIVE path_type PATH_LINEAR, PATH_ANGLES enable_hand Enable Hand Axis
- Returns
- SUCCESS, FAILED
- Examples:
- GettingStarted.ino, movement.ino, and UArmProtocol.ino.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void uArmClass::pump_off | ( | ) |
Turn off Pump.
- Examples:
- GettingStarted.ino, and UArmProtocol.ino.
void uArmClass::pump_on | ( | ) |
Turn on Pump.
- Examples:
- GettingStarted.ino, and UArmProtocol.ino.
void uArmClass::read_linear_offset | ( | byte | servo_num, |
double & | intercept_val, | ||
double & | slope_val | ||
) |
read Linear Offset from EEPROM, From LINEAR_INTERCEPT_START_ADDRESS & LINEAR_SLOPE_START_ADDRESS, each offset occupy 4 bytes in rom
- Parameters
-
servo_num SERVO_ROT_NUM, SERVO_LEFT_NUM, SERVO_RIGHT_NUM, SERVO_HAND_ROT_NUM intercept_val get intercept_val slope_val get slope_val
double uArmClass::read_servo_angle | ( | byte | servo_num | ) |
read Angle by servo_num without offset
- Parameters
-
servo_num SERVO_ROT_NUM, SERVO_LEFT_NUM, SERVO_RIGHT_NUM, SERVO_HAND_ROT_NUM
- Returns
- Return servo_num Angle
- Examples:
- UArmProtocol.ino.
double uArmClass::read_servo_angle | ( | byte | servo_num, |
boolean | withOffset | ||
) |
read Angle by servo_num
- Parameters
-
servo_num SERVO_ROT_NUM, SERVO_LEFT_NUM, SERVO_RIGHT_NUM, SERVO_HAND_ROT_NUM withOffset true, false
- Returns
- Return servo_num Angle
double uArmClass::read_servo_offset | ( | byte | servo_num | ) |
Read Servo Offset from EEPROM. From OFFSET_START_ADDRESS, each offset occupy 4 bytes in rom.
- Parameters
-
servo_num SERVO_ROT_NUM, SERVO_LEFT_NUM, SERVO_RIGHT_NUM, SERVO_HAND_ROT_NUM
- Returns
- Return servo offset
- Examples:
- GettingStarted.ino.
boolean uArmClass::set_servo_status | ( | boolean | setAttached, |
byte | servoNum | ||
) |
Attach Servo, if servo has not been attached, attach the servo, and read the current Angle.
- Parameters
-
servo number SERVO_ROT_NUM, SERVO_LEFT_NUM, SERVO_RIGHT_NUM, SERVO_HAND_ROT_NUM
- Examples:
- GettingStarted.ino, movement.ino, and UArmProtocol.ino.
void uArmClass::write_left_right_servo_angle | ( | double | servo_left_angle, |
double | servo_right_angle, | ||
boolean | writeWithoffset | ||
) |
Write the left Servo & Right Servo in the same time (Avoid demage the Servo)
- Parameters
-
servo_left_angle left servo target angle servo_right_angle right servo target angle writeWithoffset True: with Offset, False: without Offset
- Examples:
- UArmProtocol.ino.
void uArmClass::write_servo_angle | ( | byte | servo_number, |
double | servo_angle, | ||
boolean | writeWithoffset | ||
) |
Write the angle to Servo.
- Parameters
-
servo_number SERVO_ROT_NUM, SERVO_LEFT_NUM, SERVO_RIGHT_NUM, SERVO_HAND_ROT_NUM servo_angle Servo target angle, 0.00 - 180.00 writeWithoffset True: with Offset, False: without Offset
- Examples:
- UArmProtocol.ino.
int uArmClass::write_servo_angle | ( | byte | servo_rot_angle, |
byte | servo_left_angle, | ||
byte | servo_right_angle, | ||
byte | servo_hand_rot_angle, | ||
byte | trigger | ||
) |
int uArmClass::write_servo_angle | ( | double | servo_rot_angle, |
double | servo_left_angle, | ||
double | servo_right_angle, | ||
double | servo_hand_rot_angle | ||
) |
Write 4 Servo Angles, servo_rot, servo_left, servo_right, servo_hand_rot.
- Parameters
-
servo_rot_angle SERVO_ROT_NUM servo_left_angle SERVO_LEFT_NUM servo_right_angle SERVO_RIGHT_NUM servo_hand_rot_angle SERVO_HAND_ROT_NUM
- Returns
- SUCCESS, FAILED
int uArmClass::write_servo_angle | ( | double | servo_rot_angle, |
double | servo_left_angle, | ||
double | servo_right_angle | ||
) |
Write 3 Servo Angles, servo_rot, servo_left, servo_right.
- Parameters
-
servo_rot_angle SERVO_ROT_NUM servo_left_angle SERVO_LEFT_NUM servo_right_angle SERVO_RIGHT_NUM
- Returns
- SUCCESS, FAILED
void uArmClass::write_stretch_height | ( | double | armStretch, |
double | armHeight | ||
) |
Write Sretch & Height. This is an old control method to uArm. Using uarm's Stretch and height, , Height from -180 to 150.
- Parameters
-
armStretch Stretch from 0 to 195 armHeight Height from -150 to 150
- Examples:
- UArmProtocol.ino.
Member Data Documentation
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
unsigned int uArmClass::INTERP_INTVLS |
The documentation for this class was generated from the following files:
- /Users/alex/Workspace/develop/uarm_metal/uarm4arduino/src/uarm_library.h
- /Users/alex/Workspace/develop/uarm_metal/uarm4arduino/src/uarm_library.cpp