(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Sending Commands [python]

Description: Simply sends a command to the Shadow Hand from python.

Tutorial Level:


The following python code will send one target (of 1.5 radians) to FFJ3. First we initialise the node (to register it with the rest of the ROS ecosystem). We then create a publisher to be able to stream some data to the correct topic. Finally we publish the target we want to send.

   1 import roslib; roslib.load_manifest('sr_example')
   2 import rospy
   3 from std_msgs.msg import Float64
   5 rospy.init_node('shadowhand_command_publisher_python')
   6 pub = rospy.Publisher('sh_ffj3_position_controller/command', Float64, latch=True)
   7 pub.publish(1.5)
   9 rospy.spin()

Wiki: sr_hand/Tutorials/Sending Commands [python] (last edited 2014-02-19 12:45:16 by UgoCupcic)