DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Safety Force Field Sample
SW Release Applicability: This sample is available in NVIDIA DRIVE Software releases.


The Safety Force Field sample checks whether a desired control (i.e., a choice of steering angle and longitudinal acceleration) is safe when all actors (ego-vehicle and other obstacles) execute a safety procedure. Safety is with respect to the obstacles in a given obstacle array, or egomotion/vehicleIO state. If the control is deemed unsafe, it is corrected to a safe one.

In this sample, only the ego-vehicle executes a corrected control. Other vehicles do not apply any control correction. A lane graph can optionally be specified and will make the safety procedure line up parallel to the given lane.

Running the Sample

The command line for the sample is:

./sample_safetyforcefield --testcase=[0|1]


    Specifies a predefined synthetic scenario.
    Scenario 0 has an ego-vehicle with two other vehicles that are cutting in the ego-vehicle's driving direction.
    Scenario 1 has an ego-vehicle following another slow vehicle.
    Default value: 0
    1 for safety procedure to line up with a road
    Default value: 0
    1 for claimed sets to expand by possible reaction time uncertainty
    Default value: 0


Running the sample with default arguments


Running the sample using a expanding claimed set that lines up with the road structure

./sample_safetyforcefield --useRoadStructure=1 --expandClaimedSets=1


The output is composed of two images:

  • The left image is a top down view of the claimed sets, i.e., the likely trajectories of the actors executing their safety procedures.
  • The right image is a control constraint image of the ego-vehicle.

In the top down view of claimed sets:

  • The ego-vehicle's claimed set is magenta.
  • Other vehicles claimed sets are cyan.
  • Rendering hovers over the ego-vehicle, where the claimed set remains stationary.

In the control constraint image:

  • The X-axis indicates the front wheel steering angle. Any pixel on the left half of the image has a positive steering angle. On the X-axis there is one gray marking per degree.
  • The Y-axis indicates acceleration. Any pixel on the top half of the image has positive acceleration. On the Y-axis there is one gray marking per meter per second squared.
  • The white unfilled box indicates the steering angle and acceleration limits.
  • A green pixel indicates a safe control, which meets all control constraints.
  • A red pixel indicates an unsafe control, which violates at least one of the control constraints.
  • The black circle is the ego-vehicle's control before actuation.
  • The blue circle is the ego-vehicle's control after actuation.
  • The dark green circle is the initial control on the ego-vehicle's safety procedure.

Additional Information

For more details, please refer to Safety Force Field.