Python SDK /fastsim.task

fastsim.task

5 个类

Task execution framework: define multi-action tasks, track their status, and manage them through TaskManager. Each Task contains an ordered sequence of Actions evaluated against Goals.

class

TaskStatus

6 个方法
fastsim.task.task_status.TaskStatus

Dataclass capturing the full execution state of a running or completed task.

task_nameproperty
@property def task_name(self)str

The name of the task this status belongs to.

runningproperty
@property def running(self)bool

True while the task is still executing.

finishedproperty
@property def finished(self)bool

True once the task has completed (success or failure).

successproperty
@property def success(self)bool

True if the task finished and all goals were satisfied.

fail_reasonproperty
@property def fail_reason(self)str

Human-readable description of why the task failed, or empty string on success.

current_actionproperty
@property def current_action(self)str

Name of the action currently being executed, or empty string if idle.

class

ActionResultStatus

4 个方法
fastsim.task.task_status.ActionResultStatus

Result of a single action execution within a task.

successproperty
@property def success(self)bool

True if the action executed successfully.

action_nameproperty
@property def action_name(self)str

The name of the action that was executed.

action_typeproperty
@property def action_type(self)str

The type identifier of the action (e.g. "pick", "place").

messageproperty
@property def message(self)str

Optional message providing detail about the result.

class

GoalResultStatus

4 个方法
fastsim.task.task_status.GoalResultStatus

Result of a goal evaluation after an action.

successproperty
@property def success(self)bool

True if the goal condition was satisfied.

goal_nameproperty
@property def goal_name(self)str

The name of the goal that was evaluated.

goal_typeproperty
@property def goal_type(self)str

The type identifier of the goal (e.g. "pose", "on_top").

messageproperty
@property def message(self)str

Optional message providing detail about the evaluation.

class

Task

2 个方法
fastsim.task.task.Task

Executable task instance: an ordered sequence of actions evaluated against goals.

Tasks are defined via config or programmatically by subclassing. Call execute() to run the full action sequence; inspect get_status() for progress tracking.

get_statusmethod
def get_status(self)TaskStatus

Return the current execution status of the task.

TaskStatus — Live status snapshot.
executemethod
def execute(self)TaskStatus

Run the task: execute each action in order, evaluate goals, and update status.

TaskStatus — Final task status after all actions complete.
class

TaskManager

静态类4 个方法
fastsim.task.task_manager.TaskManager

Static task registry: register, select, and run tasks by name.

TaskManager maintains a registry of Task instances keyed by name. Use run_task() to execute a named task, or set_current_task() + run_current_task() for the typical workflow.

run_taskstaticmethod
@staticmethod def run_task(task_name: str)TaskStatus

Execute a named task and return its final status.

参数名类型默认值说明
task_namestrName of the registered task to run.
TaskStatus — Final task status.
get_current_task_statusstaticmethod
@staticmethod def get_current_task_status()TaskStatus

Return the status of the currently selected task.

TaskStatus — Current task status, or None if no task is selected.
run_current_taskstaticmethod
@staticmethod def run_current_task()TaskStatus

Execute whichever task is currently selected via set_current_task().

TaskStatus — Final task status.
set_current_taskstaticmethod
@staticmethod def set_current_task(task_name: str)None

Set the active task by name.

参数名类型默认值说明
task_namestrName of the task to make current.