00001 #!/usr/bin/env python 00002 # 00003 # Copyright (c) 2009, Georgia Tech Research Corporation 00004 # All rights reserved. 00005 # 00006 # Redistribution and use in source and binary forms, with or without 00007 # modification, are permitted provided that the following conditions are met: 00008 # * Redistributions of source code must retain the above copyright 00009 # notice, this list of conditions and the following disclaimer. 00010 # * Redistributions in binary form must reproduce the above copyright 00011 # notice, this list of conditions and the following disclaimer in the 00012 # documentation and/or other materials provided with the distribution. 00013 # * Neither the name of the Georgia Tech Research Corporation nor the 00014 # names of its contributors may be used to endorse or promote products 00015 # derived from this software without specific prior written permission. 00016 # 00017 # THIS SOFTWARE IS PROVIDED BY GEORGIA TECH RESEARCH CORPORATION ''AS IS'' AND 00018 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00019 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00020 # DISCLAIMED. IN NO EVENT SHALL GEORGIA TECH BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00022 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00023 # OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00024 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 00025 # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00026 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 # 00028 #Author: Marc Killpack 00029 00030 import roslib 00031 roslib.load_manifest('pr2_playpen') 00032 from UI_segment_object.srv import GetObject 00033 import rospy 00034 import sys 00035 00036 import optparse 00037 p = optparse.OptionParser() 00038 00039 p.add_option('--node', action='store', type='string', dest='node') 00040 p.add_option('--serv', action='store', type='string', dest='service') 00041 00042 opt, args = p.parse_args() 00043 00044 rospy.init_node(opt.node) 00045 rospy.wait_for_service(opt.service) 00046 pub_filtered_cloud = rospy.ServiceProxy(opt.service, GetObject) 00047 r = rospy.Rate(30) 00048 00049 while not rospy.is_shutdown(): 00050 pub_filtered_cloud() 00051 r.sleep()