Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
scripts
sr_hand
Grasp.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
#
3
# Copyright 2011 Shadow Robot Company Ltd.
4
#
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by the Free
7
# Software Foundation, either version 2 of the License, or (at your option)
8
# any later version.
9
#
10
# This program is distributed in the hope that it will be useful, but WITHOUT
11
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13
# more details.
14
#
15
# You should have received a copy of the GNU General Public License along
16
# with this program. If not, see <http://www.gnu.org/licenses/>.
17
#
18
19
VERBOSE = 1
20
21
22
class
Grasp
(object):
23
24
def
__init__
(self):
25
self.
grasp_name
=
""
26
self.
joints_and_positions
= {}
27
28
def
display_grasp
(self):
29
print
self.
grasp_name
30
print
self.
joints_and_positions
31
32
def
convert_to_xml
(self):
33
grasp =
' <grasp name="'
+ self.
grasp_name
+
'">'
+
'\n'
34
for
key, value
in
self.joints_and_positions.items():
35
grasp = grasp +
' <joint name="'
+ \
36
str(key) +
'">'
+ str(value) +
'</joint>\n'
37
grasp = grasp +
' </grasp>'
+
'\n'
38
return
grasp
sr_hand.Grasp.Grasp.convert_to_xml
def convert_to_xml(self)
Definition:
Grasp.py:32
sr_hand.Grasp.Grasp.joints_and_positions
joints_and_positions
Definition:
Grasp.py:26
sr_hand.Grasp.Grasp
Definition:
Grasp.py:22
sr_hand.Grasp.Grasp.__init__
def __init__(self)
Definition:
Grasp.py:24
sr_hand.Grasp.Grasp.grasp_name
grasp_name
Definition:
Grasp.py:25
sr_hand.Grasp.Grasp.display_grasp
def display_grasp(self)
Definition:
Grasp.py:28
sr_hand
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:55:53