Package rospy

Source Code for Package rospy

  1  # Software License Agreement (BSD License) 
  2  # 
  3  # Copyright (c) 2008, Willow Garage, Inc. 
  4  # All rights reserved. 
  5  # 
  6  # Redistribution and use in source and binary forms, with or without 
  7  # modification, are permitted provided that the following conditions 
  8  # are met: 
  9  # 
 10  #  * Redistributions of source code must retain the above copyright 
 11  #    notice, this list of conditions and the following disclaimer. 
 12  #  * Redistributions in binary form must reproduce the above 
 13  #    copyright notice, this list of conditions and the following 
 14  #    disclaimer in the documentation and/or other materials provided 
 15  #    with the distribution. 
 16  #  * Neither the name of Willow Garage, Inc. nor the names of its 
 17  #    contributors may be used to endorse or promote products derived 
 18  #    from this software without specific prior written permission. 
 19  # 
 20  # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 21  # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 22  # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
 23  # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 24  # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 
 25  # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
 26  # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 27  # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
 28  # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
 29  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
 30  # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 31  # POSSIBILITY OF SUCH DAMAGE. 
 32  # 
 33  # Copyright (c) 2008, Willow Garage, Inc. 
 34  # Revision $Id: __init__.py 12069 2010-11-09 20:31:55Z kwc $ 
 35   
 36  """ 
 37  ROS client library for Python. 
 38  See U{http://ros.org/wiki/rospy} 
 39  @author: Ken Conley (kwc) 
 40  """ 
 41   
 42  from roslib.rosenv import ROS_ROOT, ROS_MASTER_URI, ROS_HOSTNAME, ROS_NAMESPACE, ROS_PACKAGE_PATH, ROS_LOG_DIR 
 43   
 44  # import symbols into rospy namespace 
 45  # NOTE: there are much better ways to configure python module 
 46  # dictionaries, but the rospy codebase isn't quite in shape for that 
 47  # yet 
 48   
 49  from std_msgs.msg import Header 
 50   
 51  from .client import spin, myargv, init_node, \ 
 52      get_published_topics, \ 
 53      wait_for_message, \ 
 54      get_master, \ 
 55      on_shutdown, \ 
 56      get_param, get_param_names, set_param, delete_param, has_param, search_param,\ 
 57      sleep, Rate,\ 
 58      DEBUG, INFO, WARN, ERROR, FATAL 
 59  from .core import is_shutdown, signal_shutdown, \ 
 60      get_node_uri, get_ros_root, \ 
 61      logdebug, logwarn, loginfo, logout, logerr, logfatal, \ 
 62      parse_rosrpc_uri 
 63  from .exceptions import * 
 64  from .msg import AnyMsg 
 65  from .msproxy import MasterProxy 
 66  from .names import get_name, get_caller_id, get_namespace, resolve_name, remap_name 
 67  from .rostime import Time, Duration, get_rostime, get_time 
 68  from .service import ServiceException, ServiceDefinition 
 69   
 70  # - use tcp ros implementation of services 
 71  from .impl.tcpros_service import Service, ServiceProxy, wait_for_service 
 72  from .topics import Message, SubscribeListener, Publisher, Subscriber 
 73   
 74  ## \defgroup validators Validators 
 75  ## \defgroup clientapi Client API 
 76   
 77  # initialize default loggers, this has to happen independent of a node being created 
 78  from .impl import init 
 79  init.init_log_handlers() 
 80   
 81  __all__ = [ 
 82      'Header', 
 83      'spin', 
 84      'myargv', 
 85      'init_node', 
 86      'get_master', 
 87      'get_published_topics', 
 88      'wait_for_service', 
 89      'on_shutdown', 
 90      'get_param', 
 91      'get_param_names', 
 92      'set_param', 
 93      'delete_param', 
 94      'has_param', 
 95      'search_param', 
 96      'sleep', 
 97      'Rate', 
 98      'DEBUG', 
 99      'INFO', 
100      'WARN', 
101      'ERROR', 
102      'FATAL' 
103      'is_shutdown', 
104      'signal_shutdown', 
105      'get_node_uri', 
106      'get_ros_root', 
107      'logdebug', 
108      'logwarn', 'loginfo', 
109      'logout', 'logerr', 'logfatal', 
110      'parse_rosrpc_uri', 
111      'MasterProxy', 
112      'NodeProxy',     
113      'ROSException', 
114      'ROSSerializationException', 
115      'ROSInitException', 
116      'ROSInterruptException', 
117      'ROSInternalException', 
118      'TransportException', 
119      'TransportTerminated', 
120      'TransportInitError', 
121      'AnyMsg', 'Message', 
122      'get_name', 
123      'get_caller_id', 
124      'get_namespace', 
125      'resolve_name', 
126      'remap_name', 
127      'Time', 'Duration', 'get_rostime', 'get_time', 
128      'ServiceException', 'ServiceDefinition', 
129      'Service', 'ServiceProxy', 
130      'SubscribeListener', 'Publisher', 'Subscriber', 
131      ] 
132