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.

Functions

 AvoidanceWorkspace ()
 
void Reset (const AvoidanceCollider &rootCollider, KyFloat32 visualDebugAltitude=0.0f)
 Reset the workspace and prepare it for a given root collider. More...
 
AvoidanceWorkspaceAddColliderResult AddCollider (const AvoidanceConfig &config, AvoidanceCollider &collider)
 Compute the time to collision and filters accordingly: More...
 
KyFloat32 ComputeAvoidanceScore (const Vec2f &candidateVelocity, const KyFloat32 safetyDistance, const KyFloat32 timeHorizon, KyFloat32 &collisionTime, KyInt32 &colliderIndex) const
 Computes the avoidance score. More...
 

Data

AvoidanceCollider m_rootCollider
 
ColliderArray m_colliders
 The Bot collider for which the AvoidanceWorkspace computes a velocity. More...
 
ColliderArray m_ignoredColliders
 The array of discarded Colliders. More...
 

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 below AvoidanceConfig::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

Computes the avoidance score.

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

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 Bot collider for which the AvoidanceWorkspace computes a velocity.

The array of colliders which have been kept.

ColliderArray Kaim::AvoidanceWorkspace::m_ignoredColliders

The array of discarded Colliders.


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