controller

class jiminy_py.core.AbstractController

Bases: instance

Raises an exception This class cannot be instantiated from Python

compute_command((AbstractController)self, (float)t, (numpy.ndarray)q, (numpy.ndarray)v, (numpy.ndarray)command) None :

Compute the command.

It assumes that the robot internal state (including sensors) is consistent with other input arguments. It fetches the sensor data automatically.

Parameters:
  • t – Current time.

  • q – Current configuration vector.

  • v – Current velocity vector.

  • command – Output effort vector.

get_options((AbstractController)arg1) dict :

Dictionary with the parameters of the controller.

initialize((AbstractController)self, (Robot)robot) None :

Initialize the internal state of the controller for a given robot.

This method can be called multiple times with different robots. The internal state of the controller will be systematically overwritten.

Parameters:

robot – Robot

internal_dynamics((AbstractController)self, (float)t, (numpy.ndarray)q, (numpy.ndarray)v, (numpy.ndarray)u_custom) None :

Emulate custom phenomenon that are part of the internal dynamics of the system but not included in the physics engine.

Parameters:
  • t – Current time.

  • q – Current configuration vector.

  • v – Current velocity vector.

  • uCustom – Output effort vector.

property is_initialized

fget( (jiminy_py.core.core.AbstractController)self) -> bool:

Whether the controller has been initialized.

Note

Note that a controller can be considered initialized even if its telemetry is not properly configured. If not, it must be done before being ready to use.

register_constant((AbstractController)self, (str)name, (object)value) None :

Register a constant (so-called invariant) to the telemetry.

The user is responsible to convert it as a byte array (eg std::string), either using toString for arithmetic types or saveToBinary complex types.

Parameters:
  • name – Name of the constant.

  • value – Constant to add to the telemetry.

register_variable((AbstractController)self, (str)name, (object)value) None :

Dynamically registered a scalar variable to the telemetry. It is the main entry point for a user to log custom variables.

Internally, all it does is to store a reference to the variable, then it logs its value periodically. There is no update mechanism what so ever nor safety check. The user has to take care of the life span of the variable, and to update it manually whenever it is necessary to do so.

Parameters:
  • name – Name of the variable. It will appear in the header of the log.

  • values – Variable to add to the telemetry.

register_variables((AbstractController)self, (list)fieldnames, (object)values) None
remove_entries((AbstractController)arg1) None :

Remove all variables dynamically registered to the telemetry.

Note that one must reset Jiminy Engine for this to take effect.

reset((AbstractController)self[, (bool)reset_dynamic_telemetry=False]) None :

Reset the internal state of the controller.

Note that it resets the configuration of the telemetry.

Note

s This method is not intended to be called manually. The Engine is taking care of it when its own reset method is called.

Parameters:

resetDynamicTelemetry – Whether variables dynamically registered to the telemetry must be removed. Optional: False by default.

property robot

fget( (jiminy_py.core.core.AbstractController)self) -> jiminy_py.core.core.Robot

property sensor_measurements

fget( (jiminy_py.core.core.AbstractController)self) -> jiminy_py.core.core.SensorMeasurementTree

set_options((AbstractController)self, (dict)options) None :

Set the configuration options of the controller.

Note that one must reset Jiminy Engine for this to take effect.

Parameters:

controllerOptions – Dictionary with the parameters of the controller.

class jiminy_py.core.BaseController((object)arg1)

Bases: AbstractController

compute_command((BaseController)self, (float)t, (numpy.ndarray)q, (numpy.ndarray)v, (numpy.ndarray)command) None :

Compute the command.

It assumes that the robot internal state (including sensors) is consistent with other input arguments. It fetches the sensor data automatically.

param t:

Current time.

param q:

Current configuration vector.

param v:

Current velocity vector.

param command:

Output effort vector.

compute_command( (BaseController)arg1, (float)arg2, (numpy.ndarray)arg3, (numpy.ndarray)arg4, (numpy.ndarray)arg5) -> None

internal_dynamics((BaseController)self, (float)t, (numpy.ndarray)q, (numpy.ndarray)v, (numpy.ndarray)u_custom) None :
Emulate custom phenomenon that are part of the internal dynamics of the system

but not included in the physics engine.

param t:

Current time.

param q:

Current configuration vector.

param v:

Current velocity vector.

param uCustom:

Output effort vector.

internal_dynamics( (BaseController)arg1, (float)arg2, (numpy.ndarray)arg3, (numpy.ndarray)arg4, (numpy.ndarray)arg5) -> None

reset((BaseController)self[, (bool)reset_dynamic_telemetry=False]) None

reset( (BaseController)self [, (bool)reset_dynamic_telemetry=False]) -> None

class jiminy_py.core.FunctionalController((object)arg1[, (object)compute_command=None[, (object)internal_dynamics=None]])

Bases: BaseFunctionalController

reset((FunctionalController)self[, (bool)reset_dynamic_telemetry=False]) None

reset( (FunctionalController)self [, (bool)reset_dynamic_telemetry=False]) -> None