sensor_info.py
Go to the documentation of this file.
1 #! /usr/bin/python3
2 
3 #***********************************************************
4 #* Software License Agreement (BSD License)
5 #*
6 #* Copyright (c) 2009, Willow Garage, Inc.
7 #* All rights reserved.
8 #*
9 #* Redistribution and use in source and binary forms, with or without
10 #* modification, are permitted provided that the following conditions
11 #* are met:
12 #*
13 #* * Redistributions of source code must retain the above copyright
14 #* notice, this list of conditions and the following disclaimer.
15 #* * Redistributions in binary form must reproduce the above
16 #* copyright notice, this list of conditions and the following
17 #* disclaimer in the documentation and/or other materials provided
18 #* with the distribution.
19 #* * Neither the name of the Willow Garage nor the names of its
20 #* contributors may be used to endorse or promote products derived
21 #* from this software without specific prior written permission.
22 #*
23 #* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 #* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 #* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 #* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 #* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 #* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 #* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 #* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 #* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 #* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 #* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 #* POSSIBILITY OF SUCH DAMAGE.
35 #***********************************************************
36 
37 # Author: Blaise Gassend
38 
39 # Publish information needed to interpret fingertep pressure sensor data:
40 # - Frame id
41 # -
42 
43 import roslib
44 roslib.load_manifest('fingertip_pressure')
45 import rospy
46 
47 from fingertip_pressure.msg import PressureInfo
49 
50 
52  def __init__(self, dest, frame0, frame1):
53  self.info = []
54  self.info.append(pressureInformation(frame0, 1))
55  self.info.append(pressureInformation(frame1, -1))
56  self.publisher = rospy.Publisher(dest, PressureInfo, latch=True, queue_size=1000)
57 
58  def publish(self):
59  self.publisher.publish(self.info)
60 
61 
62 if __name__ == '__main__':
63 
64  #@todo it would be nice to read an xml configuration file to get these parameters.
65  rospy.init_node('pressure_sensor_info')
66 
67  pip1=pressureInformationPublisher('pressure/r_gripper_motor_info',
68  'r_gripper_l_finger_tip_link', 'r_gripper_r_finger_tip_link')
69  pip2=pressureInformationPublisher('pressure/l_gripper_motor_info',
70  'l_gripper_l_finger_tip_link', 'l_gripper_r_finger_tip_link')
71 
72  pip1.publish()
73  pip2.publish()
74 
75  while not rospy.is_shutdown():
76  rospy.spin()
77 
def pressureInformation(frame_id, orientation)
def __init__(self, dest, frame0, frame1)
Definition: sensor_info.py:52


fingertip_pressure
Author(s): Blaise Gassend
autogenerated on Thu Mar 4 2021 03:10:25