move_fake_pi_arm_start.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env python
  2. """ move_fake_pi_arm_start.py - Version 1.1 2013-12-20
  3. Position the fake Pi Robot's arm to a more natural starting position.
  4. Created for the Pi Robot Project: http://www.pirobot.org
  5. Copyright (c) 2012 Patrick Goebel. All rights reserved.
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.5
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details at:
  14. http://www.gnu.org/licenses/gpl.html
  15. """
  16. import rospy
  17. from std_msgs.msg import Float64
  18. from sensor_msgs.msg import JointState
  19. if __name__ == '__main__':
  20. rospy.init_node('move_fake_pi_arm_start')
  21. lift = rospy.Publisher('arm_shoulder_lift_joint/command', Float64, queue_size=5)
  22. elbow = rospy.Publisher('arm_elbow_flex_joint/command', Float64, queue_size=5)
  23. rospy.wait_for_message('joint_states', JointState)
  24. for i in range(3):
  25. lift.publish(Float64(2.62))
  26. elbow.publish(Float64(0.45))
  27. rospy.sleep(0.5)