sr_hand_tactile_example.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright 2019 Shadow Robot Company Ltd.
3 #
4 # This program is free software: you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the Free
6 # Software Foundation version 2 of the License.
7 #
8 # This program is distributed in the hope that it will be useful, but WITHOUT
9 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 # more details.
12 #
13 # You should have received a copy of the GNU General Public License along
14 # with this program. If not, see <http://www.gnu.org/licenses/>.
15 
16 # Reading the tactiles from the hand.
17 
18 import rospy
19 from sr_robot_commander.sr_hand_commander import SrHandCommander
20 from sr_utilities.hand_finder import HandFinder
21 
22 rospy.init_node("tactile_reader", anonymous=True)
23 hand_finder = HandFinder()
24 
25 hand_parameters = hand_finder.get_hand_parameters()
26 hand_serial = hand_parameters.mapping.keys()[0]
27 
28 hand_commander = SrHandCommander(hand_parameters=hand_parameters,
29  hand_serial=hand_serial)
30 
31 rospy.sleep(1.0)
32 
33 print "Tactile type: ", hand_commander.get_tactile_type()
34 print "Tactile state: ", hand_commander.get_tactile_state()


sr_example
Author(s): Ugo Cupcic
autogenerated on Wed Oct 14 2020 04:05:12