kuavo-humanoid-sdk 1.1.3a1252__py3-none-any.whl → 1.1.6__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.
- kuavo_humanoid_sdk/interfaces/data_types.py +0 -46
- kuavo_humanoid_sdk/kuavo/__init__.py +0 -3
- kuavo_humanoid_sdk/kuavo/core/core.py +6 -18
- kuavo_humanoid_sdk/kuavo/core/ros/control.py +19 -645
- kuavo_humanoid_sdk/kuavo/core/ros/param.py +4 -142
- kuavo_humanoid_sdk/kuavo/core/ros/state.py +15 -329
- kuavo_humanoid_sdk/kuavo/core/ros_env.py +1 -229
- kuavo_humanoid_sdk/kuavo/dexterous_hand.py +2 -6
- kuavo_humanoid_sdk/kuavo/leju_claw.py +2 -6
- kuavo_humanoid_sdk/kuavo/robot.py +22 -43
- kuavo_humanoid_sdk/kuavo/robot_info.py +2 -7
- kuavo_humanoid_sdk/kuavo/robot_state.py +2 -6
- kuavo_humanoid_sdk/msg/kuavo_msgs/msg/__init__.py +0 -7
- kuavo_humanoid_sdk/msg/kuavo_msgs/srv/__init__.py +0 -4
- kuavo_humanoid_sdk/msg/kuavo_msgs/srv/_playmusic.py +20 -26
- kuavo_humanoid_sdk/msg/motion_capture_ik/msg/__init__.py +9 -0
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_armHandPose.py +2 -2
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_handPose.py +2 -2
- kuavo_humanoid_sdk/msg/motion_capture_ik/msg/_headBodyPose.py +145 -0
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_ikSolveError.py +13 -13
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_ikSolveParam.py +2 -2
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_robotArmQVVD.py +2 -2
- kuavo_humanoid_sdk/msg/motion_capture_ik/msg/_robotHandPosition.py +225 -0
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_twoArmHandPose.py +13 -13
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/msg/_twoArmHandPoseCmd.py +15 -15
- kuavo_humanoid_sdk/msg/motion_capture_ik/srv/__init__.py +4 -0
- kuavo_humanoid_sdk/msg/{kuavo_msgs/srv/_SpeechSynthesis.py → motion_capture_ik/srv/_changeArmCtrlMode.py} +98 -93
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/srv/_changeArmCtrlModeKuavo.py +5 -5
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/srv/_fkSrv.py +13 -13
- kuavo_humanoid_sdk/msg/{kuavo_msgs → motion_capture_ik}/srv/_twoArmHandPoseCmdSrv.py +23 -23
- {kuavo_humanoid_sdk-1.1.3a1252.dist-info → kuavo_humanoid_sdk-1.1.6.dist-info}/METADATA +1 -2
- {kuavo_humanoid_sdk-1.1.3a1252.dist-info → kuavo_humanoid_sdk-1.1.6.dist-info}/RECORD +34 -39
- kuavo_humanoid_sdk/common/global_config.py +0 -16
- kuavo_humanoid_sdk/common/websocket_kuavo_sdk.py +0 -23
- kuavo_humanoid_sdk/kuavo/core/audio.py +0 -36
- kuavo_humanoid_sdk/kuavo/core/ros/audio.py +0 -176
- kuavo_humanoid_sdk/kuavo/core/ros/tools.py +0 -158
- kuavo_humanoid_sdk/kuavo/core/ros/vision.py +0 -522
- kuavo_humanoid_sdk/kuavo/robot_audio.py +0 -39
- kuavo_humanoid_sdk/kuavo/robot_tool.py +0 -62
- kuavo_humanoid_sdk/kuavo/robot_vision.py +0 -90
- {kuavo_humanoid_sdk-1.1.3a1252.dist-info → kuavo_humanoid_sdk-1.1.6.dist-info}/WHEEL +0 -0
- {kuavo_humanoid_sdk-1.1.3a1252.dist-info → kuavo_humanoid_sdk-1.1.6.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# This Python file uses the following encoding: utf-8
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/headBodyPose.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 headBodyPose(genpy.Message):
|
|
11
|
+
_md5sum = "86a58d9f885335d8a0b389ace07ba692"
|
|
12
|
+
_type = "motion_capture_ik/headBodyPose"
|
|
13
|
+
_has_header = False # flag to mark the presence of a Header object
|
|
14
|
+
_full_text = """# head (rad)
|
|
15
|
+
float64 head_pitch
|
|
16
|
+
float64 head_yaw
|
|
17
|
+
# body (rad)
|
|
18
|
+
float64 body_roll
|
|
19
|
+
float64 body_pitch
|
|
20
|
+
float64 body_yaw
|
|
21
|
+
|
|
22
|
+
float64 body_x
|
|
23
|
+
float64 body_y
|
|
24
|
+
float64 body_height"""
|
|
25
|
+
__slots__ = ['head_pitch','head_yaw','body_roll','body_pitch','body_yaw','body_x','body_y','body_height']
|
|
26
|
+
_slot_types = ['float64','float64','float64','float64','float64','float64','float64','float64']
|
|
27
|
+
|
|
28
|
+
def __init__(self, *args, **kwds):
|
|
29
|
+
"""
|
|
30
|
+
Constructor. Any message fields that are implicitly/explicitly
|
|
31
|
+
set to None will be assigned a default value. The recommend
|
|
32
|
+
use is keyword arguments as this is more robust to future message
|
|
33
|
+
changes. You cannot mix in-order arguments and keyword arguments.
|
|
34
|
+
|
|
35
|
+
The available fields are:
|
|
36
|
+
head_pitch,head_yaw,body_roll,body_pitch,body_yaw,body_x,body_y,body_height
|
|
37
|
+
|
|
38
|
+
:param args: complete set of field values, in .msg order
|
|
39
|
+
:param kwds: use keyword arguments corresponding to message field names
|
|
40
|
+
to set specific fields.
|
|
41
|
+
"""
|
|
42
|
+
if args or kwds:
|
|
43
|
+
super(headBodyPose, self).__init__(*args, **kwds)
|
|
44
|
+
# message fields cannot be None, assign default values for those that are
|
|
45
|
+
if self.head_pitch is None:
|
|
46
|
+
self.head_pitch = 0.
|
|
47
|
+
if self.head_yaw is None:
|
|
48
|
+
self.head_yaw = 0.
|
|
49
|
+
if self.body_roll is None:
|
|
50
|
+
self.body_roll = 0.
|
|
51
|
+
if self.body_pitch is None:
|
|
52
|
+
self.body_pitch = 0.
|
|
53
|
+
if self.body_yaw is None:
|
|
54
|
+
self.body_yaw = 0.
|
|
55
|
+
if self.body_x is None:
|
|
56
|
+
self.body_x = 0.
|
|
57
|
+
if self.body_y is None:
|
|
58
|
+
self.body_y = 0.
|
|
59
|
+
if self.body_height is None:
|
|
60
|
+
self.body_height = 0.
|
|
61
|
+
else:
|
|
62
|
+
self.head_pitch = 0.
|
|
63
|
+
self.head_yaw = 0.
|
|
64
|
+
self.body_roll = 0.
|
|
65
|
+
self.body_pitch = 0.
|
|
66
|
+
self.body_yaw = 0.
|
|
67
|
+
self.body_x = 0.
|
|
68
|
+
self.body_y = 0.
|
|
69
|
+
self.body_height = 0.
|
|
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_8d().pack(_x.head_pitch, _x.head_yaw, _x.body_roll, _x.body_pitch, _x.body_yaw, _x.body_x, _x.body_y, _x.body_height))
|
|
85
|
+
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
|
|
86
|
+
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
|
|
87
|
+
|
|
88
|
+
def deserialize(self, str):
|
|
89
|
+
"""
|
|
90
|
+
unpack serialized message in str into this message instance
|
|
91
|
+
:param str: byte array of serialized message, ``str``
|
|
92
|
+
"""
|
|
93
|
+
if python3:
|
|
94
|
+
codecs.lookup_error("rosmsg").msg_type = self._type
|
|
95
|
+
try:
|
|
96
|
+
end = 0
|
|
97
|
+
_x = self
|
|
98
|
+
start = end
|
|
99
|
+
end += 64
|
|
100
|
+
(_x.head_pitch, _x.head_yaw, _x.body_roll, _x.body_pitch, _x.body_yaw, _x.body_x, _x.body_y, _x.body_height,) = _get_struct_8d().unpack(str[start:end])
|
|
101
|
+
return self
|
|
102
|
+
except struct.error as e:
|
|
103
|
+
raise genpy.DeserializationError(e) # most likely buffer underfill
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def serialize_numpy(self, buff, numpy):
|
|
107
|
+
"""
|
|
108
|
+
serialize message with numpy array types into buffer
|
|
109
|
+
:param buff: buffer, ``StringIO``
|
|
110
|
+
:param numpy: numpy python module
|
|
111
|
+
"""
|
|
112
|
+
try:
|
|
113
|
+
_x = self
|
|
114
|
+
buff.write(_get_struct_8d().pack(_x.head_pitch, _x.head_yaw, _x.body_roll, _x.body_pitch, _x.body_yaw, _x.body_x, _x.body_y, _x.body_height))
|
|
115
|
+
except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
|
|
116
|
+
except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
|
|
117
|
+
|
|
118
|
+
def deserialize_numpy(self, str, numpy):
|
|
119
|
+
"""
|
|
120
|
+
unpack serialized message in str into this message instance using numpy for array types
|
|
121
|
+
:param str: byte array of serialized message, ``str``
|
|
122
|
+
:param numpy: numpy python module
|
|
123
|
+
"""
|
|
124
|
+
if python3:
|
|
125
|
+
codecs.lookup_error("rosmsg").msg_type = self._type
|
|
126
|
+
try:
|
|
127
|
+
end = 0
|
|
128
|
+
_x = self
|
|
129
|
+
start = end
|
|
130
|
+
end += 64
|
|
131
|
+
(_x.head_pitch, _x.head_yaw, _x.body_roll, _x.body_pitch, _x.body_yaw, _x.body_x, _x.body_y, _x.body_height,) = _get_struct_8d().unpack(str[start:end])
|
|
132
|
+
return self
|
|
133
|
+
except struct.error as e:
|
|
134
|
+
raise genpy.DeserializationError(e) # most likely buffer underfill
|
|
135
|
+
|
|
136
|
+
_struct_I = genpy.struct_I
|
|
137
|
+
def _get_struct_I():
|
|
138
|
+
global _struct_I
|
|
139
|
+
return _struct_I
|
|
140
|
+
_struct_8d = None
|
|
141
|
+
def _get_struct_8d():
|
|
142
|
+
global _struct_8d
|
|
143
|
+
if _struct_8d is None:
|
|
144
|
+
_struct_8d = struct.Struct("<8d")
|
|
145
|
+
return _struct_8d
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
# This Python file uses the following encoding: utf-8
|
|
2
|
-
"""autogenerated by genpy from
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/ikSolveError.msg. Do not edit."""
|
|
3
3
|
import codecs
|
|
4
4
|
import sys
|
|
5
5
|
python3 = True if sys.hexversion > 0x03000000 else False
|
|
6
6
|
import genpy
|
|
7
7
|
import struct
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import motion_capture_ik.msg
|
|
10
10
|
|
|
11
11
|
class ikSolveError(genpy.Message):
|
|
12
12
|
_md5sum = "06c12c0e6e08f286627a6f856e26223c"
|
|
13
|
-
_type = "
|
|
13
|
+
_type = "motion_capture_ik/ikSolveError"
|
|
14
14
|
_has_header = False # flag to mark the presence of a Header object
|
|
15
15
|
_full_text = """string ik_type
|
|
16
16
|
handPose left_pose_error
|
|
17
17
|
handPose right_pose_error
|
|
18
18
|
================================================================================
|
|
19
|
-
MSG:
|
|
19
|
+
MSG: motion_capture_ik/handPose
|
|
20
20
|
# pos
|
|
21
21
|
float64 x
|
|
22
22
|
float64 y
|
|
@@ -26,7 +26,7 @@ float64 roll
|
|
|
26
26
|
float64 pitch
|
|
27
27
|
float64 yaw"""
|
|
28
28
|
__slots__ = ['ik_type','left_pose_error','right_pose_error']
|
|
29
|
-
_slot_types = ['string','
|
|
29
|
+
_slot_types = ['string','motion_capture_ik/handPose','motion_capture_ik/handPose']
|
|
30
30
|
|
|
31
31
|
def __init__(self, *args, **kwds):
|
|
32
32
|
"""
|
|
@@ -48,13 +48,13 @@ float64 yaw"""
|
|
|
48
48
|
if self.ik_type is None:
|
|
49
49
|
self.ik_type = ''
|
|
50
50
|
if self.left_pose_error is None:
|
|
51
|
-
self.left_pose_error =
|
|
51
|
+
self.left_pose_error = motion_capture_ik.msg.handPose()
|
|
52
52
|
if self.right_pose_error is None:
|
|
53
|
-
self.right_pose_error =
|
|
53
|
+
self.right_pose_error = motion_capture_ik.msg.handPose()
|
|
54
54
|
else:
|
|
55
55
|
self.ik_type = ''
|
|
56
|
-
self.left_pose_error =
|
|
57
|
-
self.right_pose_error =
|
|
56
|
+
self.left_pose_error = motion_capture_ik.msg.handPose()
|
|
57
|
+
self.right_pose_error = motion_capture_ik.msg.handPose()
|
|
58
58
|
|
|
59
59
|
def _get_types(self):
|
|
60
60
|
"""
|
|
@@ -88,9 +88,9 @@ float64 yaw"""
|
|
|
88
88
|
codecs.lookup_error("rosmsg").msg_type = self._type
|
|
89
89
|
try:
|
|
90
90
|
if self.left_pose_error is None:
|
|
91
|
-
self.left_pose_error =
|
|
91
|
+
self.left_pose_error = motion_capture_ik.msg.handPose()
|
|
92
92
|
if self.right_pose_error is None:
|
|
93
|
-
self.right_pose_error =
|
|
93
|
+
self.right_pose_error = motion_capture_ik.msg.handPose()
|
|
94
94
|
end = 0
|
|
95
95
|
start = end
|
|
96
96
|
end += 4
|
|
@@ -138,9 +138,9 @@ float64 yaw"""
|
|
|
138
138
|
codecs.lookup_error("rosmsg").msg_type = self._type
|
|
139
139
|
try:
|
|
140
140
|
if self.left_pose_error is None:
|
|
141
|
-
self.left_pose_error =
|
|
141
|
+
self.left_pose_error = motion_capture_ik.msg.handPose()
|
|
142
142
|
if self.right_pose_error is None:
|
|
143
|
-
self.right_pose_error =
|
|
143
|
+
self.right_pose_error = motion_capture_ik.msg.handPose()
|
|
144
144
|
end = 0
|
|
145
145
|
start = end
|
|
146
146
|
end += 4
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This Python file uses the following encoding: utf-8
|
|
2
|
-
"""autogenerated by genpy from
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/ikSolveParam.msg. Do not edit."""
|
|
3
3
|
import codecs
|
|
4
4
|
import sys
|
|
5
5
|
python3 = True if sys.hexversion > 0x03000000 else False
|
|
@@ -9,7 +9,7 @@ import struct
|
|
|
9
9
|
|
|
10
10
|
class ikSolveParam(genpy.Message):
|
|
11
11
|
_md5sum = "be29d8b02ad14da680464b8c4f590f98"
|
|
12
|
-
_type = "
|
|
12
|
+
_type = "motion_capture_ik/ikSolveParam"
|
|
13
13
|
_has_header = False # flag to mark the presence of a Header object
|
|
14
14
|
_full_text = """# snopt params
|
|
15
15
|
float64 major_optimality_tol
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This Python file uses the following encoding: utf-8
|
|
2
|
-
"""autogenerated by genpy from
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/robotArmQVVD.msg. Do not edit."""
|
|
3
3
|
import codecs
|
|
4
4
|
import sys
|
|
5
5
|
python3 = True if sys.hexversion > 0x03000000 else False
|
|
@@ -9,7 +9,7 @@ import struct
|
|
|
9
9
|
|
|
10
10
|
class robotArmQVVD(genpy.Message):
|
|
11
11
|
_md5sum = "f2840165d02c529a8a4e8e04370a219b"
|
|
12
|
-
_type = "
|
|
12
|
+
_type = "motion_capture_ik/robotArmQVVD"
|
|
13
13
|
_has_header = False # flag to mark the presence of a Header object
|
|
14
14
|
_full_text = """float64[] q
|
|
15
15
|
float64[] v
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# This Python file uses the following encoding: utf-8
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/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 = "motion_capture_ik/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
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# This Python file uses the following encoding: utf-8
|
|
2
|
-
"""autogenerated by genpy from
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/twoArmHandPose.msg. Do not edit."""
|
|
3
3
|
import codecs
|
|
4
4
|
import sys
|
|
5
5
|
python3 = True if sys.hexversion > 0x03000000 else False
|
|
6
6
|
import genpy
|
|
7
7
|
import struct
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import motion_capture_ik.msg
|
|
10
10
|
import std_msgs.msg
|
|
11
11
|
|
|
12
12
|
class twoArmHandPose(genpy.Message):
|
|
13
13
|
_md5sum = "5bdb1e027f430369b6f88e5e2f5d31ca"
|
|
14
|
-
_type = "
|
|
14
|
+
_type = "motion_capture_ik/twoArmHandPose"
|
|
15
15
|
_has_header = True # flag to mark the presence of a Header object
|
|
16
16
|
_full_text = """Header header
|
|
17
17
|
armHandPose left_pose
|
|
@@ -33,7 +33,7 @@ time stamp
|
|
|
33
33
|
string frame_id
|
|
34
34
|
|
|
35
35
|
================================================================================
|
|
36
|
-
MSG:
|
|
36
|
+
MSG: motion_capture_ik/armHandPose
|
|
37
37
|
float64[3] pos_xyz
|
|
38
38
|
float64[4] quat_xyzw
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ float64[3] elbow_pos_xyz
|
|
|
41
41
|
|
|
42
42
|
float64[7] joint_angles"""
|
|
43
43
|
__slots__ = ['header','left_pose','right_pose']
|
|
44
|
-
_slot_types = ['std_msgs/Header','
|
|
44
|
+
_slot_types = ['std_msgs/Header','motion_capture_ik/armHandPose','motion_capture_ik/armHandPose']
|
|
45
45
|
|
|
46
46
|
def __init__(self, *args, **kwds):
|
|
47
47
|
"""
|
|
@@ -63,13 +63,13 @@ float64[7] joint_angles"""
|
|
|
63
63
|
if self.header is None:
|
|
64
64
|
self.header = std_msgs.msg.Header()
|
|
65
65
|
if self.left_pose is None:
|
|
66
|
-
self.left_pose =
|
|
66
|
+
self.left_pose = motion_capture_ik.msg.armHandPose()
|
|
67
67
|
if self.right_pose is None:
|
|
68
|
-
self.right_pose =
|
|
68
|
+
self.right_pose = motion_capture_ik.msg.armHandPose()
|
|
69
69
|
else:
|
|
70
70
|
self.header = std_msgs.msg.Header()
|
|
71
|
-
self.left_pose =
|
|
72
|
-
self.right_pose =
|
|
71
|
+
self.left_pose = motion_capture_ik.msg.armHandPose()
|
|
72
|
+
self.right_pose = motion_capture_ik.msg.armHandPose()
|
|
73
73
|
|
|
74
74
|
def _get_types(self):
|
|
75
75
|
"""
|
|
@@ -113,9 +113,9 @@ float64[7] joint_angles"""
|
|
|
113
113
|
if self.header is None:
|
|
114
114
|
self.header = std_msgs.msg.Header()
|
|
115
115
|
if self.left_pose is None:
|
|
116
|
-
self.left_pose =
|
|
116
|
+
self.left_pose = motion_capture_ik.msg.armHandPose()
|
|
117
117
|
if self.right_pose is None:
|
|
118
|
-
self.right_pose =
|
|
118
|
+
self.right_pose = motion_capture_ik.msg.armHandPose()
|
|
119
119
|
end = 0
|
|
120
120
|
_x = self
|
|
121
121
|
start = end
|
|
@@ -197,9 +197,9 @@ float64[7] joint_angles"""
|
|
|
197
197
|
if self.header is None:
|
|
198
198
|
self.header = std_msgs.msg.Header()
|
|
199
199
|
if self.left_pose is None:
|
|
200
|
-
self.left_pose =
|
|
200
|
+
self.left_pose = motion_capture_ik.msg.armHandPose()
|
|
201
201
|
if self.right_pose is None:
|
|
202
|
-
self.right_pose =
|
|
202
|
+
self.right_pose = motion_capture_ik.msg.armHandPose()
|
|
203
203
|
end = 0
|
|
204
204
|
_x = self
|
|
205
205
|
start = end
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# This Python file uses the following encoding: utf-8
|
|
2
|
-
"""autogenerated by genpy from
|
|
2
|
+
"""autogenerated by genpy from motion_capture_ik/twoArmHandPoseCmd.msg. Do not edit."""
|
|
3
3
|
import codecs
|
|
4
4
|
import sys
|
|
5
5
|
python3 = True if sys.hexversion > 0x03000000 else False
|
|
6
6
|
import genpy
|
|
7
7
|
import struct
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import motion_capture_ik.msg
|
|
10
10
|
import std_msgs.msg
|
|
11
11
|
|
|
12
12
|
class twoArmHandPoseCmd(genpy.Message):
|
|
13
13
|
_md5sum = "d4b6792a6f960bea428fd7158220110b"
|
|
14
|
-
_type = "
|
|
14
|
+
_type = "motion_capture_ik/twoArmHandPoseCmd"
|
|
15
15
|
_has_header = False # flag to mark the presence of a Header object
|
|
16
16
|
_full_text = """twoArmHandPose hand_poses
|
|
17
17
|
# params for the IK solver
|
|
@@ -19,7 +19,7 @@ bool use_custom_ik_param
|
|
|
19
19
|
bool joint_angles_as_q0
|
|
20
20
|
ikSolveParam ik_param
|
|
21
21
|
================================================================================
|
|
22
|
-
MSG:
|
|
22
|
+
MSG: motion_capture_ik/twoArmHandPose
|
|
23
23
|
Header header
|
|
24
24
|
armHandPose left_pose
|
|
25
25
|
armHandPose right_pose
|
|
@@ -40,7 +40,7 @@ time stamp
|
|
|
40
40
|
string frame_id
|
|
41
41
|
|
|
42
42
|
================================================================================
|
|
43
|
-
MSG:
|
|
43
|
+
MSG: motion_capture_ik/armHandPose
|
|
44
44
|
float64[3] pos_xyz
|
|
45
45
|
float64[4] quat_xyzw
|
|
46
46
|
|
|
@@ -48,7 +48,7 @@ float64[3] elbow_pos_xyz
|
|
|
48
48
|
|
|
49
49
|
float64[7] joint_angles
|
|
50
50
|
================================================================================
|
|
51
|
-
MSG:
|
|
51
|
+
MSG: motion_capture_ik/ikSolveParam
|
|
52
52
|
# snopt params
|
|
53
53
|
float64 major_optimality_tol
|
|
54
54
|
float64 major_feasibility_tol
|
|
@@ -59,7 +59,7 @@ float64 oritation_constraint_tol
|
|
|
59
59
|
float64 pos_constraint_tol # work when pos_cost_weight > 0.0
|
|
60
60
|
float64 pos_cost_weight"""
|
|
61
61
|
__slots__ = ['hand_poses','use_custom_ik_param','joint_angles_as_q0','ik_param']
|
|
62
|
-
_slot_types = ['
|
|
62
|
+
_slot_types = ['motion_capture_ik/twoArmHandPose','bool','bool','motion_capture_ik/ikSolveParam']
|
|
63
63
|
|
|
64
64
|
def __init__(self, *args, **kwds):
|
|
65
65
|
"""
|
|
@@ -79,18 +79,18 @@ float64 pos_cost_weight"""
|
|
|
79
79
|
super(twoArmHandPoseCmd, self).__init__(*args, **kwds)
|
|
80
80
|
# message fields cannot be None, assign default values for those that are
|
|
81
81
|
if self.hand_poses is None:
|
|
82
|
-
self.hand_poses =
|
|
82
|
+
self.hand_poses = motion_capture_ik.msg.twoArmHandPose()
|
|
83
83
|
if self.use_custom_ik_param is None:
|
|
84
84
|
self.use_custom_ik_param = False
|
|
85
85
|
if self.joint_angles_as_q0 is None:
|
|
86
86
|
self.joint_angles_as_q0 = False
|
|
87
87
|
if self.ik_param is None:
|
|
88
|
-
self.ik_param =
|
|
88
|
+
self.ik_param = motion_capture_ik.msg.ikSolveParam()
|
|
89
89
|
else:
|
|
90
|
-
self.hand_poses =
|
|
90
|
+
self.hand_poses = motion_capture_ik.msg.twoArmHandPose()
|
|
91
91
|
self.use_custom_ik_param = False
|
|
92
92
|
self.joint_angles_as_q0 = False
|
|
93
|
-
self.ik_param =
|
|
93
|
+
self.ik_param = motion_capture_ik.msg.ikSolveParam()
|
|
94
94
|
|
|
95
95
|
def _get_types(self):
|
|
96
96
|
"""
|
|
@@ -134,9 +134,9 @@ float64 pos_cost_weight"""
|
|
|
134
134
|
codecs.lookup_error("rosmsg").msg_type = self._type
|
|
135
135
|
try:
|
|
136
136
|
if self.hand_poses is None:
|
|
137
|
-
self.hand_poses =
|
|
137
|
+
self.hand_poses = motion_capture_ik.msg.twoArmHandPose()
|
|
138
138
|
if self.ik_param is None:
|
|
139
|
-
self.ik_param =
|
|
139
|
+
self.ik_param = motion_capture_ik.msg.ikSolveParam()
|
|
140
140
|
end = 0
|
|
141
141
|
_x = self
|
|
142
142
|
start = end
|
|
@@ -224,9 +224,9 @@ float64 pos_cost_weight"""
|
|
|
224
224
|
codecs.lookup_error("rosmsg").msg_type = self._type
|
|
225
225
|
try:
|
|
226
226
|
if self.hand_poses is None:
|
|
227
|
-
self.hand_poses =
|
|
227
|
+
self.hand_poses = motion_capture_ik.msg.twoArmHandPose()
|
|
228
228
|
if self.ik_param is None:
|
|
229
|
-
self.ik_param =
|
|
229
|
+
self.ik_param = motion_capture_ik.msg.ikSolveParam()
|
|
230
230
|
end = 0
|
|
231
231
|
_x = self
|
|
232
232
|
start = end
|