3. Auto Headlight : Run simulation by manual process#

Loading examples manually without usage of script.#

../../../_images/manual_add_ext_proc.png
  • Click on “Start external process” button and browse for a FMU either Carla or VAPI example FMU.

../../../_images/manual_start_ext_proc.png
  • Autoheadlight fmu is loaded and user can see signals in widgets being updated.

../../../_images/manual_ext_proc_loaded.png
  • In similar way again in control panel, add an external process but now its Carla FMU. After Carla bridge is loaded, screen will look similar to the screenshot shown below.Ignore the console window. it can be placed in the background.

../../../_images/manual_carla_bridge_loaded.png

Hint

Carla FMUs for examples are located in examples\auto_headlight_example\simulation_artifacts\

  • Now configure some Carla parameters in the carla io variable widget to get the correct camera placement and control.

../../../_images/manual_toggle_view.png
  • CARLAin__toggle_view = 1; second image shows the result of changing this value.

../../../_images/manual_toggled_view.png
  • CARLAin_operation_mode = 4; This enables keyboard control of vehicle.

  • CARLAin_toggle_display = 1; This activates front view camera angle of vehicle will be shown as shown below.

../../../_images/manual_toggle_display.png
  • Add the trigger file in control panel’ Equation section , this trigger file has details of signals between Carla and VAPI FMU.

../../../_images/manual_trigger_file.png
  • Click on file and browse for respective trigger file and then click on run to activate the trigger file.

../../../_images/manual_run_triggerfile.png
  • Now click on screen where the vehicle is currently being simulated, so that window context becomes active for keyboard usage. And start driving towards tunnel. As soon as vehicle enters tunnel, the headlight is switched on and as vehicle is driven outside of tunnel, headlight switches off as programmed in the vapi FMU.

../../../_images/manual_example_ready.png

Note

Use following keys on your keyboard to control the vehicle motion in carla environment.
  • “W” -> Acceleration or Gas pedal. Hold it to move continuously and leave to slow down.

  • “A” -> Steer Left.

  • “D” -> Steer Right.

  • “S” -> Apply Brake.

  • “R” -> Toggle to enable or disable reverse gear.

../../../_images/keys.png

Switching between examples#

  • User needs to terminate the loaded external processes to load another scenario/example.

  • User needs to select control panel present at the right top section.

../../../_images/controlpanel.png
  • and in control panel, user needs to click on “remove” in the process section.

../../../_images/removebutton.png
  • User can select multiple processes and click ok to to terminate the selected processes.

../../../_images/process_selection.png
  • This procedure makes sure all the external FMUs are shutdown and new examples can be loaded. This process has to be followed when switching between different examples.