forge-msgs 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ https://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 X-ERA
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ https://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,208 @@
1
+ Metadata-Version: 2.4
2
+ Name: forge-msgs
3
+ Version: 1.0.1
4
+ Summary: Python message models and Arrow serialization for Forge robotics dataflows.
5
+ Author: X-ERA
6
+ License-Expression: Apache-2.0
7
+ License-File: LICENSE
8
+ Requires-Dist: numpy>=1.26,<3
9
+ Requires-Dist: pillow>=10,<13
10
+ Requires-Dist: pyarrow>=14,<24
11
+ Requires-Dist: pydantic>=2.0,<3
12
+ Requires-Dist: pytest>=8.0.0 ; extra == 'test'
13
+ Requires-Python: >=3.11
14
+ Project-URL: Changelog, https://gitlab.ex-ai.cn/PhyAgentOS/framework/forge/-/blob/master/CHANGELOG.md
15
+ Project-URL: Issues, https://gitlab.ex-ai.cn/PhyAgentOS/framework/forge/-/issues
16
+ Project-URL: Repository, https://gitlab.ex-ai.cn/PhyAgentOS/framework/forge
17
+ Provides-Extra: test
18
+ Description-Content-Type: text/markdown
19
+
20
+ # forge-msgs
21
+
22
+ Forge message definitions for Dora dataflow.
23
+
24
+ The canonical cross-language contract starts at
25
+ `interfaces/forge_msgs/forge_msgs.v1.yaml`. That manifest references the
26
+ versioned domain schemas that Python, Rust, and future C++ implementations
27
+ should follow.
28
+
29
+ ## Core Messages
30
+
31
+ ### `JointState`
32
+
33
+ Robot or simulator joint observation payload.
34
+
35
+ - `name: list[str]`
36
+ - `position: list[float]`
37
+ - `velocity: list[float]`
38
+ - `effort: list[float]`
39
+
40
+ `name` must be non-empty and unique. Numeric lists must either be empty or have the same length as `name`.
41
+
42
+ ### `JointCommand`
43
+
44
+ Command payload for robot drivers and controllers.
45
+
46
+ - `name: list[str]`
47
+ - `mode: "position" | "velocity" | "effort" | "hybrid"`
48
+ - `position: list[float]`
49
+ - `velocity: list[float]`
50
+ - `effort: list[float]`
51
+ - `kp: list[float]`
52
+ - `kd: list[float]`
53
+
54
+ `mode` describes the command semantics. `position`, `velocity`, and `effort` match the common ROS2 command interfaces; `hybrid` is for low-level position/velocity/effort commands with optional `kp`/`kd` gains. Payloads written before `mode` existed are read as `mode="position"`.
55
+
56
+ `name` is a sparse update set: consumers update only the listed joints. Omitted joints retain their previous command target and must never be reset or filled with zero implicitly. Disjoint arm and gripper controllers can therefore share an ordered command stream without constructing a complete joint vector.
57
+
58
+ For Unitree-style low-level control, map `position -> q`, `velocity -> dq`, `effort -> tau`, `kp -> kp`, and `kd -> kd`.
59
+
60
+ ### `LocomotionCommand`
61
+
62
+ Planar body-frame locomotion velocity command for ground robots.
63
+
64
+ - `vx: float`
65
+ - `vy: float`
66
+ - `wz: float`
67
+
68
+ `vx` and `vy` are body-frame linear velocities in m/s, with positive X forward and positive Y left. `wz` is angular velocity about the body-frame Z axis in rad/s, positive counter-clockwise, corresponding to ROS2 `Twist.angular.z` / yaw rate. Stop is represented by all zeros. This message intentionally omits `mode`, `duration`, `gait`, `body_height`, timestamp/frame fields, and full 6D Twist fields.
69
+
70
+ ### `Image`
71
+
72
+ Uncompressed image payload.
73
+
74
+ - `height: int`
75
+ - `width: int`
76
+ - `encoding: str`
77
+ - `step: int`
78
+ - `data: bytes`
79
+
80
+ Supported encodings are `rgb8`, `bgr8`, `mono8`, `8UC1`, `16UC1`, `32SC1`,
81
+ and `32FC1`. Multi-byte pixels are little-endian. `8UC1` is available for
82
+ generic one-channel byte data such as label maps, while `32SC1` supports signed
83
+ 32-bit label images. Compressed images use `CompressedImage`.
84
+
85
+ ### `CompressedImage`
86
+
87
+ Compressed image bitstream payload.
88
+
89
+ - `format: str`
90
+ - `data: bytes`
91
+
92
+ Recommended formats are `jpeg`, `png`, and `webp`.
93
+
94
+ ### `TeleopObservation`
95
+
96
+ XR device raw teleop observation for embodiment-specific teleop policies.
97
+
98
+ - `device: list[str]`: XR source ids; recommended ids are `left`, `right`, and
99
+ `headset`. Match entries by id rather than list order.
100
+ - `x/y/z: list[float]`: positions in meters in the producer-configured XR
101
+ tracking frame.
102
+ - `qx/qy/qz/qw: list[float]`: quaternion components in `xyzw` order.
103
+ - `confidence: list[float]`: finite producer-defined confidence values in
104
+ `[0, 1]`; zero means that the aligned pose must not be used for control.
105
+ - `buttons_json: str`: JSON object of digital boolean and analog finite-number
106
+ values keyed by button id.
107
+ - `axes_json: str`: JSON object of finite numbers or numeric arrays keyed by
108
+ axis or documented derived-control id.
109
+
110
+ Recommended button ids include `A`, `B`, `X`, `Y`, the `left_`/`right_`
111
+ trigger and grip ids, and the joystick-click ids. `left_axis` and `right_axis`
112
+ are `[x, y]` joystick pairs. An unavailable pose may use zero position and an
113
+ identity quaternion with confidence `0`.
114
+
115
+ The payload does not carry the tracking-frame origin, handedness, axis
116
+ directions, or timestamp. Document the frame convention in producer
117
+ configuration and carry timing in Dora event context or an adapter layer.
118
+
119
+ ### `Text`
120
+
121
+ Single UTF-8 text payload for ASR transcripts, LLM responses, TTS input, and other text streams.
122
+
123
+ - `text: str`
124
+
125
+ Producers should omit empty outputs when there is no meaningful text.
126
+
127
+ ### Perception result sets
128
+
129
+ The perception messages use parallel Arrow list columns in a single-row
130
+ `RecordBatch`:
131
+
132
+ - `Detection2DSet` stores oriented pixel-space boxes and flattened class
133
+ hypotheses. Axis-aligned boxes use `rotation=0`, and high-level constructors
134
+ may fill that default automatically.
135
+ - `Detection3DSet` stores oriented metric boxes and flattened class hypotheses.
136
+ Axis-aligned boxes use identity orientation (`qx=0`, `qy=0`, `qz=0`, `qw=1`),
137
+ and high-level constructors may fill that default automatically.
138
+ - `SegmentationMaskSet` stores cropped `mono8` instance masks and their source
139
+ image offsets. Standalone masks can omit detection and track associations,
140
+ and high-level constructors may fill empty associations and zero offsets.
141
+
142
+ Detection class names and model label maps belong in node configuration.
143
+ `class_id` is the stable identifier carried on the wire.
144
+ Local features such as ORB, SIFT, or SuperPoint descriptors are intentionally
145
+ kept out of the core streaming schema; publish higher-level outputs unless a
146
+ future pipeline needs cross-node feature reuse.
147
+
148
+ ### `PointCloud`
149
+
150
+ `PointCloud` stores common XYZ point clouds as Arrow lists with optional
151
+ intensity and RGB columns. Organized clouds preserve `width` and `height`;
152
+ unorganized clouds use `height=1`. Coordinates use meters, while the coordinate
153
+ frame is supplied by Dora metadata or node configuration. High-level
154
+ constructors may infer unorganized clouds from `x/y/z` by setting `height=1`,
155
+ `width=len(x)`, and `is_dense` from finite XYZ values.
156
+
157
+ ## Motion Messages
158
+
159
+ The motion API provides single-row Arrow payloads for joint trajectories and
160
+ configured-group motion actions:
161
+
162
+ - `JointTrajectoryPoint`, `JointTrajectory`, and `JointTolerance`
163
+ - `FollowJointTrajectoryGoal`, `FollowJointTrajectoryFeedback`, and
164
+ `FollowJointTrajectoryResult`
165
+ - `GripperCommandGoal`, `GripperCommandFeedback`, and `GripperCommandResult`
166
+ - `MoveJointsGoal`, `MoveJointsFeedback`, and `MoveJointsResult`
167
+ - `MovePoseGoal`, `MovePoseFeedback`, and `MovePoseResult`
168
+
169
+ Trajectory points and tolerances are encoded as nested Arrow structs, including
170
+ `list<struct>` trajectory and tolerance fields. `MovePose*` messages reuse
171
+ `Pose` as a nested struct. Optional scalar and pose fields are represented by
172
+ Arrow nulls rather than sentinel values.
173
+
174
+ `GripperCommand` addresses the coordinate configured for its controller endpoint;
175
+ it does not carry `joint_name` or a dynamic unit. Prismatic coordinates use meters,
176
+ meters/s, and Newtons. Revolute or rotary actuator coordinates use radians,
177
+ radians/s, and Newton-meters. Explicit velocity or effort limits remain nullable so
178
+ a position-only backend can reject unsupported requested limits rather than silently
179
+ ignore them.
180
+
181
+ `goal_id` and `goal_status` are Dora action metadata and are intentionally not
182
+ included in payload columns. Domain result codes are separate from Dora's
183
+ lowercase terminal `goal_status` values.
184
+
185
+ ## Arrow Format
186
+
187
+ All core messages encode to a single-row `pyarrow.RecordBatch`.
188
+
189
+ ```python
190
+ from forge_msgs import JointCommand, JointState
191
+
192
+ state = JointState(
193
+ name=["joint1", "joint2"],
194
+ position=[0.1, 0.2],
195
+ velocity=[0.0, 0.0],
196
+ effort=[],
197
+ )
198
+ batch = state.to_arrow()
199
+ back = JointState.from_arrow(batch)
200
+
201
+ command = JointCommand.from_np(
202
+ values=[0.3, 0.4],
203
+ order=["joint1", "joint2"],
204
+ field="position",
205
+ )
206
+ ```
207
+
208
+ Timing and frame data are intentionally not part of the core schema. Carry them in Dora event context, topic naming, node configuration, or adapter layers.
@@ -0,0 +1,189 @@
1
+ # forge-msgs
2
+
3
+ Forge message definitions for Dora dataflow.
4
+
5
+ The canonical cross-language contract starts at
6
+ `interfaces/forge_msgs/forge_msgs.v1.yaml`. That manifest references the
7
+ versioned domain schemas that Python, Rust, and future C++ implementations
8
+ should follow.
9
+
10
+ ## Core Messages
11
+
12
+ ### `JointState`
13
+
14
+ Robot or simulator joint observation payload.
15
+
16
+ - `name: list[str]`
17
+ - `position: list[float]`
18
+ - `velocity: list[float]`
19
+ - `effort: list[float]`
20
+
21
+ `name` must be non-empty and unique. Numeric lists must either be empty or have the same length as `name`.
22
+
23
+ ### `JointCommand`
24
+
25
+ Command payload for robot drivers and controllers.
26
+
27
+ - `name: list[str]`
28
+ - `mode: "position" | "velocity" | "effort" | "hybrid"`
29
+ - `position: list[float]`
30
+ - `velocity: list[float]`
31
+ - `effort: list[float]`
32
+ - `kp: list[float]`
33
+ - `kd: list[float]`
34
+
35
+ `mode` describes the command semantics. `position`, `velocity`, and `effort` match the common ROS2 command interfaces; `hybrid` is for low-level position/velocity/effort commands with optional `kp`/`kd` gains. Payloads written before `mode` existed are read as `mode="position"`.
36
+
37
+ `name` is a sparse update set: consumers update only the listed joints. Omitted joints retain their previous command target and must never be reset or filled with zero implicitly. Disjoint arm and gripper controllers can therefore share an ordered command stream without constructing a complete joint vector.
38
+
39
+ For Unitree-style low-level control, map `position -> q`, `velocity -> dq`, `effort -> tau`, `kp -> kp`, and `kd -> kd`.
40
+
41
+ ### `LocomotionCommand`
42
+
43
+ Planar body-frame locomotion velocity command for ground robots.
44
+
45
+ - `vx: float`
46
+ - `vy: float`
47
+ - `wz: float`
48
+
49
+ `vx` and `vy` are body-frame linear velocities in m/s, with positive X forward and positive Y left. `wz` is angular velocity about the body-frame Z axis in rad/s, positive counter-clockwise, corresponding to ROS2 `Twist.angular.z` / yaw rate. Stop is represented by all zeros. This message intentionally omits `mode`, `duration`, `gait`, `body_height`, timestamp/frame fields, and full 6D Twist fields.
50
+
51
+ ### `Image`
52
+
53
+ Uncompressed image payload.
54
+
55
+ - `height: int`
56
+ - `width: int`
57
+ - `encoding: str`
58
+ - `step: int`
59
+ - `data: bytes`
60
+
61
+ Supported encodings are `rgb8`, `bgr8`, `mono8`, `8UC1`, `16UC1`, `32SC1`,
62
+ and `32FC1`. Multi-byte pixels are little-endian. `8UC1` is available for
63
+ generic one-channel byte data such as label maps, while `32SC1` supports signed
64
+ 32-bit label images. Compressed images use `CompressedImage`.
65
+
66
+ ### `CompressedImage`
67
+
68
+ Compressed image bitstream payload.
69
+
70
+ - `format: str`
71
+ - `data: bytes`
72
+
73
+ Recommended formats are `jpeg`, `png`, and `webp`.
74
+
75
+ ### `TeleopObservation`
76
+
77
+ XR device raw teleop observation for embodiment-specific teleop policies.
78
+
79
+ - `device: list[str]`: XR source ids; recommended ids are `left`, `right`, and
80
+ `headset`. Match entries by id rather than list order.
81
+ - `x/y/z: list[float]`: positions in meters in the producer-configured XR
82
+ tracking frame.
83
+ - `qx/qy/qz/qw: list[float]`: quaternion components in `xyzw` order.
84
+ - `confidence: list[float]`: finite producer-defined confidence values in
85
+ `[0, 1]`; zero means that the aligned pose must not be used for control.
86
+ - `buttons_json: str`: JSON object of digital boolean and analog finite-number
87
+ values keyed by button id.
88
+ - `axes_json: str`: JSON object of finite numbers or numeric arrays keyed by
89
+ axis or documented derived-control id.
90
+
91
+ Recommended button ids include `A`, `B`, `X`, `Y`, the `left_`/`right_`
92
+ trigger and grip ids, and the joystick-click ids. `left_axis` and `right_axis`
93
+ are `[x, y]` joystick pairs. An unavailable pose may use zero position and an
94
+ identity quaternion with confidence `0`.
95
+
96
+ The payload does not carry the tracking-frame origin, handedness, axis
97
+ directions, or timestamp. Document the frame convention in producer
98
+ configuration and carry timing in Dora event context or an adapter layer.
99
+
100
+ ### `Text`
101
+
102
+ Single UTF-8 text payload for ASR transcripts, LLM responses, TTS input, and other text streams.
103
+
104
+ - `text: str`
105
+
106
+ Producers should omit empty outputs when there is no meaningful text.
107
+
108
+ ### Perception result sets
109
+
110
+ The perception messages use parallel Arrow list columns in a single-row
111
+ `RecordBatch`:
112
+
113
+ - `Detection2DSet` stores oriented pixel-space boxes and flattened class
114
+ hypotheses. Axis-aligned boxes use `rotation=0`, and high-level constructors
115
+ may fill that default automatically.
116
+ - `Detection3DSet` stores oriented metric boxes and flattened class hypotheses.
117
+ Axis-aligned boxes use identity orientation (`qx=0`, `qy=0`, `qz=0`, `qw=1`),
118
+ and high-level constructors may fill that default automatically.
119
+ - `SegmentationMaskSet` stores cropped `mono8` instance masks and their source
120
+ image offsets. Standalone masks can omit detection and track associations,
121
+ and high-level constructors may fill empty associations and zero offsets.
122
+
123
+ Detection class names and model label maps belong in node configuration.
124
+ `class_id` is the stable identifier carried on the wire.
125
+ Local features such as ORB, SIFT, or SuperPoint descriptors are intentionally
126
+ kept out of the core streaming schema; publish higher-level outputs unless a
127
+ future pipeline needs cross-node feature reuse.
128
+
129
+ ### `PointCloud`
130
+
131
+ `PointCloud` stores common XYZ point clouds as Arrow lists with optional
132
+ intensity and RGB columns. Organized clouds preserve `width` and `height`;
133
+ unorganized clouds use `height=1`. Coordinates use meters, while the coordinate
134
+ frame is supplied by Dora metadata or node configuration. High-level
135
+ constructors may infer unorganized clouds from `x/y/z` by setting `height=1`,
136
+ `width=len(x)`, and `is_dense` from finite XYZ values.
137
+
138
+ ## Motion Messages
139
+
140
+ The motion API provides single-row Arrow payloads for joint trajectories and
141
+ configured-group motion actions:
142
+
143
+ - `JointTrajectoryPoint`, `JointTrajectory`, and `JointTolerance`
144
+ - `FollowJointTrajectoryGoal`, `FollowJointTrajectoryFeedback`, and
145
+ `FollowJointTrajectoryResult`
146
+ - `GripperCommandGoal`, `GripperCommandFeedback`, and `GripperCommandResult`
147
+ - `MoveJointsGoal`, `MoveJointsFeedback`, and `MoveJointsResult`
148
+ - `MovePoseGoal`, `MovePoseFeedback`, and `MovePoseResult`
149
+
150
+ Trajectory points and tolerances are encoded as nested Arrow structs, including
151
+ `list<struct>` trajectory and tolerance fields. `MovePose*` messages reuse
152
+ `Pose` as a nested struct. Optional scalar and pose fields are represented by
153
+ Arrow nulls rather than sentinel values.
154
+
155
+ `GripperCommand` addresses the coordinate configured for its controller endpoint;
156
+ it does not carry `joint_name` or a dynamic unit. Prismatic coordinates use meters,
157
+ meters/s, and Newtons. Revolute or rotary actuator coordinates use radians,
158
+ radians/s, and Newton-meters. Explicit velocity or effort limits remain nullable so
159
+ a position-only backend can reject unsupported requested limits rather than silently
160
+ ignore them.
161
+
162
+ `goal_id` and `goal_status` are Dora action metadata and are intentionally not
163
+ included in payload columns. Domain result codes are separate from Dora's
164
+ lowercase terminal `goal_status` values.
165
+
166
+ ## Arrow Format
167
+
168
+ All core messages encode to a single-row `pyarrow.RecordBatch`.
169
+
170
+ ```python
171
+ from forge_msgs import JointCommand, JointState
172
+
173
+ state = JointState(
174
+ name=["joint1", "joint2"],
175
+ position=[0.1, 0.2],
176
+ velocity=[0.0, 0.0],
177
+ effort=[],
178
+ )
179
+ batch = state.to_arrow()
180
+ back = JointState.from_arrow(batch)
181
+
182
+ command = JointCommand.from_np(
183
+ values=[0.3, 0.4],
184
+ order=["joint1", "joint2"],
185
+ field="position",
186
+ )
187
+ ```
188
+
189
+ Timing and frame data are intentionally not part of the core schema. Carry them in Dora event context, topic naming, node configuration, or adapter layers.
@@ -0,0 +1,29 @@
1
+ [project]
2
+ name = "forge-msgs"
3
+ version = "1.0.1"
4
+ description = "Python message models and Arrow serialization for Forge robotics dataflows."
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "X-ERA" }
8
+ ]
9
+ requires-python = ">=3.11"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ dependencies = [
13
+ "numpy>=1.26,<3",
14
+ "pillow>=10,<13",
15
+ "pyarrow>=14,<24",
16
+ "pydantic>=2.0,<3",
17
+ ]
18
+
19
+ [project.optional-dependencies]
20
+ test = ["pytest>=8.0.0"]
21
+
22
+ [project.urls]
23
+ Repository = "https://gitlab.ex-ai.cn/PhyAgentOS/framework/forge"
24
+ Changelog = "https://gitlab.ex-ai.cn/PhyAgentOS/framework/forge/-/blob/master/CHANGELOG.md"
25
+ Issues = "https://gitlab.ex-ai.cn/PhyAgentOS/framework/forge/-/issues"
26
+
27
+ [build-system]
28
+ requires = ["uv_build>=0.8.17,<0.9.0"]
29
+ build-backend = "uv_build"