pyrcf.components.controller_manager.command_accumulators

Accumulation policies will decide how control commands from multiple controllers (if present) in the same control loop will be combined before sending them to the robot.

Submodules

Classes

CommandAccumulatorBase

Accumulation policies are functions that takes in commands from two controllers

SimpleCmdOverride

This accumulation policy simply overrides the command from all controllers with the latest

Package Contents

class pyrcf.components.controller_manager.command_accumulators.CommandAccumulatorBase

Bases: abc.ABC

Accumulation policies are functions that takes in commands from two controllers and decides how to generate a single command to be sent to the robot.

NOTE: this should ideally be done at joint level, but we are simplifying by doing accumulation at robot-level instead.

abstract accumulate(commands=List[RobotCmd]) pyrcf.core.types.robot_io.RobotCmd

Accumulate the specified commands into a single command to be sent to the robot.

Parameters:

commands (List[RobotCmd]) – the robot commands from different controllers (in sequence).

Returns:

The final control command (action) to be sent to the robot.

Return type:

RobotCmd

Raises:

NotImplementedError – Raised if this method is not implemented by the child class.

class pyrcf.components.controller_manager.command_accumulators.SimpleCmdOverride

Bases: CommandAccumulatorBase

This accumulation policy simply overrides the command from all controllers with the latest one.

accumulate(commands=List[RobotCmd]) pyrcf.core.types.robot_io.RobotCmd

Accumulate the specified commands into a single command to be sent to the robot.

Parameters:

commands (List[RobotCmd]) – the robot commands from different controllers (in sequence).

Returns:

The final control command (action) to be sent to the robot.

Return type:

RobotCmd

Raises:

NotImplementedError – Raised if this method is not implemented by the child class.