fastsim.controllers
High-level controller classes decorated with @apiclass. Each controller wraps one or more backend capabilities and returns a structured Result object. The command queue system allows multi-step actions to be dispatched and awaited.
Result
1 methodTyped dict returned by every controller method: success flag, message, and payload.
Result inherits from dict and always contains the keys 'success' (bool), 'msg' (str), and 'data' (Any). Use unwrap() for safe payload extraction.
PriorityLevel
5 methodsInteger enum defining standard command priority levels used by ControllerManager.
Values: LOW=0, MEDIUM=5, HIGH=10, MIN=-999, MAX=999. Higher value means higher priority in the command queue.
LOWpropertyLow priority (value 0).
MEDIUMpropertyMedium priority (value 5).
HIGHpropertyHigh priority (value 10).
MINpropertyMinimum possible priority (value -999).
MAXpropertyMaximum possible priority (value 999).
Command
abstract3 methodsAbstract base command with a priority level. Commands are queued and executed by ControllerManager.
prioritypropertyThe priority level of this command.
SimpleCommand
1 methodSingle-step command that executes entirely within one simulation tick.
Inherited fromCommand3
wait_for_resultmethodBlock the calling thread until this command finishes.
get_resultmethodReturn the result of the command (may be None if not yet finished).
MultiCommand
3 methodsMulti-step command that spans multiple simulation ticks.
ControllerManager calls step() every tick until is_finished() returns True, then calls get_result().
Inherited fromCommand3
wait_for_resultmethodBlock the calling thread until this command finishes.
get_resultmethodReturn the result of the command (may be None if not yet finished).
ControllerManager
static-only4 methodsManages a priority-ordered command queue and drives command execution each tick.
ControllerManager is the runtime dispatcher for Command objects. Add commands from controller threads; the manager executes them in priority order on the simulation thread.
SpawnableController
static-only6 methodsGeneric controller for sending commands to robots, objects, and sensors, plus spawning and introspection.
spawn_with_configmethodDynamically spawn an entity from a config dict at runtime.
RobotController
static-only3 methodsHigh-level robot motion primitives: trajectory following, IK (no collision), and direct EE pose commands.
move_robot_along_trajectorymethodCommand the robot to follow a pre-computed joint trajectory.
| Name | Type | Default | Description |
|---|---|---|---|
robot_name | str | — | Target robot name. |
trajectory | list | — | Sequence of joint position waypoints. |
joint_names | list | — | Ordered list of joint names corresponding to trajectory columns. |
step_sizeopt | int | 1 | Number of trajectory waypoints to advance per simulation step. |
syncopt | bool | True | Block until the trajectory completes. |
solve_ik_no_collision_checkmethodSolve IK for a target end-effector pose without collision checking.
MotionPlanController
static-only11 methodsMotion planning controller: IK, FK, collision-aware trajectory generation, joint state queries, and object attachment.
solve_fkmethodCompute forward kinematics for a given joint configuration.
ActionController
static-only1 methodHigh-level action execution: dispatch a named action with parameters and optionally verify goal satisfaction.
actmethodExecute a configured action and optionally verify the goal condition.