1 # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
3 @page safetyforcefield_usecase1 Safety Force Field Workflow
6 @note SW Release Applicability: This tutorial is applicable to modules in **NVIDIA DRIVE Software** releases.
8 @section safetyforcefield_initialization Initialization
10 #### To initialize the Safety Force Field default parameters
13 dwStatus dwSafetyForceField_initDefaultParams(dwSafetyForceFieldParams* params);
16 An actor's claimed set is the likely trajectory in space-time of the actor executing its safety procedure.
17 For example, the green set in the following figure is a claimed set if the safety procedure is driving straight and braking:
19 
22 The underlying space of the green claimed set is space-time where the space is the xy-plane. Its projection on xy-plane is a long rectangle, showing the obstacle is moving along a fixed direction. Its projection on the plane spanned by the obstacle direction and time axis is a parabola opening downwards. This indicates the obstacle is slowing down over time.
24 The following attributes for the `dwSafetyForceFieldParams` struct configure the shape for each actor's claimed set:
27 - `expandClaimedSets`.
29 The default value for these attributes is `false`, so the default claimed set comes from holding the steering wheel and braking.
31 The following figures are examples of claimed sets when each of these attributes are enabled:
32 - `forceStraight = true`, and other attributes are default.
33 The claimed set is continued straight in the actor's current heading throughout the safety procedure.
35 
38 - `useRoadStructure = true`, and other attributes are default. The claimed sets align with the ego-vehicle's current path.
40 
43 - `expandClaimedSets = true`, and other attributes are default.
44 The claimed sets expand laterally and longitudinally to take account of control uncertainties and reaction time. In the following figure, the quadrilateral time slices of the green claimed set grow over time.
46 
49 About combining the attributes, you can set `useRoadStructure = true` and `expandClaimedSets = true` together.
50 However, the setting `forceStraight = true` ignores what `useRoadStructure` and `expandClaimedSets` are set, so that road structure is not used and claimed sets are not expanded.
52 #### To initialize a pointer to a Safety Force Field handle
55 dwStatus dwSafetyForceField_initialize(dwSafetyForceFieldHandle_t* handle,
56 const dwSafetyForceFieldParams* params,
57 dwContextHandle_t context);
60 @section safetyforcefield_binding_inputs Binding Inputs
62 The inputs for a Safety Force Field module must be bound before you run the process function.
63 These include obstacles, egomotion, the vehicleIO state, and a lane graph.
65 #### To bind an objects pointer
68 dwStatus dwSafetyForceField_bindInputObjects(const uint32_t* slotId,
69 dwObjectArray* objects,
70 dwSafetyForceFieldHandle_t handle);
73 The Safety Force Field module consumes obstacles on the ground within 120 meters of the ego-vehicle.
74 The `maxNumActors` attribute for the `dwSafetyForceFieldParams` struct determines the upper bound of the number of these obstacles to be processed.
76 The egomotion and vehicleIO state decide the ego-vehicle's state (including speed and front wheel steering angle).
77 This is used as input to generate the ego-vehicle's claimed set.
79 #### To bind an egomotion handle
82 dwStatus dwSafetyForceField_setEgomotion(dwEgomotionConstHandle_t egomotion,
83 dwSafetyForceFieldHandle_t handle);
86 #### To bind the vehicleIO state
89 dwStatus dwSafetyForceField_bindInputVehicleIOState(const dwVehicleIOState* vioState,
90 dwSafetyForceFieldHandle_t handle);
94 #### To bind a lane graph pointer
97 dwStatus dwSafetyForceField_bindInputLaneGraph(const dwLaneGraph* lg,
98 dwSafetyForceFieldHandle_t handle);
101 @section safetyforcefield_process_function Process Function
103 The process function computes the claimed set for each actor, checks for collisions between the ego-vehicle and an actor, and computes
104 a Safety Force Field for each collision point.
107 dwStatus dwSafetyForceField_process(dwSafetyForceFieldHandle_t handle);
110 Each Safety Force Field generates one control constraint.
112 #### To obtain the control constraints from a Safety Force Field module for actuation
115 dwStatus dwSafetyForceField_getControlConstraints(dwSafetyForceFieldControlConstraints* constraints,
116 dwSafetyForceFieldHandle_t handle);
119 @section safetyforcefield_release Release
121 #### To release a Safety Force Field module
124 dwStatus dwSafetyForceField_release(dwSafetyForceFieldHandle_t handle);
127 For a more detailed workflow, please refer to the @ref dwx_safetyforcefield_sample.