kuavo-humanoid-sdk 1.2.1b1698__20250813130752-py3-none-any.whl

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.

Potentially problematic release.


This version of kuavo-humanoid-sdk might be problematic. Click here for more details.

Files changed (158) hide show
  1. kuavo_humanoid_sdk/__init__.py +6 -0
  2. kuavo_humanoid_sdk/common/logger.py +45 -0
  3. kuavo_humanoid_sdk/interfaces/__init__.py +4 -0
  4. kuavo_humanoid_sdk/interfaces/data_types.py +288 -0
  5. kuavo_humanoid_sdk/interfaces/end_effector.py +62 -0
  6. kuavo_humanoid_sdk/interfaces/robot.py +22 -0
  7. kuavo_humanoid_sdk/interfaces/robot_info.py +56 -0
  8. kuavo_humanoid_sdk/kuavo/__init__.py +11 -0
  9. kuavo_humanoid_sdk/kuavo/core/audio.py +32 -0
  10. kuavo_humanoid_sdk/kuavo/core/core.py +634 -0
  11. kuavo_humanoid_sdk/kuavo/core/dex_hand_control.py +114 -0
  12. kuavo_humanoid_sdk/kuavo/core/leju_claw_control.py +67 -0
  13. kuavo_humanoid_sdk/kuavo/core/ros/audio.py +92 -0
  14. kuavo_humanoid_sdk/kuavo/core/ros/control.py +1453 -0
  15. kuavo_humanoid_sdk/kuavo/core/ros/observation.py +94 -0
  16. kuavo_humanoid_sdk/kuavo/core/ros/param.py +183 -0
  17. kuavo_humanoid_sdk/kuavo/core/ros/sat_utils.py +103 -0
  18. kuavo_humanoid_sdk/kuavo/core/ros/state.py +634 -0
  19. kuavo_humanoid_sdk/kuavo/core/ros/tools.py +220 -0
  20. kuavo_humanoid_sdk/kuavo/core/ros/vision.py +234 -0
  21. kuavo_humanoid_sdk/kuavo/core/ros_env.py +238 -0
  22. kuavo_humanoid_sdk/kuavo/dexterous_hand.py +201 -0
  23. kuavo_humanoid_sdk/kuavo/leju_claw.py +235 -0
  24. kuavo_humanoid_sdk/kuavo/robot.py +514 -0
  25. kuavo_humanoid_sdk/kuavo/robot_arm.py +248 -0
  26. kuavo_humanoid_sdk/kuavo/robot_audio.py +39 -0
  27. kuavo_humanoid_sdk/kuavo/robot_head.py +50 -0
  28. kuavo_humanoid_sdk/kuavo/robot_info.py +113 -0
  29. kuavo_humanoid_sdk/kuavo/robot_observation.py +64 -0
  30. kuavo_humanoid_sdk/kuavo/robot_state.py +307 -0
  31. kuavo_humanoid_sdk/kuavo/robot_tool.py +109 -0
  32. kuavo_humanoid_sdk/kuavo/robot_vision.py +81 -0
  33. kuavo_humanoid_sdk/kuavo_strategy/__init__.py +2 -0
  34. kuavo_humanoid_sdk/kuavo_strategy/grasp_box/grasp_box_strategy.py +1325 -0
  35. kuavo_humanoid_sdk/kuavo_strategy/kuavo_strategy.py +106 -0
  36. kuavo_humanoid_sdk/kuavo_strategy_v2/common/data_type.py +340 -0
  37. kuavo_humanoid_sdk/kuavo_strategy_v2/common/events/base_event.py +215 -0
  38. kuavo_humanoid_sdk/kuavo_strategy_v2/common/robot_sdk.py +25 -0
  39. kuavo_humanoid_sdk/kuavo_strategy_v2/pick_place_box/case.py +331 -0
  40. kuavo_humanoid_sdk/kuavo_strategy_v2/pick_place_box/strategy.py +504 -0
  41. kuavo_humanoid_sdk/kuavo_strategy_v2/utils/logger_setup.py +40 -0
  42. kuavo_humanoid_sdk/kuavo_strategy_v2/utils/utils.py +88 -0
  43. kuavo_humanoid_sdk/msg/__init__.py +4 -0
  44. kuavo_humanoid_sdk/msg/kuavo_msgs/__init__.py +7 -0
  45. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_AprilTagDetection.py +306 -0
  46. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_AprilTagDetectionArray.py +437 -0
  47. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_AudioReceiverData.py +122 -0
  48. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_JoySticks.py +191 -0
  49. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_Metadata.py +199 -0
  50. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_MmDetectionMsg.py +264 -0
  51. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_RobotActionState.py +112 -0
  52. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_TFArray.py +323 -0
  53. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/__init__.py +59 -0
  54. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armCollisionCheckInfo.py +160 -0
  55. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armHandPose.py +160 -0
  56. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armHandPoseFree.py +171 -0
  57. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armPoseWithTimeStamp.py +168 -0
  58. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armTargetPoses.py +151 -0
  59. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_bezierCurveCubicPoint.py +178 -0
  60. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_dexhandCommand.py +229 -0
  61. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_dexhandTouchState.py +256 -0
  62. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_endEffectorData.py +227 -0
  63. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPose.py +123 -0
  64. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPose6D.py +123 -0
  65. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPose6DTargetTrajectories.py +301 -0
  66. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoseTargetTrajectories.py +301 -0
  67. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoseWithVision.py +136 -0
  68. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoseWithVisionArray.py +231 -0
  69. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoses.py +149 -0
  70. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoses6D.py +149 -0
  71. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_fullBodyTargetTrajectories.py +258 -0
  72. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gaitTimeName.py +147 -0
  73. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gestureInfo.py +218 -0
  74. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gestureTask.py +149 -0
  75. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_handPose.py +136 -0
  76. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_headBodyPose.py +145 -0
  77. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_ikSolveError.py +171 -0
  78. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_ikSolveParam.py +140 -0
  79. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_imuData.py +165 -0
  80. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointBezierTrajectory.py +201 -0
  81. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointCmd.py +390 -0
  82. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointData.py +205 -0
  83. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_lejuClawCommand.py +320 -0
  84. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_lejuClawState.py +341 -0
  85. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_motorParam.py +122 -0
  86. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_picoPoseInfo.py +143 -0
  87. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_picoPoseInfoList.py +220 -0
  88. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_planArmState.py +120 -0
  89. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_qv.py +121 -0
  90. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotArmQVVD.py +177 -0
  91. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotBodyMatrices.py +332 -0
  92. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotHandPosition.py +225 -0
  93. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotHeadMotionData.py +128 -0
  94. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotState.py +222 -0
  95. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_sensorsData.py +495 -0
  96. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_switchGaitByName.py +200 -0
  97. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_tagDataArray.py +216 -0
  98. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_touchSensorStatus.py +162 -0
  99. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPose.py +272 -0
  100. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseCmd.py +315 -0
  101. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseCmdFree.py +338 -0
  102. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseFree.py +299 -0
  103. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_yoloDetection.py +251 -0
  104. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_yoloOutputData.py +168 -0
  105. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_ExecuteArmAction.py +281 -0
  106. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_GetTargetPartPoseInCamera.py +298 -0
  107. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_RepublishTFs.py +373 -0
  108. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SetJoyTopic.py +282 -0
  109. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SetLEDMode.py +468 -0
  110. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SpeechSynthesis.py +270 -0
  111. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/__init__.py +32 -0
  112. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeArmCtrlMode.py +275 -0
  113. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeArmCtrlModeKuavo.py +236 -0
  114. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeMotorParam.py +299 -0
  115. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeTorsoCtrlMode.py +274 -0
  116. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_controlLejuClaw.py +408 -0
  117. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_enableHandTouchSensor.py +304 -0
  118. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_fkSrv.py +394 -0
  119. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_footPose6DTargetTrajectoriesSrv.py +410 -0
  120. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_footPoseTargetTrajectoriesSrv.py +409 -0
  121. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureExecute.py +339 -0
  122. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureExecuteState.py +257 -0
  123. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureList.py +418 -0
  124. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_getCurrentGaitName.py +253 -0
  125. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_getMotorParam.py +299 -0
  126. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_handForceLevel.py +330 -0
  127. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_jointMoveTo.py +302 -0
  128. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_planArmTrajectoryBezierCurve.py +421 -0
  129. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_planArmTrajectoryCubicSpline.py +490 -0
  130. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_playmusic.py +268 -0
  131. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setHwIntialState.py +304 -0
  132. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setMmCtrlFrame.py +273 -0
  133. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setMotorEncoderRoundService.py +283 -0
  134. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setTagId.py +275 -0
  135. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_singleStepControl.py +444 -0
  136. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_twoArmHandPoseCmdFreeSrv.py +716 -0
  137. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_twoArmHandPoseCmdSrv.py +662 -0
  138. kuavo_humanoid_sdk/msg/motion_capture_ik/__init__.py +7 -0
  139. kuavo_humanoid_sdk/msg/ocs2_msgs/__init__.py +7 -0
  140. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/__init__.py +12 -0
  141. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_constraint.py +142 -0
  142. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_controller_data.py +121 -0
  143. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_lagrangian_metrics.py +148 -0
  144. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mode_schedule.py +150 -0
  145. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_flattened_controller.py +666 -0
  146. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_input.py +122 -0
  147. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_observation.py +209 -0
  148. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_performance_indices.py +140 -0
  149. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_solver_data.py +886 -0
  150. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_state.py +122 -0
  151. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_target_trajectories.py +239 -0
  152. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_multiplier.py +148 -0
  153. kuavo_humanoid_sdk/msg/ocs2_msgs/srv/__init__.py +1 -0
  154. kuavo_humanoid_sdk/msg/ocs2_msgs/srv/_reset.py +376 -0
  155. kuavo_humanoid_sdk-1.2.1b1698.dist-info/METADATA +291 -0
  156. kuavo_humanoid_sdk-1.2.1b1698.dist-info/RECORD +158 -0
  157. kuavo_humanoid_sdk-1.2.1b1698.dist-info/WHEEL +6 -0
  158. kuavo_humanoid_sdk-1.2.1b1698.dist-info/top_level.txt +1 -0
@@ -0,0 +1,121 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/qv.msg. Do not edit."""
3
+ import codecs
4
+ import sys
5
+ python3 = True if sys.hexversion > 0x03000000 else False
6
+ import genpy
7
+ import struct
8
+
9
+
10
+ class qv(genpy.Message):
11
+ _md5sum = "0db98d790b5b039efb61505385ae8369"
12
+ _type = "kuavo_msgs/qv"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """float64[] value
15
+ """
16
+ __slots__ = ['value']
17
+ _slot_types = ['float64[]']
18
+
19
+ def __init__(self, *args, **kwds):
20
+ """
21
+ Constructor. Any message fields that are implicitly/explicitly
22
+ set to None will be assigned a default value. The recommend
23
+ use is keyword arguments as this is more robust to future message
24
+ changes. You cannot mix in-order arguments and keyword arguments.
25
+
26
+ The available fields are:
27
+ value
28
+
29
+ :param args: complete set of field values, in .msg order
30
+ :param kwds: use keyword arguments corresponding to message field names
31
+ to set specific fields.
32
+ """
33
+ if args or kwds:
34
+ super(qv, self).__init__(*args, **kwds)
35
+ # message fields cannot be None, assign default values for those that are
36
+ if self.value is None:
37
+ self.value = []
38
+ else:
39
+ self.value = []
40
+
41
+ def _get_types(self):
42
+ """
43
+ internal API method
44
+ """
45
+ return self._slot_types
46
+
47
+ def serialize(self, buff):
48
+ """
49
+ serialize message into buffer
50
+ :param buff: buffer, ``StringIO``
51
+ """
52
+ try:
53
+ length = len(self.value)
54
+ buff.write(_struct_I.pack(length))
55
+ pattern = '<%sd'%length
56
+ buff.write(struct.Struct(pattern).pack(*self.value))
57
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
58
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
59
+
60
+ def deserialize(self, str):
61
+ """
62
+ unpack serialized message in str into this message instance
63
+ :param str: byte array of serialized message, ``str``
64
+ """
65
+ if python3:
66
+ codecs.lookup_error("rosmsg").msg_type = self._type
67
+ try:
68
+ end = 0
69
+ start = end
70
+ end += 4
71
+ (length,) = _struct_I.unpack(str[start:end])
72
+ pattern = '<%sd'%length
73
+ start = end
74
+ s = struct.Struct(pattern)
75
+ end += s.size
76
+ self.value = s.unpack(str[start:end])
77
+ return self
78
+ except struct.error as e:
79
+ raise genpy.DeserializationError(e) # most likely buffer underfill
80
+
81
+
82
+ def serialize_numpy(self, buff, numpy):
83
+ """
84
+ serialize message with numpy array types into buffer
85
+ :param buff: buffer, ``StringIO``
86
+ :param numpy: numpy python module
87
+ """
88
+ try:
89
+ length = len(self.value)
90
+ buff.write(_struct_I.pack(length))
91
+ pattern = '<%sd'%length
92
+ buff.write(self.value.tostring())
93
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
94
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
95
+
96
+ def deserialize_numpy(self, str, numpy):
97
+ """
98
+ unpack serialized message in str into this message instance using numpy for array types
99
+ :param str: byte array of serialized message, ``str``
100
+ :param numpy: numpy python module
101
+ """
102
+ if python3:
103
+ codecs.lookup_error("rosmsg").msg_type = self._type
104
+ try:
105
+ end = 0
106
+ start = end
107
+ end += 4
108
+ (length,) = _struct_I.unpack(str[start:end])
109
+ pattern = '<%sd'%length
110
+ start = end
111
+ s = struct.Struct(pattern)
112
+ end += s.size
113
+ self.value = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
114
+ return self
115
+ except struct.error as e:
116
+ raise genpy.DeserializationError(e) # most likely buffer underfill
117
+
118
+ _struct_I = genpy.struct_I
119
+ def _get_struct_I():
120
+ global _struct_I
121
+ return _struct_I
@@ -0,0 +1,177 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/robotArmQVVD.msg. Do not edit."""
3
+ import codecs
4
+ import sys
5
+ python3 = True if sys.hexversion > 0x03000000 else False
6
+ import genpy
7
+ import struct
8
+
9
+
10
+ class robotArmQVVD(genpy.Message):
11
+ _md5sum = "f2840165d02c529a8a4e8e04370a219b"
12
+ _type = "kuavo_msgs/robotArmQVVD"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """float64[] q
15
+ float64[] v
16
+ float64[] vd
17
+ """
18
+ __slots__ = ['q','v','vd']
19
+ _slot_types = ['float64[]','float64[]','float64[]']
20
+
21
+ def __init__(self, *args, **kwds):
22
+ """
23
+ Constructor. Any message fields that are implicitly/explicitly
24
+ set to None will be assigned a default value. The recommend
25
+ use is keyword arguments as this is more robust to future message
26
+ changes. You cannot mix in-order arguments and keyword arguments.
27
+
28
+ The available fields are:
29
+ q,v,vd
30
+
31
+ :param args: complete set of field values, in .msg order
32
+ :param kwds: use keyword arguments corresponding to message field names
33
+ to set specific fields.
34
+ """
35
+ if args or kwds:
36
+ super(robotArmQVVD, self).__init__(*args, **kwds)
37
+ # message fields cannot be None, assign default values for those that are
38
+ if self.q is None:
39
+ self.q = []
40
+ if self.v is None:
41
+ self.v = []
42
+ if self.vd is None:
43
+ self.vd = []
44
+ else:
45
+ self.q = []
46
+ self.v = []
47
+ self.vd = []
48
+
49
+ def _get_types(self):
50
+ """
51
+ internal API method
52
+ """
53
+ return self._slot_types
54
+
55
+ def serialize(self, buff):
56
+ """
57
+ serialize message into buffer
58
+ :param buff: buffer, ``StringIO``
59
+ """
60
+ try:
61
+ length = len(self.q)
62
+ buff.write(_struct_I.pack(length))
63
+ pattern = '<%sd'%length
64
+ buff.write(struct.Struct(pattern).pack(*self.q))
65
+ length = len(self.v)
66
+ buff.write(_struct_I.pack(length))
67
+ pattern = '<%sd'%length
68
+ buff.write(struct.Struct(pattern).pack(*self.v))
69
+ length = len(self.vd)
70
+ buff.write(_struct_I.pack(length))
71
+ pattern = '<%sd'%length
72
+ buff.write(struct.Struct(pattern).pack(*self.vd))
73
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
74
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
75
+
76
+ def deserialize(self, str):
77
+ """
78
+ unpack serialized message in str into this message instance
79
+ :param str: byte array of serialized message, ``str``
80
+ """
81
+ if python3:
82
+ codecs.lookup_error("rosmsg").msg_type = self._type
83
+ try:
84
+ end = 0
85
+ start = end
86
+ end += 4
87
+ (length,) = _struct_I.unpack(str[start:end])
88
+ pattern = '<%sd'%length
89
+ start = end
90
+ s = struct.Struct(pattern)
91
+ end += s.size
92
+ self.q = s.unpack(str[start:end])
93
+ start = end
94
+ end += 4
95
+ (length,) = _struct_I.unpack(str[start:end])
96
+ pattern = '<%sd'%length
97
+ start = end
98
+ s = struct.Struct(pattern)
99
+ end += s.size
100
+ self.v = s.unpack(str[start:end])
101
+ start = end
102
+ end += 4
103
+ (length,) = _struct_I.unpack(str[start:end])
104
+ pattern = '<%sd'%length
105
+ start = end
106
+ s = struct.Struct(pattern)
107
+ end += s.size
108
+ self.vd = s.unpack(str[start:end])
109
+ return self
110
+ except struct.error as e:
111
+ raise genpy.DeserializationError(e) # most likely buffer underfill
112
+
113
+
114
+ def serialize_numpy(self, buff, numpy):
115
+ """
116
+ serialize message with numpy array types into buffer
117
+ :param buff: buffer, ``StringIO``
118
+ :param numpy: numpy python module
119
+ """
120
+ try:
121
+ length = len(self.q)
122
+ buff.write(_struct_I.pack(length))
123
+ pattern = '<%sd'%length
124
+ buff.write(self.q.tostring())
125
+ length = len(self.v)
126
+ buff.write(_struct_I.pack(length))
127
+ pattern = '<%sd'%length
128
+ buff.write(self.v.tostring())
129
+ length = len(self.vd)
130
+ buff.write(_struct_I.pack(length))
131
+ pattern = '<%sd'%length
132
+ buff.write(self.vd.tostring())
133
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
134
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
135
+
136
+ def deserialize_numpy(self, str, numpy):
137
+ """
138
+ unpack serialized message in str into this message instance using numpy for array types
139
+ :param str: byte array of serialized message, ``str``
140
+ :param numpy: numpy python module
141
+ """
142
+ if python3:
143
+ codecs.lookup_error("rosmsg").msg_type = self._type
144
+ try:
145
+ end = 0
146
+ start = end
147
+ end += 4
148
+ (length,) = _struct_I.unpack(str[start:end])
149
+ pattern = '<%sd'%length
150
+ start = end
151
+ s = struct.Struct(pattern)
152
+ end += s.size
153
+ self.q = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
154
+ start = end
155
+ end += 4
156
+ (length,) = _struct_I.unpack(str[start:end])
157
+ pattern = '<%sd'%length
158
+ start = end
159
+ s = struct.Struct(pattern)
160
+ end += s.size
161
+ self.v = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
162
+ start = end
163
+ end += 4
164
+ (length,) = _struct_I.unpack(str[start:end])
165
+ pattern = '<%sd'%length
166
+ start = end
167
+ s = struct.Struct(pattern)
168
+ end += s.size
169
+ self.vd = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
170
+ return self
171
+ except struct.error as e:
172
+ raise genpy.DeserializationError(e) # most likely buffer underfill
173
+
174
+ _struct_I = genpy.struct_I
175
+ def _get_struct_I():
176
+ global _struct_I
177
+ return _struct_I
@@ -0,0 +1,332 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/robotBodyMatrices.msg. Do not edit."""
3
+ import codecs
4
+ import sys
5
+ python3 = True if sys.hexversion > 0x03000000 else False
6
+ import genpy
7
+ import struct
8
+
9
+ import genpy
10
+ import std_msgs.msg
11
+
12
+ class robotBodyMatrices(genpy.Message):
13
+ _md5sum = "8e448e11a251e177feb29dc5f6298be7"
14
+ _type = "kuavo_msgs/robotBodyMatrices"
15
+ _has_header = True # flag to mark the presence of a Header object
16
+ _full_text = """# robotBodyMatrices.msg
17
+ Header header
18
+
19
+ # 时间戳
20
+ time timestamp
21
+
22
+ # 矩阵数据 - 每个矩阵是4x4的齐次变换矩阵,展平为16个float64
23
+ float64[] matrices_data
24
+
25
+ # 矩阵数量
26
+ uint32 num_matrices
27
+
28
+ # 身体部位名称列表
29
+ string[] body_parts
30
+
31
+ # 数据来源标识
32
+ string data_source
33
+
34
+ ================================================================================
35
+ MSG: std_msgs/Header
36
+ # Standard metadata for higher-level stamped data types.
37
+ # This is generally used to communicate timestamped data
38
+ # in a particular coordinate frame.
39
+ #
40
+ # sequence ID: consecutively increasing ID
41
+ uint32 seq
42
+ #Two-integer timestamp that is expressed as:
43
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
44
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
45
+ # time-handling sugar is provided by the client library
46
+ time stamp
47
+ #Frame this data is associated with
48
+ string frame_id
49
+ """
50
+ __slots__ = ['header','timestamp','matrices_data','num_matrices','body_parts','data_source']
51
+ _slot_types = ['std_msgs/Header','time','float64[]','uint32','string[]','string']
52
+
53
+ def __init__(self, *args, **kwds):
54
+ """
55
+ Constructor. Any message fields that are implicitly/explicitly
56
+ set to None will be assigned a default value. The recommend
57
+ use is keyword arguments as this is more robust to future message
58
+ changes. You cannot mix in-order arguments and keyword arguments.
59
+
60
+ The available fields are:
61
+ header,timestamp,matrices_data,num_matrices,body_parts,data_source
62
+
63
+ :param args: complete set of field values, in .msg order
64
+ :param kwds: use keyword arguments corresponding to message field names
65
+ to set specific fields.
66
+ """
67
+ if args or kwds:
68
+ super(robotBodyMatrices, self).__init__(*args, **kwds)
69
+ # message fields cannot be None, assign default values for those that are
70
+ if self.header is None:
71
+ self.header = std_msgs.msg.Header()
72
+ if self.timestamp is None:
73
+ self.timestamp = genpy.Time()
74
+ if self.matrices_data is None:
75
+ self.matrices_data = []
76
+ if self.num_matrices is None:
77
+ self.num_matrices = 0
78
+ if self.body_parts is None:
79
+ self.body_parts = []
80
+ if self.data_source is None:
81
+ self.data_source = ''
82
+ else:
83
+ self.header = std_msgs.msg.Header()
84
+ self.timestamp = genpy.Time()
85
+ self.matrices_data = []
86
+ self.num_matrices = 0
87
+ self.body_parts = []
88
+ self.data_source = ''
89
+
90
+ def _get_types(self):
91
+ """
92
+ internal API method
93
+ """
94
+ return self._slot_types
95
+
96
+ def serialize(self, buff):
97
+ """
98
+ serialize message into buffer
99
+ :param buff: buffer, ``StringIO``
100
+ """
101
+ try:
102
+ _x = self
103
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
104
+ _x = self.header.frame_id
105
+ length = len(_x)
106
+ if python3 or type(_x) == unicode:
107
+ _x = _x.encode('utf-8')
108
+ length = len(_x)
109
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
110
+ _x = self
111
+ buff.write(_get_struct_2I().pack(_x.timestamp.secs, _x.timestamp.nsecs))
112
+ length = len(self.matrices_data)
113
+ buff.write(_struct_I.pack(length))
114
+ pattern = '<%sd'%length
115
+ buff.write(struct.Struct(pattern).pack(*self.matrices_data))
116
+ _x = self.num_matrices
117
+ buff.write(_get_struct_I().pack(_x))
118
+ length = len(self.body_parts)
119
+ buff.write(_struct_I.pack(length))
120
+ for val1 in self.body_parts:
121
+ length = len(val1)
122
+ if python3 or type(val1) == unicode:
123
+ val1 = val1.encode('utf-8')
124
+ length = len(val1)
125
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
126
+ _x = self.data_source
127
+ length = len(_x)
128
+ if python3 or type(_x) == unicode:
129
+ _x = _x.encode('utf-8')
130
+ length = len(_x)
131
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
132
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
133
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
134
+
135
+ def deserialize(self, str):
136
+ """
137
+ unpack serialized message in str into this message instance
138
+ :param str: byte array of serialized message, ``str``
139
+ """
140
+ if python3:
141
+ codecs.lookup_error("rosmsg").msg_type = self._type
142
+ try:
143
+ if self.header is None:
144
+ self.header = std_msgs.msg.Header()
145
+ if self.timestamp is None:
146
+ self.timestamp = genpy.Time()
147
+ end = 0
148
+ _x = self
149
+ start = end
150
+ end += 12
151
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
152
+ start = end
153
+ end += 4
154
+ (length,) = _struct_I.unpack(str[start:end])
155
+ start = end
156
+ end += length
157
+ if python3:
158
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
159
+ else:
160
+ self.header.frame_id = str[start:end]
161
+ _x = self
162
+ start = end
163
+ end += 8
164
+ (_x.timestamp.secs, _x.timestamp.nsecs,) = _get_struct_2I().unpack(str[start:end])
165
+ start = end
166
+ end += 4
167
+ (length,) = _struct_I.unpack(str[start:end])
168
+ pattern = '<%sd'%length
169
+ start = end
170
+ s = struct.Struct(pattern)
171
+ end += s.size
172
+ self.matrices_data = s.unpack(str[start:end])
173
+ start = end
174
+ end += 4
175
+ (self.num_matrices,) = _get_struct_I().unpack(str[start:end])
176
+ start = end
177
+ end += 4
178
+ (length,) = _struct_I.unpack(str[start:end])
179
+ self.body_parts = []
180
+ for i in range(0, length):
181
+ start = end
182
+ end += 4
183
+ (length,) = _struct_I.unpack(str[start:end])
184
+ start = end
185
+ end += length
186
+ if python3:
187
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
188
+ else:
189
+ val1 = str[start:end]
190
+ self.body_parts.append(val1)
191
+ start = end
192
+ end += 4
193
+ (length,) = _struct_I.unpack(str[start:end])
194
+ start = end
195
+ end += length
196
+ if python3:
197
+ self.data_source = str[start:end].decode('utf-8', 'rosmsg')
198
+ else:
199
+ self.data_source = str[start:end]
200
+ self.timestamp.canon()
201
+ return self
202
+ except struct.error as e:
203
+ raise genpy.DeserializationError(e) # most likely buffer underfill
204
+
205
+
206
+ def serialize_numpy(self, buff, numpy):
207
+ """
208
+ serialize message with numpy array types into buffer
209
+ :param buff: buffer, ``StringIO``
210
+ :param numpy: numpy python module
211
+ """
212
+ try:
213
+ _x = self
214
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
215
+ _x = self.header.frame_id
216
+ length = len(_x)
217
+ if python3 or type(_x) == unicode:
218
+ _x = _x.encode('utf-8')
219
+ length = len(_x)
220
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
221
+ _x = self
222
+ buff.write(_get_struct_2I().pack(_x.timestamp.secs, _x.timestamp.nsecs))
223
+ length = len(self.matrices_data)
224
+ buff.write(_struct_I.pack(length))
225
+ pattern = '<%sd'%length
226
+ buff.write(self.matrices_data.tostring())
227
+ _x = self.num_matrices
228
+ buff.write(_get_struct_I().pack(_x))
229
+ length = len(self.body_parts)
230
+ buff.write(_struct_I.pack(length))
231
+ for val1 in self.body_parts:
232
+ length = len(val1)
233
+ if python3 or type(val1) == unicode:
234
+ val1 = val1.encode('utf-8')
235
+ length = len(val1)
236
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
237
+ _x = self.data_source
238
+ length = len(_x)
239
+ if python3 or type(_x) == unicode:
240
+ _x = _x.encode('utf-8')
241
+ length = len(_x)
242
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
243
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
244
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
245
+
246
+ def deserialize_numpy(self, str, numpy):
247
+ """
248
+ unpack serialized message in str into this message instance using numpy for array types
249
+ :param str: byte array of serialized message, ``str``
250
+ :param numpy: numpy python module
251
+ """
252
+ if python3:
253
+ codecs.lookup_error("rosmsg").msg_type = self._type
254
+ try:
255
+ if self.header is None:
256
+ self.header = std_msgs.msg.Header()
257
+ if self.timestamp is None:
258
+ self.timestamp = genpy.Time()
259
+ end = 0
260
+ _x = self
261
+ start = end
262
+ end += 12
263
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
264
+ start = end
265
+ end += 4
266
+ (length,) = _struct_I.unpack(str[start:end])
267
+ start = end
268
+ end += length
269
+ if python3:
270
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
271
+ else:
272
+ self.header.frame_id = str[start:end]
273
+ _x = self
274
+ start = end
275
+ end += 8
276
+ (_x.timestamp.secs, _x.timestamp.nsecs,) = _get_struct_2I().unpack(str[start:end])
277
+ start = end
278
+ end += 4
279
+ (length,) = _struct_I.unpack(str[start:end])
280
+ pattern = '<%sd'%length
281
+ start = end
282
+ s = struct.Struct(pattern)
283
+ end += s.size
284
+ self.matrices_data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
285
+ start = end
286
+ end += 4
287
+ (self.num_matrices,) = _get_struct_I().unpack(str[start:end])
288
+ start = end
289
+ end += 4
290
+ (length,) = _struct_I.unpack(str[start:end])
291
+ self.body_parts = []
292
+ for i in range(0, length):
293
+ start = end
294
+ end += 4
295
+ (length,) = _struct_I.unpack(str[start:end])
296
+ start = end
297
+ end += length
298
+ if python3:
299
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
300
+ else:
301
+ val1 = str[start:end]
302
+ self.body_parts.append(val1)
303
+ start = end
304
+ end += 4
305
+ (length,) = _struct_I.unpack(str[start:end])
306
+ start = end
307
+ end += length
308
+ if python3:
309
+ self.data_source = str[start:end].decode('utf-8', 'rosmsg')
310
+ else:
311
+ self.data_source = str[start:end]
312
+ self.timestamp.canon()
313
+ return self
314
+ except struct.error as e:
315
+ raise genpy.DeserializationError(e) # most likely buffer underfill
316
+
317
+ _struct_I = genpy.struct_I
318
+ def _get_struct_I():
319
+ global _struct_I
320
+ return _struct_I
321
+ _struct_2I = None
322
+ def _get_struct_2I():
323
+ global _struct_2I
324
+ if _struct_2I is None:
325
+ _struct_2I = struct.Struct("<2I")
326
+ return _struct_2I
327
+ _struct_3I = None
328
+ def _get_struct_3I():
329
+ global _struct_3I
330
+ if _struct_3I is None:
331
+ _struct_3I = struct.Struct("<3I")
332
+ return _struct_3I