sr_print_ef_position.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 # An example of how to print the current end effector of the hand and arm
17 
18 # For more information, please see:
19 # https://dexterous-hand.readthedocs.io/en/latest/user_guide/2_software_description.html#robot-commander
20 
21 import rospy
22 from sr_robot_commander.sr_hand_commander import SrHandCommander
23 from sr_robot_commander.sr_arm_commander import SrArmCommander
24 from sr_utilities.hand_finder import HandFinder
25 from math import pi
26 import argparse
27 
28 rospy.init_node("print_ef_position", anonymous=True)
29 
30 hand_commander = SrHandCommander(name="right_hand")
31 arm_commander = SrArmCommander(name="right_arm")
32 
33 rospy.loginfo("The end effectors:\n")
34 
35 eff_pose_arm = arm_commander.get_current_pose()
36 rospy.loginfo("The arm end effector pose:\n" + str(eff_pose_arm))
37 
38 eff_pose_hand = arm_commander.get_current_pose("rh_palm")
39 rospy.loginfo("The hand end effector pose:\n" + str(eff_pose_hand))


sr_example
Author(s): Ugo Cupcic
autogenerated on Mon Feb 28 2022 23:52:10