A controller represents a specific robotic behavior. Its main method is execute(), that accepts the state of the robot and the elapsed time as arguments and returns a structure suitable for controlling the robot. For example, the controllers implemented in pySimiam so far return a (v, ω) tuple - the linear and angular speeds in the unicycle model.
The controller can also have a set of parameters, set with set_parameters(). Again, the structure of the parameters is up to the controller implementation. The supervisor using this controller should provide suitable arguments to the controller’s constructor.
Additionally, the controller should provide the means to reset its internal state by implementing restart(). This method is called every time the supervisor switches from one controller to the next, and it might be necessary to reset the accumulated error, for example, as in a PID controller.
The controller class defines a behavior for the supervisor class. Any implemention must inherit from this class and implement the Controller,execute() method to return a unicycle model output.
Parameters: | params (Struct) – A structure containing the internal controller parameters, such as PID constants. |
---|
Given a state and elapsed time, calculate and return robot motion parameters
Parameters: |
|
---|
To be implemented in subclasses.
Reset the controller to the initial state.