AMOR API library  V1.1.44
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator
Data Structures | Defines | Typedefs | Enumerations | Functions
The AMOR API library

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 ()

Enumeration Type Documentation

Current status of the movement.

Enumerator:
AMOR_MOVEMENT_STATUS_MOVING 

AMOR is moving.

AMOR_MOVEMENT_STATUS_PENDING 

Movement is pending.

AMOR_MOVEMENT_STATUS_FINISHED 

AMOR reached the requested position.


Function Documentation

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.

Note:
Make sure AMOR is powered before calling this function.
Parameters:
[in]libraryNamea null terminated string referring to the canlib dll driver that should be used to connect to the CAN interface.
[in]can_portCAN 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.
Returns:
If successful, a valid AMOR_HANDLE is returned. In case of an error AMOR_INVALID_HANDLE is returned. Use amor_errno() for requesting the corresponding error code, and amor_error() for a textual representation of the error.

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.

Note:
This function is not a replacement for any safety related equipment such as an emergency switch.
Parameters:
[in]handlehandle to the AMOR robot
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Warning:
Even while the robot may not have reached zero velocity within this time interval brakes will be applied to the joints equipped with a braking system. Depending on the payload joints without a brake may continue moving as a result of their angular momentum.
Note:
This function is not a replacement for any safety related equipment such as an emergency switch.
Parameters:
[in]handlehandle to the AMOR robot
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise
unsigned int amor_errno ( )
Returns:
The error number describing the error reported from the last erroneous function call
const char* amor_error ( )
Returns:
A null-terminated string describing the error reported from the last erroneous function call

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.

Parameters:
[in]handlehandle to the AMOR robot
[out]currentsmotor currents measured by the robot [mA] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[out]positionsjoint angles measured by the robot
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[out]velocitiesjoint velocities measured by the robot
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[out]voltagesmotor voltages measured by the robot in [mV] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[out]positionsactual position of the robot in [mm] for positions and [rad] units for angle
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise
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.

Parameters:
[in]handlehandle to the AMOR robot
[in]jointindex of the joint of interest (0 = A1, 1 = A2, 2 = A2.5, 3=A3, ...)
[out]parametersjoint limit information
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise
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.

Parameters:
[out]majormajor part of version number
[out]minorminor part of version number
[out]buildbuild part of version number

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.

Parameters:
[in]handlehandle to the AMOR robot
[out]statusAMOR movement status
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

Retrieve the requested motor currents.

Basically, this function returns the currents requested using the amor_set_currents function.

Parameters:
[in]handlehandle to the AMOR robot
[out]currentsrequested motor currents in [mA] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

Request the joints angles the robot was last commanded to move to.

Parameters:
[in]handlehandle to the AMOR robot
[out]positionsthe last commanded joint angles
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

Request the joint velocities the robot was last commanded to achieve.

Parameters:
[in]handlehandle to the AMOR robot
[out]velocitiesthe last commanded joint velocities
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

Retrieve the requested motor voltages.

Basically this function returns the voltages requested using the amor_set_voltages function.

Parameters:
[in]handlehandle to the AMOR robot
[out]voltagesrequested motor voltages in [mV] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise
AMOR_RESULT amor_get_status ( AMOR_HANDLE  handle,
int  joint,
int *  status 
)
Parameters:
[in]handlehandle to the AMOR robot
[in]jointindex of the joint of interest (0 = A1, 1 = A2, 2 = A2.5, 3=A3, ...)
[out]status
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

Release the handle to the AMOR robot.

Always call this function before closing your application.

Parameters:
[in]handlehandle to the AMOR robot
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[in]positionstarget position of the robot in [mm] for positions and [rad] units for angles
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[in]velocitiestarget velocities of the robot joints in [mm] for positions and [rad] units for angles
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[in]currentscurrents that should be applied to the motor joints in [mA] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[in]positionstarget position of the robot in [rad] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[in]velocitiestarget velocities of the robot joints in [rad] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise

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.

Parameters:
[in]handlehandle to the AMOR robot
[in]voltagesvoltages that should be applied to the motor joints in [mV] units
Returns:
AMOR_SUCCESS if succesfull, AMOR_FAILED otherwise