2Stand-ins for `rospy.msg` in ROS2.
4------------------------------------------------------------------------------
5This file is part of rosros - simple unified interface to ROS1 / ROS2.
6Released under the BSD License.
11------------------------------------------------------------------------------
13## @namespace rosros.rospify.msg
16from . import exceptions
17from . topics import Message
20Header = std_msgs.msg.Header
25 Stand-in for `rospy.AnyMsg`.
27 Message
class to use for subscribing to any topic regardless of type.
28 Incoming messages are
not deserialized. Instead, the raw serialized data
29 can be accessed via the buff property.
31 Caveat
in ROS2: subscription will be made
with the first available published type
32 on this topic, creation will fail
if no publisher
is available. Will
not provide
33 messages of different types.
43 Constructor. Does not accept any arguments.
50 """AnyMsg provides an implementation so that a node can forward messages w/o (de)serialization."""
51 if self.
_buff is None:
53 buff.write(self.
_buff)
56 """Copies raw buffer into self._buff, returns self."""
62 """Returns true if C is AnyMsg or descendant, else `NotImplemented`."""
63 if getattr(C,
"_type",
None) == cls.
_type:
return True
Base exception class for ROS clients.
__init__(self, *args)
Constructor.
serialize(self, buff)
AnyMsg provides an implementation so that a node can forward messages w/o (de)serialization.
deserialize(self, str)
Copies raw buffer into self._buff, returns self.
__subclasshook__(cls, C)
Returns true if C is AnyMsg or descendant, else `NotImplemented`.