AMOR API library
V1.1.44
|
Data Structures | |
struct | AMOR_JOINT_INFO |
Representation of joint limit information. More... | |
struct | AMOR_JOINT_VERSION |
Representation of joint firmware version. More... | |
struct | AMOR_MATRIX44 |
Struct representing a 4x4 matrix. More... | |
Defines | |
#define | AMOR_SUCCESS 0 |
Represents successfull excution of a function. | |
#define | AMOR_FAILED -1 |
Represents unsuccessfull excution of a function. See amor_errno and amor_error for details. | |
#define | AMOR_INVALID_HANDLE 0 |
Returned from amor_connect if the function call fails. See amor_errno and amor_error for details. | |
#define | AMOR_NO_WARNING 0 |
There is currently no warning. | |
#define | AMOR_WARN_TEMPERATURE 1 |
The joint temperature is too high/low. | |
#define | AMOR_WARN_LOWER_END_SWITCH 2 |
The joint has reached the lower end-switch. | |
#define | AMOR_WARN_UPPER_END_SWITCH 3 |
The joint has reached the upper end-switch. | |
#define | AMOR_WARN_BUFFER_EMPTY 5 |
The setpoint buffer is empty. | |
#define | AMOR_NUM_JOINTS 7 |
AMOR amount of joints. | |
#define | AMOR_ERROR_NONE 0 |
Returned from amor_error when no error is. | |
#define | AMOR_ERROR_UNKNOWN 1 |
An unknown error has occured. | |
#define | AMOR_ERROR_CONNECTION_FAILURE 2 |
Returned when the connection with the AMOR failed. | |
#define | AMOR_ERROR_INVALID_ARGUMENT 3 |
Returned when an invalid argument has been supplied. | |
#define | AMOR_ERROR_COMMUNICATION 4 |
Returned when there are communication problems. | |
#define | AMOR_ERROR_CAN_DRIVER 5 |
Returned when the CAN driver fails. | |
Typedefs | |
typedef void * | AMOR_HANDLE |
Represents a handle to the AMOR API. | |
typedef int | AMOR_RESULT |
Represents the result from calling an AMOR API library function. | |
typedef double | real |
In the AMOR API library, reals are represented as doubles. | |
typedef real | AMOR_VECTOR7 [AMOR_NUM_JOINTS] |
Representation of a 7 dimensional real vector. | |
Enumerations | |
enum | amor_movement_status { AMOR_MOVEMENT_STATUS_MOVING, AMOR_MOVEMENT_STATUS_PENDING, AMOR_MOVEMENT_STATUS_FINISHED } |
Current status of the movement. More... | |
Functions | |
void | amor_get_library_version (int *major, int *minor, int *build) |
Request AMOR API library version information. | |
AMOR_HANDLE | amor_connect (char *libraryName, int can_port) |
Open/initiate a connection to AMOR. | |
AMOR_RESULT | amor_set_currents (AMOR_HANDLE handle, AMOR_VECTOR7 currents) |
Specify the currents that should be applied to each joint motor. | |
AMOR_RESULT | amor_get_req_currents (AMOR_HANDLE handle, AMOR_VECTOR7 *currents) |
Retrieve the requested motor currents. | |
AMOR_RESULT | amor_get_actual_currents (AMOR_HANDLE handle, AMOR_VECTOR7 *currents) |
Retrieve the currents that are currently measured at the joint motors. | |
AMOR_RESULT | amor_set_voltages (AMOR_HANDLE handle, AMOR_VECTOR7 voltages) |
Specify the voltages that should be applied to each joint motor. | |
AMOR_RESULT | amor_get_req_voltages (AMOR_HANDLE handle, AMOR_VECTOR7 *voltages) |
Retrieve the requested motor voltages. | |
AMOR_RESULT | amor_get_actual_voltages (AMOR_HANDLE handle, AMOR_VECTOR7 *voltages) |
Retrieve the voltages that are currently measured at the joint motors. | |
AMOR_RESULT | amor_set_positions (AMOR_HANDLE handle, AMOR_VECTOR7 positions) |
Specify the joints angles the robot should try to move to. | |
AMOR_RESULT | amor_get_req_positions (AMOR_HANDLE handle, AMOR_VECTOR7 *positions) |
Request the joints angles the robot was last commanded to move to. | |
AMOR_RESULT | amor_get_actual_positions (AMOR_HANDLE handle, AMOR_VECTOR7 *positions) |
Retrieve the actual joints angles of the robot. | |
AMOR_RESULT | amor_set_velocities (AMOR_HANDLE handle, AMOR_VECTOR7 velocities) |
Specify the joint velocities the robot should try achieve. | |
AMOR_RESULT | amor_get_req_velocities (AMOR_HANDLE handle, AMOR_VECTOR7 *velocities) |
Request the joint velocities the robot was last commanded to achieve. | |
AMOR_RESULT | amor_get_actual_velocities (AMOR_HANDLE handle, AMOR_VECTOR7 *velocities) |
Retrieve the actual joints angles of the robot. | |
AMOR_RESULT | amor_emergency_stop (AMOR_HANDLE handle) |
Command an emergency stop to the robot. | |
AMOR_RESULT | amor_controlled_stop (AMOR_HANDLE handle) |
Command a controlled stop to the robot. | |
AMOR_RESULT | amor_release (AMOR_HANDLE handle) |
Release the handle to the AMOR robot. | |
AMOR_RESULT | amor_get_status (AMOR_HANDLE handle, int joint, int *status) |
AMOR_RESULT | amor_get_joint_info (AMOR_HANDLE handle, int joint, AMOR_JOINT_INFO *parameters) |
Retrieve limit information of an AMOR joint. | |
AMOR_RESULT | amor_get_movement_status (AMOR_HANDLE handle, amor_movement_status *status) |
Retrieve current position and velocity movement status. | |
AMOR_RESULT | amor_set_cartesian_velocities (AMOR_HANDLE handle, AMOR_VECTOR7 velocities) |
Specify the cartesian joint velocities the robot should try achieve. | |
AMOR_RESULT | amor_set_cartesian_positions (AMOR_HANDLE handle, AMOR_VECTOR7 positions) |
Specify the cartesian position the robot should try to move to. | |
AMOR_RESULT | amor_get_cartesian_position (AMOR_HANDLE handle, AMOR_VECTOR7 &positions) |
Retrieve the actual cartesian position of the robot. | |
unsigned int | amor_errno () |
const char * | amor_error () |
enum amor_movement_status |
AMOR_HANDLE amor_connect | ( | char * | libraryName, |
int | can_port | ||
) |
Open/initiate a connection to AMOR.
Before it is possible to control AMOR with this API, a connection needs to be initiated. This function will open and initiate the connection to AMOR. The handle that is returned should be stored and supplied to all functions of this API. It is possible to open multiple connections to multiple AMOR connected to the PC, however it is not possible to open multiple connections to a single AMOR.
[in] | libraryName | a null terminated string referring to the canlib dll driver that should be used to connect to the CAN interface. |
[in] | can_port | CAN device net number to which AMOR is connected Please refer to the manual of the CAN interface device for information about installing and using the CAN device. |
AMOR_RESULT amor_controlled_stop | ( | AMOR_HANDLE | handle | ) |
Command a controlled stop to the robot.
The robot will decelerate to zero velocity as fast as permissible by the joint acceleration limits. Note that this function does not aim to make all joints stop simultaneously. Each joint is stopped as quick as possible. After stopping, the robot remains in NORMAL_POSITION_MODE. Thus, no brakes will be applied and the robot will aim to keep the position reached after stopping.
[in] | handle | handle to the AMOR robot |
AMOR_RESULT amor_emergency_stop | ( | AMOR_HANDLE | handle | ) |
Command an emergency stop to the robot.
This function is almost equal to amor_controlled stop. The robot will decelerate to zero velocity as fast as permissible by the joint acceleration limits. Note that this function does not aim to make all joints stop simultaneously. Each joint is stopped as quick as possible. This function differs from amor_controlled_stop in that it will command all joints to go to MODE_IDLE approx. 250 milliseconds after calling this function.
[in] | handle | handle to the AMOR robot |
unsigned int amor_errno | ( | ) |
const char* amor_error | ( | ) |
AMOR_RESULT amor_get_actual_currents | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | currents | ||
) |
Retrieve the currents that are currently measured at the joint motors.
AMOR is requested to send the currents that have been measured at the joint motors.
[in] | handle | handle to the AMOR robot |
[out] | currents | motor currents measured by the robot [mA] units |
AMOR_RESULT amor_get_actual_positions | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | positions | ||
) |
Retrieve the actual joints angles of the robot.
Retrieve the actual joint angles of the robot. Depending on the mode of operation of the robot two methods may be used to retreive the actual joint angles. In MODE_IDLE, this function returns the angle from the optical angle measurement system. Otherwise, it will return the angle calculated from an initial optical angle encoders read-out and subsequent pulses from the incremental angle encoders.
[in] | handle | handle to the AMOR robot |
[out] | positions | joint angles measured by the robot |
AMOR_RESULT amor_get_actual_velocities | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | velocities | ||
) |
Retrieve the actual joints angles of the robot.
Retrieve the actual joint angles of the robot. Depending on the mode of operation of the robot two methods may be used to retreive the actual joint angles. In MODE_IDLE, this function returns the angle from the optical angle measurement system. Otherwise, it will return the angle calculated from an initial optical angle encoders and subsequent pulses from the incremental angle encoders.
[in] | handle | handle to the AMOR robot |
[out] | velocities | joint velocities measured by the robot |
AMOR_RESULT amor_get_actual_voltages | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | voltages | ||
) |
Retrieve the voltages that are currently measured at the joint motors.
AMOR is requested to send the voltages that have been measured at the joint motors.
[in] | handle | handle to the AMOR robot |
[out] | voltages | motor voltages measured by the robot in [mV] units |
AMOR_RESULT amor_get_cartesian_position | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 & | positions | ||
) |
Retrieve the actual cartesian position of the robot.
Calculates the actual cartesian position of the robot. The output vector contains the X, Y, Z position in mm. and the Yaw, Pitch and Roll angles in radians.
[in] | handle | handle to the AMOR robot |
[out] | positions | actual position of the robot in [mm] for positions and [rad] units for angle |
AMOR_RESULT amor_get_joint_info | ( | AMOR_HANDLE | handle, |
int | joint, | ||
AMOR_JOINT_INFO * | parameters | ||
) |
Retrieve limit information of an AMOR joint.
Every AMOR joint has a maximum velocity, maximum acceleration, maximum voltage/current and angle limits (see the Instructions for Use for details). This function can be used to retrieve these values for a specific joint.
[in] | handle | handle to the AMOR robot |
[in] | joint | index of the joint of interest (0 = A1, 1 = A2, 2 = A2.5, 3=A3, ...) |
[out] | parameters | joint limit information |
void amor_get_library_version | ( | int * | major, |
int * | minor, | ||
int * | build | ||
) |
Request AMOR API library version information.
This function can be used to request version information of the AMOR library. The version number is constructed by a triplet consisting of a major, minor, and build number.
[out] | major | major part of version number |
[out] | minor | minor part of version number |
[out] | build | build part of version number |
AMOR_RESULT amor_get_movement_status | ( | AMOR_HANDLE | handle, |
amor_movement_status * | status | ||
) |
Retrieve current position and velocity movement status.
When using joint position function, this function tells when all corresponding setpoints are sent to the AMOR. When using controlled stop, this function can be used to see if the AMOR has already stopped moving.
[in] | handle | handle to the AMOR robot |
[out] | status | AMOR movement status |
AMOR_RESULT amor_get_req_currents | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | currents | ||
) |
Retrieve the requested motor currents.
Basically, this function returns the currents requested using the amor_set_currents function.
[in] | handle | handle to the AMOR robot |
[out] | currents | requested motor currents in [mA] units |
AMOR_RESULT amor_get_req_positions | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | positions | ||
) |
Request the joints angles the robot was last commanded to move to.
[in] | handle | handle to the AMOR robot |
[out] | positions | the last commanded joint angles |
AMOR_RESULT amor_get_req_velocities | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | velocities | ||
) |
Request the joint velocities the robot was last commanded to achieve.
[in] | handle | handle to the AMOR robot |
[out] | velocities | the last commanded joint velocities |
AMOR_RESULT amor_get_req_voltages | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 * | voltages | ||
) |
Retrieve the requested motor voltages.
Basically this function returns the voltages requested using the amor_set_voltages function.
[in] | handle | handle to the AMOR robot |
[out] | voltages | requested motor voltages in [mV] units |
AMOR_RESULT amor_get_status | ( | AMOR_HANDLE | handle, |
int | joint, | ||
int * | status | ||
) |
[in] | handle | handle to the AMOR robot |
[in] | joint | index of the joint of interest (0 = A1, 1 = A2, 2 = A2.5, 3=A3, ...) |
[out] | status |
AMOR_RESULT amor_release | ( | AMOR_HANDLE | handle | ) |
Release the handle to the AMOR robot.
Always call this function before closing your application.
[in] | handle | handle to the AMOR robot |
AMOR_RESULT amor_set_cartesian_positions | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 | positions | ||
) |
Specify the cartesian position the robot should try to move to.
If applicable, sets all AMOR joints in NORMAL_POSITION_MODE and generates a trajectory for the given positions. The generated trajectory has a trapezoidal velocity profile computed using the joint velocity and acceleration limits. The trajectory is generated online and trajectory points are sent to the robot each time the robot performs a PID control cycle. See the Instructions for Use document for details.
[in] | handle | handle to the AMOR robot |
[in] | positions | target position of the robot in [mm] for positions and [rad] units for angles |
AMOR_RESULT amor_set_cartesian_velocities | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 | velocities | ||
) |
Specify the cartesian joint velocities the robot should try achieve.
If applicable, sets all AMOR joints in NORMAL_POSITION_MODE and generates a trajectory using the given velocites. The generated trajectory has a trapezoidal velocity profile computed using the joint velocity and acceleration limits. The trajectory is generated online and trajectory points are sent to the robot each time the robot performs a PID control cycle. See the Instructions for Use document for details.
[in] | handle | handle to the AMOR robot |
[in] | velocities | target velocities of the robot joints in [mm] for positions and [rad] units for angles |
AMOR_RESULT amor_set_currents | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 | currents | ||
) |
Specify the currents that should be applied to each joint motor.
If applicable, sets all AMOR joints in NORMAL_CURRENT_MODE and applies the given currents to the joints.
[in] | handle | handle to the AMOR robot |
[in] | currents | currents that should be applied to the motor joints in [mA] units |
AMOR_RESULT amor_set_positions | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 | positions | ||
) |
Specify the joints angles the robot should try to move to.
If applicable, sets all AMOR joints in NORMAL_POSITION_MODE and generates a trajectory for the given positions. The generated trajectory has a trapezoidal velocity profile computed using the joint velocity and acceleration limits. The trajectory is generated online and trajectory points are sent to the robot each time the robot performs a PID control cycle. See the Instructions for Use document for details.
[in] | handle | handle to the AMOR robot |
[in] | positions | target position of the robot in [rad] units |
AMOR_RESULT amor_set_velocities | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 | velocities | ||
) |
Specify the joint velocities the robot should try achieve.
If applicable, sets all AMOR joints in NORMAL_POSITION_MODE and generates a trajectory using the given velocites. The generated trajectory has a trapezoidal velocity profile computed using the joint velocity and acceleration limits. The trajectory is generated online and trajectory points are sent to the robot each time the robot performs a PID control cycle. See the Instructions for Use document for details.
[in] | handle | handle to the AMOR robot |
[in] | velocities | target velocities of the robot joints in [rad] units |
AMOR_RESULT amor_set_voltages | ( | AMOR_HANDLE | handle, |
AMOR_VECTOR7 | voltages | ||
) |
Specify the voltages that should be applied to each joint motor.
Sets all AMOR joints in NORMAL_VOLTAGE_MODE and applies the given voltages to the joints.
[in] | handle | handle to the AMOR robot |
[in] | voltages | voltages that should be applied to the motor joints in [mV] units |