simfwk_cli) serves as the primary entry point for executing a simulation loop using the Simulation Framework.
To align with AVxcelerate Architecture 2.0, simfwk_cli now requires a single mandatory simulation configuration file in JSON format. This file is referred to as the “solver setting configuration” throughout this documentation and represents the simulation configuration file.
To perform a quick test with the default solver setting configuration, use the following command:
”simulation_parameters”
input_open_scenario: Specifies the file containing the autonomy simulation scenario.output_directory: Specifies the directory where simulation outputs will be saved.
input_driver_input: Defines the file for driver’s input data. This file will be used if “dummy_driver_activity” is applied in scheduling configuration. If not given, a default input driver file will be generated under path"/tmp/simulation_framework/default_data/driver_input_default.json"and be applied for simulation.input_user_settings: Provides the file containing user-specific settings for Gt-gen. This becomes a mandatory parameter if “groundtruth_generator_activity” is applied in scheduling configuration. If other customized world simulator is used, this can be ignored.job_id: A string describes the simulation instance
simfwk_cli binary, located in the bin folder.
”simulation_scheduling”
This section is specifically designed for setting up simulation scheduling. It allows users to define the Activities and configure their behavior during simulations. Below is an example ofsimulation_scheduling.
For a detailed explanation, please refer to the dedicated chapter: Simulation Scheduling.
Running Simulation Framework using the CLI executable
Different arguments can be passed as options to configure the simulation:-s <simulation_configuration.json> is the only mandatory argument. If extra parameters are required by customized autonomy simulation, they can be given through the CLI. Thus, the file path can be retrieved by using the getter API of any activity. More explanation about the getter API in activities can be found here.
E.g. if you want a file named “file_foo” with path “path/to/file_foo.txt”, the following command can be given using the CLI:
GetCustomizedParameters().
Batch Mode Usage
If you want to execute the scenario and simply have the output,simfwk_cli can be executed using the command below:
Interactive Usage
Additionally, you can trigger the cli controller mode by option-c true
cli_controller, instead of just running through of your scenario. With the cli controller , the user can send commands like run , pause , resume , restart , step or kill , to interact with simulation.
Interact with simulation using the cli_controller
When the-c true is applied, a server will be created for listening to the user command. To control the simulation, following command are available:
Example
- First start your simulation and enable user control:
- Then you will see following message in the console, if the default controller port is not changed:
- Open a new terminal, and try trigger the simulation:
- After a successful execution, the console shows
Cli Controller Execution Status OK!. Then you can see the simulation has started.
simfwk_cli will not terminate unless you send kill from the cli_controller or manually press ctrl+c.