kuavo-humanoid-sdk 1.2.2__20250922181216-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 (137) 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 +276 -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 +612 -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 +1309 -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 +605 -0
  19. kuavo_humanoid_sdk/kuavo/core/ros/tools.py +219 -0
  20. kuavo_humanoid_sdk/kuavo/core/ros/vision.py +234 -0
  21. kuavo_humanoid_sdk/kuavo/core/ros_env.py +237 -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 +465 -0
  25. kuavo_humanoid_sdk/kuavo/robot_arm.py +210 -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 +299 -0
  31. kuavo_humanoid_sdk/kuavo/robot_tool.py +82 -0
  32. kuavo_humanoid_sdk/kuavo/robot_vision.py +83 -0
  33. kuavo_humanoid_sdk/kuavo_strategy/__init__.py +2 -0
  34. kuavo_humanoid_sdk/kuavo_strategy/grasp_box/grasp_box_strategy.py +1126 -0
  35. kuavo_humanoid_sdk/kuavo_strategy/kuavo_strategy.py +104 -0
  36. kuavo_humanoid_sdk/msg/__init__.py +4 -0
  37. kuavo_humanoid_sdk/msg/kuavo_msgs/__init__.py +7 -0
  38. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_AprilTagDetection.py +306 -0
  39. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_AprilTagDetectionArray.py +437 -0
  40. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_JoySticks.py +191 -0
  41. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_Metadata.py +199 -0
  42. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_RobotActionState.py +112 -0
  43. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_TFArray.py +323 -0
  44. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/__init__.py +48 -0
  45. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armHandPose.py +160 -0
  46. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armHandPoseFree.py +171 -0
  47. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armPoseWithTimeStamp.py +168 -0
  48. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armTargetPoses.py +151 -0
  49. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_bezierCurveCubicPoint.py +178 -0
  50. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_dexhandCommand.py +229 -0
  51. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_dexhandTouchState.py +256 -0
  52. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_endEffectorData.py +227 -0
  53. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPose.py +123 -0
  54. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoseTargetTrajectories.py +301 -0
  55. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoses.py +149 -0
  56. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_fullBodyTargetTrajectories.py +258 -0
  57. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gaitTimeName.py +147 -0
  58. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gestureInfo.py +218 -0
  59. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gestureTask.py +149 -0
  60. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_handPose.py +136 -0
  61. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_headBodyPose.py +145 -0
  62. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_ikSolveError.py +171 -0
  63. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_ikSolveParam.py +140 -0
  64. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_imuData.py +165 -0
  65. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointBezierTrajectory.py +201 -0
  66. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointCmd.py +390 -0
  67. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointData.py +205 -0
  68. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_lejuClawCommand.py +320 -0
  69. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_lejuClawState.py +341 -0
  70. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_motorParam.py +122 -0
  71. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_planArmState.py +120 -0
  72. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_questJoySticks.py +191 -0
  73. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_qv.py +121 -0
  74. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotArmQVVD.py +177 -0
  75. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotHandPosition.py +225 -0
  76. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotHeadMotionData.py +128 -0
  77. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotState.py +222 -0
  78. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_sensorsData.py +495 -0
  79. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_switchGaitByName.py +200 -0
  80. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_touchSensorStatus.py +162 -0
  81. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPose.py +272 -0
  82. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseCmd.py +315 -0
  83. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseCmdFree.py +338 -0
  84. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseFree.py +299 -0
  85. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_yoloDetection.py +251 -0
  86. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_yoloOutputData.py +168 -0
  87. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_ExecuteArmAction.py +281 -0
  88. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_RepublishTFs.py +373 -0
  89. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SetJoyTopic.py +282 -0
  90. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SpeechSynthesis.py +270 -0
  91. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/__init__.py +29 -0
  92. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeArmCtrlMode.py +275 -0
  93. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeArmCtrlModeKuavo.py +236 -0
  94. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeMotorParam.py +299 -0
  95. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeTorsoCtrlMode.py +274 -0
  96. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_controlLejuClaw.py +408 -0
  97. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_enableHandTouchSensor.py +304 -0
  98. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_fkSrv.py +394 -0
  99. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_footPoseTargetTrajectoriesSrv.py +409 -0
  100. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureExecute.py +339 -0
  101. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureExecuteState.py +257 -0
  102. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureList.py +418 -0
  103. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_getCurrentGaitName.py +253 -0
  104. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_getMotorParam.py +299 -0
  105. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_handForceLevel.py +330 -0
  106. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_jointMoveTo.py +302 -0
  107. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_planArmTrajectoryBezierCurve.py +421 -0
  108. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_planArmTrajectoryCubicSpline.py +490 -0
  109. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_playmusic.py +268 -0
  110. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setHwIntialState.py +304 -0
  111. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setMmCtrlFrame.py +273 -0
  112. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setMotorEncoderRoundService.py +283 -0
  113. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setTagId.py +275 -0
  114. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_singleStepControl.py +444 -0
  115. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_twoArmHandPoseCmdFreeSrv.py +716 -0
  116. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_twoArmHandPoseCmdSrv.py +662 -0
  117. kuavo_humanoid_sdk/msg/motion_capture_ik/__init__.py +7 -0
  118. kuavo_humanoid_sdk/msg/ocs2_msgs/__init__.py +7 -0
  119. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/__init__.py +12 -0
  120. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_constraint.py +142 -0
  121. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_controller_data.py +121 -0
  122. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_lagrangian_metrics.py +148 -0
  123. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mode_schedule.py +150 -0
  124. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_flattened_controller.py +666 -0
  125. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_input.py +122 -0
  126. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_observation.py +209 -0
  127. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_performance_indices.py +140 -0
  128. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_solver_data.py +886 -0
  129. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_state.py +122 -0
  130. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_target_trajectories.py +239 -0
  131. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_multiplier.py +148 -0
  132. kuavo_humanoid_sdk/msg/ocs2_msgs/srv/__init__.py +1 -0
  133. kuavo_humanoid_sdk/msg/ocs2_msgs/srv/_reset.py +376 -0
  134. kuavo_humanoid_sdk-1.2.2.dist-info/METADATA +291 -0
  135. kuavo_humanoid_sdk-1.2.2.dist-info/RECORD +137 -0
  136. kuavo_humanoid_sdk-1.2.2.dist-info/WHEEL +6 -0
  137. kuavo_humanoid_sdk-1.2.2.dist-info/top_level.txt +1 -0
@@ -0,0 +1,437 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/AprilTagDetectionArray.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 geometry_msgs.msg
10
+ import kuavo_msgs.msg
11
+ import std_msgs.msg
12
+
13
+ class AprilTagDetectionArray(genpy.Message):
14
+ _md5sum = "2b6c03434883a5c9897c13b5594dbd91"
15
+ _type = "kuavo_msgs/AprilTagDetectionArray"
16
+ _has_header = True # flag to mark the presence of a Header object
17
+ _full_text = """std_msgs/Header header
18
+ AprilTagDetection[] detections
19
+
20
+ ================================================================================
21
+ MSG: std_msgs/Header
22
+ # Standard metadata for higher-level stamped data types.
23
+ # This is generally used to communicate timestamped data
24
+ # in a particular coordinate frame.
25
+ #
26
+ # sequence ID: consecutively increasing ID
27
+ uint32 seq
28
+ #Two-integer timestamp that is expressed as:
29
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
30
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
31
+ # time-handling sugar is provided by the client library
32
+ time stamp
33
+ #Frame this data is associated with
34
+ string frame_id
35
+
36
+ ================================================================================
37
+ MSG: kuavo_msgs/AprilTagDetection
38
+ # Tag ID(s). If a standalone tag, this is a vector of size 1. If a tag bundle,
39
+ # this is a vector containing the IDs of each tag in the bundle.
40
+ int32[] id
41
+
42
+ # Tag size(s). If a standalone tag, this is a vector of size 1. If a tag bundle,
43
+ # this is a vector containing the sizes of each tag in the bundle, in the same
44
+ # order as the IDs above.
45
+ float64[] size
46
+
47
+ # Pose in the camera frame, obtained from homography transform. If a standalone
48
+ # tag, the homography is from the four tag corners. If a tag bundle, the
49
+ # homography is from at least the four corners of one member tag and at most the
50
+ # four corners of all member tags.
51
+ geometry_msgs/PoseWithCovarianceStamped pose
52
+ ================================================================================
53
+ MSG: geometry_msgs/PoseWithCovarianceStamped
54
+ # This expresses an estimated pose with a reference coordinate frame and timestamp
55
+
56
+ Header header
57
+ PoseWithCovariance pose
58
+
59
+ ================================================================================
60
+ MSG: geometry_msgs/PoseWithCovariance
61
+ # This represents a pose in free space with uncertainty.
62
+
63
+ Pose pose
64
+
65
+ # Row-major representation of the 6x6 covariance matrix
66
+ # The orientation parameters use a fixed-axis representation.
67
+ # In order, the parameters are:
68
+ # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
69
+ float64[36] covariance
70
+
71
+ ================================================================================
72
+ MSG: geometry_msgs/Pose
73
+ # A representation of pose in free space, composed of position and orientation.
74
+ Point position
75
+ Quaternion orientation
76
+
77
+ ================================================================================
78
+ MSG: geometry_msgs/Point
79
+ # This contains the position of a point in free space
80
+ float64 x
81
+ float64 y
82
+ float64 z
83
+
84
+ ================================================================================
85
+ MSG: geometry_msgs/Quaternion
86
+ # This represents an orientation in free space in quaternion form.
87
+
88
+ float64 x
89
+ float64 y
90
+ float64 z
91
+ float64 w
92
+ """
93
+ __slots__ = ['header','detections']
94
+ _slot_types = ['std_msgs/Header','kuavo_msgs/AprilTagDetection[]']
95
+
96
+ def __init__(self, *args, **kwds):
97
+ """
98
+ Constructor. Any message fields that are implicitly/explicitly
99
+ set to None will be assigned a default value. The recommend
100
+ use is keyword arguments as this is more robust to future message
101
+ changes. You cannot mix in-order arguments and keyword arguments.
102
+
103
+ The available fields are:
104
+ header,detections
105
+
106
+ :param args: complete set of field values, in .msg order
107
+ :param kwds: use keyword arguments corresponding to message field names
108
+ to set specific fields.
109
+ """
110
+ if args or kwds:
111
+ super(AprilTagDetectionArray, self).__init__(*args, **kwds)
112
+ # message fields cannot be None, assign default values for those that are
113
+ if self.header is None:
114
+ self.header = std_msgs.msg.Header()
115
+ if self.detections is None:
116
+ self.detections = []
117
+ else:
118
+ self.header = std_msgs.msg.Header()
119
+ self.detections = []
120
+
121
+ def _get_types(self):
122
+ """
123
+ internal API method
124
+ """
125
+ return self._slot_types
126
+
127
+ def serialize(self, buff):
128
+ """
129
+ serialize message into buffer
130
+ :param buff: buffer, ``StringIO``
131
+ """
132
+ try:
133
+ _x = self
134
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
135
+ _x = self.header.frame_id
136
+ length = len(_x)
137
+ if python3 or type(_x) == unicode:
138
+ _x = _x.encode('utf-8')
139
+ length = len(_x)
140
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
141
+ length = len(self.detections)
142
+ buff.write(_struct_I.pack(length))
143
+ for val1 in self.detections:
144
+ length = len(val1.id)
145
+ buff.write(_struct_I.pack(length))
146
+ pattern = '<%si'%length
147
+ buff.write(struct.Struct(pattern).pack(*val1.id))
148
+ length = len(val1.size)
149
+ buff.write(_struct_I.pack(length))
150
+ pattern = '<%sd'%length
151
+ buff.write(struct.Struct(pattern).pack(*val1.size))
152
+ _v1 = val1.pose
153
+ _v2 = _v1.header
154
+ _x = _v2.seq
155
+ buff.write(_get_struct_I().pack(_x))
156
+ _v3 = _v2.stamp
157
+ _x = _v3
158
+ buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
159
+ _x = _v2.frame_id
160
+ length = len(_x)
161
+ if python3 or type(_x) == unicode:
162
+ _x = _x.encode('utf-8')
163
+ length = len(_x)
164
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
165
+ _v4 = _v1.pose
166
+ _v5 = _v4.pose
167
+ _v6 = _v5.position
168
+ _x = _v6
169
+ buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
170
+ _v7 = _v5.orientation
171
+ _x = _v7
172
+ buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
173
+ buff.write(_get_struct_36d().pack(*_v4.covariance))
174
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
175
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
176
+
177
+ def deserialize(self, str):
178
+ """
179
+ unpack serialized message in str into this message instance
180
+ :param str: byte array of serialized message, ``str``
181
+ """
182
+ if python3:
183
+ codecs.lookup_error("rosmsg").msg_type = self._type
184
+ try:
185
+ if self.header is None:
186
+ self.header = std_msgs.msg.Header()
187
+ if self.detections is None:
188
+ self.detections = None
189
+ end = 0
190
+ _x = self
191
+ start = end
192
+ end += 12
193
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
194
+ start = end
195
+ end += 4
196
+ (length,) = _struct_I.unpack(str[start:end])
197
+ start = end
198
+ end += length
199
+ if python3:
200
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
201
+ else:
202
+ self.header.frame_id = str[start:end]
203
+ start = end
204
+ end += 4
205
+ (length,) = _struct_I.unpack(str[start:end])
206
+ self.detections = []
207
+ for i in range(0, length):
208
+ val1 = kuavo_msgs.msg.AprilTagDetection()
209
+ start = end
210
+ end += 4
211
+ (length,) = _struct_I.unpack(str[start:end])
212
+ pattern = '<%si'%length
213
+ start = end
214
+ s = struct.Struct(pattern)
215
+ end += s.size
216
+ val1.id = s.unpack(str[start:end])
217
+ start = end
218
+ end += 4
219
+ (length,) = _struct_I.unpack(str[start:end])
220
+ pattern = '<%sd'%length
221
+ start = end
222
+ s = struct.Struct(pattern)
223
+ end += s.size
224
+ val1.size = s.unpack(str[start:end])
225
+ _v8 = val1.pose
226
+ _v9 = _v8.header
227
+ start = end
228
+ end += 4
229
+ (_v9.seq,) = _get_struct_I().unpack(str[start:end])
230
+ _v10 = _v9.stamp
231
+ _x = _v10
232
+ start = end
233
+ end += 8
234
+ (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
235
+ start = end
236
+ end += 4
237
+ (length,) = _struct_I.unpack(str[start:end])
238
+ start = end
239
+ end += length
240
+ if python3:
241
+ _v9.frame_id = str[start:end].decode('utf-8', 'rosmsg')
242
+ else:
243
+ _v9.frame_id = str[start:end]
244
+ _v11 = _v8.pose
245
+ _v12 = _v11.pose
246
+ _v13 = _v12.position
247
+ _x = _v13
248
+ start = end
249
+ end += 24
250
+ (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
251
+ _v14 = _v12.orientation
252
+ _x = _v14
253
+ start = end
254
+ end += 32
255
+ (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
256
+ start = end
257
+ end += 288
258
+ _v11.covariance = _get_struct_36d().unpack(str[start:end])
259
+ self.detections.append(val1)
260
+ return self
261
+ except struct.error as e:
262
+ raise genpy.DeserializationError(e) # most likely buffer underfill
263
+
264
+
265
+ def serialize_numpy(self, buff, numpy):
266
+ """
267
+ serialize message with numpy array types into buffer
268
+ :param buff: buffer, ``StringIO``
269
+ :param numpy: numpy python module
270
+ """
271
+ try:
272
+ _x = self
273
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
274
+ _x = self.header.frame_id
275
+ length = len(_x)
276
+ if python3 or type(_x) == unicode:
277
+ _x = _x.encode('utf-8')
278
+ length = len(_x)
279
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
280
+ length = len(self.detections)
281
+ buff.write(_struct_I.pack(length))
282
+ for val1 in self.detections:
283
+ length = len(val1.id)
284
+ buff.write(_struct_I.pack(length))
285
+ pattern = '<%si'%length
286
+ buff.write(val1.id.tostring())
287
+ length = len(val1.size)
288
+ buff.write(_struct_I.pack(length))
289
+ pattern = '<%sd'%length
290
+ buff.write(val1.size.tostring())
291
+ _v15 = val1.pose
292
+ _v16 = _v15.header
293
+ _x = _v16.seq
294
+ buff.write(_get_struct_I().pack(_x))
295
+ _v17 = _v16.stamp
296
+ _x = _v17
297
+ buff.write(_get_struct_2I().pack(_x.secs, _x.nsecs))
298
+ _x = _v16.frame_id
299
+ length = len(_x)
300
+ if python3 or type(_x) == unicode:
301
+ _x = _x.encode('utf-8')
302
+ length = len(_x)
303
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
304
+ _v18 = _v15.pose
305
+ _v19 = _v18.pose
306
+ _v20 = _v19.position
307
+ _x = _v20
308
+ buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
309
+ _v21 = _v19.orientation
310
+ _x = _v21
311
+ buff.write(_get_struct_4d().pack(_x.x, _x.y, _x.z, _x.w))
312
+ buff.write(_v18.covariance.tostring())
313
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
314
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
315
+
316
+ def deserialize_numpy(self, str, numpy):
317
+ """
318
+ unpack serialized message in str into this message instance using numpy for array types
319
+ :param str: byte array of serialized message, ``str``
320
+ :param numpy: numpy python module
321
+ """
322
+ if python3:
323
+ codecs.lookup_error("rosmsg").msg_type = self._type
324
+ try:
325
+ if self.header is None:
326
+ self.header = std_msgs.msg.Header()
327
+ if self.detections is None:
328
+ self.detections = None
329
+ end = 0
330
+ _x = self
331
+ start = end
332
+ end += 12
333
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
334
+ start = end
335
+ end += 4
336
+ (length,) = _struct_I.unpack(str[start:end])
337
+ start = end
338
+ end += length
339
+ if python3:
340
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
341
+ else:
342
+ self.header.frame_id = str[start:end]
343
+ start = end
344
+ end += 4
345
+ (length,) = _struct_I.unpack(str[start:end])
346
+ self.detections = []
347
+ for i in range(0, length):
348
+ val1 = kuavo_msgs.msg.AprilTagDetection()
349
+ start = end
350
+ end += 4
351
+ (length,) = _struct_I.unpack(str[start:end])
352
+ pattern = '<%si'%length
353
+ start = end
354
+ s = struct.Struct(pattern)
355
+ end += s.size
356
+ val1.id = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
357
+ start = end
358
+ end += 4
359
+ (length,) = _struct_I.unpack(str[start:end])
360
+ pattern = '<%sd'%length
361
+ start = end
362
+ s = struct.Struct(pattern)
363
+ end += s.size
364
+ val1.size = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
365
+ _v22 = val1.pose
366
+ _v23 = _v22.header
367
+ start = end
368
+ end += 4
369
+ (_v23.seq,) = _get_struct_I().unpack(str[start:end])
370
+ _v24 = _v23.stamp
371
+ _x = _v24
372
+ start = end
373
+ end += 8
374
+ (_x.secs, _x.nsecs,) = _get_struct_2I().unpack(str[start:end])
375
+ start = end
376
+ end += 4
377
+ (length,) = _struct_I.unpack(str[start:end])
378
+ start = end
379
+ end += length
380
+ if python3:
381
+ _v23.frame_id = str[start:end].decode('utf-8', 'rosmsg')
382
+ else:
383
+ _v23.frame_id = str[start:end]
384
+ _v25 = _v22.pose
385
+ _v26 = _v25.pose
386
+ _v27 = _v26.position
387
+ _x = _v27
388
+ start = end
389
+ end += 24
390
+ (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
391
+ _v28 = _v26.orientation
392
+ _x = _v28
393
+ start = end
394
+ end += 32
395
+ (_x.x, _x.y, _x.z, _x.w,) = _get_struct_4d().unpack(str[start:end])
396
+ start = end
397
+ end += 288
398
+ _v25.covariance = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=36)
399
+ self.detections.append(val1)
400
+ return self
401
+ except struct.error as e:
402
+ raise genpy.DeserializationError(e) # most likely buffer underfill
403
+
404
+ _struct_I = genpy.struct_I
405
+ def _get_struct_I():
406
+ global _struct_I
407
+ return _struct_I
408
+ _struct_2I = None
409
+ def _get_struct_2I():
410
+ global _struct_2I
411
+ if _struct_2I is None:
412
+ _struct_2I = struct.Struct("<2I")
413
+ return _struct_2I
414
+ _struct_36d = None
415
+ def _get_struct_36d():
416
+ global _struct_36d
417
+ if _struct_36d is None:
418
+ _struct_36d = struct.Struct("<36d")
419
+ return _struct_36d
420
+ _struct_3I = None
421
+ def _get_struct_3I():
422
+ global _struct_3I
423
+ if _struct_3I is None:
424
+ _struct_3I = struct.Struct("<3I")
425
+ return _struct_3I
426
+ _struct_3d = None
427
+ def _get_struct_3d():
428
+ global _struct_3d
429
+ if _struct_3d is None:
430
+ _struct_3d = struct.Struct("<3d")
431
+ return _struct_3d
432
+ _struct_4d = None
433
+ def _get_struct_4d():
434
+ global _struct_4d
435
+ if _struct_4d is None:
436
+ _struct_4d = struct.Struct("<4d")
437
+ return _struct_4d
@@ -0,0 +1,191 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/JoySticks.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 JoySticks(genpy.Message):
11
+ _md5sum = "c686b65cdd180a9046db651d6492ec65"
12
+ _type = "kuavo_msgs/JoySticks"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """float32 left_x
15
+ float32 left_y
16
+ float32 left_trigger
17
+ float32 left_grip
18
+ bool left_first_button_pressed
19
+ bool left_second_button_pressed
20
+ bool left_first_button_touched
21
+ bool left_second_button_touched
22
+ float32 right_x
23
+ float32 right_y
24
+ float32 right_trigger
25
+ float32 right_grip
26
+ bool right_first_button_pressed
27
+ bool right_second_button_pressed
28
+ bool right_first_button_touched
29
+ bool right_second_button_touched
30
+ """
31
+ __slots__ = ['left_x','left_y','left_trigger','left_grip','left_first_button_pressed','left_second_button_pressed','left_first_button_touched','left_second_button_touched','right_x','right_y','right_trigger','right_grip','right_first_button_pressed','right_second_button_pressed','right_first_button_touched','right_second_button_touched']
32
+ _slot_types = ['float32','float32','float32','float32','bool','bool','bool','bool','float32','float32','float32','float32','bool','bool','bool','bool']
33
+
34
+ def __init__(self, *args, **kwds):
35
+ """
36
+ Constructor. Any message fields that are implicitly/explicitly
37
+ set to None will be assigned a default value. The recommend
38
+ use is keyword arguments as this is more robust to future message
39
+ changes. You cannot mix in-order arguments and keyword arguments.
40
+
41
+ The available fields are:
42
+ left_x,left_y,left_trigger,left_grip,left_first_button_pressed,left_second_button_pressed,left_first_button_touched,left_second_button_touched,right_x,right_y,right_trigger,right_grip,right_first_button_pressed,right_second_button_pressed,right_first_button_touched,right_second_button_touched
43
+
44
+ :param args: complete set of field values, in .msg order
45
+ :param kwds: use keyword arguments corresponding to message field names
46
+ to set specific fields.
47
+ """
48
+ if args or kwds:
49
+ super(JoySticks, self).__init__(*args, **kwds)
50
+ # message fields cannot be None, assign default values for those that are
51
+ if self.left_x is None:
52
+ self.left_x = 0.
53
+ if self.left_y is None:
54
+ self.left_y = 0.
55
+ if self.left_trigger is None:
56
+ self.left_trigger = 0.
57
+ if self.left_grip is None:
58
+ self.left_grip = 0.
59
+ if self.left_first_button_pressed is None:
60
+ self.left_first_button_pressed = False
61
+ if self.left_second_button_pressed is None:
62
+ self.left_second_button_pressed = False
63
+ if self.left_first_button_touched is None:
64
+ self.left_first_button_touched = False
65
+ if self.left_second_button_touched is None:
66
+ self.left_second_button_touched = False
67
+ if self.right_x is None:
68
+ self.right_x = 0.
69
+ if self.right_y is None:
70
+ self.right_y = 0.
71
+ if self.right_trigger is None:
72
+ self.right_trigger = 0.
73
+ if self.right_grip is None:
74
+ self.right_grip = 0.
75
+ if self.right_first_button_pressed is None:
76
+ self.right_first_button_pressed = False
77
+ if self.right_second_button_pressed is None:
78
+ self.right_second_button_pressed = False
79
+ if self.right_first_button_touched is None:
80
+ self.right_first_button_touched = False
81
+ if self.right_second_button_touched is None:
82
+ self.right_second_button_touched = False
83
+ else:
84
+ self.left_x = 0.
85
+ self.left_y = 0.
86
+ self.left_trigger = 0.
87
+ self.left_grip = 0.
88
+ self.left_first_button_pressed = False
89
+ self.left_second_button_pressed = False
90
+ self.left_first_button_touched = False
91
+ self.left_second_button_touched = False
92
+ self.right_x = 0.
93
+ self.right_y = 0.
94
+ self.right_trigger = 0.
95
+ self.right_grip = 0.
96
+ self.right_first_button_pressed = False
97
+ self.right_second_button_pressed = False
98
+ self.right_first_button_touched = False
99
+ self.right_second_button_touched = False
100
+
101
+ def _get_types(self):
102
+ """
103
+ internal API method
104
+ """
105
+ return self._slot_types
106
+
107
+ def serialize(self, buff):
108
+ """
109
+ serialize message into buffer
110
+ :param buff: buffer, ``StringIO``
111
+ """
112
+ try:
113
+ _x = self
114
+ buff.write(_get_struct_4f4B4f4B().pack(_x.left_x, _x.left_y, _x.left_trigger, _x.left_grip, _x.left_first_button_pressed, _x.left_second_button_pressed, _x.left_first_button_touched, _x.left_second_button_touched, _x.right_x, _x.right_y, _x.right_trigger, _x.right_grip, _x.right_first_button_pressed, _x.right_second_button_pressed, _x.right_first_button_touched, _x.right_second_button_touched))
115
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
116
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
117
+
118
+ def deserialize(self, str):
119
+ """
120
+ unpack serialized message in str into this message instance
121
+ :param str: byte array of serialized message, ``str``
122
+ """
123
+ if python3:
124
+ codecs.lookup_error("rosmsg").msg_type = self._type
125
+ try:
126
+ end = 0
127
+ _x = self
128
+ start = end
129
+ end += 40
130
+ (_x.left_x, _x.left_y, _x.left_trigger, _x.left_grip, _x.left_first_button_pressed, _x.left_second_button_pressed, _x.left_first_button_touched, _x.left_second_button_touched, _x.right_x, _x.right_y, _x.right_trigger, _x.right_grip, _x.right_first_button_pressed, _x.right_second_button_pressed, _x.right_first_button_touched, _x.right_second_button_touched,) = _get_struct_4f4B4f4B().unpack(str[start:end])
131
+ self.left_first_button_pressed = bool(self.left_first_button_pressed)
132
+ self.left_second_button_pressed = bool(self.left_second_button_pressed)
133
+ self.left_first_button_touched = bool(self.left_first_button_touched)
134
+ self.left_second_button_touched = bool(self.left_second_button_touched)
135
+ self.right_first_button_pressed = bool(self.right_first_button_pressed)
136
+ self.right_second_button_pressed = bool(self.right_second_button_pressed)
137
+ self.right_first_button_touched = bool(self.right_first_button_touched)
138
+ self.right_second_button_touched = bool(self.right_second_button_touched)
139
+ return self
140
+ except struct.error as e:
141
+ raise genpy.DeserializationError(e) # most likely buffer underfill
142
+
143
+
144
+ def serialize_numpy(self, buff, numpy):
145
+ """
146
+ serialize message with numpy array types into buffer
147
+ :param buff: buffer, ``StringIO``
148
+ :param numpy: numpy python module
149
+ """
150
+ try:
151
+ _x = self
152
+ buff.write(_get_struct_4f4B4f4B().pack(_x.left_x, _x.left_y, _x.left_trigger, _x.left_grip, _x.left_first_button_pressed, _x.left_second_button_pressed, _x.left_first_button_touched, _x.left_second_button_touched, _x.right_x, _x.right_y, _x.right_trigger, _x.right_grip, _x.right_first_button_pressed, _x.right_second_button_pressed, _x.right_first_button_touched, _x.right_second_button_touched))
153
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
154
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
155
+
156
+ def deserialize_numpy(self, str, numpy):
157
+ """
158
+ unpack serialized message in str into this message instance using numpy for array types
159
+ :param str: byte array of serialized message, ``str``
160
+ :param numpy: numpy python module
161
+ """
162
+ if python3:
163
+ codecs.lookup_error("rosmsg").msg_type = self._type
164
+ try:
165
+ end = 0
166
+ _x = self
167
+ start = end
168
+ end += 40
169
+ (_x.left_x, _x.left_y, _x.left_trigger, _x.left_grip, _x.left_first_button_pressed, _x.left_second_button_pressed, _x.left_first_button_touched, _x.left_second_button_touched, _x.right_x, _x.right_y, _x.right_trigger, _x.right_grip, _x.right_first_button_pressed, _x.right_second_button_pressed, _x.right_first_button_touched, _x.right_second_button_touched,) = _get_struct_4f4B4f4B().unpack(str[start:end])
170
+ self.left_first_button_pressed = bool(self.left_first_button_pressed)
171
+ self.left_second_button_pressed = bool(self.left_second_button_pressed)
172
+ self.left_first_button_touched = bool(self.left_first_button_touched)
173
+ self.left_second_button_touched = bool(self.left_second_button_touched)
174
+ self.right_first_button_pressed = bool(self.right_first_button_pressed)
175
+ self.right_second_button_pressed = bool(self.right_second_button_pressed)
176
+ self.right_first_button_touched = bool(self.right_first_button_touched)
177
+ self.right_second_button_touched = bool(self.right_second_button_touched)
178
+ return self
179
+ except struct.error as e:
180
+ raise genpy.DeserializationError(e) # most likely buffer underfill
181
+
182
+ _struct_I = genpy.struct_I
183
+ def _get_struct_I():
184
+ global _struct_I
185
+ return _struct_I
186
+ _struct_4f4B4f4B = None
187
+ def _get_struct_4f4B4f4B():
188
+ global _struct_4f4B4f4B
189
+ if _struct_4f4B4f4B is None:
190
+ _struct_4f4B4f4B = struct.Struct("<4f4B4f4B")
191
+ return _struct_4f4B4f4B