kuavo-humanoid-sdk 1.1.6b1155__20250612161700-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.6b1155.dist-info/METADATA +291 -0
  130. kuavo_humanoid_sdk-1.1.6b1155.dist-info/RECORD +132 -0
  131. kuavo_humanoid_sdk-1.1.6b1155.dist-info/WHEEL +6 -0
  132. kuavo_humanoid_sdk-1.1.6b1155.dist-info/top_level.txt +1 -0
@@ -0,0 +1,177 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/robotArmQVVD.msg. Do not edit."""
3
+ import codecs
4
+ import sys
5
+ python3 = True if sys.hexversion > 0x03000000 else False
6
+ import genpy
7
+ import struct
8
+
9
+
10
+ class robotArmQVVD(genpy.Message):
11
+ _md5sum = "f2840165d02c529a8a4e8e04370a219b"
12
+ _type = "kuavo_msgs/robotArmQVVD"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """float64[] q
15
+ float64[] v
16
+ float64[] vd
17
+ """
18
+ __slots__ = ['q','v','vd']
19
+ _slot_types = ['float64[]','float64[]','float64[]']
20
+
21
+ def __init__(self, *args, **kwds):
22
+ """
23
+ Constructor. Any message fields that are implicitly/explicitly
24
+ set to None will be assigned a default value. The recommend
25
+ use is keyword arguments as this is more robust to future message
26
+ changes. You cannot mix in-order arguments and keyword arguments.
27
+
28
+ The available fields are:
29
+ q,v,vd
30
+
31
+ :param args: complete set of field values, in .msg order
32
+ :param kwds: use keyword arguments corresponding to message field names
33
+ to set specific fields.
34
+ """
35
+ if args or kwds:
36
+ super(robotArmQVVD, self).__init__(*args, **kwds)
37
+ # message fields cannot be None, assign default values for those that are
38
+ if self.q is None:
39
+ self.q = []
40
+ if self.v is None:
41
+ self.v = []
42
+ if self.vd is None:
43
+ self.vd = []
44
+ else:
45
+ self.q = []
46
+ self.v = []
47
+ self.vd = []
48
+
49
+ def _get_types(self):
50
+ """
51
+ internal API method
52
+ """
53
+ return self._slot_types
54
+
55
+ def serialize(self, buff):
56
+ """
57
+ serialize message into buffer
58
+ :param buff: buffer, ``StringIO``
59
+ """
60
+ try:
61
+ length = len(self.q)
62
+ buff.write(_struct_I.pack(length))
63
+ pattern = '<%sd'%length
64
+ buff.write(struct.Struct(pattern).pack(*self.q))
65
+ length = len(self.v)
66
+ buff.write(_struct_I.pack(length))
67
+ pattern = '<%sd'%length
68
+ buff.write(struct.Struct(pattern).pack(*self.v))
69
+ length = len(self.vd)
70
+ buff.write(_struct_I.pack(length))
71
+ pattern = '<%sd'%length
72
+ buff.write(struct.Struct(pattern).pack(*self.vd))
73
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
74
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
75
+
76
+ def deserialize(self, str):
77
+ """
78
+ unpack serialized message in str into this message instance
79
+ :param str: byte array of serialized message, ``str``
80
+ """
81
+ if python3:
82
+ codecs.lookup_error("rosmsg").msg_type = self._type
83
+ try:
84
+ end = 0
85
+ start = end
86
+ end += 4
87
+ (length,) = _struct_I.unpack(str[start:end])
88
+ pattern = '<%sd'%length
89
+ start = end
90
+ s = struct.Struct(pattern)
91
+ end += s.size
92
+ self.q = s.unpack(str[start:end])
93
+ start = end
94
+ end += 4
95
+ (length,) = _struct_I.unpack(str[start:end])
96
+ pattern = '<%sd'%length
97
+ start = end
98
+ s = struct.Struct(pattern)
99
+ end += s.size
100
+ self.v = s.unpack(str[start:end])
101
+ start = end
102
+ end += 4
103
+ (length,) = _struct_I.unpack(str[start:end])
104
+ pattern = '<%sd'%length
105
+ start = end
106
+ s = struct.Struct(pattern)
107
+ end += s.size
108
+ self.vd = s.unpack(str[start:end])
109
+ return self
110
+ except struct.error as e:
111
+ raise genpy.DeserializationError(e) # most likely buffer underfill
112
+
113
+
114
+ def serialize_numpy(self, buff, numpy):
115
+ """
116
+ serialize message with numpy array types into buffer
117
+ :param buff: buffer, ``StringIO``
118
+ :param numpy: numpy python module
119
+ """
120
+ try:
121
+ length = len(self.q)
122
+ buff.write(_struct_I.pack(length))
123
+ pattern = '<%sd'%length
124
+ buff.write(self.q.tostring())
125
+ length = len(self.v)
126
+ buff.write(_struct_I.pack(length))
127
+ pattern = '<%sd'%length
128
+ buff.write(self.v.tostring())
129
+ length = len(self.vd)
130
+ buff.write(_struct_I.pack(length))
131
+ pattern = '<%sd'%length
132
+ buff.write(self.vd.tostring())
133
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
134
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
135
+
136
+ def deserialize_numpy(self, str, numpy):
137
+ """
138
+ unpack serialized message in str into this message instance using numpy for array types
139
+ :param str: byte array of serialized message, ``str``
140
+ :param numpy: numpy python module
141
+ """
142
+ if python3:
143
+ codecs.lookup_error("rosmsg").msg_type = self._type
144
+ try:
145
+ end = 0
146
+ start = end
147
+ end += 4
148
+ (length,) = _struct_I.unpack(str[start:end])
149
+ pattern = '<%sd'%length
150
+ start = end
151
+ s = struct.Struct(pattern)
152
+ end += s.size
153
+ self.q = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
154
+ start = end
155
+ end += 4
156
+ (length,) = _struct_I.unpack(str[start:end])
157
+ pattern = '<%sd'%length
158
+ start = end
159
+ s = struct.Struct(pattern)
160
+ end += s.size
161
+ self.v = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
162
+ start = end
163
+ end += 4
164
+ (length,) = _struct_I.unpack(str[start:end])
165
+ pattern = '<%sd'%length
166
+ start = end
167
+ s = struct.Struct(pattern)
168
+ end += s.size
169
+ self.vd = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
170
+ return self
171
+ except struct.error as e:
172
+ raise genpy.DeserializationError(e) # most likely buffer underfill
173
+
174
+ _struct_I = genpy.struct_I
175
+ def _get_struct_I():
176
+ global _struct_I
177
+ return _struct_I
@@ -0,0 +1,225 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/robotHandPosition.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 robotHandPosition(genpy.Message):
12
+ _md5sum = "ee45ac8dfb6e0c9a4c7712025fd69d4f"
13
+ _type = "kuavo_msgs/robotHandPosition"
14
+ _has_header = True # flag to mark the presence of a Header object
15
+ _full_text = """Header header
16
+ uint8[] left_hand_position
17
+ uint8[] right_hand_position
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','left_hand_position','right_hand_position']
35
+ _slot_types = ['std_msgs/Header','uint8[]','uint8[]']
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,left_hand_position,right_hand_position
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(robotHandPosition, 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.left_hand_position is None:
57
+ self.left_hand_position = b''
58
+ if self.right_hand_position is None:
59
+ self.right_hand_position = b''
60
+ else:
61
+ self.header = std_msgs.msg.Header()
62
+ self.left_hand_position = b''
63
+ self.right_hand_position = b''
64
+
65
+ def _get_types(self):
66
+ """
67
+ internal API method
68
+ """
69
+ return self._slot_types
70
+
71
+ def serialize(self, buff):
72
+ """
73
+ serialize message into buffer
74
+ :param buff: buffer, ``StringIO``
75
+ """
76
+ try:
77
+ _x = self
78
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
79
+ _x = self.header.frame_id
80
+ length = len(_x)
81
+ if python3 or type(_x) == unicode:
82
+ _x = _x.encode('utf-8')
83
+ length = len(_x)
84
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
85
+ _x = self.left_hand_position
86
+ length = len(_x)
87
+ # - if encoded as a list instead, serialize as bytes instead of string
88
+ if type(_x) in [list, tuple]:
89
+ buff.write(struct.Struct('<I%sB'%length).pack(length, *_x))
90
+ else:
91
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
92
+ _x = self.right_hand_position
93
+ length = len(_x)
94
+ # - if encoded as a list instead, serialize as bytes instead of string
95
+ if type(_x) in [list, tuple]:
96
+ buff.write(struct.Struct('<I%sB'%length).pack(length, *_x))
97
+ else:
98
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
99
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
100
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
101
+
102
+ def deserialize(self, str):
103
+ """
104
+ unpack serialized message in str into this message instance
105
+ :param str: byte array of serialized message, ``str``
106
+ """
107
+ if python3:
108
+ codecs.lookup_error("rosmsg").msg_type = self._type
109
+ try:
110
+ if self.header is None:
111
+ self.header = std_msgs.msg.Header()
112
+ end = 0
113
+ _x = self
114
+ start = end
115
+ end += 12
116
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
117
+ start = end
118
+ end += 4
119
+ (length,) = _struct_I.unpack(str[start:end])
120
+ start = end
121
+ end += length
122
+ if python3:
123
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
124
+ else:
125
+ self.header.frame_id = str[start:end]
126
+ start = end
127
+ end += 4
128
+ (length,) = _struct_I.unpack(str[start:end])
129
+ start = end
130
+ end += length
131
+ self.left_hand_position = str[start:end]
132
+ start = end
133
+ end += 4
134
+ (length,) = _struct_I.unpack(str[start:end])
135
+ start = end
136
+ end += length
137
+ self.right_hand_position = str[start:end]
138
+ return self
139
+ except struct.error as e:
140
+ raise genpy.DeserializationError(e) # most likely buffer underfill
141
+
142
+
143
+ def serialize_numpy(self, buff, numpy):
144
+ """
145
+ serialize message with numpy array types into buffer
146
+ :param buff: buffer, ``StringIO``
147
+ :param numpy: numpy python module
148
+ """
149
+ try:
150
+ _x = self
151
+ buff.write(_get_struct_3I().pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
152
+ _x = self.header.frame_id
153
+ length = len(_x)
154
+ if python3 or type(_x) == unicode:
155
+ _x = _x.encode('utf-8')
156
+ length = len(_x)
157
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
158
+ _x = self.left_hand_position
159
+ length = len(_x)
160
+ # - if encoded as a list instead, serialize as bytes instead of string
161
+ if type(_x) in [list, tuple]:
162
+ buff.write(struct.Struct('<I%sB'%length).pack(length, *_x))
163
+ else:
164
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
165
+ _x = self.right_hand_position
166
+ length = len(_x)
167
+ # - if encoded as a list instead, serialize as bytes instead of string
168
+ if type(_x) in [list, tuple]:
169
+ buff.write(struct.Struct('<I%sB'%length).pack(length, *_x))
170
+ else:
171
+ buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
172
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
173
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
174
+
175
+ def deserialize_numpy(self, str, numpy):
176
+ """
177
+ unpack serialized message in str into this message instance using numpy for array types
178
+ :param str: byte array of serialized message, ``str``
179
+ :param numpy: numpy python module
180
+ """
181
+ if python3:
182
+ codecs.lookup_error("rosmsg").msg_type = self._type
183
+ try:
184
+ if self.header is None:
185
+ self.header = std_msgs.msg.Header()
186
+ end = 0
187
+ _x = self
188
+ start = end
189
+ end += 12
190
+ (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _get_struct_3I().unpack(str[start:end])
191
+ start = end
192
+ end += 4
193
+ (length,) = _struct_I.unpack(str[start:end])
194
+ start = end
195
+ end += length
196
+ if python3:
197
+ self.header.frame_id = str[start:end].decode('utf-8', 'rosmsg')
198
+ else:
199
+ self.header.frame_id = str[start:end]
200
+ start = end
201
+ end += 4
202
+ (length,) = _struct_I.unpack(str[start:end])
203
+ start = end
204
+ end += length
205
+ self.left_hand_position = str[start:end]
206
+ start = end
207
+ end += 4
208
+ (length,) = _struct_I.unpack(str[start:end])
209
+ start = end
210
+ end += length
211
+ self.right_hand_position = str[start:end]
212
+ return self
213
+ except struct.error as e:
214
+ raise genpy.DeserializationError(e) # most likely buffer underfill
215
+
216
+ _struct_I = genpy.struct_I
217
+ def _get_struct_I():
218
+ global _struct_I
219
+ return _struct_I
220
+ _struct_3I = None
221
+ def _get_struct_3I():
222
+ global _struct_3I
223
+ if _struct_3I is None:
224
+ _struct_3I = struct.Struct("<3I")
225
+ return _struct_3I
@@ -0,0 +1,128 @@
1
+ # This Python file uses the following encoding: utf-8
2
+ """autogenerated by genpy from kuavo_msgs/robotHeadMotionData.msg. Do not edit."""
3
+ import codecs
4
+ import sys
5
+ python3 = True if sys.hexversion > 0x03000000 else False
6
+ import genpy
7
+ import struct
8
+
9
+
10
+ class robotHeadMotionData(genpy.Message):
11
+ _md5sum = "400001e7cf73111efbced59084cb481a"
12
+ _type = "kuavo_msgs/robotHeadMotionData"
13
+ _has_header = False # flag to mark the presence of a Header object
14
+ _full_text = """# robotHeadMotionData.msg
15
+ #
16
+ # - joint_data[0] : yaw, [-30, 30]
17
+ # - joint_data[1] : pitch, [-25, 25]
18
+ #
19
+ # - [-8.000000, 0.000000]
20
+
21
+ float64[] joint_data
22
+ """
23
+ __slots__ = ['joint_data']
24
+ _slot_types = ['float64[]']
25
+
26
+ def __init__(self, *args, **kwds):
27
+ """
28
+ Constructor. Any message fields that are implicitly/explicitly
29
+ set to None will be assigned a default value. The recommend
30
+ use is keyword arguments as this is more robust to future message
31
+ changes. You cannot mix in-order arguments and keyword arguments.
32
+
33
+ The available fields are:
34
+ joint_data
35
+
36
+ :param args: complete set of field values, in .msg order
37
+ :param kwds: use keyword arguments corresponding to message field names
38
+ to set specific fields.
39
+ """
40
+ if args or kwds:
41
+ super(robotHeadMotionData, self).__init__(*args, **kwds)
42
+ # message fields cannot be None, assign default values for those that are
43
+ if self.joint_data is None:
44
+ self.joint_data = []
45
+ else:
46
+ self.joint_data = []
47
+
48
+ def _get_types(self):
49
+ """
50
+ internal API method
51
+ """
52
+ return self._slot_types
53
+
54
+ def serialize(self, buff):
55
+ """
56
+ serialize message into buffer
57
+ :param buff: buffer, ``StringIO``
58
+ """
59
+ try:
60
+ length = len(self.joint_data)
61
+ buff.write(_struct_I.pack(length))
62
+ pattern = '<%sd'%length
63
+ buff.write(struct.Struct(pattern).pack(*self.joint_data))
64
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
65
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
66
+
67
+ def deserialize(self, str):
68
+ """
69
+ unpack serialized message in str into this message instance
70
+ :param str: byte array of serialized message, ``str``
71
+ """
72
+ if python3:
73
+ codecs.lookup_error("rosmsg").msg_type = self._type
74
+ try:
75
+ end = 0
76
+ start = end
77
+ end += 4
78
+ (length,) = _struct_I.unpack(str[start:end])
79
+ pattern = '<%sd'%length
80
+ start = end
81
+ s = struct.Struct(pattern)
82
+ end += s.size
83
+ self.joint_data = s.unpack(str[start:end])
84
+ return self
85
+ except struct.error as e:
86
+ raise genpy.DeserializationError(e) # most likely buffer underfill
87
+
88
+
89
+ def serialize_numpy(self, buff, numpy):
90
+ """
91
+ serialize message with numpy array types into buffer
92
+ :param buff: buffer, ``StringIO``
93
+ :param numpy: numpy python module
94
+ """
95
+ try:
96
+ length = len(self.joint_data)
97
+ buff.write(_struct_I.pack(length))
98
+ pattern = '<%sd'%length
99
+ buff.write(self.joint_data.tostring())
100
+ except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
101
+ except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
102
+
103
+ def deserialize_numpy(self, str, numpy):
104
+ """
105
+ unpack serialized message in str into this message instance using numpy for array types
106
+ :param str: byte array of serialized message, ``str``
107
+ :param numpy: numpy python module
108
+ """
109
+ if python3:
110
+ codecs.lookup_error("rosmsg").msg_type = self._type
111
+ try:
112
+ end = 0
113
+ start = end
114
+ end += 4
115
+ (length,) = _struct_I.unpack(str[start:end])
116
+ pattern = '<%sd'%length
117
+ start = end
118
+ s = struct.Struct(pattern)
119
+ end += s.size
120
+ self.joint_data = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
121
+ return self
122
+ except struct.error as e:
123
+ raise genpy.DeserializationError(e) # most likely buffer underfill
124
+
125
+ _struct_I = genpy.struct_I
126
+ def _get_struct_I():
127
+ global _struct_I
128
+ return _struct_I