toggle-fist.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 # Copyright (C) 2017 rerobots, Inc.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 # http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 """Example: repeatedly toggle the "fist" position
16 
17 This repeatedly sends the "fist" motion primitive. Each successive
18 command negates the previous, so the hand should alternate between
19 opened and closed fists.
20 """
21 
22 import roslib; roslib.load_manifest('brunel_hand_ros')
23 import rospy
24 from brunel_hand_ros.msg import HandPrimitive
25 
26 
27 rospy.init_node('open_close_fist', anonymous=True)
28 
29 pubprime = rospy.Publisher('/motion_primitive', HandPrimitive, queue_size=1)
30 
31 rate = rospy.Rate(0.3)
32 while not rospy.is_shutdown():
33  hp = HandPrimitive()
34  hp.primitive = HandPrimitive.FIST
35  pubprime.publish(hp)
36  rate.sleep()


brunel_hand_ros
Author(s): Scott C. Livingston
autogenerated on Mon Jun 10 2019 12:49:18