Public Member Functions | Static Public Attributes | List of all members
generate_msgs.generator Class Reference
Inheritance diagram for generate_msgs.generator:
Inheritance graph
[legend]

Public Member Functions

def make_random_value (cls, typename, options=None)
 
def populate (cls, msg, options=None)
 

Static Public Attributes

dictionary OPTIONS
 Attribute generating options. More...
 

Detailed Description

Generates random ROS values and message attributes.

Definition at line 319 of file generate_msgs.py.

Member Function Documentation

◆ make_random_value()

def generate_msgs.generator.make_random_value (   cls,
  typename,
  options = None 
)
Returns random value for ROS builtin type.

@param   options  {numtype like "int8": fixvalue or (minval, maxval),
           "strlen": fixlen or (minlen, maxlen),
           "strchars": str} if not using generator defaults

Definition at line 331 of file generate_msgs.py.

◆ populate()

def generate_msgs.generator.populate (   cls,
  msg,
  options = None 
)
Returns ROS message with fields populated with random content.

@param   options  {"arraylen" or "nestedlen" or "strlen": fixlen or (minlen, maxlen),
           numtype like "int8": fixvalue or (minval, maxval),
           "strchars": str} if not using generator defaults

Definition at line 361 of file generate_msgs.py.

Member Data Documentation

◆ OPTIONS

dictionary generate_msgs.generator.OPTIONS
static
Initial value:
= {
"arraylen": (50, 100), # Length range for primitive arrays like uint8[]
"nestedlen": ( 1, 2), # Length range for nested message lists like Point[]
"strlen": (10, 50), # Length range for strings
"strchars": string.printable.strip() + " ", # Characters used in string
}

Attribute generating options.

Definition at line 323 of file generate_msgs.py.


The documentation for this class was generated from the following file:


grepros
Author(s): Erki Suurjaak
autogenerated on Sat Jan 6 2024 03:11:29