logger_trigger.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 ###############################################################################
00003 # \file
00004 #
00005 # $Id:$
00006 #
00007 # Copyright (C) Brno University of Technology
00008 #
00009 # This file is part of software developed by dcgm-robotics@FIT group.
00010 # 
00011 # Author: Zdenek Materna (imaterna@fit.vutbr.cz)
00012 # Supervised by: Michal Spanel (spanel@fit.vutbr.cz)
00013 # Date: dd/mm/2012
00014 #
00015 # This file is free software: you can redistribute it and/or modify
00016 # it under the terms of the GNU Lesser General Public License as published by
00017 # the Free Software Foundation, either version 3 of the License, or
00018 # (at your option) any later version.
00019 # 
00020 # This file is distributed in the hope that it will be useful,
00021 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 # GNU Lesser General Public License for more details.
00024 # 
00025 # You should have received a copy of the GNU Lesser General Public License
00026 # along with this file.  If not, see <http://www.gnu.org/licenses/>.
00027 #
00028 import roslib; roslib.load_manifest('srs_user_tests')
00029 import rospy
00030 from std_srvs.srv import Empty
00031 
00032 
00033 def main():
00034     
00035     rospy.init_node('logger_trigger_node')
00036     
00037     s_log = rospy.ServiceProxy("/logger/start", Empty)
00038     
00039     rospy.loginfo("Waiting for logger...")
00040 
00041     rospy.wait_for_service("/logger/start")
00042     
00043     rospy.sleep(2)
00044 
00045     rospy.loginfo("Starting logging")
00046     
00047     try:
00048             
00049       s_log()
00050             
00051     except Exception, e:
00052         
00053       rospy.logerr('Error on calling service: %s',str(e))
00054       
00055     rospy.loginfo("Finished!")
00056       
00057 
00058 if __name__ == '__main__':
00059   try:
00060     main()
00061   except rospy.ROSInterruptException: pass


srs_user_tests
Author(s): SRS team
autogenerated on Mon Oct 6 2014 08:53:11