The paths module

Paths is an abstraction module for construction of paths and trajectories on a 3D space with constraints.

Volumes can be defined using Pyrame’s or custom functions. These volumes can then be used either to define forbidden zones or matrices.

Volumes are created using the init_volume_paths function, which registers the volume in a pool. Then, they can be used to define a forbidden region of space (add_limits_space_paths) or a path (init_path_paths).

Both the function move_space_paths and move_next_paths will move in space avoiding forbidden volumes. An A-star (A*) algorithm is used from one point to another on both functions.

Warning

The complexity of the A-star path finding problem increases rapidly with decreasing values of the minimum steps (r1,r2,r3). Keep them to the largest value required on your experiment.

API

cmd_paths.init_space_paths(space_id, motion1_id, motion2_id, motion3_id, r1, r2, r3)[source]

Initialize space_id with id of motion system motion_id and minimal steps for each axis rn

cmd_paths.deinit_space_paths(space_id)[source]

Deinitialize space_id

cmd_paths.add_limits_space_paths(space_id, volume_id)[source]

Add volume_id to the forbidden regions of space_id

cmd_paths.move_space_paths(space_id, d1, d2, d3, s1, s2, s3, a1, a2, a3, strategy='undef')[source]

Move on space_id to dn destination at sn speed, with an acceleration (for n=1,2,3). strategy is the preferential order of axis movement (e.g. 213 to move first axis 2, then axis 1 finally axis 3)

cmd_paths.init_volume_paths(volume_id, space_id, module, function, *params)[source]

Create volume_id by specifying the Python module and function that will determine inside/outside of volume

cmd_paths.deinit_volume_paths(volume_id)[source]

Deinitialize volume_id

cmd_paths.init_path_paths(path_id, space_id, volume_id, p1d, p2d, p3d, order, path_type, directions)[source]

Create path to scan volume_id with pnd steps (for n=1,2,3). The path is associated to space_id

order is a three character string. Its first character is the number of the fastest axis, and the third one is the slowest.

path_type is a two character string indicating: the type of scan (‘r’ for raster, ‘m’ for meander) of the fastest and middle axis (first character), and middle and slowest axis (second character).

directions is a three character string with either ‘p’ or ‘n’ for positive or negative for the fastest, middle and slowest axis.

cmd_paths.deinit_path_paths(path_id)[source]

Deinitialize path_id

cmd_paths.get_path_paths(path_id)[source]

Returns the path (sequence of 3D points) described by path_id

cmd_paths.dump_path_paths(path_id, filename)[source]

Dump in filename the path (sequence of 3D points) described by path_id

cmd_paths.move_next_paths(path_id, s1, s2, s3, a1, a2, a3, strategy='undef')[source]

Go to next point of path_id. The first time after initialization of the path, next goes to the first point. It moves with speed sn and acceleration an (for axis number n: 1,2,3)

cmd_paths.move_first_paths(path_id, s1, s2, s3, a1, a2, a3, strategy='undef')[source]

Go the first point of path_id. Next call to move_next_paths will go to the next point in the path.