hex-util-msg 0.1.0a2__tar.gz → 0.1.0a3__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.
Files changed (88) hide show
  1. {hex_util_msg-0.1.0a2/hex_util_msg.egg-info → hex_util_msg-0.1.0a3}/PKG-INFO +36 -36
  2. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/README.md +35 -35
  3. hex_util_msg-0.1.0a3/hex_util_msg/dataclass/__init__.py +98 -0
  4. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg/dataclass/dataclass_base.py +16 -16
  5. hex_util_msg-0.1.0a3/hex_util_msg/dataclass/dataclass_robo.py +189 -0
  6. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg/dataclass/dataclass_teleop.py +11 -11
  7. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseHeader.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseHeader.py +14 -14
  8. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseJntFull.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseJntFull.py +48 -48
  9. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseJntState.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseJntState.py +24 -24
  10. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseOdometry.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseOdometry.py +14 -14
  11. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBasePose.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBasePose.py +5 -5
  12. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseQuaternion.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseQuaternion.py +7 -7
  13. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseTime.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseTime.py +5 -5
  14. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseTwist.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseTwist.py +5 -5
  15. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/HexBaseVector3.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/HexFbsBaseVector3.py +6 -6
  16. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_base/__init__.py +21 -0
  17. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_envelope/MsgEnvelope.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_envelope/HexFbsMsgEnvelope.py +10 -10
  18. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_envelope/HexFbsMsgPayload.py +35 -0
  19. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_envelope/__init__.py +7 -0
  20. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboArmCtrl.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboArmCtrl.py +20 -20
  21. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboArmCtrlMode.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboArmCtrlMode.py +1 -1
  22. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboManipStateStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboArmCtrlStamped.py +15 -15
  23. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboArmState.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboArmState.py +14 -14
  24. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboGripStateStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboArmStateStamped.py +15 -15
  25. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboChsCtrl.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboChsCtrl.py +16 -16
  26. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboChsCtrlMode.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboChsCtrlMode.py +1 -1
  27. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboLiftCtrlStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboChsCtrlStamped.py +15 -15
  28. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboChsState.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboChsState.py +14 -14
  29. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboLiftStateStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboChsStateStamped.py +15 -15
  30. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboGripCtrl.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboGripCtrl.py +12 -12
  31. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboGripCtrlMode.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboGripCtrlMode.py +1 -1
  32. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboManipCtrlStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboGripCtrlStamped.py +15 -15
  33. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboGripState.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboGripState.py +10 -10
  34. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_teleop/HexTeleopHandleCtrlStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboGripStateStamped.py +16 -16
  35. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboLiftCtrl.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboLiftCtrl.py +12 -12
  36. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboLiftCtrlMode.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboLiftCtrlMode.py +1 -1
  37. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboLiftCtrlStamped.py +48 -0
  38. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboLiftState.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboLiftState.py +14 -14
  39. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboLiftStateStamped.py +48 -0
  40. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboArmCtrlStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboManipCtrl.py +16 -16
  41. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboManipCtrlStamped.py +48 -0
  42. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboArmStateStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboManipState.py +16 -16
  43. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_teleop/HexTeleopHandleStateStamped.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/HexFbsRoboManipStateStamped.py +16 -16
  44. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_robo/__init__.py +51 -0
  45. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_teleop/HexTeleopHandleCtrl.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_teleop/HexFbsTeleopHandleCtrl.py +24 -24
  46. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_teleop/HexFbsTeleopHandleCtrlStamped.py +48 -0
  47. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_teleop/HexTeleopHandleState.py → hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_teleop/HexFbsTeleopHandleState.py +20 -20
  48. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_teleop/HexFbsTeleopHandleStateStamped.py +48 -0
  49. hex_util_msg-0.1.0a3/hex_util_msg/fbs/msg_teleop/__init__.py +11 -0
  50. hex_util_msg-0.1.0a3/hex_util_msg/trans/hex_msg_trans.py +322 -0
  51. hex_util_msg-0.1.0a3/hex_util_msg/trans/trans_base.py +219 -0
  52. hex_util_msg-0.1.0a3/hex_util_msg/trans/trans_robo.py +569 -0
  53. hex_util_msg-0.1.0a3/hex_util_msg/trans/trans_teleop.py +156 -0
  54. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3/hex_util_msg.egg-info}/PKG-INFO +36 -36
  55. hex_util_msg-0.1.0a3/hex_util_msg.egg-info/SOURCES.txt +66 -0
  56. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/pyproject.toml +1 -1
  57. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/tests/test_hex_msg_trans.py +114 -114
  58. hex_util_msg-0.1.0a3/tests/test_hex_util_msg_imports.py +200 -0
  59. hex_util_msg-0.1.0a3/tests/test_msg_robo.py +333 -0
  60. hex_util_msg-0.1.0a3/tests/test_msg_teleop.py +125 -0
  61. hex_util_msg-0.1.0a2/hex_util_msg/dataclass/__init__.py +0 -98
  62. hex_util_msg-0.1.0a2/hex_util_msg/dataclass/dataclass_robo.py +0 -189
  63. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_base/__init__.py +0 -21
  64. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_envelope/MsgPayload.py +0 -35
  65. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_envelope/__init__.py +0 -7
  66. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboChsCtrlStamped.py +0 -48
  67. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboChsStateStamped.py +0 -48
  68. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboGripCtrlStamped.py +0 -48
  69. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboManipCtrl.py +0 -48
  70. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/HexRoboManipState.py +0 -48
  71. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_robo/__init__.py +0 -51
  72. hex_util_msg-0.1.0a2/hex_util_msg/fbs/msg_teleop/__init__.py +0 -11
  73. hex_util_msg-0.1.0a2/hex_util_msg/trans/hex_msg_trans.py +0 -322
  74. hex_util_msg-0.1.0a2/hex_util_msg/trans/trans_base.py +0 -219
  75. hex_util_msg-0.1.0a2/hex_util_msg/trans/trans_robo.py +0 -569
  76. hex_util_msg-0.1.0a2/hex_util_msg/trans/trans_teleop.py +0 -156
  77. hex_util_msg-0.1.0a2/hex_util_msg.egg-info/SOURCES.txt +0 -66
  78. hex_util_msg-0.1.0a2/tests/test_hex_util_msg_imports.py +0 -200
  79. hex_util_msg-0.1.0a2/tests/test_msg_robo.py +0 -333
  80. hex_util_msg-0.1.0a2/tests/test_msg_teleop.py +0 -125
  81. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/LICENSE +0 -0
  82. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/MANIFEST.in +0 -0
  83. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg/__init__.py +0 -0
  84. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg/trans/__init__.py +0 -0
  85. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg.egg-info/dependency_links.txt +0 -0
  86. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg.egg-info/requires.txt +0 -0
  87. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/hex_util_msg.egg-info/top_level.txt +0 -0
  88. {hex_util_msg-0.1.0a2 → hex_util_msg-0.1.0a3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hex_util_msg
3
- Version: 0.1.0a2
3
+ Version: 0.1.0a3
4
4
  Summary: HEXFELLOW Util Message
5
5
  Author-email: Dong Zhaorui <dzr159@gmail.com>
6
6
  Maintainer-email: jecjune <zejun.chen@hexfellow.com>, Dong Zhaorui <dzr159@gmail.com>
@@ -59,8 +59,8 @@ The library consists of three layers:
59
59
 
60
60
  | Layer | Subpackage | Purpose |
61
61
  |-------|-----------|---------|
62
- | **Dataclass** | `hex_util_msg.dataclass` | Type-safe Python `@dataclass` objects for all 28 message types (base geometry, robot arm/chassis/grip/lift/manip, teleoperation handle) |
63
- | **Converters** | `hex_util_msg.trans` | Bidirectional `dc2fbs` / `fbs2dc` functions plus the `HexMsgTrans` high-level envelope-based dispatcher |
62
+ | **Dataclass** | `hex_util_msg.dataclass` | Type-safe Python `@dataclass` objects for all 28 message types (base geometry, robot arm/chassis/grip/lift/manip, teleoperation handle) — classes use `HexDc*` naming |
63
+ | **Converters** | `hex_util_msg.trans` | Bidirectional `dc2fbs` / `fbs2dc` functions plus the `HexMsgTrans` high-level envelope-based dispatcher — FBS classes use `HexFbs*` naming |
64
64
  | **FlatBuffers** | `hex_util_msg.fbs` | Auto-generated FlatBuffers Python bindings for 4 namespaces (`msg_base`, `msg_robo`, `msg_teleop`, `msg_envelope`) |
65
65
 
66
66
  ## Message Categories
@@ -79,7 +79,7 @@ The library consists of three layers:
79
79
 
80
80
  - **Zero-copy deserialization**: FlatBuffers enables direct memory access on the receiving end without decode overhead.
81
81
  - **Type-safe dataclass API**: Work with standard Python dataclasses and numpy arrays — no manual FlatBuffers table construction.
82
- - **Envelope dispatch**: `HexMsgTrans.dc2fbs()` and `.fbs2dc()` wrap all messages in a self-describing envelope so the receiver auto-detects the message type.
82
+ - **Envelope dispatch**: `HexMsgTrans.dc2fbs()` and `.fbs2dc()` wrap all messages in a self-describing `HexFbsMsgEnvelope` so the receiver auto-detects the message type.
83
83
  - **NumPy integration**: Joint fields are `np.float64` / `np.uint8` arrays, natural for scientific and robotics workflows.
84
84
 
85
85
  ## Target users
@@ -167,13 +167,13 @@ source .venv/bin/activate
167
167
  ```python
168
168
  import numpy as np
169
169
  from hex_util_msg.dataclass import (
170
- HexBaseVector3, HexBaseQuaternion, HexBasePose, HexBaseTwist,
171
- HexBaseTime, HexBaseHeader,
172
- HexBaseJntState, HexBaseJntFull,
173
- HexRoboArmCtrl, HexRoboArmCtrlMode, HexRoboArmCtrlStamped,
174
- HexRoboArmState, HexRoboArmStateStamped,
175
- HexRoboManipCtrl, HexRoboManipState,
176
- HexTeleopHandleState,
170
+ HexDcBaseVector3, HexDcBaseQuaternion, HexDcBasePose, HexDcBaseTwist,
171
+ HexDcBaseTime, HexDcBaseHeader,
172
+ HexDcBaseJntState, HexDcBaseJntFull,
173
+ HexDcRoboArmCtrl, HexDcRoboArmCtrlMode, HexDcRoboArmCtrlStamped,
174
+ HexDcRoboArmState, HexDcRoboArmStateStamped,
175
+ HexDcRoboManipCtrl, HexDcRoboManipState,
176
+ HexDcTeleopHandleState,
177
177
  )
178
178
  ```
179
179
 
@@ -183,16 +183,16 @@ from hex_util_msg.dataclass import (
183
183
  from hex_util_msg.trans import HexMsgTrans
184
184
 
185
185
  # --- Create a stamped arm control message ---
186
- arm_ctrl = HexRoboArmCtrlStamped(
187
- header=HexBaseHeader(
186
+ arm_ctrl = HexDcRoboArmCtrlStamped(
187
+ header=HexDcBaseHeader(
188
188
  seq=1,
189
- stamp=HexBaseTime(secs=123, nsecs=456_000_000),
189
+ stamp=HexDcBaseTime(secs=123, nsecs=456_000_000),
190
190
  frame_id="arm_base",
191
191
  ),
192
- arm_ctrl=HexRoboArmCtrl(
193
- ctrl_mode=HexRoboArmCtrlMode.MIT,
194
- grav=HexBaseVector3(x=0.0, y=0.0, z=9.81),
195
- jnt=HexBaseJntFull(
192
+ arm_ctrl=HexDcRoboArmCtrl(
193
+ ctrl_mode=HexDcRoboArmCtrlMode.MIT,
194
+ grav=HexDcBaseVector3(x=0.0, y=0.0, z=9.81),
195
+ jnt=HexDcBaseJntFull(
196
196
  pos=np.zeros(7, dtype=np.float64),
197
197
  vel=np.zeros(7, dtype=np.float64),
198
198
  eff=np.zeros(7, dtype=np.float64),
@@ -201,9 +201,9 @@ arm_ctrl = HexRoboArmCtrlStamped(
201
201
  lim_vel=np.zeros(7, dtype=np.float64),
202
202
  lim_acc=np.zeros(7, dtype=np.float64),
203
203
  ),
204
- pose=HexBasePose(
205
- position=HexBaseVector3(x=0.5, y=0.0, z=1.0),
206
- orientation=HexBaseQuaternion(x=0.0, y=0.0, z=0.0, w=1.0),
204
+ pose=HexDcBasePose(
205
+ position=HexDcBaseVector3(x=0.5, y=0.0, z=1.0),
206
+ orientation=HexDcBaseQuaternion(x=0.0, y=0.0, z=0.0, w=1.0),
207
207
  ),
208
208
  ),
209
209
  )
@@ -214,25 +214,25 @@ buf = HexMsgTrans.dc2fbs(arm_ctrl)
214
214
  # Deserialize back — type is auto-detected from the envelope
215
215
  restored = HexMsgTrans.fbs2dc(buf)
216
216
 
217
- # restored is a HexRoboArmCtrlStamped dataclass
217
+ # restored is a HexDcRoboArmCtrlStamped dataclass
218
218
  print(restored.header.seq) # 1
219
- print(restored.arm_ctrl.ctrl_mode) # HexRoboArmCtrlMode.MIT
219
+ print(restored.arm_ctrl.ctrl_mode) # HexDcRoboArmCtrlMode.MIT
220
220
  ```
221
221
 
222
222
  ## Arm state
223
223
 
224
224
  ```python
225
- arm_state = HexRoboArmStateStamped(
226
- header=HexBaseHeader(seq=0, stamp=HexBaseTime(secs=0), frame_id=""),
227
- arm_state=HexRoboArmState(
228
- jnt=HexBaseJntState(
225
+ arm_state = HexDcRoboArmStateStamped(
226
+ header=HexDcBaseHeader(seq=0, stamp=HexDcBaseTime(secs=0), frame_id=""),
227
+ arm_state=HexDcRoboArmState(
228
+ jnt=HexDcBaseJntState(
229
229
  position=np.array([0.0, 0.25, 0.5], dtype=np.float64),
230
230
  velocity=np.array([0.0, 0.0, 0.0], dtype=np.float64),
231
231
  effort=np.zeros(3, dtype=np.float64),
232
232
  ),
233
- pose=HexBasePose(
234
- position=HexBaseVector3(x=1.0, y=2.0, z=3.0),
235
- orientation=HexBaseQuaternion(x=0.0, y=0.0, z=0.707, w=0.707),
233
+ pose=HexDcBasePose(
234
+ position=HexDcBaseVector3(x=1.0, y=2.0, z=3.0),
235
+ orientation=HexDcBaseQuaternion(x=0.0, y=0.0, z=0.707, w=0.707),
236
236
  ),
237
237
  ),
238
238
  )
@@ -243,7 +243,7 @@ restored = HexMsgTrans.fbs2dc(buf)
243
243
  ## Teleop handle state
244
244
 
245
245
  ```python
246
- handle = HexTeleopHandleState(
246
+ handle = HexDcTeleopHandleState(
247
247
  trigger=0.5,
248
248
  axis_x=0.3,
249
249
  axis_y=-0.2,
@@ -260,14 +260,14 @@ restored = HexMsgTrans.fbs2dc(buf)
260
260
  ## Manipulator (composite arm + grip)
261
261
 
262
262
  ```python
263
- manip_state = HexRoboManipState(
264
- arm_state=HexRoboArmState(
265
- jnt=HexBaseJntState(
263
+ manip_state = HexDcRoboManipState(
264
+ arm_state=HexDcRoboArmState(
265
+ jnt=HexDcBaseJntState(
266
266
  position=np.zeros(7, dtype=np.float64),
267
267
  ),
268
268
  ),
269
- grip_state=HexRoboGripState(
270
- jnt=HexBaseJntState(
269
+ grip_state=HexDcRoboGripState(
270
+ jnt=HexDcBaseJntState(
271
271
  position=np.zeros(1, dtype=np.float64),
272
272
  ),
273
273
  ),
@@ -29,8 +29,8 @@ The library consists of three layers:
29
29
 
30
30
  | Layer | Subpackage | Purpose |
31
31
  |-------|-----------|---------|
32
- | **Dataclass** | `hex_util_msg.dataclass` | Type-safe Python `@dataclass` objects for all 28 message types (base geometry, robot arm/chassis/grip/lift/manip, teleoperation handle) |
33
- | **Converters** | `hex_util_msg.trans` | Bidirectional `dc2fbs` / `fbs2dc` functions plus the `HexMsgTrans` high-level envelope-based dispatcher |
32
+ | **Dataclass** | `hex_util_msg.dataclass` | Type-safe Python `@dataclass` objects for all 28 message types (base geometry, robot arm/chassis/grip/lift/manip, teleoperation handle) — classes use `HexDc*` naming |
33
+ | **Converters** | `hex_util_msg.trans` | Bidirectional `dc2fbs` / `fbs2dc` functions plus the `HexMsgTrans` high-level envelope-based dispatcher — FBS classes use `HexFbs*` naming |
34
34
  | **FlatBuffers** | `hex_util_msg.fbs` | Auto-generated FlatBuffers Python bindings for 4 namespaces (`msg_base`, `msg_robo`, `msg_teleop`, `msg_envelope`) |
35
35
 
36
36
  ## Message Categories
@@ -49,7 +49,7 @@ The library consists of three layers:
49
49
 
50
50
  - **Zero-copy deserialization**: FlatBuffers enables direct memory access on the receiving end without decode overhead.
51
51
  - **Type-safe dataclass API**: Work with standard Python dataclasses and numpy arrays — no manual FlatBuffers table construction.
52
- - **Envelope dispatch**: `HexMsgTrans.dc2fbs()` and `.fbs2dc()` wrap all messages in a self-describing envelope so the receiver auto-detects the message type.
52
+ - **Envelope dispatch**: `HexMsgTrans.dc2fbs()` and `.fbs2dc()` wrap all messages in a self-describing `HexFbsMsgEnvelope` so the receiver auto-detects the message type.
53
53
  - **NumPy integration**: Joint fields are `np.float64` / `np.uint8` arrays, natural for scientific and robotics workflows.
54
54
 
55
55
  ## Target users
@@ -137,13 +137,13 @@ source .venv/bin/activate
137
137
  ```python
138
138
  import numpy as np
139
139
  from hex_util_msg.dataclass import (
140
- HexBaseVector3, HexBaseQuaternion, HexBasePose, HexBaseTwist,
141
- HexBaseTime, HexBaseHeader,
142
- HexBaseJntState, HexBaseJntFull,
143
- HexRoboArmCtrl, HexRoboArmCtrlMode, HexRoboArmCtrlStamped,
144
- HexRoboArmState, HexRoboArmStateStamped,
145
- HexRoboManipCtrl, HexRoboManipState,
146
- HexTeleopHandleState,
140
+ HexDcBaseVector3, HexDcBaseQuaternion, HexDcBasePose, HexDcBaseTwist,
141
+ HexDcBaseTime, HexDcBaseHeader,
142
+ HexDcBaseJntState, HexDcBaseJntFull,
143
+ HexDcRoboArmCtrl, HexDcRoboArmCtrlMode, HexDcRoboArmCtrlStamped,
144
+ HexDcRoboArmState, HexDcRoboArmStateStamped,
145
+ HexDcRoboManipCtrl, HexDcRoboManipState,
146
+ HexDcTeleopHandleState,
147
147
  )
148
148
  ```
149
149
 
@@ -153,16 +153,16 @@ from hex_util_msg.dataclass import (
153
153
  from hex_util_msg.trans import HexMsgTrans
154
154
 
155
155
  # --- Create a stamped arm control message ---
156
- arm_ctrl = HexRoboArmCtrlStamped(
157
- header=HexBaseHeader(
156
+ arm_ctrl = HexDcRoboArmCtrlStamped(
157
+ header=HexDcBaseHeader(
158
158
  seq=1,
159
- stamp=HexBaseTime(secs=123, nsecs=456_000_000),
159
+ stamp=HexDcBaseTime(secs=123, nsecs=456_000_000),
160
160
  frame_id="arm_base",
161
161
  ),
162
- arm_ctrl=HexRoboArmCtrl(
163
- ctrl_mode=HexRoboArmCtrlMode.MIT,
164
- grav=HexBaseVector3(x=0.0, y=0.0, z=9.81),
165
- jnt=HexBaseJntFull(
162
+ arm_ctrl=HexDcRoboArmCtrl(
163
+ ctrl_mode=HexDcRoboArmCtrlMode.MIT,
164
+ grav=HexDcBaseVector3(x=0.0, y=0.0, z=9.81),
165
+ jnt=HexDcBaseJntFull(
166
166
  pos=np.zeros(7, dtype=np.float64),
167
167
  vel=np.zeros(7, dtype=np.float64),
168
168
  eff=np.zeros(7, dtype=np.float64),
@@ -171,9 +171,9 @@ arm_ctrl = HexRoboArmCtrlStamped(
171
171
  lim_vel=np.zeros(7, dtype=np.float64),
172
172
  lim_acc=np.zeros(7, dtype=np.float64),
173
173
  ),
174
- pose=HexBasePose(
175
- position=HexBaseVector3(x=0.5, y=0.0, z=1.0),
176
- orientation=HexBaseQuaternion(x=0.0, y=0.0, z=0.0, w=1.0),
174
+ pose=HexDcBasePose(
175
+ position=HexDcBaseVector3(x=0.5, y=0.0, z=1.0),
176
+ orientation=HexDcBaseQuaternion(x=0.0, y=0.0, z=0.0, w=1.0),
177
177
  ),
178
178
  ),
179
179
  )
@@ -184,25 +184,25 @@ buf = HexMsgTrans.dc2fbs(arm_ctrl)
184
184
  # Deserialize back — type is auto-detected from the envelope
185
185
  restored = HexMsgTrans.fbs2dc(buf)
186
186
 
187
- # restored is a HexRoboArmCtrlStamped dataclass
187
+ # restored is a HexDcRoboArmCtrlStamped dataclass
188
188
  print(restored.header.seq) # 1
189
- print(restored.arm_ctrl.ctrl_mode) # HexRoboArmCtrlMode.MIT
189
+ print(restored.arm_ctrl.ctrl_mode) # HexDcRoboArmCtrlMode.MIT
190
190
  ```
191
191
 
192
192
  ## Arm state
193
193
 
194
194
  ```python
195
- arm_state = HexRoboArmStateStamped(
196
- header=HexBaseHeader(seq=0, stamp=HexBaseTime(secs=0), frame_id=""),
197
- arm_state=HexRoboArmState(
198
- jnt=HexBaseJntState(
195
+ arm_state = HexDcRoboArmStateStamped(
196
+ header=HexDcBaseHeader(seq=0, stamp=HexDcBaseTime(secs=0), frame_id=""),
197
+ arm_state=HexDcRoboArmState(
198
+ jnt=HexDcBaseJntState(
199
199
  position=np.array([0.0, 0.25, 0.5], dtype=np.float64),
200
200
  velocity=np.array([0.0, 0.0, 0.0], dtype=np.float64),
201
201
  effort=np.zeros(3, dtype=np.float64),
202
202
  ),
203
- pose=HexBasePose(
204
- position=HexBaseVector3(x=1.0, y=2.0, z=3.0),
205
- orientation=HexBaseQuaternion(x=0.0, y=0.0, z=0.707, w=0.707),
203
+ pose=HexDcBasePose(
204
+ position=HexDcBaseVector3(x=1.0, y=2.0, z=3.0),
205
+ orientation=HexDcBaseQuaternion(x=0.0, y=0.0, z=0.707, w=0.707),
206
206
  ),
207
207
  ),
208
208
  )
@@ -213,7 +213,7 @@ restored = HexMsgTrans.fbs2dc(buf)
213
213
  ## Teleop handle state
214
214
 
215
215
  ```python
216
- handle = HexTeleopHandleState(
216
+ handle = HexDcTeleopHandleState(
217
217
  trigger=0.5,
218
218
  axis_x=0.3,
219
219
  axis_y=-0.2,
@@ -230,14 +230,14 @@ restored = HexMsgTrans.fbs2dc(buf)
230
230
  ## Manipulator (composite arm + grip)
231
231
 
232
232
  ```python
233
- manip_state = HexRoboManipState(
234
- arm_state=HexRoboArmState(
235
- jnt=HexBaseJntState(
233
+ manip_state = HexDcRoboManipState(
234
+ arm_state=HexDcRoboArmState(
235
+ jnt=HexDcBaseJntState(
236
236
  position=np.zeros(7, dtype=np.float64),
237
237
  ),
238
238
  ),
239
- grip_state=HexRoboGripState(
240
- jnt=HexBaseJntState(
239
+ grip_state=HexDcRoboGripState(
240
+ jnt=HexDcBaseJntState(
241
241
  position=np.zeros(1, dtype=np.float64),
242
242
  ),
243
243
  ),
@@ -0,0 +1,98 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding:utf-8 -*-
3
+ ################################################################
4
+ # Copyright 2026 Dong Zhaorui. All rights reserved.
5
+ # Author: Dong Zhaorui 847235539@qq.com
6
+ # Date : 2026-06-11
7
+ ################################################################
8
+
9
+ from .dataclass_base import (
10
+ HexDcBaseHeader,
11
+ HexDcBaseOdometry,
12
+ HexDcBaseJntState,
13
+ HexDcBaseJntFull,
14
+ HexDcBasePose,
15
+ HexDcBaseQuaternion,
16
+ HexDcBaseTime,
17
+ HexDcBaseTwist,
18
+ HexDcBaseVector3,
19
+ )
20
+ from .dataclass_robo import (
21
+ HexDcRoboArmCtrl,
22
+ HexDcRoboArmCtrlMode,
23
+ HexDcRoboArmCtrlStamped,
24
+ HexDcRoboArmState,
25
+ HexDcRoboArmStateStamped,
26
+ HexDcRoboChsCtrl,
27
+ HexDcRoboChsCtrlMode,
28
+ HexDcRoboChsCtrlStamped,
29
+ HexDcRoboChsState,
30
+ HexDcRoboChsStateStamped,
31
+ HexDcRoboGripCtrl,
32
+ HexDcRoboGripCtrlMode,
33
+ HexDcRoboGripCtrlStamped,
34
+ HexDcRoboGripState,
35
+ HexDcRoboGripStateStamped,
36
+ HexDcRoboLiftCtrl,
37
+ HexDcRoboLiftCtrlMode,
38
+ HexDcRoboLiftCtrlStamped,
39
+ HexDcRoboLiftState,
40
+ HexDcRoboLiftStateStamped,
41
+ HexDcRoboManipCtrl,
42
+ HexDcRoboManipCtrlStamped,
43
+ HexDcRoboManipState,
44
+ HexDcRoboManipStateStamped,
45
+ )
46
+ from .dataclass_teleop import (
47
+ HexDcTeleopHandleCtrl,
48
+ HexDcTeleopHandleCtrlStamped,
49
+ HexDcTeleopHandleState,
50
+ HexDcTeleopHandleStateStamped,
51
+ )
52
+
53
+ __all__ = [
54
+ # Base types
55
+ "HexDcBaseHeader",
56
+ "HexDcBaseOdometry",
57
+ "HexDcBaseJntState",
58
+ "HexDcBaseJntFull",
59
+ "HexDcBasePose",
60
+ "HexDcBaseQuaternion",
61
+ "HexDcBaseTime",
62
+ "HexDcBaseTwist",
63
+ "HexDcBaseVector3",
64
+ # Arm
65
+ "HexDcRoboArmCtrl",
66
+ "HexDcRoboArmCtrlMode",
67
+ "HexDcRoboArmCtrlStamped",
68
+ "HexDcRoboArmState",
69
+ "HexDcRoboArmStateStamped",
70
+ # Chassis
71
+ "HexDcRoboChsCtrl",
72
+ "HexDcRoboChsCtrlMode",
73
+ "HexDcRoboChsCtrlStamped",
74
+ "HexDcRoboChsState",
75
+ "HexDcRoboChsStateStamped",
76
+ # Grip
77
+ "HexDcRoboGripCtrl",
78
+ "HexDcRoboGripCtrlMode",
79
+ "HexDcRoboGripCtrlStamped",
80
+ "HexDcRoboGripState",
81
+ "HexDcRoboGripStateStamped",
82
+ # Lift
83
+ "HexDcRoboLiftCtrl",
84
+ "HexDcRoboLiftCtrlMode",
85
+ "HexDcRoboLiftCtrlStamped",
86
+ "HexDcRoboLiftState",
87
+ "HexDcRoboLiftStateStamped",
88
+ # Manip
89
+ "HexDcRoboManipCtrl",
90
+ "HexDcRoboManipCtrlStamped",
91
+ "HexDcRoboManipState",
92
+ "HexDcRoboManipStateStamped",
93
+ # Teleop
94
+ "HexDcTeleopHandleCtrl",
95
+ "HexDcTeleopHandleCtrlStamped",
96
+ "HexDcTeleopHandleState",
97
+ "HexDcTeleopHandleStateStamped",
98
+ ]
@@ -12,14 +12,14 @@ import numpy as np
12
12
 
13
13
 
14
14
  @dataclass
15
- class HexBaseVector3:
15
+ class HexDcBaseVector3:
16
16
  x: float = 0.0
17
17
  y: float = 0.0
18
18
  z: float = 0.0
19
19
 
20
20
 
21
21
  @dataclass
22
- class HexBaseQuaternion:
22
+ class HexDcBaseQuaternion:
23
23
  x: float = 0.0
24
24
  y: float = 0.0
25
25
  z: float = 0.0
@@ -27,38 +27,38 @@ class HexBaseQuaternion:
27
27
 
28
28
 
29
29
  @dataclass
30
- class HexBasePose:
31
- position: HexBaseVector3 = field(default_factory=HexBaseVector3)
32
- orientation: HexBaseQuaternion = field(default_factory=HexBaseQuaternion)
30
+ class HexDcBasePose:
31
+ position: HexDcBaseVector3 = field(default_factory=HexDcBaseVector3)
32
+ orientation: HexDcBaseQuaternion = field(default_factory=HexDcBaseQuaternion)
33
33
 
34
34
 
35
35
  @dataclass
36
- class HexBaseTwist:
37
- linear: HexBaseVector3 = field(default_factory=HexBaseVector3)
38
- angular: HexBaseVector3 = field(default_factory=HexBaseVector3)
36
+ class HexDcBaseTwist:
37
+ linear: HexDcBaseVector3 = field(default_factory=HexDcBaseVector3)
38
+ angular: HexDcBaseVector3 = field(default_factory=HexDcBaseVector3)
39
39
 
40
40
 
41
41
  @dataclass
42
- class HexBaseTime:
42
+ class HexDcBaseTime:
43
43
  secs: int = 0
44
44
  nsecs: int = 0
45
45
 
46
46
 
47
47
  @dataclass
48
- class HexBaseHeader:
48
+ class HexDcBaseHeader:
49
49
  seq: int = 0
50
- stamp: HexBaseTime = field(default_factory=HexBaseTime)
50
+ stamp: HexDcBaseTime = field(default_factory=HexDcBaseTime)
51
51
  frame_id: str = ""
52
52
 
53
53
 
54
54
  @dataclass
55
- class HexBaseOdometry:
56
- pose: HexBasePose = field(default_factory=HexBasePose)
57
- twist: HexBaseTwist = field(default_factory=HexBaseTwist)
55
+ class HexDcBaseOdometry:
56
+ pose: HexDcBasePose = field(default_factory=HexDcBasePose)
57
+ twist: HexDcBaseTwist = field(default_factory=HexDcBaseTwist)
58
58
 
59
59
 
60
60
  @dataclass
61
- class HexBaseJntState:
61
+ class HexDcBaseJntState:
62
62
  position: np.ndarray = field(
63
63
  default_factory=lambda: np.array([], dtype=np.float64))
64
64
  velocity: np.ndarray = field(
@@ -68,7 +68,7 @@ class HexBaseJntState:
68
68
 
69
69
 
70
70
  @dataclass
71
- class HexBaseJntFull:
71
+ class HexDcBaseJntFull:
72
72
  pos: np.ndarray = field(
73
73
  default_factory=lambda: np.array([], dtype=np.float64))
74
74
  vel: np.ndarray = field(
@@ -0,0 +1,189 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding:utf-8 -*-
3
+ ################################################################
4
+ # Copyright 2026 Dong Zhaorui. All rights reserved.
5
+ # Author: Dong Zhaorui 847235539@qq.com
6
+ # Date : 2026-06-11
7
+ ################################################################
8
+
9
+ from dataclasses import dataclass, field
10
+ from enum import IntEnum
11
+
12
+ from .dataclass_base import HexDcBaseHeader, HexDcBaseJntState, HexDcBaseOdometry, HexDcBasePose, HexDcBaseTwist, HexDcBaseVector3, HexDcBaseJntFull
13
+
14
+ # ---------------------------------------------------------------------------
15
+ # CtrlMode enums
16
+ # ---------------------------------------------------------------------------
17
+
18
+
19
+ class HexDcRoboArmCtrlMode(IntEnum):
20
+ NONE = 0
21
+ MIT = 1
22
+ JNT = 2
23
+ EE = 3
24
+
25
+
26
+ class HexDcRoboChsCtrlMode(IntEnum):
27
+ NONE = 0
28
+ MIT = 1
29
+ VEL = 2
30
+
31
+
32
+ class HexDcRoboGripCtrlMode(IntEnum):
33
+ NONE = 0
34
+ MIT = 1
35
+ JNT = 2
36
+ TAU = 3
37
+
38
+
39
+ class HexDcRoboLiftCtrlMode(IntEnum):
40
+ NONE = 0
41
+ POS = 1
42
+ VEL = 2
43
+
44
+
45
+ # ---------------------------------------------------------------------------
46
+ # Arm
47
+ # ---------------------------------------------------------------------------
48
+
49
+
50
+ @dataclass
51
+ class HexDcRoboArmCtrl:
52
+ ctrl_mode: HexDcRoboArmCtrlMode = HexDcRoboArmCtrlMode.MIT
53
+ grav: HexDcBaseVector3 = field(default_factory=HexDcBaseVector3)
54
+ jnt: HexDcBaseJntFull = field(default_factory=HexDcBaseJntFull)
55
+ pose: HexDcBasePose = field(default_factory=HexDcBasePose)
56
+
57
+
58
+ @dataclass
59
+ class HexDcRoboArmState:
60
+ jnt: HexDcBaseJntState = field(default_factory=HexDcBaseJntState)
61
+ pose: HexDcBasePose = field(default_factory=HexDcBasePose)
62
+
63
+
64
+ @dataclass
65
+ class HexDcRoboArmCtrlStamped:
66
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
67
+ arm_ctrl: HexDcRoboArmCtrl = field(default_factory=HexDcRoboArmCtrl)
68
+
69
+
70
+ @dataclass
71
+ class HexDcRoboArmStateStamped:
72
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
73
+ arm_state: HexDcRoboArmState = field(default_factory=HexDcRoboArmState)
74
+
75
+
76
+ # ---------------------------------------------------------------------------
77
+ # Chassis
78
+ # ---------------------------------------------------------------------------
79
+
80
+
81
+ @dataclass
82
+ class HexDcRoboChsCtrl:
83
+ ctrl_mode: HexDcRoboChsCtrlMode = HexDcRoboChsCtrlMode.MIT
84
+ jnt: HexDcBaseJntFull = field(default_factory=HexDcBaseJntFull)
85
+ vel: HexDcBaseTwist = field(default_factory=HexDcBaseTwist)
86
+
87
+
88
+ @dataclass
89
+ class HexDcRoboChsState:
90
+ jnt: HexDcBaseJntState = field(default_factory=HexDcBaseJntState)
91
+ odom: HexDcBaseOdometry = field(default_factory=HexDcBaseOdometry)
92
+
93
+
94
+ @dataclass
95
+ class HexDcRoboChsCtrlStamped:
96
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
97
+ chs_ctrl: HexDcRoboChsCtrl = field(default_factory=HexDcRoboChsCtrl)
98
+
99
+
100
+ @dataclass
101
+ class HexDcRoboChsStateStamped:
102
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
103
+ chs_state: HexDcRoboChsState = field(default_factory=HexDcRoboChsState)
104
+
105
+
106
+ # ---------------------------------------------------------------------------
107
+ # Grip
108
+ # ---------------------------------------------------------------------------
109
+
110
+
111
+ @dataclass
112
+ class HexDcRoboGripCtrl:
113
+ ctrl_mode: HexDcRoboGripCtrlMode = HexDcRoboGripCtrlMode.MIT
114
+ jnt: HexDcBaseJntFull = field(default_factory=HexDcBaseJntFull)
115
+
116
+
117
+ @dataclass
118
+ class HexDcRoboGripState:
119
+ jnt: HexDcBaseJntState = field(default_factory=HexDcBaseJntState)
120
+
121
+
122
+ @dataclass
123
+ class HexDcRoboGripCtrlStamped:
124
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
125
+ grip_ctrl: HexDcRoboGripCtrl = field(default_factory=HexDcRoboGripCtrl)
126
+
127
+
128
+ @dataclass
129
+ class HexDcRoboGripStateStamped:
130
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
131
+ grip_state: HexDcRoboGripState = field(default_factory=HexDcRoboGripState)
132
+
133
+
134
+ # ---------------------------------------------------------------------------
135
+ # Lift
136
+ # ---------------------------------------------------------------------------
137
+
138
+
139
+ @dataclass
140
+ class HexDcRoboLiftCtrl:
141
+ ctrl_mode: HexDcRoboLiftCtrlMode = HexDcRoboLiftCtrlMode.POS
142
+ jnt: HexDcBaseJntFull = field(default_factory=HexDcBaseJntFull)
143
+
144
+
145
+ @dataclass
146
+ class HexDcRoboLiftState:
147
+ jnt: HexDcBaseJntState = field(default_factory=HexDcBaseJntState)
148
+ pose: HexDcBasePose = field(default_factory=HexDcBasePose)
149
+
150
+
151
+ @dataclass
152
+ class HexDcRoboLiftCtrlStamped:
153
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
154
+ lift_ctrl: HexDcRoboLiftCtrl = field(default_factory=HexDcRoboLiftCtrl)
155
+
156
+
157
+ @dataclass
158
+ class HexDcRoboLiftStateStamped:
159
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
160
+ lift_state: HexDcRoboLiftState = field(default_factory=HexDcRoboLiftState)
161
+
162
+
163
+ # ---------------------------------------------------------------------------
164
+ # Manip (composite: Arm + Grip)
165
+ # ---------------------------------------------------------------------------
166
+
167
+
168
+ @dataclass
169
+ class HexDcRoboManipCtrl:
170
+ arm_ctrl: HexDcRoboArmCtrl = field(default_factory=HexDcRoboArmCtrl)
171
+ grip_ctrl: HexDcRoboGripCtrl = field(default_factory=HexDcRoboGripCtrl)
172
+
173
+
174
+ @dataclass
175
+ class HexDcRoboManipState:
176
+ arm_state: HexDcRoboArmState = field(default_factory=HexDcRoboArmState)
177
+ grip_state: HexDcRoboGripState = field(default_factory=HexDcRoboGripState)
178
+
179
+
180
+ @dataclass
181
+ class HexDcRoboManipCtrlStamped:
182
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
183
+ manip_ctrl: HexDcRoboManipCtrl = field(default_factory=HexDcRoboManipCtrl)
184
+
185
+
186
+ @dataclass
187
+ class HexDcRoboManipStateStamped:
188
+ header: HexDcBaseHeader = field(default_factory=HexDcBaseHeader)
189
+ manip_state: HexDcRoboManipState = field(default_factory=HexDcRoboManipState)