spike.scenario.dynamics

Robot dynamic state management

Classes

ScenarioDynamics(model[, mat])

Robot dynamics modelisation

class spike.scenario.dynamics.ScenarioDynamics(model, mat=None)

Robot dynamics modelisation

__init__(model, mat=None)

Constructor

Parameters:
reset()

Reset function

configure(coordinates=None)

Configure dynamics

Parameters:

coordinates (dictionary {'north', 'east', 'yaw'}) – initial robot coordinates, default is None

current()

Current robot dynamic status accessor

Returns:

current robot dynamics measurements

Return type:

dictionary

set_degrees_counted(port, degrees)

Single motor set_degrees_counted function

Parameters:
  • port (string) – motor port

  • degrees (integer) – the number of degrees to set

Raises:

RuntimeError – The port is not associated to a motor

extrapolate(time)

Extrapolate robot status at a given date

Parameters:

time (float (seconds)) – extrapolation date

__compute_motor_speeds_from_steering(steering, speed)

Compute left and right motors command from steering and speed The behavior of this function, with a discontinuities between 99% and 100% as been validated by experiment using spike motors

Parameters:
  • steering (integer [-100,100]) – the direction and quantity to steer the Driving Base.

  • steering – the speed at which the Driving Base will move while performing a curve.

Returns:

motor left and right command

Return type:

dictionary

__update_kinematics()

Update robot global kinematics from motor speeds

__check_pair(left, right)

Check if left and right ports connects pairable motors

Parameters:
  • left (string) – left motor port

  • right (boolean) – right motor port

Returns:

True if motors are pairable, False otherwise

Raises:

RuntimeError – No motor in input ports or motor can not be paired

__check_configuration(coordinates)

Check input json configuration

Parameters:

conf (dictionary) – configuration file content

Raises:

ValueError – Missing north, east or yaw coordinates

__modulo_dir(angle)

Degrees to radians transformation

Parameters:

input (float (radians)) – angle

Returns:

angle

Return type:

float (degrees) [-180,180]