首页 理论 架构 工程 文档 白皮书 著作 研究 案例 下载 博客 关于 开始使用 →

第189章 Action Object 行为对象

第189章 Action Object

行为对象

第188章已经完成:

Cognition
 ↓
Method
 ↓
Algorithm
 ↓
Calculation
 ↓
Result

第189章进一步解决:

Method Calculation 产生的 Result,如何形成一个可以被机器执行系统直接接收的标准行为对象?

因此建立:

Cognition
 ↓
Method
 ↓
Calculation
 ↓
Action Object
 ↓
Machine

1. Action 不再只是动作名称

传统程序中的 Action 可能只是:

Grasp
Move
Release
Stop

但对于真实机器来说,仅仅知道:

Action = Grasp

是不够的。

机器还需要知道:

Target
Position
Orientation
Velocity
Force
Parameters

因此建立:

Action
{
    type
    target
    position
    orientation
    velocity
    force
    parameters
}

2. Action Object 的基本定义

Action 成为一个真正的 OOP 对象:

class Action
{
    protected $type;
    protected $target;
    protected $position;
    protected $orientation;
    protected $velocity;
    protected $force;
    protected $parameters;
}

于是:

Action

不再是一个简单字符串,而是:

描述机器下一步行为的结构化对象。


3. Method 输出 Action

第188章:

Method Calculation
 ↓
Result

第189章:

Result
 ↓
Action Object

完整形成:

Cognition
 ↓
Method Matching
 ↓
Method Calculation
 ↓
Calculation Result
 ↓
Action Object

例如:

GraspMethod
 ↓
Calculate
 ↓
Action

得到:

Action
{
    type: grasp
    target: egg_001
    position: (...)
    orientation: (...)
    velocity: 0.2
    force: 4
}

4. Action Object 与 Machine Action 的区别

需要明确区分:

Action Object

和:

Physical Action

Action Object 是:

机器准备执行的结构化行为描述。

例如:

Action
{
    type: grasp
    target: egg_001
    force: 4
}

而:

Robot Gripper

真正执行:

Close
Move
Apply Force

因此:

Action Object
 ↓
Machine Controller
 ↓
Physical Action

这样认知系统和机器控制系统可以保持独立。


5. Action Object 的核心字段

type

定义行为类型:

grasp
move
release
avoid
rotate
stop
reposition

target

定义行为目标:

egg_001
table_001
obstacle_001

position

定义空间目标:

{
    "x": 120,
    "y": 80,
    "z": 35
}

orientation

定义目标姿态:

{
    "x": 0,
    "y": 20,
    "z": 90
}

velocity

定义运动速度。

force

定义作用力或限制力。

parameters

保存 Method Calculation 产生的其他参数。


6. Action Object 与实时场景

Action 不是脱离 Scene 产生的。

完整关系:

Current Scene
 ↓
Cognition
 ↓
Method
 ↓
Calculation
 ↓
Action

例如当前:

Egg
+
Position
+
Orientation
+
Contact
+
Distance
+
Risk

共同构成:

Current Cognition

然后:

GraspMethod

根据这些数据计算:

Target Position
Force
Velocity
Orientation

最终生成:

Action Object

7. Action Object 是实时对象

由于 Scene 是:

Scene(t)

Action 同样具有时间属性:

Action(t)

例如:

Scene(t)
 ↓
Cognition(t)
 ↓
Method(t)
 ↓
Action(t)

发生世界变化:

World Change

以后:

Scene(t+1)
 ↓
Cognition(t+1)
 ↓
Method(t+1)
 ↓
Action(t+1)

因此:

Action(t)

和:

Action(t+1)

完全可能不同。

这正好与第151章:

Action(t)
≠
Action(t+1)

形成工程对应。


8. Action Object 与 Method Instance

建立:

Method Instance
 ↓
calculate()
 ↓
Action Instance

例如:

$method = new GraspMethod();

$action = $method->calculate(
    $cognition
);

得到:

Action Object

因此:

Method

负责:

计算如何行动。

而:

Action

负责:

描述计算出来的具体行为。


9. Action Factory

为了避免每一个 Method 都直接负责构造复杂 Action,可以建立:

class ActionFactory
{
    public function create($result)
    {
        $action = new Action();

        // 将计算结果转换为 Action Object

        return $action;
    }
}

于是:

Method Calculation
 ↓
Calculation Result
 ↓
ActionFactory
 ↓
Action Instance

形成明确的对象转换层。


10. Action Object 的标准化

不同 Method:

GraspMethod
MoveMethod
AvoidMethod
ReleaseMethod
RepositionMethod

最终都可以输出统一结构:

Action Object

例如:

GraspMethod
      ↓
Action

MoveMethod
      ↓
Action

AvoidMethod
      ↓
Action

ReleaseMethod
      ↓
Action

这样机器执行层不需要理解所有 Cognitive Method。

它只需要理解:

Action Object

11. Action Object API

由于系统采用独立系统 + API 通讯:

Cognitive System
        ↓
Action Object
        ↓
JSON
        ↓
Machine API

例如:

{
    "action": {
        "type": "grasp",
        "target": "egg_001",
        "position": {
            "x": 120,
            "y": 80,
            "z": 35
        },
        "orientation": {
            "x": 0,
            "y": 20,
            "z": 90
        },
        "velocity": 0.2,
        "force": 4,
        "parameters": {}
    }
}

因此:

PHP Object
 ↓
JSON
 ↓
API
 ↓
Machine System

形成天然的数据边界。


12. Action Object 与设备解耦

这是这一章非常重要的工程原则。

认知系统输出:

Action Object

而不直接写死:

Motor 1
Motor 2
Servo 3
GPIO 4

因此:

ICAI Cognitive System

只负责:

What
+
Where
+
How
+
Parameters

机器控制系统负责:

How to physically execute

形成:

Cognition
 ↓
Action Object
 ↓
Device Adapter
 ↓
Specific Machine

同一个:

Action
{
    type: "move",
    position: (...)
}

理论上可以交给不同设备的 Adapter 转换。


13. Action Object 与设备能力

Action 最终仍然需要经过:

Machine Capability

验证。

例如:

Action
=
rotate

但是:

Robot Capability
=
No Rotate

那么不能直接执行。

因此:

Action Object
 ↓
Capability Validation
 ↓
Executable Action

如果无法执行:

Action
 ↓
Validation Failure
 ↓
Feedback
 ↓
Cognition

重新进入认知循环。


14. Action Object 与 Feedback

Action 执行后:

Action
 ↓
Machine
 ↓
Physical World
 ↓
World Change
 ↓
Sensor

得到:

Feedback

然后:

Feedback
 ↓
Element Update
 ↓
Object Update
 ↓
Scene Update
 ↓
New Cognition

最终形成:

Action Object
 ↓
Physical Action
 ↓
World Change
 ↓
New Scene
 ↓
Cognition

因此 Action Object 是:

认知系统向现实世界输出的结构化行为载体。


15. Action Object 与第153章 Scene Reconstruction

第153章:

Action
 ↓
World Change
 ↓
New Perception
 ↓
New Scene

现在工程化为:

Action Object
 ↓
Machine Execution
 ↓
World Change
 ↓
Sensor Data
 ↓
Element Update
 ↓
Object Update
 ↓
Scene Update

因此第189章把昨天的理论进一步落到对象层。


16. Action Object 与连续认知

完整闭环:

Real-Time Data
 ↓
Element
 ↓
Object
 ↓
Scene
 ↓
Cognition
 ↓
Method Matching
 ↓
Method Calculation
 ↓
Action Object
 ↓
Machine
 ↓
World Change
 ↓
Real-Time Data

最终形成:

World
 ↕
Scene
 ↕
Cognition
 ↕
Method
 ↕
Action

这已经不是:

Input
 ↓
Output

而是:

实时世界与机器认知之间的双向结构化循环。


17. Action Object 的核心公式

可以定义:

Action(t)
=
F(
    Method(t),
    Cognition(t),
    Scene(t),
    CalculationResult(t)
)

其中:

Action(t)

是:

{
    type,
    target,
    position,
    orientation,
    velocity,
    force,
    parameters
}

因此:

Cognition
 ↓
Method
 ↓
Calculation
 ↓
Action Object

形成明确的数据转换关系。


18. 本章核心原则

Action Object Principle

ICAI 中的 Action 不是简单的动作名称,而是由 Method Calculation 根据当前 Cognition 和 Current Scene 生成的结构化行为对象。Action Object 包含行为类型、目标、空间位置、姿态、速度、作用力及其他参数,并通过标准接口传递给机器执行系统。

最终:

Current Scene
       ↓
Cognition
       ↓
Method Matching
       ↓
Method Calculation
       ↓
Action Object
       ↓
Machine API
       ↓
Machine
       ↓
World Change
       ↓
New Scene

这样,第171–189章已经逐步形成了非常清晰的 ICAI 实时认知对象工程链

Real-Time Data
      ↓
Element Instance
      ↓
Object Instance
      ↓
Relation Instance
      ↓
Scene Instance
      ↓
Cognition Instance
      ↓
Method Instance
      ↓
Method Calculation
      ↓
Action Instance
      ↓
Machine

而下一步第190章就可以自然进入 Action Execution

Action Object
      ↓
Action Validation
      ↓
Capability Check
      ↓
Device API
      ↓
Physical Execution

也就是从现在的 “生成 Action Object”,正式进入 “让机器执行 Action Object”

Leave a Reply

Your email address will not be published. Required fields are marked *