sierra.core.ros1.generators

Classes for generating XML changes common to all ROS1 platforms.

I.e., changes which are platform-specific, but applicable to all projects using ROS1.

class sierra.core.ros1.generators.ROSExpDefGenerator(exp_spec: ExperimentSpec, controller: str, cmdopts: Dict[str, Any], **kwargs)[source]

Generates XML changes to input files that common to all ROS experiments.

ROS1 requires up to 2 input files per run:

  • The launch file containing robot definitions, world definitions (for simulations only).

  • The parameter file for project code (optional).

Putting everything in 1 file would require extensively using the ROS1 parameter server which does NOT accept parameters specified in XML–only YAML. So requiring some conventions on the .launch input file seemed more reasonable.

controller

The controller used for the experiment.

cmdopts

Dictionary of parsed cmdline parameters.

Inheritance

Inheritance diagram of ROSExpDefGenerator
__dict__ = mappingproxy({'__module__': 'sierra.core.ros1.generators', '__doc__': 'Generates XML changes to input files that common to all ROS experiments.\n\n     ROS1 requires up to 2 input files per run:\n\n    - The launch file containing robot definitions, world definitions (for\n      simulations only).\n\n    - The parameter file for project code (optional).\n\n    Putting everything in 1 file would require extensively using the ROS1\n    parameter server which does NOT accept parameters specified in XML--only\n    YAML. So requiring some conventions on the .launch input file seemed more\n    reasonable.\n\n    Attributes:\n\n        controller: The controller used for the experiment.\n        cmdopts: Dictionary of parsed cmdline parameters.\n\n    ', '__init__': <function ROSExpDefGenerator.__init__>, 'generate': <function ROSExpDefGenerator.generate>, '_generate_experiment': <function ROSExpDefGenerator._generate_experiment>, '__dict__': <attribute '__dict__' of 'ROSExpDefGenerator' objects>, '__weakref__': <attribute '__weakref__' of 'ROSExpDefGenerator' objects>, '__annotations__': {}})
__doc__ = 'Generates XML changes to input files that common to all ROS experiments.\n\n     ROS1 requires up to 2 input files per run:\n\n    - The launch file containing robot definitions, world definitions (for\n      simulations only).\n\n    - The parameter file for project code (optional).\n\n    Putting everything in 1 file would require extensively using the ROS1\n    parameter server which does NOT accept parameters specified in XML--only\n    YAML. So requiring some conventions on the .launch input file seemed more\n    reasonable.\n\n    Attributes:\n\n        controller: The controller used for the experiment.\n        cmdopts: Dictionary of parsed cmdline parameters.\n\n    '
__init__(exp_spec: ExperimentSpec, controller: str, cmdopts: Dict[str, Any], **kwargs) None[source]
__module__ = 'sierra.core.ros1.generators'
__weakref__

list of weak references to the object (if defined)

_generate_experiment(exp_def: XMLExpDef) None[source]

Generate XML tag changes to setup basic experiment parameters.

Writes generated changes to the simulation definition pickle file.

generate() XMLExpDef[source]
class sierra.core.ros1.generators.ROSExpRunDefUniqueGenerator(run_num: int, run_output_path: Path, launch_stem_path: Path, random_seed: int, cmdopts: Dict[str, Any])[source]

Generate XML changes unique to a experimental runs for ROS experiments.

These include:

  • Random seeds for each: term: Experimental Run.

  • Unique parameter file for each: term: Experimental Run.

Inheritance

Inheritance diagram of ROSExpRunDefUniqueGenerator
__dict__ = mappingproxy({'__module__': 'sierra.core.ros1.generators', '__doc__': '\n    Generate XML changes unique to a experimental runs for ROS experiments.\n\n    These include:\n\n    - Random seeds for each: term: `Experimental Run`.\n\n    - Unique parameter file for each: term: `Experimental Run`.\n    ', '__init__': <function ROSExpRunDefUniqueGenerator.__init__>, 'generate': <function ROSExpRunDefUniqueGenerator.generate>, 'generate_random': <function ROSExpRunDefUniqueGenerator.generate_random>, 'generate_paramfile': <function ROSExpRunDefUniqueGenerator.generate_paramfile>, '__dict__': <attribute '__dict__' of 'ROSExpRunDefUniqueGenerator' objects>, '__weakref__': <attribute '__weakref__' of 'ROSExpRunDefUniqueGenerator' objects>, '__annotations__': {}})
__doc__ = '\n    Generate XML changes unique to a experimental runs for ROS experiments.\n\n    These include:\n\n    - Random seeds for each: term: `Experimental Run`.\n\n    - Unique parameter file for each: term: `Experimental Run`.\n    '
__init__(run_num: int, run_output_path: Path, launch_stem_path: Path, random_seed: int, cmdopts: Dict[str, Any]) None[source]
__module__ = 'sierra.core.ros1.generators'
__weakref__

list of weak references to the object (if defined)

generate(exp_def: XMLExpDef)[source]
generate_paramfile(exp_def: XMLExpDef) None[source]

Generate XML changes for the parameter file for an experimental run.

generate_random(exp_def: XMLExpDef) None[source]

Generate XML changes for random seeding for an experimental run.