|
AGX Dynamics 2.42.3.1
|
Container for all user configurable parameters for the regression planes. More...
#include <RegressionPlanesParameters.h>
Inheritance diagram for agxTerrain::RegressionPlanesParameters:Classes | |
| struct | GridScalePair |
Public Types | |
| enum class | ContributionMode { INCLUDE , EXCLUDE } |
| enum class | GridScale { RADIUS , WIDTH , ELEMENT_SIZE , UNITY } |
| Scaling factors for regression-plane grid step sizes. More... | |
| enum class | GridShape { RECTANGLE , ELLIPSE } |
Public Member Functions | |
| RegressionPlanesParameters () | |
| bool | areScalesTerrainDependent () const |
| bool | isDirty () const |
| bool | isValid () const |
| void | setDirty (bool isDirty) |
| Set dirty flag on the RegressionPlanesParameters. | |
| void | setRegressionPlanesForceFeedbackHeightFieldLengths (const agx::Vec2 &lengths) |
| Set the lengths of the force-feedback plane along its local x- and y-axes. | |
| void | setRegressionPlanesForceFeedbackHeightFieldLengthsScale (const GridScalePair &scales) |
| Set the scale expressions for the force-feedback plane length sizes. | |
| void | setRegressionPlanesForwardDirectionOmegaYThreshold (const agx::Real threshold) |
| Set the threshold for the wheel axle axis angular velocity magnitude used to suppress the update of the sign of the forward direction of the frame associated with the regression planes. | |
| void | setRegressionPlanesForwardDirectionVxAngularEquivalentThreshold (const agx::Real threshold) |
| Set the threshold for the longitudinal wheel velocity expressed as an angular-equivalent velocity used to suppress the update of the sign of the forward direction of the frame associated with the regression planes. | |
| void | setRegressionPlanesGridCombinationIndexForceFeedbackPlane (const agx::Int index) |
| Set which grid combination is used to construct the force-feedback plane. | |
| void | setRegressionPlanesGridCombinationIndexFrontAnglePlane (const agx::Int index) |
| Set which grid combination defines the front-angle plane. | |
| void | setRegressionPlanesGridCombinationIndexRearAndFrontAngleReferencePlane (const agx::Int index) |
| Set which grid combination defines the reference plane used for rear- and front-angle measurements. | |
| void | setRegressionPlanesGridCombinationIndexRearAnglePlane (const agx::Int index) |
| Set which grid combination defines the rear-angle plane. | |
| void | setRegressionPlanesGridCombinations (const std::vector< std::vector< std::vector< agx::Int > > > &combinations) |
| Set the grid-combination definition used for constructing combined regression planes. | |
| void | setRegressionPlanesGridCombinationsIndicesOrigin (const std::vector< std::vector< agx::Int > > &indices) |
| Set the origin indices for each grid inside each regression-plane grid combination. | |
| void | setRegressionPlanesGridCombinationsIndicesReferenceNormal (const std::vector< std::vector< agx::Int > > &indices) |
| Set the reference-normal indices for each grid inside each regression-plane grid combination. | |
| void | setRegressionPlanesGridsAdaptToRearAndFrontAngles (const std::vector< bool > &adapts) |
| Enable or disable adaptation of each regression-plane grid to the wheel's rear and front angles. | |
| void | setRegressionPlanesGridsCenterPoint (const agx::Vec2Vector &gridsCenterPoint) |
| Configure the center points for all regression-plane sampling grids. | |
| void | setRegressionPlanesGridsCenterPointScale (const agx::VectorPOD< GridScalePair > &scales) |
| Set the scale expressions for each regression-plane grid center point. | |
| void | setRegressionPlanesGridsContributionMode (const agx::VectorPOD< ContributionMode > &modes) |
| Set the contribution mode for each regression-plane grid. | |
| void | setRegressionPlanesGridsNumGridPoints (const agx::Vec2iVector &gridsNumGridPoints) |
| Set the number of sampling points for each regression-plane grid. | |
| void | setRegressionPlanesGridsShape (const agx::VectorPOD< GridShape > &shapes) |
| Set the geometric shape for each regression-plane grid. | |
| void | setRegressionPlanesGridsStepSize (const agx::Vec2Vector &gridsStepSize) |
| Set the step size for each regression-plane sampling grid. | |
| void | setRegressionPlanesGridsStepSizeScale (const agx::VectorPOD< GridScalePair > &scales) |
| Set the scale expressions for each regression-plane grid step size. | |
| void | setRegressionPlanesOverrideRearAndFrontAngleReferenceWithZ (const bool enable) |
| Determine if the rear and front angle reference normal should be overridden to always be (0,0,1). | |
Public Member Functions inherited from agx::Referenced | |
| Referenced () | |
| Default constructor. | |
| Referenced (const Referenced &) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. | |
| template<typename T > | |
| const T * | asSafe () const |
| int | getReferenceCount () const |
| template<typename T > | |
| bool | is () const |
| Subclass test. | |
| Referenced & | operator= (const Referenced &) |
| Assignment operator. Will increment the number of references to the referenced object. | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. | |
Additional Inherited Members | |
Static Public Member Functions inherited from agx::Referenced | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions inherited from agx::Referenced | |
| virtual | ~Referenced () |
| Destructor. | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Static Protected Member Functions inherited from agx::Referenced | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. | |
Protected Attributes inherited from agx::Referenced | |
| Mutex | m_mutex |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
Container for all user configurable parameters for the regression planes.
The parameters define e.g.:
The spatial layout of sampling grids (center, step size, shape, etc.). Scaling rules (scale e.g. step size by wheel radius, element size, etc.) How individual grids contribute to different regression planes (force feedback, front/rear angle, reference planes, etc.). Flags for adapting grids based on wheel angles or overriding references with Z height.
Together, these parameters control how regression planes are generated, combined, and updated each timestep to represent the terrain under the wheel.
Definition at line 44 of file RegressionPlanesParameters.h.
|
strong |
| Enumerator | |
|---|---|
| INCLUDE | |
| EXCLUDE | |
Definition at line 103 of file RegressionPlanesParameters.h.
|
strong |
Scaling factors for regression-plane grid step sizes.
| Enumerator | |
|---|---|
| RADIUS | |
| WIDTH | |
| ELEMENT_SIZE | |
| UNITY | |
Definition at line 80 of file RegressionPlanesParameters.h.
|
strong |
| Enumerator | |
|---|---|
| RECTANGLE | |
| ELLIPSE | |
Definition at line 97 of file RegressionPlanesParameters.h.
| agxTerrain::RegressionPlanesParameters::RegressionPlanesParameters | ( | ) |
| bool agxTerrain::RegressionPlanesParameters::areScalesTerrainDependent | ( | ) | const |
| bool agxTerrain::RegressionPlanesParameters::isDirty | ( | ) | const |
| bool agxTerrain::RegressionPlanesParameters::isValid | ( | ) | const |
| void agxTerrain::RegressionPlanesParameters::setDirty | ( | bool | isDirty | ) |
Set dirty flag on the RegressionPlanesParameters.
This means that they have changed since last time, and internals dependent on the parameters might need reinitialization.
| isDirty | - set whether the parameters should be marked as dirty or not. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesForceFeedbackHeightFieldLengths | ( | const agx::Vec2 & | lengths | ) |
Set the lengths of the force-feedback plane along its local x- and y-axes.
The force-feedback plane is the plane that interacts physically with the wheel, producing forces and torques. Its size determines how large an area around the wheel is considered when evaluating force feedback. The two components specify the plane's half-extent (or radius-like measure) in each principal direction.
Example input: '{ 2.0, 2.0 }' meaning the plane spans 2 units in both x and y directions before scaling.
| lengths | A vector of two values:
|
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesForceFeedbackHeightFieldLengthsScale | ( | const GridScalePair & | scales | ) |
Set the scale expressions for the force-feedback plane length sizes.
Each local lengthof the plane force-feedback plane can be multiplied by one of the predefined scale enums (See GridScale):
These scale identifiers allow the force-feedback plane size to adapt automatically to wheel geometry or terrain resolution, without changing the provided base lengths. (See setRegressionPlanesForceFeedbackHeightFieldLengths).
| scales | A 2D array of GridScale enums where scales[0] and scales[1] represent the scale used for the force feedback length scale in the x- or y-direction, respectively. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesForwardDirectionOmegaYThreshold | ( | const agx::Real | threshold | ) |
Set the threshold for the wheel axle axis angular velocity magnitude used to suppress the update of the sign of the forward direction of the frame associated with the regression planes.
The longitudinal velocity vX is converted to an angular equivalent by dividing by the wheel radius R, i.e. |vX| / R.
If both:
| threshold | Threshold for |omegaY| [rad/s]. Must be >= 0. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesForwardDirectionVxAngularEquivalentThreshold | ( | const agx::Real | threshold | ) |
Set the threshold for the longitudinal wheel velocity expressed as an angular-equivalent velocity used to suppress the update of the sign of the forward direction of the frame associated with the regression planes.
The longitudinal velocity vX is converted to an angular equivalent by dividing by the wheel radius R, i.e. |vX| / R.
If both:
The corresponding linear velocity threshold is: |vX| < vXAngEquivThreshold * R
| threshold | Threshold for |vX| / R [rad/s]. Must be >= 0. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinationIndexForceFeedbackPlane | ( | const agx::Int | index | ) |
Set which grid combination is used to construct the force-feedback plane.
The force-feedback plane is the plane that physically interacts with the wheel during simulation, generating forces and torques based on contact with the terrain. By supplying an index i, the plane will be built using the grid combination 'gridCombinations[i]'.
| index | The grid-combination index used to construct the force-feedback plane. If index = i, then gridCombinations[i] defines the plane. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinationIndexFrontAnglePlane | ( | const agx::Int | index | ) |
Set which grid combination defines the front-angle plane.
The rear-angle plane determines the wheel's front angle by intersection the plane with the wheel
| index | The grid-combination index used to construct the front-angle plane. If index = i, then gridCombinations[i] defines the plane. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinationIndexRearAndFrontAngleReferencePlane | ( | const agx::Int | index | ) |
Set which grid combination defines the reference plane used for rear- and front-angle measurements.
The normal of this plane serves as the reference normal against which both the rear angle and front angle of the wheel are measured.
| index | The grid-combination index used to construct the rear-and-front angle reference plane. If index = i, then gridCombinations[i] defines the reference plane. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinationIndexRearAnglePlane | ( | const agx::Int | index | ) |
Set which grid combination defines the rear-angle plane.
The rear-angle plane determines the wheel's rear angle by intersection the plane with the wheel
| index | The grid-combination index used to construct the rear-angle plane. If index = i, then gridCombinations[i] defines the plane. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinations | ( | const std::vector< std::vector< std::vector< agx::Int > > > & | combinations | ) |
Set the grid-combination definition used for constructing combined regression planes.
A grid combination defines how individual regression-plane grids (from the configuration arrays such as gridsCenterPoint, gridsStepSize, etc.) are grouped together to form a combined plane. Each entry in the outer vector corresponds to one combined plane, and each combined plane consists of one or more grid groups.
A grid group is a list of grid indices. All grids within a group are first aggregated together (their regression results are merged), producing:
If the combined plane contains multiple grid groups, each group produces its own aggregated normal and aggregated regression center point. These per-group results are then further averaged to produce the final average normal and average regression point of the combined plane.
Examples:
| combinations | A 3D structure describing how grids are grouped into combined planes.
|
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinationsIndicesOrigin | ( | const std::vector< std::vector< agx::Int > > & | indices | ) |
Set the origin indices for each grid inside each regression-plane grid combination.
This configuration mirrors the structure and logic of 'setRegressionPlanesGridCombinationsIndicesReferenceNormal', but instead determines which origin point (relative to the wheel center) should be used when constructing each combined regression-plane grid.
Structure:
Origin-selection rules:
This allows different grid groups within the same combined plane to use different origin sources—even if the grid-combination structure is identical. It also allows a combined plane to anchor its grids relative to completely different reference planes.
Example:
| indices | A 2D structure describing origin selection:
|
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridCombinationsIndicesReferenceNormal | ( | const std::vector< std::vector< agx::Int > > & | indices | ) |
Set the reference-normal indices for each grid inside each regression-plane grid combination.
For every combined regression-plane definition in 'gridCombinations', this method specifies which reference normal should be used when constructing the coordinate frame for each of its grid groups.
A reference normal determines the "up-axis" used when generating the sampling grid. Together with the wheel's local y-axis, it defines the grid's orientation in space.
Structure:
Reference-normal rules:
This mapping allows two combined planes with identical grid definitions to use different orientation frames, simply by assigning different reference-normal indices.
Example (simplified):
Interpretation:
| indices | A 2D structure where:
|
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsAdaptToRearAndFrontAngles | ( | const std::vector< bool > & | adapts | ) |
Enable or disable adaptation of each regression-plane grid to the wheel's rear and front angles.
When adaptation is enabled for a grid, its sample points are dynamically shifted based on the wheel's current rear and front angles. This allows the grid to "follow" the effective contact geometry as the wheel sinkage increases or decreases.
When adaptation is disabled, the grid's points remain fixed relative to the wheel's local frame, independent of wheel sinkage.
| adapts | A list of boolean flags, one per regression-plane grid.
|
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsCenterPoint | ( | const agx::Vec2Vector & | gridsCenterPoint | ) |
Configure the center points for all regression-plane sampling grids.
This method defines the (x, y) offsets of each grid's center in the wheel's local coordinate frame, expressed relative to the wheel center. These center points are later used together with grid scale, step size, and number-of-points settings to construct the sampling grids used by the regression-plane pipeline.
| gridsCenterPoint | A 2D array where gridsCenterPoint[i] contains the center offset for grid i, specified as { xOffset, yOffset }. The length of the outer vector determines the number of regression-plane grids. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsCenterPointScale | ( | const agx::VectorPOD< GridScalePair > & | scales | ) |
Set the scale expressions for each regression-plane grid center point.
Each center-point component of a regression-plane grid can be multiplied by one of the predefined scale enums (See GridScale):
These symbolic scale identifiers allow grid center points to automatically adapt to wheel geometry or terrain resolution.
| scales | A 2D array where scales[i] contains the scale identifiers applied to the center-point components of grid i (e.g., { "width", "unity" }). The structure must match the dimensions of the center-point array supplied to setRegressionPlanesGridsCenterPoint(). |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsContributionMode | ( | const agx::VectorPOD< ContributionMode > & | modes | ) |
Set the contribution mode for each regression-plane grid.
Each grid determines how sample points falling within or on the boundary of its region should be treated:
This allows grids to act either as additive regions (include) or masking regions (exclude) when constructing the final set of regression-plane samples. The mode strings are converted to AGX string types and applied during grid evaluation.
| modes | A list of contribution-mode identifiers ("include" or "exclude"), one for each regression-plane grid. The number of entries must match the number of configured regression-plane grids. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsNumGridPoints | ( | const agx::Vec2iVector & | gridsNumGridPoints | ) |
Set the number of sampling points for each regression-plane grid.
Each regression-plane grid is discretized into a 2D array of sample points. This method specifies how many points should be used along each grid axis. These values, together with the grid step size and center point, determine the resolution and coverage of each regression-plane sampling grid.
| gridsNumGridPoints | A 2D array where gridsNumGridPoints[i] contains the number of grid points for grid i. Each entry should be { numX, numY }, defining the number of samples along the grid's local x- and y-directions. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsShape | ( | const agx::VectorPOD< GridShape > & | shapes | ) |
Set the geometric shape for each regression-plane grid.
Each regression-plane grid can be generated using one of the supported shapes: "rectangle" or "ellipse". The chosen shape determines how sample points are distributed within the grid region:
The provided shape identifiers are converted to AGX string types and stored for use during grid construction.
| shapes | A list of shape identifiers (either "rectangle" or "ellipse"), one for each regression-plane grid. The size of this list must match the number of configured regression-plane grids. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsStepSize | ( | const agx::Vec2Vector & | gridsStepSize | ) |
Set the step size for each regression-plane sampling grid.
The step size defines the spacing between adjacent sample points along the grid's local x- and y-directions. Together with the number of grid points and the grid center, these values determine the spatial extent and density of each regression-plane sampling grid.
| gridsStepSize | A 2D array where gridsStepSize[i] contains the step sizes for grid i, specified as { stepX, stepY }. These values determine how far apart neighboring points are placed along each axis. |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesGridsStepSizeScale | ( | const agx::VectorPOD< GridScalePair > & | scales | ) |
Set the scale expressions for each regression-plane grid step size.
Each step-size component of a regression-plane grid can be multiplied by one of the predefined scale enums (See GridScale):
These scale identifiers allow grid step sizes to adapt automatically to wheel geometry or terrain resolution.
| scales | A vector of enum 2D arrays where scales[i] contains the scale identifiers applied to the step-size components of grid i (e.g., { "RADIUS", "UNITY" }). The number of given scales must match the number of step-size-arrays given to setRegressionPlanesGridsStepSize(). |
| void agxTerrain::RegressionPlanesParameters::setRegressionPlanesOverrideRearAndFrontAngleReferenceWithZ | ( | const bool | enable | ) |
Determine if the rear and front angle reference normal should be overridden to always be (0,0,1).
| enable | If true, (0,0,1) is used. If false, refernce normal is computed via the regression planes |
| agxTerrain::RegressionPlanesParameters::AGXTERRAIN_TERRAINWHEEL_STORE_RESTORE_INTERFACE |
Definition at line 551 of file RegressionPlanesParameters.h.
| agx::Vec2 agxTerrain::RegressionPlanesParameters::m_forceFeedbackHeightFieldLengths |
Definition at line 573 of file RegressionPlanesParameters.h.
| GridScalePair agxTerrain::RegressionPlanesParameters::m_forceFeedbackHeightFieldLengthsScale |
Definition at line 574 of file RegressionPlanesParameters.h.
| agx::Real agxTerrain::RegressionPlanesParameters::m_forwardDirectionOmegaYThreshold |
Definition at line 576 of file RegressionPlanesParameters.h.
| agx::Real agxTerrain::RegressionPlanesParameters::m_forwardDirectionVxAngularEquivalentThreshold |
Definition at line 575 of file RegressionPlanesParameters.h.
| agx::Int agxTerrain::RegressionPlanesParameters::m_gridCombinationIndexForceFeedbackPlane |
Definition at line 568 of file RegressionPlanesParameters.h.
| agx::Int agxTerrain::RegressionPlanesParameters::m_gridCombinationIndexFrontAnglePlane |
Definition at line 569 of file RegressionPlanesParameters.h.
| agx::Int agxTerrain::RegressionPlanesParameters::m_gridCombinationIndexRearAndFrontAngleReferencePlane |
Definition at line 571 of file RegressionPlanesParameters.h.
| agx::Int agxTerrain::RegressionPlanesParameters::m_gridCombinationIndexRearAnglePlane |
Definition at line 570 of file RegressionPlanesParameters.h.
| std::vector<std::vector<std::vector<agx::Int> > > agxTerrain::RegressionPlanesParameters::m_gridCombinations |
Definition at line 565 of file RegressionPlanesParameters.h.
| std::vector<std::vector<agx::Int> > agxTerrain::RegressionPlanesParameters::m_gridCombinationsIndicesOrigin |
Definition at line 567 of file RegressionPlanesParameters.h.
| std::vector<std::vector<agx::Int> > agxTerrain::RegressionPlanesParameters::m_gridCombinationsIndicesReferenceNormal |
Definition at line 566 of file RegressionPlanesParameters.h.
| agx::Vec2Vector agxTerrain::RegressionPlanesParameters::m_gridsCenterPoint |
Definition at line 557 of file RegressionPlanesParameters.h.
| agx::VectorPOD<GridScalePair> agxTerrain::RegressionPlanesParameters::m_gridsCenterPointScale |
Definition at line 558 of file RegressionPlanesParameters.h.
| agx::VectorPOD<ContributionMode> agxTerrain::RegressionPlanesParameters::m_gridsContributionMode |
Definition at line 563 of file RegressionPlanesParameters.h.
| std::vector<bool> agxTerrain::RegressionPlanesParameters::m_gridsIsAdaptToRearAndFrontAngles |
Definition at line 564 of file RegressionPlanesParameters.h.
| agx::Vec2iVector agxTerrain::RegressionPlanesParameters::m_gridsNumGridPoints |
Definition at line 559 of file RegressionPlanesParameters.h.
| agx::VectorPOD<GridShape> agxTerrain::RegressionPlanesParameters::m_gridsShape |
Definition at line 562 of file RegressionPlanesParameters.h.
| agx::Vec2Vector agxTerrain::RegressionPlanesParameters::m_gridsStepSize |
Definition at line 560 of file RegressionPlanesParameters.h.
| agx::VectorPOD<GridScalePair> agxTerrain::RegressionPlanesParameters::m_gridsStepSizeScale |
Definition at line 561 of file RegressionPlanesParameters.h.
| bool agxTerrain::RegressionPlanesParameters::m_isDirty |
Definition at line 577 of file RegressionPlanesParameters.h.
| bool agxTerrain::RegressionPlanesParameters::m_overrideRearAndFrontAngleReferenceWithZ |
Definition at line 572 of file RegressionPlanesParameters.h.