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,315 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/twoArmHandPoseCmd.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 twoArmHandPoseCmd(genpy.Message):
13
+ _md5sum = "cd5f0a3dc4154eb55aff1c874e2dc81e"
14
+ _type = "kuavo_msgs/twoArmHandPoseCmd"
15
+ _has_header = False # flag to mark the presence of a Header object
16
+ _full_text = """twoArmHandPose hand_poses
17
+ # params for the IK solver
18
+ bool use_custom_ik_param
19
+ bool joint_angles_as_q0
20
+ ikSolveParam ik_param
21
+ int32 frame # 0 keep current frame 1 world frame (based on odom) 2 local frame 3 manipulation world frame
22
+ ================================================================================
23
+ MSG: kuavo_msgs/twoArmHandPose
24
+ Header header
25
+ armHandPose left_pose
26
+ armHandPose right_pose
27
+ ================================================================================
28
+ MSG: std_msgs/Header
29
+ # Standard metadata for higher-level stamped data types.
30
+ # This is generally used to communicate timestamped data
31
+ # in a particular coordinate frame.
32
+ #
33
+ # sequence ID: consecutively increasing ID
34
+ uint32 seq
35
+ #Two-integer timestamp that is expressed as:
36
+ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')
37
+ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')
38
+ # time-handling sugar is provided by the client library
39
+ time stamp
40
+ #Frame this data is associated with
41
+ string frame_id
42
+
43
+ ================================================================================
44
+ MSG: kuavo_msgs/armHandPose
45
+ float64[3] pos_xyz
46
+ float64[4] quat_xyzw
47
+
48
+ float64[3] elbow_pos_xyz
49
+
50
+ float64[7] joint_angles
51
+ ================================================================================
52
+ MSG: kuavo_msgs/ikSolveParam
53
+ # snopt params
54
+ float64 major_optimality_tol
55
+ float64 major_feasibility_tol
56
+ float64 minor_feasibility_tol
57
+ float64 major_iterations_limit
58
+ # constraint and cost params
59
+ float64 oritation_constraint_tol
60
+ float64 pos_constraint_tol # work when pos_cost_weight > 0.0
61
+ float64 pos_cost_weight"""
62
+ __slots__ = ['hand_poses','use_custom_ik_param','joint_angles_as_q0','ik_param','frame']
63
+ _slot_types = ['kuavo_msgs/twoArmHandPose','bool','bool','kuavo_msgs/ikSolveParam','int32']
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
+ hand_poses,use_custom_ik_param,joint_angles_as_q0,ik_param,frame
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(twoArmHandPoseCmd, self).__init__(*args, **kwds)
81
+ # message fields cannot be None, assign default values for those that are
82
+ if self.hand_poses is None:
83
+ self.hand_poses = kuavo_msgs.msg.twoArmHandPose()
84
+ if self.use_custom_ik_param is None:
85
+ self.use_custom_ik_param = False
86
+ if self.joint_angles_as_q0 is None:
87
+ self.joint_angles_as_q0 = False
88
+ if self.ik_param is None:
89
+ self.ik_param = kuavo_msgs.msg.ikSolveParam()
90
+ if self.frame is None:
91
+ self.frame = 0
92
+ else:
93
+ self.hand_poses = kuavo_msgs.msg.twoArmHandPose()
94
+ self.use_custom_ik_param = False
95
+ self.joint_angles_as_q0 = False
96
+ self.ik_param = kuavo_msgs.msg.ikSolveParam()
97
+ self.frame = 0
98
+
99
+ def _get_types(self):
100
+ """
101
+ internal API method
102
+ """
103
+ return self._slot_types
104
+
105
+ def serialize(self, buff):
106
+ """
107
+ serialize message into buffer
108
+ :param buff: buffer, ``StringIO``
109
+ """
110
+ try:
111
+ _x = self
112
+ buff.write(_get_struct_3I().pack(_x.hand_poses.header.seq, _x.hand_poses.header.stamp.secs, _x.hand_poses.header.stamp.nsecs))
113
+ _x = self.hand_poses.header.frame_id
114
+ length = len(_x)
115
+ if python3 or type(_x) == unicode:
116
+ _x = _x.encode('utf-8')
117
+ length = len(_x)
118
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
119
+ buff.write(_get_struct_3d().pack(*self.hand_poses.left_pose.pos_xyz))
120
+ buff.write(_get_struct_4d().pack(*self.hand_poses.left_pose.quat_xyzw))
121
+ buff.write(_get_struct_3d().pack(*self.hand_poses.left_pose.elbow_pos_xyz))
122
+ buff.write(_get_struct_7d().pack(*self.hand_poses.left_pose.joint_angles))
123
+ buff.write(_get_struct_3d().pack(*self.hand_poses.right_pose.pos_xyz))
124
+ buff.write(_get_struct_4d().pack(*self.hand_poses.right_pose.quat_xyzw))
125
+ buff.write(_get_struct_3d().pack(*self.hand_poses.right_pose.elbow_pos_xyz))
126
+ buff.write(_get_struct_7d().pack(*self.hand_poses.right_pose.joint_angles))
127
+ _x = self
128
+ buff.write(_get_struct_2B7di().pack(_x.use_custom_ik_param, _x.joint_angles_as_q0, _x.ik_param.major_optimality_tol, _x.ik_param.major_feasibility_tol, _x.ik_param.minor_feasibility_tol, _x.ik_param.major_iterations_limit, _x.ik_param.oritation_constraint_tol, _x.ik_param.pos_constraint_tol, _x.ik_param.pos_cost_weight, _x.frame))
129
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
130
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
131
+
132
+ def deserialize(self, str):
133
+ """
134
+ unpack serialized message in str into this message instance
135
+ :param str: byte array of serialized message, ``str``
136
+ """
137
+ if python3:
138
+ codecs.lookup_error("rosmsg").msg_type = self._type
139
+ try:
140
+ if self.hand_poses is None:
141
+ self.hand_poses = kuavo_msgs.msg.twoArmHandPose()
142
+ if self.ik_param is None:
143
+ self.ik_param = kuavo_msgs.msg.ikSolveParam()
144
+ end = 0
145
+ _x = self
146
+ start = end
147
+ end += 12
148
+ (_x.hand_poses.header.seq, _x.hand_poses.header.stamp.secs, _x.hand_poses.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
149
+ start = end
150
+ end += 4
151
+ (length,) = _struct_I.unpack(str[start:end])
152
+ start = end
153
+ end += length
154
+ if python3:
155
+ self.hand_poses.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
156
+ else:
157
+ self.hand_poses.header.frame_id = str[start:end]
158
+ start = end
159
+ end += 24
160
+ self.hand_poses.left_pose.pos_xyz = _get_struct_3d().unpack(str[start:end])
161
+ start = end
162
+ end += 32
163
+ self.hand_poses.left_pose.quat_xyzw = _get_struct_4d().unpack(str[start:end])
164
+ start = end
165
+ end += 24
166
+ self.hand_poses.left_pose.elbow_pos_xyz = _get_struct_3d().unpack(str[start:end])
167
+ start = end
168
+ end += 56
169
+ self.hand_poses.left_pose.joint_angles = _get_struct_7d().unpack(str[start:end])
170
+ start = end
171
+ end += 24
172
+ self.hand_poses.right_pose.pos_xyz = _get_struct_3d().unpack(str[start:end])
173
+ start = end
174
+ end += 32
175
+ self.hand_poses.right_pose.quat_xyzw = _get_struct_4d().unpack(str[start:end])
176
+ start = end
177
+ end += 24
178
+ self.hand_poses.right_pose.elbow_pos_xyz = _get_struct_3d().unpack(str[start:end])
179
+ start = end
180
+ end += 56
181
+ self.hand_poses.right_pose.joint_angles = _get_struct_7d().unpack(str[start:end])
182
+ _x = self
183
+ start = end
184
+ end += 62
185
+ (_x.use_custom_ik_param, _x.joint_angles_as_q0, _x.ik_param.major_optimality_tol, _x.ik_param.major_feasibility_tol, _x.ik_param.minor_feasibility_tol, _x.ik_param.major_iterations_limit, _x.ik_param.oritation_constraint_tol, _x.ik_param.pos_constraint_tol, _x.ik_param.pos_cost_weight, _x.frame,) = _get_struct_2B7di().unpack(str[start:end])
186
+ self.use_custom_ik_param = bool(self.use_custom_ik_param)
187
+ self.joint_angles_as_q0 = bool(self.joint_angles_as_q0)
188
+ return self
189
+ except struct.error as e:
190
+ raise genpy.DeserializationError(e) # most likely buffer underfill
191
+
192
+
193
+ def serialize_numpy(self, buff, numpy):
194
+ """
195
+ serialize message with numpy array types into buffer
196
+ :param buff: buffer, ``StringIO``
197
+ :param numpy: numpy python module
198
+ """
199
+ try:
200
+ _x = self
201
+ buff.write(_get_struct_3I().pack(_x.hand_poses.header.seq, _x.hand_poses.header.stamp.secs, _x.hand_poses.header.stamp.nsecs))
202
+ _x = self.hand_poses.header.frame_id
203
+ length = len(_x)
204
+ if python3 or type(_x) == unicode:
205
+ _x = _x.encode('utf-8')
206
+ length = len(_x)
207
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
208
+ buff.write(self.hand_poses.left_pose.pos_xyz.tostring())
209
+ buff.write(self.hand_poses.left_pose.quat_xyzw.tostring())
210
+ buff.write(self.hand_poses.left_pose.elbow_pos_xyz.tostring())
211
+ buff.write(self.hand_poses.left_pose.joint_angles.tostring())
212
+ buff.write(self.hand_poses.right_pose.pos_xyz.tostring())
213
+ buff.write(self.hand_poses.right_pose.quat_xyzw.tostring())
214
+ buff.write(self.hand_poses.right_pose.elbow_pos_xyz.tostring())
215
+ buff.write(self.hand_poses.right_pose.joint_angles.tostring())
216
+ _x = self
217
+ buff.write(_get_struct_2B7di().pack(_x.use_custom_ik_param, _x.joint_angles_as_q0, _x.ik_param.major_optimality_tol, _x.ik_param.major_feasibility_tol, _x.ik_param.minor_feasibility_tol, _x.ik_param.major_iterations_limit, _x.ik_param.oritation_constraint_tol, _x.ik_param.pos_constraint_tol, _x.ik_param.pos_cost_weight, _x.frame))
218
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
219
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
220
+
221
+ def deserialize_numpy(self, str, numpy):
222
+ """
223
+ unpack serialized message in str into this message instance using numpy for array types
224
+ :param str: byte array of serialized message, ``str``
225
+ :param numpy: numpy python module
226
+ """
227
+ if python3:
228
+ codecs.lookup_error("rosmsg").msg_type = self._type
229
+ try:
230
+ if self.hand_poses is None:
231
+ self.hand_poses = kuavo_msgs.msg.twoArmHandPose()
232
+ if self.ik_param is None:
233
+ self.ik_param = kuavo_msgs.msg.ikSolveParam()
234
+ end = 0
235
+ _x = self
236
+ start = end
237
+ end += 12
238
+ (_x.hand_poses.header.seq, _x.hand_poses.header.stamp.secs, _x.hand_poses.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
239
+ start = end
240
+ end += 4
241
+ (length,) = _struct_I.unpack(str[start:end])
242
+ start = end
243
+ end += length
244
+ if python3:
245
+ self.hand_poses.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
246
+ else:
247
+ self.hand_poses.header.frame_id = str[start:end]
248
+ start = end
249
+ end += 24
250
+ self.hand_poses.left_pose.pos_xyz = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
251
+ start = end
252
+ end += 32
253
+ self.hand_poses.left_pose.quat_xyzw = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=4)
254
+ start = end
255
+ end += 24
256
+ self.hand_poses.left_pose.elbow_pos_xyz = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
257
+ start = end
258
+ end += 56
259
+ self.hand_poses.left_pose.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=7)
260
+ start = end
261
+ end += 24
262
+ self.hand_poses.right_pose.pos_xyz = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
263
+ start = end
264
+ end += 32
265
+ self.hand_poses.right_pose.quat_xyzw = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=4)
266
+ start = end
267
+ end += 24
268
+ self.hand_poses.right_pose.elbow_pos_xyz = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=3)
269
+ start = end
270
+ end += 56
271
+ self.hand_poses.right_pose.joint_angles = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=7)
272
+ _x = self
273
+ start = end
274
+ end += 62
275
+ (_x.use_custom_ik_param, _x.joint_angles_as_q0, _x.ik_param.major_optimality_tol, _x.ik_param.major_feasibility_tol, _x.ik_param.minor_feasibility_tol, _x.ik_param.major_iterations_limit, _x.ik_param.oritation_constraint_tol, _x.ik_param.pos_constraint_tol, _x.ik_param.pos_cost_weight, _x.frame,) = _get_struct_2B7di().unpack(str[start:end])
276
+ self.use_custom_ik_param = bool(self.use_custom_ik_param)
277
+ self.joint_angles_as_q0 = bool(self.joint_angles_as_q0)
278
+ return self
279
+ except struct.error as e:
280
+ raise genpy.DeserializationError(e) # most likely buffer underfill
281
+
282
+ _struct_I = genpy.struct_I
283
+ def _get_struct_I():
284
+ global _struct_I
285
+ return _struct_I
286
+ _struct_2B7di = None
287
+ def _get_struct_2B7di():
288
+ global _struct_2B7di
289
+ if _struct_2B7di is None:
290
+ _struct_2B7di = struct.Struct("<2B7di")
291
+ return _struct_2B7di
292
+ _struct_3I = None
293
+ def _get_struct_3I():
294
+ global _struct_3I
295
+ if _struct_3I is None:
296
+ _struct_3I = struct.Struct("<3I")
297
+ return _struct_3I
298
+ _struct_3d = None
299
+ def _get_struct_3d():
300
+ global _struct_3d
301
+ if _struct_3d is None:
302
+ _struct_3d = struct.Struct("<3d")
303
+ return _struct_3d
304
+ _struct_4d = None
305
+ def _get_struct_4d():
306
+ global _struct_4d
307
+ if _struct_4d is None:
308
+ _struct_4d = struct.Struct("<4d")
309
+ return _struct_4d
310
+ _struct_7d = None
311
+ def _get_struct_7d():
312
+ global _struct_7d
313
+ if _struct_7d is None:
314
+ _struct_7d = struct.Struct("<7d")
315
+ return _struct_7d
@@ -0,0 +1,251 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/yoloDetection.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 yoloDetection(genpy.Message):
13
+ _md5sum = "442f2c4723f0369e79b97b3e674354d8"
14
+ _type = "kuavo_msgs/yoloDetection"
15
+ _has_header = True # flag to mark the presence of a Header object
16
+ _full_text = """std_msgs/Header header
17
+ yoloOutputData[] data
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
+ ================================================================================
35
+ MSG: kuavo_msgs/yoloOutputData
36
+ string class_name
37
+ int32 class_id
38
+ float32 confidence
39
+ float32 x_pos
40
+ float32 y_pos
41
+ float32 height
42
+ float32 width"""
43
+ __slots__ = ['header','data']
44
+ _slot_types = ['std_msgs/Header','kuavo_msgs/yoloOutputData[]']
45
+
46
+ def __init__(self, *args, **kwds):
47
+ """
48
+ Constructor. Any message fields that are implicitly/explicitly
49
+ set to None will be assigned a default value. The recommend
50
+ use is keyword arguments as this is more robust to future message
51
+ changes. You cannot mix in-order arguments and keyword arguments.
52
+
53
+ The available fields are:
54
+ header,data
55
+
56
+ :param args: complete set of field values, in .msg order
57
+ :param kwds: use keyword arguments corresponding to message field names
58
+ to set specific fields.
59
+ """
60
+ if args or kwds:
61
+ super(yoloDetection, self).__init__(*args, **kwds)
62
+ # message fields cannot be None, assign default values for those that are
63
+ if self.header is None:
64
+ self.header = std_msgs.msg.Header()
65
+ if self.data is None:
66
+ self.data = []
67
+ else:
68
+ self.header = std_msgs.msg.Header()
69
+ self.data = []
70
+
71
+ def _get_types(self):
72
+ """
73
+ internal API method
74
+ """
75
+ return self._slot_types
76
+
77
+ def serialize(self, buff):
78
+ """
79
+ serialize message into buffer
80
+ :param buff: buffer, ``StringIO``
81
+ """
82
+ try:
83
+ _x = self
84
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
85
+ _x = self.header.frame_id
86
+ length = len(_x)
87
+ if python3 or type(_x) == unicode:
88
+ _x = _x.encode('utf-8')
89
+ length = len(_x)
90
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
91
+ length = len(self.data)
92
+ buff.write(_struct_I.pack(length))
93
+ for val1 in self.data:
94
+ _x = val1.class_name
95
+ length = len(_x)
96
+ if python3 or type(_x) == unicode:
97
+ _x = _x.encode('utf-8')
98
+ length = len(_x)
99
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
100
+ _x = val1
101
+ buff.write(_get_struct_i5f().pack(_x.class_id, _x.confidence, _x.x_pos, _x.y_pos, _x.height, _x.width))
102
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
103
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
104
+
105
+ def deserialize(self, str):
106
+ """
107
+ unpack serialized message in str into this message instance
108
+ :param str: byte array of serialized message, ``str``
109
+ """
110
+ if python3:
111
+ codecs.lookup_error("rosmsg").msg_type = self._type
112
+ try:
113
+ if self.header is None:
114
+ self.header = std_msgs.msg.Header()
115
+ if self.data is None:
116
+ self.data = None
117
+ end = 0
118
+ _x = self
119
+ start = end
120
+ end += 12
121
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
122
+ start = end
123
+ end += 4
124
+ (length,) = _struct_I.unpack(str[start:end])
125
+ start = end
126
+ end += length
127
+ if python3:
128
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
129
+ else:
130
+ self.header.frame_id = str[start:end]
131
+ start = end
132
+ end += 4
133
+ (length,) = _struct_I.unpack(str[start:end])
134
+ self.data = []
135
+ for i in range(0, length):
136
+ val1 = kuavo_msgs.msg.yoloOutputData()
137
+ start = end
138
+ end += 4
139
+ (length,) = _struct_I.unpack(str[start:end])
140
+ start = end
141
+ end += length
142
+ if python3:
143
+ val1.class_name = str[start:end].decode('utf-8', 'rosmsg')
144
+ else:
145
+ val1.class_name = str[start:end]
146
+ _x = val1
147
+ start = end
148
+ end += 24
149
+ (_x.class_id, _x.confidence, _x.x_pos, _x.y_pos, _x.height, _x.width,) = _get_struct_i5f().unpack(str[start:end])
150
+ self.data.append(val1)
151
+ return self
152
+ except struct.error as e:
153
+ raise genpy.DeserializationError(e) # most likely buffer underfill
154
+
155
+
156
+ def serialize_numpy(self, buff, numpy):
157
+ """
158
+ serialize message with numpy array types into buffer
159
+ :param buff: buffer, ``StringIO``
160
+ :param numpy: numpy python module
161
+ """
162
+ try:
163
+ _x = self
164
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
165
+ _x = self.header.frame_id
166
+ length = len(_x)
167
+ if python3 or type(_x) == unicode:
168
+ _x = _x.encode('utf-8')
169
+ length = len(_x)
170
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
171
+ length = len(self.data)
172
+ buff.write(_struct_I.pack(length))
173
+ for val1 in self.data:
174
+ _x = val1.class_name
175
+ length = len(_x)
176
+ if python3 or type(_x) == unicode:
177
+ _x = _x.encode('utf-8')
178
+ length = len(_x)
179
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
180
+ _x = val1
181
+ buff.write(_get_struct_i5f().pack(_x.class_id, _x.confidence, _x.x_pos, _x.y_pos, _x.height, _x.width))
182
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
183
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
184
+
185
+ def deserialize_numpy(self, str, numpy):
186
+ """
187
+ unpack serialized message in str into this message instance using numpy for array types
188
+ :param str: byte array of serialized message, ``str``
189
+ :param numpy: numpy python module
190
+ """
191
+ if python3:
192
+ codecs.lookup_error("rosmsg").msg_type = self._type
193
+ try:
194
+ if self.header is None:
195
+ self.header = std_msgs.msg.Header()
196
+ if self.data is None:
197
+ self.data = None
198
+ end = 0
199
+ _x = self
200
+ start = end
201
+ end += 12
202
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
203
+ start = end
204
+ end += 4
205
+ (length,) = _struct_I.unpack(str[start:end])
206
+ start = end
207
+ end += length
208
+ if python3:
209
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
210
+ else:
211
+ self.header.frame_id = str[start:end]
212
+ start = end
213
+ end += 4
214
+ (length,) = _struct_I.unpack(str[start:end])
215
+ self.data = []
216
+ for i in range(0, length):
217
+ val1 = kuavo_msgs.msg.yoloOutputData()
218
+ start = end
219
+ end += 4
220
+ (length,) = _struct_I.unpack(str[start:end])
221
+ start = end
222
+ end += length
223
+ if python3:
224
+ val1.class_name = str[start:end].decode('utf-8', 'rosmsg')
225
+ else:
226
+ val1.class_name = str[start:end]
227
+ _x = val1
228
+ start = end
229
+ end += 24
230
+ (_x.class_id, _x.confidence, _x.x_pos, _x.y_pos, _x.height, _x.width,) = _get_struct_i5f().unpack(str[start:end])
231
+ self.data.append(val1)
232
+ return self
233
+ except struct.error as e:
234
+ raise genpy.DeserializationError(e) # most likely buffer underfill
235
+
236
+ _struct_I = genpy.struct_I
237
+ def _get_struct_I():
238
+ global _struct_I
239
+ return _struct_I
240
+ _struct_3I = None
241
+ def _get_struct_3I():
242
+ global _struct_3I
243
+ if _struct_3I is None:
244
+ _struct_3I = struct.Struct("<3I")
245
+ return _struct_3I
246
+ _struct_i5f = None
247
+ def _get_struct_i5f():
248
+ global _struct_i5f
249
+ if _struct_i5f is None:
250
+ _struct_i5f = struct.Struct("<i5f")
251
+ return _struct_i5f