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 version 2 of the License.
8 #
9 # This program is distributed in the hope that it will be useful, but WITHOUT
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 # more details.
13 #
14 # You should have received a copy of the GNU General Public License along
15 # with this program. If not, see <http://www.gnu.org/licenses/>.
16 
17 VERBOSE = 1
18 
19 
20 class Grasp(object):
21 
22  def __init__(self):
23  self.grasp_name = ""
25 
26  def display_grasp(self):
27  print self.grasp_name
28  print self.joints_and_positions
29 
30  def convert_to_xml(self):
31  grasp = ' <grasp name="' + self.grasp_name + '">' + '\n'
32  for key, value in self.joints_and_positions.items():
33  grasp = grasp + ' <joint name="' + \
34  str(key) + '">' + str(value) + '</joint>\n'
35  grasp = grasp + ' </grasp>' + '\n'
36  return grasp
def convert_to_xml(self)
Definition: Grasp.py:30
def __init__(self)
Definition: Grasp.py:22
def display_grasp(self)
Definition: Grasp.py:26


sr_hand
Author(s): Ugo Cupcic
autogenerated on Mon Feb 28 2022 23:52:24