kuavo-humanoid-sdk 1.1.8__20250626181214-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 (132) 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/_Metadata.py +199 -0
  41. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_RobotActionState.py +112 -0
  42. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_TFArray.py +323 -0
  43. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/__init__.py +44 -0
  44. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armHandPose.py +160 -0
  45. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armPoseWithTimeStamp.py +168 -0
  46. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_armTargetPoses.py +151 -0
  47. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_bezierCurveCubicPoint.py +178 -0
  48. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_dexhandCommand.py +229 -0
  49. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_dexhandTouchState.py +256 -0
  50. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_endEffectorData.py +227 -0
  51. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPose.py +123 -0
  52. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoseTargetTrajectories.py +301 -0
  53. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_footPoses.py +149 -0
  54. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_fullBodyTargetTrajectories.py +258 -0
  55. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gaitTimeName.py +147 -0
  56. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gestureInfo.py +218 -0
  57. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_gestureTask.py +149 -0
  58. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_handPose.py +136 -0
  59. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_headBodyPose.py +145 -0
  60. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_ikSolveError.py +171 -0
  61. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_ikSolveParam.py +140 -0
  62. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_imuData.py +165 -0
  63. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointBezierTrajectory.py +201 -0
  64. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointCmd.py +390 -0
  65. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_jointData.py +205 -0
  66. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_lejuClawCommand.py +320 -0
  67. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_lejuClawState.py +341 -0
  68. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_motorParam.py +122 -0
  69. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_planArmState.py +120 -0
  70. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_questJoySticks.py +191 -0
  71. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_qv.py +121 -0
  72. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotArmQVVD.py +177 -0
  73. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotHandPosition.py +225 -0
  74. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotHeadMotionData.py +128 -0
  75. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_robotState.py +222 -0
  76. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_sensorsData.py +495 -0
  77. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_switchGaitByName.py +200 -0
  78. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_touchSensorStatus.py +162 -0
  79. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPose.py +272 -0
  80. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_twoArmHandPoseCmd.py +315 -0
  81. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_yoloDetection.py +251 -0
  82. kuavo_humanoid_sdk/msg/kuavo_msgs/msg/_yoloOutputData.py +168 -0
  83. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_ExecuteArmAction.py +281 -0
  84. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_RepublishTFs.py +373 -0
  85. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SetJoyTopic.py +282 -0
  86. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_SpeechSynthesis.py +270 -0
  87. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/__init__.py +28 -0
  88. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeArmCtrlMode.py +275 -0
  89. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeArmCtrlModeKuavo.py +236 -0
  90. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeMotorParam.py +299 -0
  91. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_changeTorsoCtrlMode.py +274 -0
  92. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_controlLejuClaw.py +408 -0
  93. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_enableHandTouchSensor.py +304 -0
  94. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_fkSrv.py +394 -0
  95. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_footPoseTargetTrajectoriesSrv.py +409 -0
  96. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureExecute.py +339 -0
  97. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureExecuteState.py +257 -0
  98. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_gestureList.py +418 -0
  99. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_getCurrentGaitName.py +253 -0
  100. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_getMotorParam.py +299 -0
  101. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_handForceLevel.py +330 -0
  102. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_jointMoveTo.py +302 -0
  103. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_planArmTrajectoryBezierCurve.py +421 -0
  104. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_planArmTrajectoryCubicSpline.py +490 -0
  105. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_playmusic.py +268 -0
  106. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setHwIntialState.py +304 -0
  107. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setMmCtrlFrame.py +273 -0
  108. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setMotorEncoderRoundService.py +283 -0
  109. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_setTagId.py +275 -0
  110. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_singleStepControl.py +444 -0
  111. kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_twoArmHandPoseCmdSrv.py +662 -0
  112. kuavo_humanoid_sdk/msg/motion_capture_ik/__init__.py +7 -0
  113. kuavo_humanoid_sdk/msg/ocs2_msgs/__init__.py +7 -0
  114. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/__init__.py +12 -0
  115. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_constraint.py +142 -0
  116. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_controller_data.py +121 -0
  117. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_lagrangian_metrics.py +148 -0
  118. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mode_schedule.py +150 -0
  119. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_flattened_controller.py +666 -0
  120. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_input.py +122 -0
  121. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_observation.py +209 -0
  122. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_performance_indices.py +140 -0
  123. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_solver_data.py +886 -0
  124. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_state.py +122 -0
  125. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_mpc_target_trajectories.py +239 -0
  126. kuavo_humanoid_sdk/msg/ocs2_msgs/msg/_multiplier.py +148 -0
  127. kuavo_humanoid_sdk/msg/ocs2_msgs/srv/__init__.py +1 -0
  128. kuavo_humanoid_sdk/msg/ocs2_msgs/srv/_reset.py +376 -0
  129. kuavo_humanoid_sdk-1.1.8.dist-info/METADATA +291 -0
  130. kuavo_humanoid_sdk-1.1.8.dist-info/RECORD +132 -0
  131. kuavo_humanoid_sdk-1.1.8.dist-info/WHEEL +6 -0
  132. kuavo_humanoid_sdk-1.1.8.dist-info/top_level.txt +1 -0
@@ -0,0 +1,320 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/lejuClawCommand.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 kuavo_msgs.msg
10
+ import std_msgs.msg
11
+
12
+ class lejuClawCommand(genpy.Message):
13
+ _md5sum = "57c40e80f90e7a289ae0b2488552e043"
14
+ _type = "kuavo_msgs/lejuClawCommand"
15
+ _has_header = True # flag to mark the presence of a Header object
16
+ _full_text = """# kuavo_msgs/endEffectorData:
17
+ # string[] name
18
+ # float64[] position
19
+ # float64[] velocity
20
+ # float64[] effort
21
+ #
22
+ # ** For the Topic Notes **
23
+ #
24
+ # name : 'left_claw' , 'right_claw'
25
+ # position : 0 ~ 100, the percentage of the claw's opening angle
26
+ # 0: closed, 100: open
27
+ # velocity : 0 ~ 100, if size is 0, will use default `50.0`.
28
+ # effort : torque/current, better 1A ~ 2A, if size is 0, will use default `1.0`.
29
+ #
30
+ # ** Example **
31
+ # data:
32
+ # - name: ['left_claw', 'right_claw']
33
+ # position: [20.0, 20.0]
34
+ # velocity: [50.0, 50.0]
35
+ # effort: [1.0, 1.0]
36
+
37
+ std_msgs/Header header
38
+ kuavo_msgs/endEffectorData data
39
+ ================================================================================
40
+ MSG: std_msgs/Header
41
+ # Standard metadata for higher-level stamped data types.
42
+ # This is generally used to communicate timestamped data
43
+ # in a particular coordinate frame.
44
+ #
45
+ # sequence ID: consecutively increasing ID
46
+ uint32 seq
47
+ #Two-integer timestamp that is expressed as:
48
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
49
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
50
+ # time-handling sugar is provided by the client library
51
+ time stamp
52
+ #Frame this data is associated with
53
+ string frame_id
54
+
55
+ ================================================================================
56
+ MSG: kuavo_msgs/endEffectorData
57
+ string[] name
58
+ float64[] position
59
+ float64[] velocity
60
+ float64[] effort
61
+ """
62
+ __slots__ = ['header','data']
63
+ _slot_types = ['std_msgs/Header','kuavo_msgs/endEffectorData']
64
+
65
+ def __init__(self, *args, **kwds):
66
+ """
67
+ Constructor. Any message fields that are implicitly/explicitly
68
+ set to None will be assigned a default value. The recommend
69
+ use is keyword arguments as this is more robust to future message
70
+ changes. You cannot mix in-order arguments and keyword arguments.
71
+
72
+ The available fields are:
73
+ header,data
74
+
75
+ :param args: complete set of field values, in .msg order
76
+ :param kwds: use keyword arguments corresponding to message field names
77
+ to set specific fields.
78
+ """
79
+ if args or kwds:
80
+ super(lejuClawCommand, self).__init__(*args, **kwds)
81
+ # message fields cannot be None, assign default values for those that are
82
+ if self.header is None:
83
+ self.header = std_msgs.msg.Header()
84
+ if self.data is None:
85
+ self.data = kuavo_msgs.msg.endEffectorData()
86
+ else:
87
+ self.header = std_msgs.msg.Header()
88
+ self.data = kuavo_msgs.msg.endEffectorData()
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
+ length = len(self.data.name)
111
+ buff.write(_struct_I.pack(length))
112
+ for val1 in self.data.name:
113
+ length = len(val1)
114
+ if python3 or type(val1) == unicode:
115
+ val1 = val1.encode('utf-8')
116
+ length = len(val1)
117
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
118
+ length = len(self.data.position)
119
+ buff.write(_struct_I.pack(length))
120
+ pattern = '<%sd'%length
121
+ buff.write(struct.Struct(pattern).pack(*self.data.position))
122
+ length = len(self.data.velocity)
123
+ buff.write(_struct_I.pack(length))
124
+ pattern = '<%sd'%length
125
+ buff.write(struct.Struct(pattern).pack(*self.data.velocity))
126
+ length = len(self.data.effort)
127
+ buff.write(_struct_I.pack(length))
128
+ pattern = '<%sd'%length
129
+ buff.write(struct.Struct(pattern).pack(*self.data.effort))
130
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
131
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
132
+
133
+ def deserialize(self, str):
134
+ """
135
+ unpack serialized message in str into this message instance
136
+ :param str: byte array of serialized message, ``str``
137
+ """
138
+ if python3:
139
+ codecs.lookup_error("rosmsg").msg_type = self._type
140
+ try:
141
+ if self.header is None:
142
+ self.header = std_msgs.msg.Header()
143
+ if self.data is None:
144
+ self.data = kuavo_msgs.msg.endEffectorData()
145
+ end = 0
146
+ _x = self
147
+ start = end
148
+ end += 12
149
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
150
+ start = end
151
+ end += 4
152
+ (length,) = _struct_I.unpack(str[start:end])
153
+ start = end
154
+ end += length
155
+ if python3:
156
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
157
+ else:
158
+ self.header.frame_id = str[start:end]
159
+ start = end
160
+ end += 4
161
+ (length,) = _struct_I.unpack(str[start:end])
162
+ self.data.name = []
163
+ for i in range(0, length):
164
+ start = end
165
+ end += 4
166
+ (length,) = _struct_I.unpack(str[start:end])
167
+ start = end
168
+ end += length
169
+ if python3:
170
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
171
+ else:
172
+ val1 = str[start:end]
173
+ self.data.name.append(val1)
174
+ start = end
175
+ end += 4
176
+ (length,) = _struct_I.unpack(str[start:end])
177
+ pattern = '<%sd'%length
178
+ start = end
179
+ s = struct.Struct(pattern)
180
+ end += s.size
181
+ self.data.position = s.unpack(str[start:end])
182
+ start = end
183
+ end += 4
184
+ (length,) = _struct_I.unpack(str[start:end])
185
+ pattern = '<%sd'%length
186
+ start = end
187
+ s = struct.Struct(pattern)
188
+ end += s.size
189
+ self.data.velocity = s.unpack(str[start:end])
190
+ start = end
191
+ end += 4
192
+ (length,) = _struct_I.unpack(str[start:end])
193
+ pattern = '<%sd'%length
194
+ start = end
195
+ s = struct.Struct(pattern)
196
+ end += s.size
197
+ self.data.effort = s.unpack(str[start:end])
198
+ return self
199
+ except struct.error as e:
200
+ raise genpy.DeserializationError(e) # most likely buffer underfill
201
+
202
+
203
+ def serialize_numpy(self, buff, numpy):
204
+ """
205
+ serialize message with numpy array types into buffer
206
+ :param buff: buffer, ``StringIO``
207
+ :param numpy: numpy python module
208
+ """
209
+ try:
210
+ _x = self
211
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
212
+ _x = self.header.frame_id
213
+ length = len(_x)
214
+ if python3 or type(_x) == unicode:
215
+ _x = _x.encode('utf-8')
216
+ length = len(_x)
217
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
218
+ length = len(self.data.name)
219
+ buff.write(_struct_I.pack(length))
220
+ for val1 in self.data.name:
221
+ length = len(val1)
222
+ if python3 or type(val1) == unicode:
223
+ val1 = val1.encode('utf-8')
224
+ length = len(val1)
225
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
226
+ length = len(self.data.position)
227
+ buff.write(_struct_I.pack(length))
228
+ pattern = '<%sd'%length
229
+ buff.write(self.data.position.tostring())
230
+ length = len(self.data.velocity)
231
+ buff.write(_struct_I.pack(length))
232
+ pattern = '<%sd'%length
233
+ buff.write(self.data.velocity.tostring())
234
+ length = len(self.data.effort)
235
+ buff.write(_struct_I.pack(length))
236
+ pattern = '<%sd'%length
237
+ buff.write(self.data.effort.tostring())
238
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
239
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
240
+
241
+ def deserialize_numpy(self, str, numpy):
242
+ """
243
+ unpack serialized message in str into this message instance using numpy for array types
244
+ :param str: byte array of serialized message, ``str``
245
+ :param numpy: numpy python module
246
+ """
247
+ if python3:
248
+ codecs.lookup_error("rosmsg").msg_type = self._type
249
+ try:
250
+ if self.header is None:
251
+ self.header = std_msgs.msg.Header()
252
+ if self.data is None:
253
+ self.data = kuavo_msgs.msg.endEffectorData()
254
+ end = 0
255
+ _x = self
256
+ start = end
257
+ end += 12
258
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
259
+ start = end
260
+ end += 4
261
+ (length,) = _struct_I.unpack(str[start:end])
262
+ start = end
263
+ end += length
264
+ if python3:
265
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
266
+ else:
267
+ self.header.frame_id = str[start:end]
268
+ start = end
269
+ end += 4
270
+ (length,) = _struct_I.unpack(str[start:end])
271
+ self.data.name = []
272
+ for i in range(0, length):
273
+ start = end
274
+ end += 4
275
+ (length,) = _struct_I.unpack(str[start:end])
276
+ start = end
277
+ end += length
278
+ if python3:
279
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
280
+ else:
281
+ val1 = str[start:end]
282
+ self.data.name.append(val1)
283
+ start = end
284
+ end += 4
285
+ (length,) = _struct_I.unpack(str[start:end])
286
+ pattern = '<%sd'%length
287
+ start = end
288
+ s = struct.Struct(pattern)
289
+ end += s.size
290
+ self.data.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
291
+ start = end
292
+ end += 4
293
+ (length,) = _struct_I.unpack(str[start:end])
294
+ pattern = '<%sd'%length
295
+ start = end
296
+ s = struct.Struct(pattern)
297
+ end += s.size
298
+ self.data.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
299
+ start = end
300
+ end += 4
301
+ (length,) = _struct_I.unpack(str[start:end])
302
+ pattern = '<%sd'%length
303
+ start = end
304
+ s = struct.Struct(pattern)
305
+ end += s.size
306
+ self.data.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
307
+ return self
308
+ except struct.error as e:
309
+ raise genpy.DeserializationError(e) # most likely buffer underfill
310
+
311
+ _struct_I = genpy.struct_I
312
+ def _get_struct_I():
313
+ global _struct_I
314
+ return _struct_I
315
+ _struct_3I = None
316
+ def _get_struct_3I():
317
+ global _struct_3I
318
+ if _struct_3I is None:
319
+ _struct_3I = struct.Struct("<3I")
320
+ return _struct_3I
@@ -0,0 +1,341 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/lejuClawState.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 kuavo_msgs.msg
10
+ import std_msgs.msg
11
+
12
+ class lejuClawState(genpy.Message):
13
+ _md5sum = "71c0eb8f4803a00f5667de51a2f70aac"
14
+ _type = "kuavo_msgs/lejuClawState"
15
+ _has_header = True # flag to mark the presence of a Header object
16
+ _full_text = """std_msgs/Header header
17
+
18
+ int8 kError = -1
19
+ int8 kUnknown = 0
20
+ int8 kMoving = 1
21
+ int8 kReached = 2
22
+ int8 kGrabbed = 3
23
+
24
+ int8[] state # 0:; left; 1: right
25
+ kuavo_msgs/endEffectorData data
26
+ ================================================================================
27
+ MSG: std_msgs/Header
28
+ # Standard metadata for higher-level stamped data types.
29
+ # This is generally used to communicate timestamped data
30
+ # in a particular coordinate frame.
31
+ #
32
+ # sequence ID: consecutively increasing ID
33
+ uint32 seq
34
+ #Two-integer timestamp that is expressed as:
35
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
36
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
37
+ # time-handling sugar is provided by the client library
38
+ time stamp
39
+ #Frame this data is associated with
40
+ string frame_id
41
+
42
+ ================================================================================
43
+ MSG: kuavo_msgs/endEffectorData
44
+ string[] name
45
+ float64[] position
46
+ float64[] velocity
47
+ float64[] effort
48
+ """
49
+ # Pseudo-constants
50
+ kError = -1
51
+ kUnknown = 0
52
+ kMoving = 1
53
+ kReached = 2
54
+ kGrabbed = 3
55
+
56
+ __slots__ = ['header','state','data']
57
+ _slot_types = ['std_msgs/Header','int8[]','kuavo_msgs/endEffectorData']
58
+
59
+ def __init__(self, *args, **kwds):
60
+ """
61
+ Constructor. Any message fields that are implicitly/explicitly
62
+ set to None will be assigned a default value. The recommend
63
+ use is keyword arguments as this is more robust to future message
64
+ changes. You cannot mix in-order arguments and keyword arguments.
65
+
66
+ The available fields are:
67
+ header,state,data
68
+
69
+ :param args: complete set of field values, in .msg order
70
+ :param kwds: use keyword arguments corresponding to message field names
71
+ to set specific fields.
72
+ """
73
+ if args or kwds:
74
+ super(lejuClawState, self).__init__(*args, **kwds)
75
+ # message fields cannot be None, assign default values for those that are
76
+ if self.header is None:
77
+ self.header = std_msgs.msg.Header()
78
+ if self.state is None:
79
+ self.state = []
80
+ if self.data is None:
81
+ self.data = kuavo_msgs.msg.endEffectorData()
82
+ else:
83
+ self.header = std_msgs.msg.Header()
84
+ self.state = []
85
+ self.data = kuavo_msgs.msg.endEffectorData()
86
+
87
+ def _get_types(self):
88
+ """
89
+ internal API method
90
+ """
91
+ return self._slot_types
92
+
93
+ def serialize(self, buff):
94
+ """
95
+ serialize message into buffer
96
+ :param buff: buffer, ``StringIO``
97
+ """
98
+ try:
99
+ _x = self
100
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
101
+ _x = self.header.frame_id
102
+ length = len(_x)
103
+ if python3 or type(_x) == unicode:
104
+ _x = _x.encode('utf-8')
105
+ length = len(_x)
106
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
107
+ length = len(self.state)
108
+ buff.write(_struct_I.pack(length))
109
+ pattern = '<%sb'%length
110
+ buff.write(struct.Struct(pattern).pack(*self.state))
111
+ length = len(self.data.name)
112
+ buff.write(_struct_I.pack(length))
113
+ for val1 in self.data.name:
114
+ length = len(val1)
115
+ if python3 or type(val1) == unicode:
116
+ val1 = val1.encode('utf-8')
117
+ length = len(val1)
118
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
119
+ length = len(self.data.position)
120
+ buff.write(_struct_I.pack(length))
121
+ pattern = '<%sd'%length
122
+ buff.write(struct.Struct(pattern).pack(*self.data.position))
123
+ length = len(self.data.velocity)
124
+ buff.write(_struct_I.pack(length))
125
+ pattern = '<%sd'%length
126
+ buff.write(struct.Struct(pattern).pack(*self.data.velocity))
127
+ length = len(self.data.effort)
128
+ buff.write(_struct_I.pack(length))
129
+ pattern = '<%sd'%length
130
+ buff.write(struct.Struct(pattern).pack(*self.data.effort))
131
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
132
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
133
+
134
+ def deserialize(self, str):
135
+ """
136
+ unpack serialized message in str into this message instance
137
+ :param str: byte array of serialized message, ``str``
138
+ """
139
+ if python3:
140
+ codecs.lookup_error("rosmsg").msg_type = self._type
141
+ try:
142
+ if self.header is None:
143
+ self.header = std_msgs.msg.Header()
144
+ if self.data is None:
145
+ self.data = kuavo_msgs.msg.endEffectorData()
146
+ end = 0
147
+ _x = self
148
+ start = end
149
+ end += 12
150
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
151
+ start = end
152
+ end += 4
153
+ (length,) = _struct_I.unpack(str[start:end])
154
+ start = end
155
+ end += length
156
+ if python3:
157
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
158
+ else:
159
+ self.header.frame_id = str[start:end]
160
+ start = end
161
+ end += 4
162
+ (length,) = _struct_I.unpack(str[start:end])
163
+ pattern = '<%sb'%length
164
+ start = end
165
+ s = struct.Struct(pattern)
166
+ end += s.size
167
+ self.state = s.unpack(str[start:end])
168
+ start = end
169
+ end += 4
170
+ (length,) = _struct_I.unpack(str[start:end])
171
+ self.data.name = []
172
+ for i in range(0, length):
173
+ start = end
174
+ end += 4
175
+ (length,) = _struct_I.unpack(str[start:end])
176
+ start = end
177
+ end += length
178
+ if python3:
179
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
180
+ else:
181
+ val1 = str[start:end]
182
+ self.data.name.append(val1)
183
+ start = end
184
+ end += 4
185
+ (length,) = _struct_I.unpack(str[start:end])
186
+ pattern = '<%sd'%length
187
+ start = end
188
+ s = struct.Struct(pattern)
189
+ end += s.size
190
+ self.data.position = s.unpack(str[start:end])
191
+ start = end
192
+ end += 4
193
+ (length,) = _struct_I.unpack(str[start:end])
194
+ pattern = '<%sd'%length
195
+ start = end
196
+ s = struct.Struct(pattern)
197
+ end += s.size
198
+ self.data.velocity = s.unpack(str[start:end])
199
+ start = end
200
+ end += 4
201
+ (length,) = _struct_I.unpack(str[start:end])
202
+ pattern = '<%sd'%length
203
+ start = end
204
+ s = struct.Struct(pattern)
205
+ end += s.size
206
+ self.data.effort = s.unpack(str[start:end])
207
+ return self
208
+ except struct.error as e:
209
+ raise genpy.DeserializationError(e) # most likely buffer underfill
210
+
211
+
212
+ def serialize_numpy(self, buff, numpy):
213
+ """
214
+ serialize message with numpy array types into buffer
215
+ :param buff: buffer, ``StringIO``
216
+ :param numpy: numpy python module
217
+ """
218
+ try:
219
+ _x = self
220
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
221
+ _x = self.header.frame_id
222
+ length = len(_x)
223
+ if python3 or type(_x) == unicode:
224
+ _x = _x.encode('utf-8')
225
+ length = len(_x)
226
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
227
+ length = len(self.state)
228
+ buff.write(_struct_I.pack(length))
229
+ pattern = '<%sb'%length
230
+ buff.write(self.state.tostring())
231
+ length = len(self.data.name)
232
+ buff.write(_struct_I.pack(length))
233
+ for val1 in self.data.name:
234
+ length = len(val1)
235
+ if python3 or type(val1) == unicode:
236
+ val1 = val1.encode('utf-8')
237
+ length = len(val1)
238
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
239
+ length = len(self.data.position)
240
+ buff.write(_struct_I.pack(length))
241
+ pattern = '<%sd'%length
242
+ buff.write(self.data.position.tostring())
243
+ length = len(self.data.velocity)
244
+ buff.write(_struct_I.pack(length))
245
+ pattern = '<%sd'%length
246
+ buff.write(self.data.velocity.tostring())
247
+ length = len(self.data.effort)
248
+ buff.write(_struct_I.pack(length))
249
+ pattern = '<%sd'%length
250
+ buff.write(self.data.effort.tostring())
251
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
252
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
253
+
254
+ def deserialize_numpy(self, str, numpy):
255
+ """
256
+ unpack serialized message in str into this message instance using numpy for array types
257
+ :param str: byte array of serialized message, ``str``
258
+ :param numpy: numpy python module
259
+ """
260
+ if python3:
261
+ codecs.lookup_error("rosmsg").msg_type = self._type
262
+ try:
263
+ if self.header is None:
264
+ self.header = std_msgs.msg.Header()
265
+ if self.data is None:
266
+ self.data = kuavo_msgs.msg.endEffectorData()
267
+ end = 0
268
+ _x = self
269
+ start = end
270
+ end += 12
271
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
272
+ start = end
273
+ end += 4
274
+ (length,) = _struct_I.unpack(str[start:end])
275
+ start = end
276
+ end += length
277
+ if python3:
278
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
279
+ else:
280
+ self.header.frame_id = str[start:end]
281
+ start = end
282
+ end += 4
283
+ (length,) = _struct_I.unpack(str[start:end])
284
+ pattern = '<%sb'%length
285
+ start = end
286
+ s = struct.Struct(pattern)
287
+ end += s.size
288
+ self.state = numpy.frombuffer(str[start:end], dtype=numpy.int8, count=length)
289
+ start = end
290
+ end += 4
291
+ (length,) = _struct_I.unpack(str[start:end])
292
+ self.data.name = []
293
+ for i in range(0, length):
294
+ start = end
295
+ end += 4
296
+ (length,) = _struct_I.unpack(str[start:end])
297
+ start = end
298
+ end += length
299
+ if python3:
300
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
301
+ else:
302
+ val1 = str[start:end]
303
+ self.data.name.append(val1)
304
+ start = end
305
+ end += 4
306
+ (length,) = _struct_I.unpack(str[start:end])
307
+ pattern = '<%sd'%length
308
+ start = end
309
+ s = struct.Struct(pattern)
310
+ end += s.size
311
+ self.data.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
312
+ start = end
313
+ end += 4
314
+ (length,) = _struct_I.unpack(str[start:end])
315
+ pattern = '<%sd'%length
316
+ start = end
317
+ s = struct.Struct(pattern)
318
+ end += s.size
319
+ self.data.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
320
+ start = end
321
+ end += 4
322
+ (length,) = _struct_I.unpack(str[start:end])
323
+ pattern = '<%sd'%length
324
+ start = end
325
+ s = struct.Struct(pattern)
326
+ end += s.size
327
+ self.data.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
328
+ return self
329
+ except struct.error as e:
330
+ raise genpy.DeserializationError(e) # most likely buffer underfill
331
+
332
+ _struct_I = genpy.struct_I
333
+ def _get_struct_I():
334
+ global _struct_I
335
+ return _struct_I
336
+ _struct_3I = None
337
+ def _get_struct_3I():
338
+ global _struct_3I
339
+ if _struct_3I is None:
340
+ _struct_3I = struct.Struct("<3I")
341
+ return _struct_3I