package documentation

Undocumented

From __init__.py:

Class CallbackEcho Callback instance that can print callback data in a variety of formats. Used for all variants of rostopic echo
Class ROSTopicBandwidth No class docstring; 0/5 instance variable, 2/3 methods documented
Class ROSTopicDelay No class docstring; 0/6 instance variable, 1/4 method documented
Class ROSTopicHz ROSTopicHz receives messages for a topic and computes frequency stats
Exception ROSTopicException Base exception class of rostopic-related errors
Exception ROSTopicIOException rostopic errors related to network I/O failures
Function argv_publish Undocumented
Function create_field_filter Undocumented
Function create_publisher Create rospy.Publisher instance from the string topic name and type. This is a powerful method as it allows creation of rospy.Publisher and Message instances using the topic and type names. This enables more dynamic publishing from Python programs.
Function create_value_transform Undocumented
Function file_yaml_arg No summary
Function find_by_type Lookup topics by topic_type :param topic_type: type of topic to find, str :returns: list of topic names that use topic_type, [str]
Function get_api Get XML-RPC API of node :param master: XML-RPC handle to ROS Master, xmlrpclib.ServerProxy :param caller_id: node name, str :returns: XML-RPC URI of node, str :raises: ROSTopicIOException If unable to communicate with master...
Function get_info_text Get human-readable topic description
Function get_topic_class Get the topic message class :returns: message class for topic, real topic
Function get_topic_list Undocumented
Function get_topic_type Get the topic type.
Function msgevalgen Generates a function that returns the relevant field(s) (aka 'subtopic(s)') of a Message object :param pattern: subtopic, e.g. /x[2:]/y[:-1]/z, str :returns: function that converts a message into the desired value, ...
Function param_publish No summary
Function param_publish_once Undocumented
Function publish_message Create new instance of msg_class, populate with pub_args, and publish. This may print output to screen.
Function rostopicmain Undocumented
Function stdin_publish No summary
Function stdin_yaml_arg Iterate over YAML documents in stdin :returns: for next list of arguments on stdin. Iterator returns a list of args for each call, iterator
Function wait_for_subscriber Undocumented
Constant NAME Undocumented
Constant SUBSCRIBER_TIMEOUT Undocumented
Class _ParamNotifier Undocumented
Function _check_master Make sure that master is available :raises: ROSTopicException If unable to successfully communicate with master
Function _convert_getattr Convert atttribute types on the fly, if necessary. This is mainly to convert uint8[] fields back to an array type.
Function _fillMessageArgs Undocumented
Function _fullusage Undocumented
Function _get_array_index_or_slice_object Undocumented
Function _get_ascii_table Undocumented
Function _get_nested_attribute Undocumented
Function _get_topic_type subroutine for getting the topic type :returns: topic type, real topic name and fn to evaluate the message instance if the topic points to a field within a topic, e.g. /rosout/msg, (str, str, fn)
Function _isstring_type Undocumented
Function _master_get_topic_types Undocumented
Function _optparse_topic_only Undocumented
Function _publish_at_rate Publish message at specified rate. Subroutine of L{publish_message()}.
Function _publish_latched Publish and latch message. Subroutine of L{publish_message()}.
Function _resource_name_package pkg/typeName -> pkg, typeName -> None
Function _rostopic_bw periodically print the received bandwidth of a topic to console until shutdown
Function _rostopic_cmd_bw Undocumented
Function _rostopic_cmd_delay Undocumented
Function _rostopic_cmd_echo Undocumented
Function _rostopic_cmd_find Implements 'rostopic type' :param argv: command-line args, [str]
Function _rostopic_cmd_hz Undocumented
Function _rostopic_cmd_info Command-line parsing for 'rostopic info' command.
Function _rostopic_cmd_list Command-line parsing for 'rostopic list' command.
Function _rostopic_cmd_pub Parse 'pub' command arguments and run command. Will cause a system exit if command-line argument parsing fails. :param argv: command-line arguments :param argv: [str] :raises: ROSTopicException If call command cannot be executed...
Function _rostopic_cmd_type Undocumented
Function _rostopic_delay Periodically print the publishing delay of a topic to console until shutdown :param topic: topic name, str :param window_size: number of messages to average over, -1 for infinite, int :param tcp_nodelay: Subscribe with the TCP_NODELAY transport hint if true...
Function _rostopic_echo Print new messages on topic to screen.
Function _rostopic_echo_bag No summary
Function _rostopic_hz Periodically print the publishing rate of a topic to console until shutdown :param topics: topic names, list of str :param window_size: number of messages to average over, -1 for infinite, int :param filter_expr: Python filter expression that is called with m, the message instance :param tcp_nodelay: Subscribe with the TCP_NODELAY transport hint if true...
Function _rostopic_info Print topic information to screen.
Function _rostopic_list Print topics to screen
Function _rostopic_list_bag Prints topics in bag file to screen :param bag_file: path to bag file, str :param topic: optional topic name to match. Will print additional information just about messagese in this topic, str
Function _rostopic_list_group_by_host Build up maps for hostname to topic list per hostname :returns: publishers host map, subscribers host map, {str: set(str)}, {str: set(str)}
Function _rostopic_type Print ROS message type of topic to screen :param topic: topic name, str
Function _sleep Undocumented
Function _str_plot Convert value to matlab/octave-friendly CSV string representation.
Function _str_plot_fields get CSV representation of fields used by _str_plot :returns: list of fields as a CSV string, str
Function _sub_rostopic_list Undocumented
Function _sub_str_plot Helper routine for _str_plot.
Function _sub_str_plot_fields recursive helper function for _str_plot_fields
Constant _ONCE_DELAY Undocumented
Variable _caller_apis Undocumented
NAME: str =

Undocumented

Value
'rostopic'
def _check_master():

Make sure that master is available :raises: ROSTopicException If unable to successfully communicate with master

def _master_get_topic_types(master):

Undocumented

def _get_ascii_table(header, cols):

Undocumented

def _sleep(duration):

Undocumented

def _rostopic_hz(topics, window_size=-1, filter_expr=None, use_wtime=False, tcp_nodelay=False):

Periodically print the publishing rate of a topic to console until shutdown :param topics: topic names, list of str :param window_size: number of messages to average over, -1 for infinite, int :param filter_expr: Python filter expression that is called with m, the message instance :param tcp_nodelay: Subscribe with the TCP_NODELAY transport hint if true

def _rostopic_delay(topic, window_size=-1, tcp_nodelay=False):

Periodically print the publishing delay of a topic to console until shutdown :param topic: topic name, str :param window_size: number of messages to average over, -1 for infinite, int :param tcp_nodelay: Subscribe with the TCP_NODELAY transport hint if true

def _isstring_type(t):

Undocumented

def _rostopic_bw(topic, window_size=-1):

periodically print the received bandwidth of a topic to console until shutdown

def msgevalgen(pattern):

Generates a function that returns the relevant field(s) (aka 'subtopic(s)') of a Message object :param pattern: subtopic, e.g. /x[2:]/y[:-1]/z, str :returns: function that converts a message into the desired value, fn(Message) -> value

def _get_array_index_or_slice_object(index_string):

Undocumented

def _get_nested_attribute(msg, nested_attributes):

Undocumented

def _get_topic_type(topic):

subroutine for getting the topic type :returns: topic type, real topic name and fn to evaluate the message instance if the topic points to a field within a topic, e.g. /rosout/msg, (str, str, fn)

def get_topic_type(topic, blocking=False):

Get the topic type.

Parameters
topictopic name, str
blocking(default False) block until topic becomes available, bool
Returns
topic type, real topic name and fn to evaluate the message instance if the topic points to a field within a topic, e.g. /rosout/msg. fn is None otherwise. (str, str, fn)
Raises
Unknown exceptionROSTopicException If master cannot be contacted
def get_topic_class(topic, blocking=False):

Get the topic message class :returns: message class for topic, real topic

name, and function for evaluating message objects into the subtopic (or None). (Message, str, str)
Raises
Unknown exceptionROSTopicException If topic type cannot be determined or loaded
def _str_plot_fields(val, f, field_filter):

get CSV representation of fields used by _str_plot :returns: list of fields as a CSV string, str

def _sub_str_plot_fields(val, f, field_filter):

recursive helper function for _str_plot_fields

def _str_plot(val, time_offset=None, current_time=None, field_filter=None, type_information=None, fixed_numeric_width=None, value_transform=None):

Convert value to matlab/octave-friendly CSV string representation.

Parameters
valmessage
time_offset(optional) for time printed for message, print as offset against this genpy.Time
current_timecurrent genpy.Time to use if message does not contain its own timestamp.
field_filterfilter the fields that are stringified for Messages, fn(Message)->iter(str)
type_informationUndocumented
fixed_numeric_widthUndocumented
value_transformNot used but for same API as CallbackEcho.custom_strify_message
Returns
comma-separated list of field values in val, str
def _sub_str_plot(val, time_offset, field_filter):

Helper routine for _str_plot.

def _convert_getattr(val, f, t):

Convert atttribute types on the fly, if necessary. This is mainly to convert uint8[] fields back to an array type.

def _rostopic_type(topic):

Print ROS message type of topic to screen :param topic: topic name, str

def _rostopic_echo_bag(callback_echo, bag_file):
Parameters
callback_echoCallbackEcho instance to invoke on new messages in bag file
bag_filename of bag file to echo messages from or None, str
def _rostopic_echo(topic, callback_echo, bag_file=None, echo_all_topics=False):

Print new messages on topic to screen.

Parameters
topictopic name, str
callback_echoUndocumented
bag_filename of bag file to echo messages from or None, str
echo_all_topicsUndocumented
_caller_apis: dict =

Undocumented

def get_api(master, caller_id):

Get XML-RPC API of node :param master: XML-RPC handle to ROS Master, xmlrpclib.ServerProxy :param caller_id: node name, str :returns: XML-RPC URI of node, str :raises: ROSTopicIOException If unable to communicate with master

def _rostopic_list_bag(bag_file, topic=None):

Prints topics in bag file to screen :param bag_file: path to bag file, str :param topic: optional topic name to match. Will print additional information just about messagese in this topic, str

def _sub_rostopic_list(master, pubs, subs, publishers_only, subscribers_only, verbose, indent=''):

Undocumented

def get_topic_list(master=None):

Undocumented

def _rostopic_list_group_by_host(master, pubs, subs):

Build up maps for hostname to topic list per hostname :returns: publishers host map, subscribers host map, {str: set(str)}, {str: set(str)}

def _rostopic_list(topic, verbose=False, subscribers_only=False, publishers_only=False, group_by_host=False):

Print topics to screen

Parameters
topictopic name to list information or None to match all topics, str
verboseprint additional debugging information, bool
subscribers_onlyprint information about subscriptions only, bool
publishers_onlyprint information about subscriptions only, bool
group_by_hostgroup topic list by hostname, bool
def get_info_text(topic):

Get human-readable topic description

Parameters
topictopic name, str
def _rostopic_info(topic):

Print topic information to screen.

Parameters
topictopic name, str
def _rostopic_cmd_echo(argv):

Undocumented

def create_value_transform(echo_nostr, echo_noarr):

Undocumented

def create_field_filter(echo_nostr, echo_noarr):

Undocumented

def _optparse_topic_only(cmd, argv):

Undocumented

def _rostopic_cmd_type(argv):

Undocumented

def _rostopic_cmd_hz(argv):

Undocumented

def _rostopic_cmd_delay(argv):

Undocumented

def _rostopic_cmd_bw(argv=sys.argv):

Undocumented

def find_by_type(topic_type):

Lookup topics by topic_type :param topic_type: type of topic to find, str :returns: list of topic names that use topic_type, [str]

def _rostopic_cmd_find(argv=sys.argv):

Implements 'rostopic type' :param argv: command-line args, [str]

def _resource_name_package(name):

pkg/typeName -> pkg, typeName -> None

Parameters
namepackage resource name, e.g. 'std_msgs/String', str
Returns
package name of resource, str
def create_publisher(topic_name, topic_type, latch, disable_rostime=True):

Create rospy.Publisher instance from the string topic name and type. This is a powerful method as it allows creation of rospy.Publisher and Message instances using the topic and type names. This enables more dynamic publishing from Python programs.

Parameters
topic_namename of topic, str
topic_typename of topic type, str
latchdisable_rostime: whether to disable rostime (use walltime instead), bool
disable_rostimeUndocumented
Returns
topic rospy.Publisher, Message class
def _publish_at_rate(pub, msg, rate, verbose=False, substitute_keywords=False, pub_args=None):

Publish message at specified rate. Subroutine of L{publish_message()}.

Parameters
pubrospy.Publisher` instance for topic
msgmessage instance to publish
ratepublishing rate (hz) or None for just once, int
verboseIf True, print more verbose output to stdout, bool
substitute_keywordsUndocumented
pub_argsUndocumented
_ONCE_DELAY: float =

Undocumented

Value
3.0
def _publish_latched(pub, msg, once=False, verbose=False):

Publish and latch message. Subroutine of L{publish_message()}.

Parameters
pubrospy.Publisher instance for topic
msgmessage instance to publish
onceif True, publish message once and then exit after sleep interval, bool
verboseIf True, print more verbose output to stdout, bool
def publish_message(pub, msg_class, pub_args, rate=None, once=False, verbose=False, substitute_keywords=False):

Create new instance of msg_class, populate with pub_args, and publish. This may print output to screen.

Parameters
pubrospy.Publisher instance for topic
msg_classMessage type, Class
pub_argsArguments to initialize message that is published, [val]
ratepublishing rate (hz) or None for just once, int
oncepublish only once and return, bool
verboseIf True, print more verbose output to stdout, bool
substitute_keywordsUndocumented
def _fillMessageArgs(msg, pub_args):

Undocumented

def _rostopic_cmd_pub(argv):

Parse 'pub' command arguments and run command. Will cause a system exit if command-line argument parsing fails. :param argv: command-line arguments :param argv: [str] :raises: ROSTopicException If call command cannot be executed

def file_yaml_arg(filename):
Parameters
filenamefile name, str
Returns
Iterator that yields pub args (list of args), iterator
Raises
Unknown exceptionROSTopicException If filename is invalid
def argv_publish(pub, msg_class, pub_args, rate, once, verbose, substitute_keywords=False):

Undocumented

SUBSCRIBER_TIMEOUT: float =

Undocumented

Value
5.0
def wait_for_subscriber(pub, timeout):

Undocumented

def param_publish_once(pub, msg_class, param_name, verbose):

Undocumented

def param_publish(pub, msg_class, param_name, rate, verbose):
Parameters
pubUndocumented
msg_classUndocumented
param_nameROS parameter name, str
rateUndocumented
verboseUndocumented
Returns
List of msg dicts in file, [{str: any}]
Raises
Unknown exceptionROSTopicException If parameter is not set
def stdin_publish(pub, msg_class, rate, once, filename, verbose):
Parameters
pubUndocumented
msg_classUndocumented
rateUndocumented
onceUndocumented
filenamename of file to read from instead of stdin, or None, str
verboseUndocumented
def stdin_yaml_arg():

Iterate over YAML documents in stdin :returns: for next list of arguments on stdin. Iterator returns a list of args for each call, iterator

def _rostopic_cmd_list(argv):

Command-line parsing for 'rostopic list' command.

def _rostopic_cmd_info(argv):

Command-line parsing for 'rostopic info' command.

def _fullusage():

Undocumented

def rostopicmain(argv=None):

Undocumented