aspsim.room.trajectory.LinearTrajectory

class aspsim.room.trajectory.LinearTrajectory(points, period, samplerate, mode='constant_speed')

Bases: Trajectory

A trajectory that moves through a series of points in straight lines.

Parameters:
  • points (ndarray of shape (numpoints, spatial_dim) or equivalent list of lists) – The points that the trajectory will move through. The trajectory will start and end at the first point.

  • period (float) – The time in seconds for the trajectory to go through all the points and return to the starting point.

  • samplerate (int) – The samplerate of the simulation.

  • mode ('constant_speed' or 'constant_time') – if ‘constant_speed’, the speed of the movement will be constant, and calibrated such that it returns to the starting position after one period. if ‘constant_time’, each segment will take equal time, and the speed will therefore go up for long segments and down for short segments.

__init__(points, period, samplerate, mode='constant_speed')

A trajectory that moves through a series of points in straight lines.

Parameters:
  • points (ndarray of shape (numpoints, spatial_dim) or equivalent list of lists) – The points that the trajectory will move through. The trajectory will start and end at the first point.

  • period (float) – The time in seconds for the trajectory to go through all the points and return to the starting point.

  • samplerate (int) – The samplerate of the simulation.

  • mode ('constant_speed' or 'constant_time') – if ‘constant_speed’, the speed of the movement will be constant, and calibrated such that it returns to the starting position after one period. if ‘constant_time’, each segment will take equal time, and the speed will therefore go up for long segments and down for short segments.

Methods

__init__(points, period, samplerate[, mode])

A trajectory that moves through a series of points in straight lines.

current_pos(time_idx)

plot(ax, symbol, label[, tot_samples])

current_pos(time_idx)
Parameters:

time_idx (int) – time index in samples

Returns:

pos – position at time time_idx

Return type:

array of shape (1,3)