grepros 1.2.2
grep for ROS bag files and live topics
Loading...
Searching...
No Matches
generator Class Reference

Generates random ROS values and message attributes. More...

Public Member Functions

 make_random_value (cls, typename, options=None)
 Returns random value for ROS builtin type.
 
 populate (cls, msg, options=None)
 Returns ROS message with fields populated with random content.
 

Static Public Attributes

dict OPTIONS
 Attribute generating options.
 

Detailed Description

Generates random ROS values and message attributes.

Definition at line 321 of file generate_msgs.py.

Member Function Documentation

◆ make_random_value()

make_random_value (   cls,
  typename,
  options = None 
)

Returns random value for ROS builtin type.

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

Definition at line 339 of file generate_msgs.py.

◆ populate()

populate (   cls,
  msg,
  options = None 
)

Returns ROS message with fields populated with random content.

Parameters
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 368 of file generate_msgs.py.

Member Data Documentation

◆ OPTIONS

dict 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 325 of file generate_msgs.py.


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