Kaim::AvoidanceWorkspace Class Reference

Kaim::AvoidanceWorkspace Class Reference

#include <avoidanceworkspace.h>

Class Description

AvoidanceWorkspace aggregates at once:

  • a root collider, that represent the Bot for which a velocity as to be found
  • the Avoidance for nearby potential collider to be avoidance.

    It is typically fed by an IAvoidanceComputer instance and then provided to a IAvoidanceSolver to compute the more appropriate velocity.

Public Member Functions

 AvoidanceWorkspace ()
 
void Reset (const AvoidanceCollider &rootCollider, KyFloat32 visualDebugAltitude=0.f)
 
AvoidanceWorkspaceAddColliderResult AddCollider (const AvoidanceConfig &config, AvoidanceCollider &collider)
 
KyFloat32 ComputeAvoidanceScore (const Vec2f &candidateVelocity, const KyFloat32 safetyDistance, const KyFloat32 timeHorizon, KyFloat32 &collisionTime, KyInt32 &colliderIndex) const
 

Public Data Members

AvoidanceCollider m_rootCollider
 
ColliderArray m_colliders
 
ColliderArray m_ignoredColliders
 

For internal use only

bool m_doSendVisualDebugBlob
 
KyFloat32 m_visualDebugAltitude
 

Member Function Documentation

AvoidanceWorkspaceAddColliderResult Kaim::AvoidanceWorkspace::AddCollider ( const AvoidanceConfig config,
AvoidanceCollider collider 
)

Compute the time to collision and filters accordingly:

  • if bellow #m_minimalTimeToCollision: insert the collider in the workspace and return AvoidanceWorkspace_ColliderAdded
  • else: ignore the collider and return AvoidanceWorkspace_ColliderIgnored All colliders are however retained in a ColliderArray, accordingly to the filtering, an can be retrieved there afterwards.
KyFloat32 Kaim::AvoidanceWorkspace::ComputeAvoidanceScore ( const Vec2f candidateVelocity,
const KyFloat32  safetyDistance,
const KyFloat32  timeHorizon,
KyFloat32 collisionTime,
KyInt32 colliderIndex 
) const

Compute the avoidance score.

void Kaim::AvoidanceWorkspace::Reset ( const AvoidanceCollider rootCollider,
KyFloat32  visualDebugAltitude = 0.f 
)

Reset the workspace and prepare it for a given root collider.

visualDebugAltitude is used only in order to VisualDebug the 2d AvoidanceWorkspace at the given altitude, usually the Bot's altitude represented by this rootColider

Member Data Documentation

ColliderArray Kaim::AvoidanceWorkspace::m_colliders

The array of Colliders which Avoidance have been kept in #m_avoidances.

ColliderArray Kaim::AvoidanceWorkspace::m_ignoredColliders

The array of discarded Colliders.

They are namely used in Integrate() function to complement #m_avoidances with the ones that should enter the focus area in next frame.

AvoidanceCollider Kaim::AvoidanceWorkspace::m_rootCollider

The AvoidanceCollider corresponding to the Bot for which the AvoidanceWorkspace is used to compute an avoidance velocity.


The documentation for this class was generated from the following file: