sr_store_hand.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 # This example demonstrates how you can send a trajectory created from named poses.
17 
18 import rospy
19 
20 from sr_robot_commander.sr_hand_commander import SrHandCommander
21 from sr_utilities.hand_finder import HandFinder
22 rospy.init_node("named_traj_example", anonymous=True)
23 
24 hand_finder = HandFinder()
25 
26 hand_parameters = hand_finder.get_hand_parameters()
27 hand_serial = hand_parameters.mapping.keys()[0]
28 
29 hand_commander = SrHandCommander(hand_parameters=hand_parameters,
30  hand_serial=hand_serial)
31 
32 trajectory = [
33  {
34  'name': 'open',
35  'interpolate_time': 3.0,
36  'pause_time': 2
37  },
38  {
39  'name': 'fingers_pack_thumb_open',
40  'interpolate_time': 3.0,
41  'pause_time': 2
42  },
43  {
44  'name': 'pack',
45  'interpolate_time': 3.0
46  }
47 ]
48 
49 # Run trajectory via moveit
50 hand_commander.run_named_trajectory(trajectory)


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