package documentation

Undocumented

From __init__.py:

Function cpp_message_declarations Return the different possible C++ declarations for a message given the message itself.
Function default_value Return the value to initialize a message member with.
Function escape_message_definition Undocumented
Function escape_string Undocumented
Function generate_fixed_length_assigns Initialize any fixed-length arrays.
Function generate_initializer_list Write the initializer list for a constructor.
Function is_fixed_length Return whether or not the message is fixed-length.
Function msg_type_to_cpp Convert a message type into the C++ declaration for that type.
Function takes_allocator Return whether or not a type can take an allocator in its constructor.
Constant MSG_TYPE_TO_CPP Undocumented
Function _escape_string Undocumented
MSG_TYPE_TO_CPP: dict[str, str] =

Undocumented

Value
{'byte': 'int8_t',
 'char': 'uint8_t',
 'bool': 'uint8_t',
 'uint8': 'uint8_t',
 'int8': 'int8_t',
 'uint16': 'uint16_t',
 'int16': 'int16_t',
...
def msg_type_to_cpp(type_):

Convert a message type into the C++ declaration for that type.

Example message types: uint32, std_msgs/String. Example C++ types: uint32_t, std_msgs::String_<ContainerAllocator>

@param type_: The message type @type type_: str @return: The C++ declaration @rtype: str

def _escape_string(s):

Undocumented

def escape_message_definition(definition):

Undocumented

def cpp_message_declarations(name_prefix, msg):

Return the different possible C++ declarations for a message given the message itself.

@param name_prefix: The C++ prefix to be prepended to the name, e.g. "std_msgs::" @type name_prefix: str @param msg: The message type @type msg: str @return: A tuple of 3 different names. cpp_message_decelarations("std_msgs::", "String") returns the tuple

("std_msgs::String_", "std_msgs::String_<ContainerAllocator>", "std_msgs::String")

@rtype: str

def is_fixed_length(spec, msg_context, includepath):

Return whether or not the message is fixed-length.

@param spec: The message spec @type spec: genmsg.msgs.MsgSpec @param package: The package of the @type package: str

def default_value(type_):

Return the value to initialize a message member with.

0 for integer types, 0.0 for floating point, false for bool, empty string for everything else

@param type_: The type @type type_: str

def takes_allocator(type_):

Return whether or not a type can take an allocator in its constructor.

False for all builtin types except string. True for all others.

@param type_: The type @type: str

def escape_string(str_):

Undocumented

def generate_fixed_length_assigns(spec, container_gets_allocator, cpp_name_prefix):

Initialize any fixed-length arrays.

@param s: The stream to write to @type s: stream @param spec: The message spec @type spec: genmsg.msgs.MsgSpec @param container_gets_allocator: Whether or not a container type (whether it's another message, a vector, array or string)

should have the allocator passed to its constructor. Assumes the allocator is named _alloc.

@type container_gets_allocator: bool @param cpp_name_prefix: The C++ prefix to use when referring to the message, e.g. "std_msgs::" @type cpp_name_prefix: str

def generate_initializer_list(spec, container_gets_allocator):

Write the initializer list for a constructor.

@param s: The stream to write to @type s: stream @param spec: The message spec @type spec: genmsg.msgs.MsgSpec @param container_gets_allocator: Whether or not a container type (whether it's another message, a vector, array or string)

should have the allocator passed to its constructor. Assumes the allocator is named _alloc.

@type container_gets_allocator: bool