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

Classes

class  generator
 Generates random ROS values and message attributes. More...
 
class  rosapi
 Generic interface for accessing ROS1 / ROS2 API. More...
 

Functions

 make_argparser ()
 Returns a populated ArgumentParser instance.
 
 plural (word, items)
 Returns "N words" or "1 word".
 
 process_args (args)
 Converts or combines arguments where necessary, returns args.
 
 run (args)
 Generates messages until Ctrl-C or end condition reached.
 
 take_sample (population, k)
 Returns a list of k randomly chosen elements from population.
 
 wildcard_to_regex (text, end=True)
 Returns plain wildcard like "foo*bar" as re.Pattern("foo.*bar", re.I).
 

Variables

dict ARGUMENTS
 Configuration for argparse, as {description, epilog, args: [..], groups: {name: [..]}}.
 
str NAME = "generate_msgs"
 Name used for node.
 
 rospy = None
 
 runargs = process_args(make_argparser().parse_args())
 

Function Documentation

◆ make_argparser()

make_argparser ( )

Returns a populated ArgumentParser instance.

Definition at line 396 of file generate_msgs.py.

◆ plural()

plural (   word,
  items 
)

Returns "N words" or "1 word".

Definition at line 405 of file generate_msgs.py.

◆ process_args()

process_args (   args)

Converts or combines arguments where necessary, returns args.

Parameters
argsarguments object like argparse.Namespace

Definition at line 435 of file generate_msgs.py.

◆ run()

run (   args)

Generates messages until Ctrl-C or end condition reached.

Definition at line 464 of file generate_msgs.py.

◆ take_sample()

take_sample (   population,
  k 
)

Returns a list of k randomly chosen elements from population.

Definition at line 411 of file generate_msgs.py.

◆ wildcard_to_regex()

wildcard_to_regex (   text,
  end = True 
)

Returns plain wildcard like "foo*bar" as re.Pattern("foo.*bar", re.I).

Parameters
endwhether pattern should match until end (adds $)

Definition at line 425 of file generate_msgs.py.

Variable Documentation

◆ ARGUMENTS

dict ARGUMENTS

Configuration for argparse, as {description, epilog, args: [..], groups: {name: [..]}}.

Definition at line 67 of file generate_msgs.py.

◆ NAME

str NAME = "generate_msgs"

Name used for node.

Definition at line 131 of file generate_msgs.py.

◆ rospy

rospy = None

Definition at line 53 of file generate_msgs.py.

◆ runargs

runargs = process_args(make_argparser().parse_args())

Definition at line 565 of file generate_msgs.py.