~ugocupcic/sr-ros-interface/manipulation

« back to all changes in this revision

Viewing changes to shadow_robot/sr_control_gui/src/sr_control_gui/plugins/hand_joint_sliders/__init__.py

  • Committer: Ugo Cupcic
  • Date: 2011-05-23 15:44:05 UTC
  • mfrom: (119.1.67 sr-ros-interface)
  • Revision ID: ugo@shadowrobot.com-20110523154405-kwvv543sy9wxehzi
Huge merge from trunk. Lots of changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
 
3
 
import roslib; roslib.load_manifest('sr_control_gui')
4
 
import rospy
5
 
 
6
 
from joint_slider import Joint, JointSlider
7
 
  
8
 
class HandJointSlider(JointSlider):  
9
 
    """
10
 
    Hand joint sliders to move the hand joints with sliders.
11
 
    """
12
 
    name = "Hand Joint Sliders"
13
 
        
14
 
    def __init__(self):
15
 
        joints_list = []
16
 
        
17
 
        joints_list.append(Joint("FFJ0", 0, 180))
18
 
        joints_list.append(Joint("FFJ3"))
19
 
        joints_list.append(Joint("FFJ4", -25, 25))
20
 
        
21
 
        joints_list.append(Joint("MFJ0", 0, 180))
22
 
        joints_list.append(Joint("MFJ3"))
23
 
        joints_list.append(Joint("MFJ4", -25, 25))
24
 
        
25
 
        joints_list.append(Joint("RFJ0", 0, 180))
26
 
        joints_list.append(Joint("RFJ3"))
27
 
        joints_list.append(Joint("RFJ4", -25, 25))
28
 
        
29
 
        joints_list.append(Joint("LFJ0", 0, 180))
30
 
        joints_list.append(Joint("LFJ3"))
31
 
        joints_list.append(Joint("LFJ4", -25, 25))
32
 
        joints_list.append(Joint("LFJ5", 0, 45))
33
 
        
34
 
        joints_list.append(Joint("THJ1"))
35
 
        joints_list.append(Joint("THJ2", -30, 30))
36
 
        joints_list.append(Joint("THJ3", -15, 15))
37
 
        joints_list.append(Joint("THJ4", 0, 70))
38
 
        joints_list.append(Joint("THJ5", -60, 60))
39
 
        
40
 
        joints_list.append(Joint("WRJ1", -35, 45))
41
 
        joints_list.append(Joint("WRJ2", -30, 10))
42
 
        
43
 
        JointSlider.__init__(self, joints_list)
44
 
 
45
 
    def sendupdate(self, dict):
46
 
        self.parent.parent.libraries["sr_library"].sendupdate_from_dict(dict)
47
 
        self.set_icon(self.parent.parent.rootPath + '/images/icons/iconHand.png')
 
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
import roslib; roslib.load_manifest('sr_control_gui')
 
20
import rospy
 
21
 
 
22
from joint_slider import Joint, JointSlider
 
23
  
 
24
class HandJointSlider(JointSlider):  
 
25
    """
 
26
    Hand joint sliders to move the hand joints with sliders.
 
27
    """
 
28
    name = "Hand Joint Sliders"
 
29
        
 
30
    def __init__(self):
 
31
        joints_list = []
 
32
        
 
33
        joints_list.append(Joint("FFJ0", 0, 180))
 
34
        joints_list.append(Joint("FFJ3"))
 
35
        joints_list.append(Joint("FFJ4", -25, 25))
 
36
        
 
37
        joints_list.append(Joint("MFJ0", 0, 180))
 
38
        joints_list.append(Joint("MFJ3"))
 
39
        joints_list.append(Joint("MFJ4", -25, 25))
 
40
        
 
41
        joints_list.append(Joint("RFJ0", 0, 180))
 
42
        joints_list.append(Joint("RFJ3"))
 
43
        joints_list.append(Joint("RFJ4", -25, 25))
 
44
        
 
45
        joints_list.append(Joint("LFJ0", 0, 180))
 
46
        joints_list.append(Joint("LFJ3"))
 
47
        joints_list.append(Joint("LFJ4", -25, 25))
 
48
        joints_list.append(Joint("LFJ5", 0, 45))
 
49
        
 
50
        joints_list.append(Joint("THJ1"))
 
51
        joints_list.append(Joint("THJ2", -30, 30))
 
52
        joints_list.append(Joint("THJ3", -15, 15))
 
53
        joints_list.append(Joint("THJ4", 0, 70))
 
54
        joints_list.append(Joint("THJ5", -60, 60))
 
55
        
 
56
        joints_list.append(Joint("WRJ1", -35, 45))
 
57
        joints_list.append(Joint("WRJ2", -30, 10))
 
58
        
 
59
        JointSlider.__init__(self, joints_list)
 
60
 
 
61
    def sendupdate(self, dict):
 
62
        self.parent.parent.libraries["sr_library"].sendupdate_from_dict(dict)
 
63
        self.set_icon(self.parent.parent.rootPath + '/images/icons/iconHand.png')