API Reference

This is additional API reference material for ROS free python scripts. Please refer to source code for more detailed descriptions of all functions.

Arm Master Functions

scripts.arm_master_functions.distance(p1, p2)

Returns straight line distance between two end effector poses

scripts.arm_master_functions.get_LR_ind(i, res=1)

Get index for left and right neighbour for node in circular graph. Implements correct edge behaviour

scripts.arm_master_functions.get_round_points()

Generates circular way points around the robot

This function generates tracjectory waypoints around a circle described by res, diameter and height. Circular points with an x value smaller then x_thresh are delted so that the arm does not plan a path behind its self and into the computers.

Returns:round_path[i] = [pos,neighbour]. The dictionary can be used for path planning. Traverse by querying a nodes neighbour, and then looking up that neighbour id back into the dict.
Return type:dict
scripts.arm_master_functions.left_or_right(start_ind, end_ind, graph)

Determines whether robot should go right or left around the circle

This is accomplished by iterating through both left and right options until the desired end_ind is reached.

Parameters:
  • start_ind (int) – The start node id in the graph
  • end_ind (str) – The end node id in the graph
  • graph (dict) – round_path[i] = [pos,neighbour] Dictonary which describes nodes and connections in the graph
Returns:

0 for left, or 1 for right

Return type:

int

Arm Server Functions

scripts.arm_server_functions.get_via_points(start, goal, res=5)

Returns sampled points between two end effector positions

Via points functions to further discretize a tracjectory. It first calculates the diplacement vector between points start and goal. It then samples along that vector direction an amount defined by res

Parameters:
  • start (list) – [x, y, z, rot_x, rot_y, rot_z]. Starting end effector position
  • end (list) – [x, y, z, rot_x, rot_y, rot_z]. Goal end effector position
Returns:

Returns list of end effector poses between the two desired location. The number of entries in the list is given by res.

Return type:

list

scripts.arm_server_functions.point2quat(p)

Converts end effector position in euler to quaterion domain

scripts.arm_server_functions.pose_e2array(pose)

Converts euluer end effector position to a list

scripts.arm_server_functions.pose_q2array(pose)

Converts quaterion end effector position to a list

scripts.arm_server_functions.quat2point(q)

Converts end effector position in quaterion to euler domain