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: :exc:`ROSTopicException` If topic type cannot be determined or loaded
Get the topic type.
:param topic: topic name, ``str``
:param 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: :exc:`ROSTopicException` If master cannot be contacted
function msgevalgen
def msgevalgen(
pattern pattern
)
Generates a function that returns the relevant field (aka 'subtopic') of a Message object
:param pattern: subtopic, e.g. /x. Must have a leading '/' if specified, ``str``
:returns: function that converts a message into the desired value, ``fn(Message) -> value``
function ros2xml
def ros2xml(
msg msg,
name name,
depth depth =0
)
function moos2xml
def moos2xml(
msg msg,
name name,
time time,
depth depth =0
)
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.
:param topic_name: name of topic, ``str``
:param topic_type: name of topic type, ``str``
:param latch: latching topic, ``bool``
:returns: topic :class:`rospy.Publisher`, :class:`Message` class
Create new instance of msg_class, populate with pub_args, and publish. This may
print output to screen.
:param pub: :class:`rospy.Publisher` instance for topic
:param msg_class: Message type, ``Class``
:param pub_args: Arguments to initialize message that is published, ``[val]``