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,299 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/getMotorParamRequest.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 getMotorParamRequest(genpy.Message):
11
+ _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
12
+ _type = "kuavo_msgs/getMotorParamRequest"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """"""
15
+ __slots__ = []
16
+ _slot_types = []
17
+
18
+ def __init__(self, *args, **kwds):
19
+ """
20
+ Constructor. Any message fields that are implicitly/explicitly
21
+ set to None will be assigned a default value. The recommend
22
+ use is keyword arguments as this is more robust to future message
23
+ changes. You cannot mix in-order arguments and keyword arguments.
24
+
25
+ The available fields are:
26
+
27
+
28
+ :param args: complete set of field values, in .msg order
29
+ :param kwds: use keyword arguments corresponding to message field names
30
+ to set specific fields.
31
+ """
32
+ if args or kwds:
33
+ super(getMotorParamRequest, self).__init__(*args, **kwds)
34
+
35
+ def _get_types(self):
36
+ """
37
+ internal API method
38
+ """
39
+ return self._slot_types
40
+
41
+ def serialize(self, buff):
42
+ """
43
+ serialize message into buffer
44
+ :param buff: buffer, ``StringIO``
45
+ """
46
+ try:
47
+ pass
48
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
49
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
50
+
51
+ def deserialize(self, str):
52
+ """
53
+ unpack serialized message in str into this message instance
54
+ :param str: byte array of serialized message, ``str``
55
+ """
56
+ if python3:
57
+ codecs.lookup_error("rosmsg").msg_type = self._type
58
+ try:
59
+ end = 0
60
+ return self
61
+ except struct.error as e:
62
+ raise genpy.DeserializationError(e) # most likely buffer underfill
63
+
64
+
65
+ def serialize_numpy(self, buff, numpy):
66
+ """
67
+ serialize message with numpy array types into buffer
68
+ :param buff: buffer, ``StringIO``
69
+ :param numpy: numpy python module
70
+ """
71
+ try:
72
+ pass
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_numpy(self, str, numpy):
77
+ """
78
+ unpack serialized message in str into this message instance using numpy for array types
79
+ :param str: byte array of serialized message, ``str``
80
+ :param numpy: numpy python module
81
+ """
82
+ if python3:
83
+ codecs.lookup_error("rosmsg").msg_type = self._type
84
+ try:
85
+ end = 0
86
+ return self
87
+ except struct.error as e:
88
+ raise genpy.DeserializationError(e) # most likely buffer underfill
89
+
90
+ _struct_I = genpy.struct_I
91
+ def _get_struct_I():
92
+ global _struct_I
93
+ return _struct_I
94
+ # This Python file uses the following encoding: utf-8
95
+ """autogenerated by genpy from kuavo_msgs/getMotorParamResponse.msg. Do not edit."""
96
+ import codecs
97
+ import sys
98
+ python3 = True if sys.hexversion > 0x03000000 else False
99
+ import genpy
100
+ import struct
101
+
102
+ import kuavo_msgs.msg
103
+
104
+ class getMotorParamResponse(genpy.Message):
105
+ _md5sum = "cdd74d158a6c4ad670bc0e368fa8483d"
106
+ _type = "kuavo_msgs/getMotorParamResponse"
107
+ _has_header = False # flag to mark the presence of a Header object
108
+ _full_text = """bool success
109
+ string message
110
+ kuavo_msgs/motorParam[] data
111
+
112
+ ================================================================================
113
+ MSG: kuavo_msgs/motorParam
114
+ float32 Kp
115
+ float32 Kd
116
+ int16 id"""
117
+ __slots__ = ['success','message','data']
118
+ _slot_types = ['bool','string','kuavo_msgs/motorParam[]']
119
+
120
+ def __init__(self, *args, **kwds):
121
+ """
122
+ Constructor. Any message fields that are implicitly/explicitly
123
+ set to None will be assigned a default value. The recommend
124
+ use is keyword arguments as this is more robust to future message
125
+ changes. You cannot mix in-order arguments and keyword arguments.
126
+
127
+ The available fields are:
128
+ success,message,data
129
+
130
+ :param args: complete set of field values, in .msg order
131
+ :param kwds: use keyword arguments corresponding to message field names
132
+ to set specific fields.
133
+ """
134
+ if args or kwds:
135
+ super(getMotorParamResponse, self).__init__(*args, **kwds)
136
+ # message fields cannot be None, assign default values for those that are
137
+ if self.success is None:
138
+ self.success = False
139
+ if self.message is None:
140
+ self.message = ''
141
+ if self.data is None:
142
+ self.data = []
143
+ else:
144
+ self.success = False
145
+ self.message = ''
146
+ self.data = []
147
+
148
+ def _get_types(self):
149
+ """
150
+ internal API method
151
+ """
152
+ return self._slot_types
153
+
154
+ def serialize(self, buff):
155
+ """
156
+ serialize message into buffer
157
+ :param buff: buffer, ``StringIO``
158
+ """
159
+ try:
160
+ _x = self.success
161
+ buff.write(_get_struct_B().pack(_x))
162
+ _x = self.message
163
+ length = len(_x)
164
+ if python3 or type(_x) == unicode:
165
+ _x = _x.encode('utf-8')
166
+ length = len(_x)
167
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
168
+ length = len(self.data)
169
+ buff.write(_struct_I.pack(length))
170
+ for val1 in self.data:
171
+ _x = val1
172
+ buff.write(_get_struct_2fh().pack(_x.Kp, _x.Kd, _x.id))
173
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
174
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
175
+
176
+ def deserialize(self, str):
177
+ """
178
+ unpack serialized message in str into this message instance
179
+ :param str: byte array of serialized message, ``str``
180
+ """
181
+ if python3:
182
+ codecs.lookup_error("rosmsg").msg_type = self._type
183
+ try:
184
+ if self.data is None:
185
+ self.data = None
186
+ end = 0
187
+ start = end
188
+ end += 1
189
+ (self.success,) = _get_struct_B().unpack(str[start:end])
190
+ self.success = bool(self.success)
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.message = str[start:end].decode('utf-8', 'rosmsg')
198
+ else:
199
+ self.message = str[start:end]
200
+ start = end
201
+ end += 4
202
+ (length,) = _struct_I.unpack(str[start:end])
203
+ self.data = []
204
+ for i in range(0, length):
205
+ val1 = kuavo_msgs.msg.motorParam()
206
+ _x = val1
207
+ start = end
208
+ end += 10
209
+ (_x.Kp, _x.Kd, _x.id,) = _get_struct_2fh().unpack(str[start:end])
210
+ self.data.append(val1)
211
+ return self
212
+ except struct.error as e:
213
+ raise genpy.DeserializationError(e) # most likely buffer underfill
214
+
215
+
216
+ def serialize_numpy(self, buff, numpy):
217
+ """
218
+ serialize message with numpy array types into buffer
219
+ :param buff: buffer, ``StringIO``
220
+ :param numpy: numpy python module
221
+ """
222
+ try:
223
+ _x = self.success
224
+ buff.write(_get_struct_B().pack(_x))
225
+ _x = self.message
226
+ length = len(_x)
227
+ if python3 or type(_x) == unicode:
228
+ _x = _x.encode('utf-8')
229
+ length = len(_x)
230
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
231
+ length = len(self.data)
232
+ buff.write(_struct_I.pack(length))
233
+ for val1 in self.data:
234
+ _x = val1
235
+ buff.write(_get_struct_2fh().pack(_x.Kp, _x.Kd, _x.id))
236
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
237
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
238
+
239
+ def deserialize_numpy(self, str, numpy):
240
+ """
241
+ unpack serialized message in str into this message instance using numpy for array types
242
+ :param str: byte array of serialized message, ``str``
243
+ :param numpy: numpy python module
244
+ """
245
+ if python3:
246
+ codecs.lookup_error("rosmsg").msg_type = self._type
247
+ try:
248
+ if self.data is None:
249
+ self.data = None
250
+ end = 0
251
+ start = end
252
+ end += 1
253
+ (self.success,) = _get_struct_B().unpack(str[start:end])
254
+ self.success = bool(self.success)
255
+ start = end
256
+ end += 4
257
+ (length,) = _struct_I.unpack(str[start:end])
258
+ start = end
259
+ end += length
260
+ if python3:
261
+ self.message = str[start:end].decode('utf-8', 'rosmsg')
262
+ else:
263
+ self.message = str[start:end]
264
+ start = end
265
+ end += 4
266
+ (length,) = _struct_I.unpack(str[start:end])
267
+ self.data = []
268
+ for i in range(0, length):
269
+ val1 = kuavo_msgs.msg.motorParam()
270
+ _x = val1
271
+ start = end
272
+ end += 10
273
+ (_x.Kp, _x.Kd, _x.id,) = _get_struct_2fh().unpack(str[start:end])
274
+ self.data.append(val1)
275
+ return self
276
+ except struct.error as e:
277
+ raise genpy.DeserializationError(e) # most likely buffer underfill
278
+
279
+ _struct_I = genpy.struct_I
280
+ def _get_struct_I():
281
+ global _struct_I
282
+ return _struct_I
283
+ _struct_2fh = None
284
+ def _get_struct_2fh():
285
+ global _struct_2fh
286
+ if _struct_2fh is None:
287
+ _struct_2fh = struct.Struct("<2fh")
288
+ return _struct_2fh
289
+ _struct_B = None
290
+ def _get_struct_B():
291
+ global _struct_B
292
+ if _struct_B is None:
293
+ _struct_B = struct.Struct("<B")
294
+ return _struct_B
295
+ class getMotorParam(object):
296
+ _type = 'kuavo_msgs/getMotorParam'
297
+ _md5sum = 'cdd74d158a6c4ad670bc0e368fa8483d'
298
+ _request_class = getMotorParamRequest
299
+ _response_class = getMotorParamResponse
@@ -0,0 +1,330 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/handForceLevelRequest.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 handForceLevelRequest(genpy.Message):
11
+ _md5sum = "5311779bc3f9aed0d69c0597dc982fd7"
12
+ _type = "kuavo_msgs/handForceLevelRequest"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """# This service sets the force level for the Dexhand.
15
+ # It is used to control the force applied by the Dexhand.
16
+ #
17
+ # Request:
18
+ # int8 SMALL = 0 # Small force level.
19
+ # int8 NORMAL = 1 # Normal force level.
20
+ # int8 FULL = 2 # Full force level.
21
+ # int8 force_level # The desired force level to set.
22
+ #
23
+ # Response:
24
+ # bool success # Indicates whether the request was successful.
25
+ # string message # A message indicating the result of the request.
26
+
27
+ int8 SMALL = 0
28
+ int8 NORMAL = 1
29
+ int8 FULL = 2
30
+
31
+ int8 LEFT_HAND=0
32
+ int8 RIGHT_HAND=1
33
+ int8 BOTH_HANDS=2
34
+
35
+ int8 force_level
36
+ int8 hand_side
37
+ """
38
+ # Pseudo-constants
39
+ SMALL = 0
40
+ NORMAL = 1
41
+ FULL = 2
42
+ LEFT_HAND = 0
43
+ RIGHT_HAND = 1
44
+ BOTH_HANDS = 2
45
+
46
+ __slots__ = ['force_level','hand_side']
47
+ _slot_types = ['int8','int8']
48
+
49
+ def __init__(self, *args, **kwds):
50
+ """
51
+ Constructor. Any message fields that are implicitly/explicitly
52
+ set to None will be assigned a default value. The recommend
53
+ use is keyword arguments as this is more robust to future message
54
+ changes. You cannot mix in-order arguments and keyword arguments.
55
+
56
+ The available fields are:
57
+ force_level,hand_side
58
+
59
+ :param args: complete set of field values, in .msg order
60
+ :param kwds: use keyword arguments corresponding to message field names
61
+ to set specific fields.
62
+ """
63
+ if args or kwds:
64
+ super(handForceLevelRequest, self).__init__(*args, **kwds)
65
+ # message fields cannot be None, assign default values for those that are
66
+ if self.force_level is None:
67
+ self.force_level = 0
68
+ if self.hand_side is None:
69
+ self.hand_side = 0
70
+ else:
71
+ self.force_level = 0
72
+ self.hand_side = 0
73
+
74
+ def _get_types(self):
75
+ """
76
+ internal API method
77
+ """
78
+ return self._slot_types
79
+
80
+ def serialize(self, buff):
81
+ """
82
+ serialize message into buffer
83
+ :param buff: buffer, ``StringIO``
84
+ """
85
+ try:
86
+ _x = self
87
+ buff.write(_get_struct_2b().pack(_x.force_level, _x.hand_side))
88
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
89
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
90
+
91
+ def deserialize(self, str):
92
+ """
93
+ unpack serialized message in str into this message instance
94
+ :param str: byte array of serialized message, ``str``
95
+ """
96
+ if python3:
97
+ codecs.lookup_error("rosmsg").msg_type = self._type
98
+ try:
99
+ end = 0
100
+ _x = self
101
+ start = end
102
+ end += 2
103
+ (_x.force_level, _x.hand_side,) = _get_struct_2b().unpack(str[start:end])
104
+ return self
105
+ except struct.error as e:
106
+ raise genpy.DeserializationError(e) # most likely buffer underfill
107
+
108
+
109
+ def serialize_numpy(self, buff, numpy):
110
+ """
111
+ serialize message with numpy array types into buffer
112
+ :param buff: buffer, ``StringIO``
113
+ :param numpy: numpy python module
114
+ """
115
+ try:
116
+ _x = self
117
+ buff.write(_get_struct_2b().pack(_x.force_level, _x.hand_side))
118
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
119
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
120
+
121
+ def deserialize_numpy(self, str, numpy):
122
+ """
123
+ unpack serialized message in str into this message instance using numpy for array types
124
+ :param str: byte array of serialized message, ``str``
125
+ :param numpy: numpy python module
126
+ """
127
+ if python3:
128
+ codecs.lookup_error("rosmsg").msg_type = self._type
129
+ try:
130
+ end = 0
131
+ _x = self
132
+ start = end
133
+ end += 2
134
+ (_x.force_level, _x.hand_side,) = _get_struct_2b().unpack(str[start:end])
135
+ return self
136
+ except struct.error as e:
137
+ raise genpy.DeserializationError(e) # most likely buffer underfill
138
+
139
+ _struct_I = genpy.struct_I
140
+ def _get_struct_I():
141
+ global _struct_I
142
+ return _struct_I
143
+ _struct_2b = None
144
+ def _get_struct_2b():
145
+ global _struct_2b
146
+ if _struct_2b is None:
147
+ _struct_2b = struct.Struct("<2b")
148
+ return _struct_2b
149
+ # This Python file uses the following encoding: utf-8
150
+ """autogenerated by genpy from kuavo_msgs/handForceLevelResponse.msg. Do not edit."""
151
+ import codecs
152
+ import sys
153
+ python3 = True if sys.hexversion > 0x03000000 else False
154
+ import genpy
155
+ import struct
156
+
157
+
158
+ class handForceLevelResponse(genpy.Message):
159
+ _md5sum = "77e365aa913b429c04069f41b0a0fea7"
160
+ _type = "kuavo_msgs/handForceLevelResponse"
161
+ _has_header = False # flag to mark the presence of a Header object
162
+ _full_text = """bool success
163
+ string message
164
+ int8[] force_level
165
+ """
166
+ __slots__ = ['success','message','force_level']
167
+ _slot_types = ['bool','string','int8[]']
168
+
169
+ def __init__(self, *args, **kwds):
170
+ """
171
+ Constructor. Any message fields that are implicitly/explicitly
172
+ set to None will be assigned a default value. The recommend
173
+ use is keyword arguments as this is more robust to future message
174
+ changes. You cannot mix in-order arguments and keyword arguments.
175
+
176
+ The available fields are:
177
+ success,message,force_level
178
+
179
+ :param args: complete set of field values, in .msg order
180
+ :param kwds: use keyword arguments corresponding to message field names
181
+ to set specific fields.
182
+ """
183
+ if args or kwds:
184
+ super(handForceLevelResponse, self).__init__(*args, **kwds)
185
+ # message fields cannot be None, assign default values for those that are
186
+ if self.success is None:
187
+ self.success = False
188
+ if self.message is None:
189
+ self.message = ''
190
+ if self.force_level is None:
191
+ self.force_level = []
192
+ else:
193
+ self.success = False
194
+ self.message = ''
195
+ self.force_level = []
196
+
197
+ def _get_types(self):
198
+ """
199
+ internal API method
200
+ """
201
+ return self._slot_types
202
+
203
+ def serialize(self, buff):
204
+ """
205
+ serialize message into buffer
206
+ :param buff: buffer, ``StringIO``
207
+ """
208
+ try:
209
+ _x = self.success
210
+ buff.write(_get_struct_B().pack(_x))
211
+ _x = self.message
212
+ length = len(_x)
213
+ if python3 or type(_x) == unicode:
214
+ _x = _x.encode('utf-8')
215
+ length = len(_x)
216
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
217
+ length = len(self.force_level)
218
+ buff.write(_struct_I.pack(length))
219
+ pattern = '<%sb'%length
220
+ buff.write(struct.Struct(pattern).pack(*self.force_level))
221
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
222
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
223
+
224
+ def deserialize(self, str):
225
+ """
226
+ unpack serialized message in str into this message instance
227
+ :param str: byte array of serialized message, ``str``
228
+ """
229
+ if python3:
230
+ codecs.lookup_error("rosmsg").msg_type = self._type
231
+ try:
232
+ end = 0
233
+ start = end
234
+ end += 1
235
+ (self.success,) = _get_struct_B().unpack(str[start:end])
236
+ self.success = bool(self.success)
237
+ start = end
238
+ end += 4
239
+ (length,) = _struct_I.unpack(str[start:end])
240
+ start = end
241
+ end += length
242
+ if python3:
243
+ self.message = str[start:end].decode('utf-8', 'rosmsg')
244
+ else:
245
+ self.message = str[start:end]
246
+ start = end
247
+ end += 4
248
+ (length,) = _struct_I.unpack(str[start:end])
249
+ pattern = '<%sb'%length
250
+ start = end
251
+ s = struct.Struct(pattern)
252
+ end += s.size
253
+ self.force_level = s.unpack(str[start:end])
254
+ return self
255
+ except struct.error as e:
256
+ raise genpy.DeserializationError(e) # most likely buffer underfill
257
+
258
+
259
+ def serialize_numpy(self, buff, numpy):
260
+ """
261
+ serialize message with numpy array types into buffer
262
+ :param buff: buffer, ``StringIO``
263
+ :param numpy: numpy python module
264
+ """
265
+ try:
266
+ _x = self.success
267
+ buff.write(_get_struct_B().pack(_x))
268
+ _x = self.message
269
+ length = len(_x)
270
+ if python3 or type(_x) == unicode:
271
+ _x = _x.encode('utf-8')
272
+ length = len(_x)
273
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
274
+ length = len(self.force_level)
275
+ buff.write(_struct_I.pack(length))
276
+ pattern = '<%sb'%length
277
+ buff.write(self.force_level.tostring())
278
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
279
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
280
+
281
+ def deserialize_numpy(self, str, numpy):
282
+ """
283
+ unpack serialized message in str into this message instance using numpy for array types
284
+ :param str: byte array of serialized message, ``str``
285
+ :param numpy: numpy python module
286
+ """
287
+ if python3:
288
+ codecs.lookup_error("rosmsg").msg_type = self._type
289
+ try:
290
+ end = 0
291
+ start = end
292
+ end += 1
293
+ (self.success,) = _get_struct_B().unpack(str[start:end])
294
+ self.success = bool(self.success)
295
+ start = end
296
+ end += 4
297
+ (length,) = _struct_I.unpack(str[start:end])
298
+ start = end
299
+ end += length
300
+ if python3:
301
+ self.message = str[start:end].decode('utf-8', 'rosmsg')
302
+ else:
303
+ self.message = str[start:end]
304
+ start = end
305
+ end += 4
306
+ (length,) = _struct_I.unpack(str[start:end])
307
+ pattern = '<%sb'%length
308
+ start = end
309
+ s = struct.Struct(pattern)
310
+ end += s.size
311
+ self.force_level = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length)
312
+ return self
313
+ except struct.error as e:
314
+ raise genpy.DeserializationError(e) # most likely buffer underfill
315
+
316
+ _struct_I = genpy.struct_I
317
+ def _get_struct_I():
318
+ global _struct_I
319
+ return _struct_I
320
+ _struct_B = None
321
+ def _get_struct_B():
322
+ global _struct_B
323
+ if _struct_B is None:
324
+ _struct_B = struct.Struct("<B")
325
+ return _struct_B
326
+ class handForceLevel(object):
327
+ _type = 'kuavo_msgs/handForceLevel'
328
+ _md5sum = '0f6c4fd291557ab445334f0487fbaf78'
329
+ _request_class = handForceLevelRequest
330
+ _response_class = handForceLevelResponse