kuavo-humanoid-sdk 1.1.9__20250627185317-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.9.dist-info/METADATA +291 -0
  130. kuavo_humanoid_sdk-1.1.9.dist-info/RECORD +132 -0
  131. kuavo_humanoid_sdk-1.1.9.dist-info/WHEEL +6 -0
  132. kuavo_humanoid_sdk-1.1.9.dist-info/top_level.txt +1 -0
@@ -0,0 +1,495 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/sensorsData.msg. Do not edit."""
3
+ import codecs
4
+ import sys
5
+ python3 = True if sys.hexversion > 0x03000000 else False
6
+ import genpy
7
+ import struct
8
+
9
+ import genpy
10
+ import geometry_msgs.msg
11
+ import kuavo_msgs.msg
12
+ import std_msgs.msg
13
+
14
+ class sensorsData(genpy.Message):
15
+ _md5sum = "35fff741b8e115992c1ac46e99c1084f"
16
+ _type = "kuavo_msgs/sensorsData"
17
+ _has_header = True # flag to mark the presence of a Header object
18
+ _full_text = """std_msgs/Header header
19
+ time sensor_time
20
+ kuavo_msgs/jointData joint_data
21
+ kuavo_msgs/imuData imu_data
22
+ kuavo_msgs/endEffectorData end_effector_data
23
+
24
+ ================================================================================
25
+ MSG: std_msgs/Header
26
+ # Standard metadata for higher-level stamped data types.
27
+ # This is generally used to communicate timestamped data
28
+ # in a particular coordinate frame.
29
+ #
30
+ # sequence ID: consecutively increasing ID
31
+ uint32 seq
32
+ #Two-integer timestamp that is expressed as:
33
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
34
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
35
+ # time-handling sugar is provided by the client library
36
+ time stamp
37
+ #Frame this data is associated with
38
+ string frame_id
39
+
40
+ ================================================================================
41
+ MSG: kuavo_msgs/jointData
42
+ float64[] joint_q
43
+ float64[] joint_v
44
+ float64[] joint_vd
45
+ float64[] joint_torque
46
+
47
+ ================================================================================
48
+ MSG: kuavo_msgs/imuData
49
+ geometry_msgs/Vector3 gyro #陀螺仪数据
50
+ geometry_msgs/Vector3 acc #加速计数据
51
+ geometry_msgs/Vector3 free_acc #无重力加速度数据
52
+ geometry_msgs/Quaternion quat #四元数数据
53
+
54
+ ================================================================================
55
+ MSG: geometry_msgs/Vector3
56
+ # This represents a vector in free space.
57
+ # It is only meant to represent a direction. Therefore, it does not
58
+ # make sense to apply a translation to it (e.g., when applying a
59
+ # generic rigid transformation to a Vector3, tf2 will only apply the
60
+ # rotation). If you want your data to be translatable too, use the
61
+ # geometry_msgs/Point message instead.
62
+
63
+ float64 x
64
+ float64 y
65
+ float64 z
66
+ ================================================================================
67
+ MSG: geometry_msgs/Quaternion
68
+ # This represents an orientation in free space in quaternion form.
69
+
70
+ float64 x
71
+ float64 y
72
+ float64 z
73
+ float64 w
74
+
75
+ ================================================================================
76
+ MSG: kuavo_msgs/endEffectorData
77
+ string[] name
78
+ float64[] position
79
+ float64[] velocity
80
+ float64[] effort
81
+ """
82
+ __slots__ = ['header','sensor_time','joint_data','imu_data','end_effector_data']
83
+ _slot_types = ['std_msgs/Header','time','kuavo_msgs/jointData','kuavo_msgs/imuData','kuavo_msgs/endEffectorData']
84
+
85
+ def __init__(self, *args, **kwds):
86
+ """
87
+ Constructor. Any message fields that are implicitly/explicitly
88
+ set to None will be assigned a default value. The recommend
89
+ use is keyword arguments as this is more robust to future message
90
+ changes. You cannot mix in-order arguments and keyword arguments.
91
+
92
+ The available fields are:
93
+ header,sensor_time,joint_data,imu_data,end_effector_data
94
+
95
+ :param args: complete set of field values, in .msg order
96
+ :param kwds: use keyword arguments corresponding to message field names
97
+ to set specific fields.
98
+ """
99
+ if args or kwds:
100
+ super(sensorsData, self).__init__(*args, **kwds)
101
+ # message fields cannot be None, assign default values for those that are
102
+ if self.header is None:
103
+ self.header = std_msgs.msg.Header()
104
+ if self.sensor_time is None:
105
+ self.sensor_time = genpy.Time()
106
+ if self.joint_data is None:
107
+ self.joint_data = kuavo_msgs.msg.jointData()
108
+ if self.imu_data is None:
109
+ self.imu_data = kuavo_msgs.msg.imuData()
110
+ if self.end_effector_data is None:
111
+ self.end_effector_data = kuavo_msgs.msg.endEffectorData()
112
+ else:
113
+ self.header = std_msgs.msg.Header()
114
+ self.sensor_time = genpy.Time()
115
+ self.joint_data = kuavo_msgs.msg.jointData()
116
+ self.imu_data = kuavo_msgs.msg.imuData()
117
+ self.end_effector_data = kuavo_msgs.msg.endEffectorData()
118
+
119
+ def _get_types(self):
120
+ """
121
+ internal API method
122
+ """
123
+ return self._slot_types
124
+
125
+ def serialize(self, buff):
126
+ """
127
+ serialize message into buffer
128
+ :param buff: buffer, ``StringIO``
129
+ """
130
+ try:
131
+ _x = self
132
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
133
+ _x = self.header.frame_id
134
+ length = len(_x)
135
+ if python3 or type(_x) == unicode:
136
+ _x = _x.encode('utf-8')
137
+ length = len(_x)
138
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
139
+ _x = self
140
+ buff.write(_get_struct_2I().pack(_x.sensor_time.secs, _x.sensor_time.nsecs))
141
+ length = len(self.joint_data.joint_q)
142
+ buff.write(_struct_I.pack(length))
143
+ pattern = '<%sd'%length
144
+ buff.write(struct.Struct(pattern).pack(*self.joint_data.joint_q))
145
+ length = len(self.joint_data.joint_v)
146
+ buff.write(_struct_I.pack(length))
147
+ pattern = '<%sd'%length
148
+ buff.write(struct.Struct(pattern).pack(*self.joint_data.joint_v))
149
+ length = len(self.joint_data.joint_vd)
150
+ buff.write(_struct_I.pack(length))
151
+ pattern = '<%sd'%length
152
+ buff.write(struct.Struct(pattern).pack(*self.joint_data.joint_vd))
153
+ length = len(self.joint_data.joint_torque)
154
+ buff.write(_struct_I.pack(length))
155
+ pattern = '<%sd'%length
156
+ buff.write(struct.Struct(pattern).pack(*self.joint_data.joint_torque))
157
+ _x = self
158
+ buff.write(_get_struct_13d().pack(_x.imu_data.gyro.x, _x.imu_data.gyro.y, _x.imu_data.gyro.z, _x.imu_data.acc.x, _x.imu_data.acc.y, _x.imu_data.acc.z, _x.imu_data.free_acc.x, _x.imu_data.free_acc.y, _x.imu_data.free_acc.z, _x.imu_data.quat.x, _x.imu_data.quat.y, _x.imu_data.quat.z, _x.imu_data.quat.w))
159
+ length = len(self.end_effector_data.name)
160
+ buff.write(_struct_I.pack(length))
161
+ for val1 in self.end_effector_data.name:
162
+ length = len(val1)
163
+ if python3 or type(val1) == unicode:
164
+ val1 = val1.encode('utf-8')
165
+ length = len(val1)
166
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
167
+ length = len(self.end_effector_data.position)
168
+ buff.write(_struct_I.pack(length))
169
+ pattern = '<%sd'%length
170
+ buff.write(struct.Struct(pattern).pack(*self.end_effector_data.position))
171
+ length = len(self.end_effector_data.velocity)
172
+ buff.write(_struct_I.pack(length))
173
+ pattern = '<%sd'%length
174
+ buff.write(struct.Struct(pattern).pack(*self.end_effector_data.velocity))
175
+ length = len(self.end_effector_data.effort)
176
+ buff.write(_struct_I.pack(length))
177
+ pattern = '<%sd'%length
178
+ buff.write(struct.Struct(pattern).pack(*self.end_effector_data.effort))
179
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
180
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
181
+
182
+ def deserialize(self, str):
183
+ """
184
+ unpack serialized message in str into this message instance
185
+ :param str: byte array of serialized message, ``str``
186
+ """
187
+ if python3:
188
+ codecs.lookup_error("rosmsg").msg_type = self._type
189
+ try:
190
+ if self.header is None:
191
+ self.header = std_msgs.msg.Header()
192
+ if self.sensor_time is None:
193
+ self.sensor_time = genpy.Time()
194
+ if self.joint_data is None:
195
+ self.joint_data = kuavo_msgs.msg.jointData()
196
+ if self.imu_data is None:
197
+ self.imu_data = kuavo_msgs.msg.imuData()
198
+ if self.end_effector_data is None:
199
+ self.end_effector_data = kuavo_msgs.msg.endEffectorData()
200
+ end = 0
201
+ _x = self
202
+ start = end
203
+ end += 12
204
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
205
+ start = end
206
+ end += 4
207
+ (length,) = _struct_I.unpack(str[start:end])
208
+ start = end
209
+ end += length
210
+ if python3:
211
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
212
+ else:
213
+ self.header.frame_id = str[start:end]
214
+ _x = self
215
+ start = end
216
+ end += 8
217
+ (_x.sensor_time.secs, _x.sensor_time.nsecs,) = _get_struct_2I().unpack(str[start:end])
218
+ start = end
219
+ end += 4
220
+ (length,) = _struct_I.unpack(str[start:end])
221
+ pattern = '<%sd'%length
222
+ start = end
223
+ s = struct.Struct(pattern)
224
+ end += s.size
225
+ self.joint_data.joint_q = s.unpack(str[start:end])
226
+ start = end
227
+ end += 4
228
+ (length,) = _struct_I.unpack(str[start:end])
229
+ pattern = '<%sd'%length
230
+ start = end
231
+ s = struct.Struct(pattern)
232
+ end += s.size
233
+ self.joint_data.joint_v = s.unpack(str[start:end])
234
+ start = end
235
+ end += 4
236
+ (length,) = _struct_I.unpack(str[start:end])
237
+ pattern = '<%sd'%length
238
+ start = end
239
+ s = struct.Struct(pattern)
240
+ end += s.size
241
+ self.joint_data.joint_vd = s.unpack(str[start:end])
242
+ start = end
243
+ end += 4
244
+ (length,) = _struct_I.unpack(str[start:end])
245
+ pattern = '<%sd'%length
246
+ start = end
247
+ s = struct.Struct(pattern)
248
+ end += s.size
249
+ self.joint_data.joint_torque = s.unpack(str[start:end])
250
+ _x = self
251
+ start = end
252
+ end += 104
253
+ (_x.imu_data.gyro.x, _x.imu_data.gyro.y, _x.imu_data.gyro.z, _x.imu_data.acc.x, _x.imu_data.acc.y, _x.imu_data.acc.z, _x.imu_data.free_acc.x, _x.imu_data.free_acc.y, _x.imu_data.free_acc.z, _x.imu_data.quat.x, _x.imu_data.quat.y, _x.imu_data.quat.z, _x.imu_data.quat.w,) = _get_struct_13d().unpack(str[start:end])
254
+ start = end
255
+ end += 4
256
+ (length,) = _struct_I.unpack(str[start:end])
257
+ self.end_effector_data.name = []
258
+ for i in range(0, length):
259
+ start = end
260
+ end += 4
261
+ (length,) = _struct_I.unpack(str[start:end])
262
+ start = end
263
+ end += length
264
+ if python3:
265
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
266
+ else:
267
+ val1 = str[start:end]
268
+ self.end_effector_data.name.append(val1)
269
+ start = end
270
+ end += 4
271
+ (length,) = _struct_I.unpack(str[start:end])
272
+ pattern = '<%sd'%length
273
+ start = end
274
+ s = struct.Struct(pattern)
275
+ end += s.size
276
+ self.end_effector_data.position = s.unpack(str[start:end])
277
+ start = end
278
+ end += 4
279
+ (length,) = _struct_I.unpack(str[start:end])
280
+ pattern = '<%sd'%length
281
+ start = end
282
+ s = struct.Struct(pattern)
283
+ end += s.size
284
+ self.end_effector_data.velocity = s.unpack(str[start:end])
285
+ start = end
286
+ end += 4
287
+ (length,) = _struct_I.unpack(str[start:end])
288
+ pattern = '<%sd'%length
289
+ start = end
290
+ s = struct.Struct(pattern)
291
+ end += s.size
292
+ self.end_effector_data.effort = s.unpack(str[start:end])
293
+ self.sensor_time.canon()
294
+ return self
295
+ except struct.error as e:
296
+ raise genpy.DeserializationError(e) # most likely buffer underfill
297
+
298
+
299
+ def serialize_numpy(self, buff, numpy):
300
+ """
301
+ serialize message with numpy array types into buffer
302
+ :param buff: buffer, ``StringIO``
303
+ :param numpy: numpy python module
304
+ """
305
+ try:
306
+ _x = self
307
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
308
+ _x = self.header.frame_id
309
+ length = len(_x)
310
+ if python3 or type(_x) == unicode:
311
+ _x = _x.encode('utf-8')
312
+ length = len(_x)
313
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
314
+ _x = self
315
+ buff.write(_get_struct_2I().pack(_x.sensor_time.secs, _x.sensor_time.nsecs))
316
+ length = len(self.joint_data.joint_q)
317
+ buff.write(_struct_I.pack(length))
318
+ pattern = '<%sd'%length
319
+ buff.write(self.joint_data.joint_q.tostring())
320
+ length = len(self.joint_data.joint_v)
321
+ buff.write(_struct_I.pack(length))
322
+ pattern = '<%sd'%length
323
+ buff.write(self.joint_data.joint_v.tostring())
324
+ length = len(self.joint_data.joint_vd)
325
+ buff.write(_struct_I.pack(length))
326
+ pattern = '<%sd'%length
327
+ buff.write(self.joint_data.joint_vd.tostring())
328
+ length = len(self.joint_data.joint_torque)
329
+ buff.write(_struct_I.pack(length))
330
+ pattern = '<%sd'%length
331
+ buff.write(self.joint_data.joint_torque.tostring())
332
+ _x = self
333
+ buff.write(_get_struct_13d().pack(_x.imu_data.gyro.x, _x.imu_data.gyro.y, _x.imu_data.gyro.z, _x.imu_data.acc.x, _x.imu_data.acc.y, _x.imu_data.acc.z, _x.imu_data.free_acc.x, _x.imu_data.free_acc.y, _x.imu_data.free_acc.z, _x.imu_data.quat.x, _x.imu_data.quat.y, _x.imu_data.quat.z, _x.imu_data.quat.w))
334
+ length = len(self.end_effector_data.name)
335
+ buff.write(_struct_I.pack(length))
336
+ for val1 in self.end_effector_data.name:
337
+ length = len(val1)
338
+ if python3 or type(val1) == unicode:
339
+ val1 = val1.encode('utf-8')
340
+ length = len(val1)
341
+ buff.write(struct.Struct('<I%ss'%length).pack(length, val1))
342
+ length = len(self.end_effector_data.position)
343
+ buff.write(_struct_I.pack(length))
344
+ pattern = '<%sd'%length
345
+ buff.write(self.end_effector_data.position.tostring())
346
+ length = len(self.end_effector_data.velocity)
347
+ buff.write(_struct_I.pack(length))
348
+ pattern = '<%sd'%length
349
+ buff.write(self.end_effector_data.velocity.tostring())
350
+ length = len(self.end_effector_data.effort)
351
+ buff.write(_struct_I.pack(length))
352
+ pattern = '<%sd'%length
353
+ buff.write(self.end_effector_data.effort.tostring())
354
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
355
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
356
+
357
+ def deserialize_numpy(self, str, numpy):
358
+ """
359
+ unpack serialized message in str into this message instance using numpy for array types
360
+ :param str: byte array of serialized message, ``str``
361
+ :param numpy: numpy python module
362
+ """
363
+ if python3:
364
+ codecs.lookup_error("rosmsg").msg_type = self._type
365
+ try:
366
+ if self.header is None:
367
+ self.header = std_msgs.msg.Header()
368
+ if self.sensor_time is None:
369
+ self.sensor_time = genpy.Time()
370
+ if self.joint_data is None:
371
+ self.joint_data = kuavo_msgs.msg.jointData()
372
+ if self.imu_data is None:
373
+ self.imu_data = kuavo_msgs.msg.imuData()
374
+ if self.end_effector_data is None:
375
+ self.end_effector_data = kuavo_msgs.msg.endEffectorData()
376
+ end = 0
377
+ _x = self
378
+ start = end
379
+ end += 12
380
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
381
+ start = end
382
+ end += 4
383
+ (length,) = _struct_I.unpack(str[start:end])
384
+ start = end
385
+ end += length
386
+ if python3:
387
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
388
+ else:
389
+ self.header.frame_id = str[start:end]
390
+ _x = self
391
+ start = end
392
+ end += 8
393
+ (_x.sensor_time.secs, _x.sensor_time.nsecs,) = _get_struct_2I().unpack(str[start:end])
394
+ start = end
395
+ end += 4
396
+ (length,) = _struct_I.unpack(str[start:end])
397
+ pattern = '<%sd'%length
398
+ start = end
399
+ s = struct.Struct(pattern)
400
+ end += s.size
401
+ self.joint_data.joint_q = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
402
+ start = end
403
+ end += 4
404
+ (length,) = _struct_I.unpack(str[start:end])
405
+ pattern = '<%sd'%length
406
+ start = end
407
+ s = struct.Struct(pattern)
408
+ end += s.size
409
+ self.joint_data.joint_v = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
410
+ start = end
411
+ end += 4
412
+ (length,) = _struct_I.unpack(str[start:end])
413
+ pattern = '<%sd'%length
414
+ start = end
415
+ s = struct.Struct(pattern)
416
+ end += s.size
417
+ self.joint_data.joint_vd = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
418
+ start = end
419
+ end += 4
420
+ (length,) = _struct_I.unpack(str[start:end])
421
+ pattern = '<%sd'%length
422
+ start = end
423
+ s = struct.Struct(pattern)
424
+ end += s.size
425
+ self.joint_data.joint_torque = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
426
+ _x = self
427
+ start = end
428
+ end += 104
429
+ (_x.imu_data.gyro.x, _x.imu_data.gyro.y, _x.imu_data.gyro.z, _x.imu_data.acc.x, _x.imu_data.acc.y, _x.imu_data.acc.z, _x.imu_data.free_acc.x, _x.imu_data.free_acc.y, _x.imu_data.free_acc.z, _x.imu_data.quat.x, _x.imu_data.quat.y, _x.imu_data.quat.z, _x.imu_data.quat.w,) = _get_struct_13d().unpack(str[start:end])
430
+ start = end
431
+ end += 4
432
+ (length,) = _struct_I.unpack(str[start:end])
433
+ self.end_effector_data.name = []
434
+ for i in range(0, length):
435
+ start = end
436
+ end += 4
437
+ (length,) = _struct_I.unpack(str[start:end])
438
+ start = end
439
+ end += length
440
+ if python3:
441
+ val1 = str[start:end].decode('utf-8', 'rosmsg')
442
+ else:
443
+ val1 = str[start:end]
444
+ self.end_effector_data.name.append(val1)
445
+ start = end
446
+ end += 4
447
+ (length,) = _struct_I.unpack(str[start:end])
448
+ pattern = '<%sd'%length
449
+ start = end
450
+ s = struct.Struct(pattern)
451
+ end += s.size
452
+ self.end_effector_data.position = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
453
+ start = end
454
+ end += 4
455
+ (length,) = _struct_I.unpack(str[start:end])
456
+ pattern = '<%sd'%length
457
+ start = end
458
+ s = struct.Struct(pattern)
459
+ end += s.size
460
+ self.end_effector_data.velocity = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
461
+ start = end
462
+ end += 4
463
+ (length,) = _struct_I.unpack(str[start:end])
464
+ pattern = '<%sd'%length
465
+ start = end
466
+ s = struct.Struct(pattern)
467
+ end += s.size
468
+ self.end_effector_data.effort = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
469
+ self.sensor_time.canon()
470
+ return self
471
+ except struct.error as e:
472
+ raise genpy.DeserializationError(e) # most likely buffer underfill
473
+
474
+ _struct_I = genpy.struct_I
475
+ def _get_struct_I():
476
+ global _struct_I
477
+ return _struct_I
478
+ _struct_13d = None
479
+ def _get_struct_13d():
480
+ global _struct_13d
481
+ if _struct_13d is None:
482
+ _struct_13d = struct.Struct("<13d")
483
+ return _struct_13d
484
+ _struct_2I = None
485
+ def _get_struct_2I():
486
+ global _struct_2I
487
+ if _struct_2I is None:
488
+ _struct_2I = struct.Struct("<2I")
489
+ return _struct_2I
490
+ _struct_3I = None
491
+ def _get_struct_3I():
492
+ global _struct_3I
493
+ if _struct_3I is None:
494
+ _struct_3I = struct.Struct("<3I")
495
+ return _struct_3I
@@ -0,0 +1,200 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/switchGaitByName.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 std_msgs.msg
10
+
11
+ class switchGaitByName(genpy.Message):
12
+ _md5sum = "f98f610ddbe99ec14bb5241e5221ca96"
13
+ _type = "kuavo_msgs/switchGaitByName"
14
+ _has_header = True # flag to mark the presence of a Header object
15
+ _full_text = """std_msgs/Header header
16
+ string gait_name
17
+
18
+ ================================================================================
19
+ MSG: std_msgs/Header
20
+ # Standard metadata for higher-level stamped data types.
21
+ # This is generally used to communicate timestamped data
22
+ # in a particular coordinate frame.
23
+ #
24
+ # sequence ID: consecutively increasing ID
25
+ uint32 seq
26
+ #Two-integer timestamp that is expressed as:
27
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
28
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
29
+ # time-handling sugar is provided by the client library
30
+ time stamp
31
+ #Frame this data is associated with
32
+ string frame_id
33
+ """
34
+ __slots__ = ['header','gait_name']
35
+ _slot_types = ['std_msgs/Header','string']
36
+
37
+ def __init__(self, *args, **kwds):
38
+ """
39
+ Constructor. Any message fields that are implicitly/explicitly
40
+ set to None will be assigned a default value. The recommend
41
+ use is keyword arguments as this is more robust to future message
42
+ changes. You cannot mix in-order arguments and keyword arguments.
43
+
44
+ The available fields are:
45
+ header,gait_name
46
+
47
+ :param args: complete set of field values, in .msg order
48
+ :param kwds: use keyword arguments corresponding to message field names
49
+ to set specific fields.
50
+ """
51
+ if args or kwds:
52
+ super(switchGaitByName, self).__init__(*args, **kwds)
53
+ # message fields cannot be None, assign default values for those that are
54
+ if self.header is None:
55
+ self.header = std_msgs.msg.Header()
56
+ if self.gait_name is None:
57
+ self.gait_name = ''
58
+ else:
59
+ self.header = std_msgs.msg.Header()
60
+ self.gait_name = ''
61
+
62
+ def _get_types(self):
63
+ """
64
+ internal API method
65
+ """
66
+ return self._slot_types
67
+
68
+ def serialize(self, buff):
69
+ """
70
+ serialize message into buffer
71
+ :param buff: buffer, ``StringIO``
72
+ """
73
+ try:
74
+ _x = self
75
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
76
+ _x = self.header.frame_id
77
+ length = len(_x)
78
+ if python3 or type(_x) == unicode:
79
+ _x = _x.encode('utf-8')
80
+ length = len(_x)
81
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
82
+ _x = self.gait_name
83
+ length = len(_x)
84
+ if python3 or type(_x) == unicode:
85
+ _x = _x.encode('utf-8')
86
+ length = len(_x)
87
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
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
+ if self.header is None:
100
+ self.header = std_msgs.msg.Header()
101
+ end = 0
102
+ _x = self
103
+ start = end
104
+ end += 12
105
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
106
+ start = end
107
+ end += 4
108
+ (length,) = _struct_I.unpack(str[start:end])
109
+ start = end
110
+ end += length
111
+ if python3:
112
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
113
+ else:
114
+ self.header.frame_id = str[start:end]
115
+ start = end
116
+ end += 4
117
+ (length,) = _struct_I.unpack(str[start:end])
118
+ start = end
119
+ end += length
120
+ if python3:
121
+ self.gait_name = str[start:end].decode('utf-8', 'rosmsg')
122
+ else:
123
+ self.gait_name = str[start:end]
124
+ return self
125
+ except struct.error as e:
126
+ raise genpy.DeserializationError(e) # most likely buffer underfill
127
+
128
+
129
+ def serialize_numpy(self, buff, numpy):
130
+ """
131
+ serialize message with numpy array types into buffer
132
+ :param buff: buffer, ``StringIO``
133
+ :param numpy: numpy python module
134
+ """
135
+ try:
136
+ _x = self
137
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
138
+ _x = self.header.frame_id
139
+ length = len(_x)
140
+ if python3 or type(_x) == unicode:
141
+ _x = _x.encode('utf-8')
142
+ length = len(_x)
143
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
144
+ _x = self.gait_name
145
+ length = len(_x)
146
+ if python3 or type(_x) == unicode:
147
+ _x = _x.encode('utf-8')
148
+ length = len(_x)
149
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
150
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
151
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
152
+
153
+ def deserialize_numpy(self, str, numpy):
154
+ """
155
+ unpack serialized message in str into this message instance using numpy for array types
156
+ :param str: byte array of serialized message, ``str``
157
+ :param numpy: numpy python module
158
+ """
159
+ if python3:
160
+ codecs.lookup_error("rosmsg").msg_type = self._type
161
+ try:
162
+ if self.header is None:
163
+ self.header = std_msgs.msg.Header()
164
+ end = 0
165
+ _x = self
166
+ start = end
167
+ end += 12
168
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
169
+ start = end
170
+ end += 4
171
+ (length,) = _struct_I.unpack(str[start:end])
172
+ start = end
173
+ end += length
174
+ if python3:
175
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
176
+ else:
177
+ self.header.frame_id = str[start:end]
178
+ start = end
179
+ end += 4
180
+ (length,) = _struct_I.unpack(str[start:end])
181
+ start = end
182
+ end += length
183
+ if python3:
184
+ self.gait_name = str[start:end].decode('utf-8', 'rosmsg')
185
+ else:
186
+ self.gait_name = str[start:end]
187
+ return self
188
+ except struct.error as e:
189
+ raise genpy.DeserializationError(e) # most likely buffer underfill
190
+
191
+ _struct_I = genpy.struct_I
192
+ def _get_struct_I():
193
+ global _struct_I
194
+ return _struct_I
195
+ _struct_3I = None
196
+ def _get_struct_3I():
197
+ global _struct_3I
198
+ if _struct_3I is None:
199
+ _struct_3I = struct.Struct("<3I")
200
+ return _struct_3I