Conscience Core
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
conscience_core::ai Namespace Reference

Namespaces

 alerts
 
 algorithms
 
 data
 
 entity_events
 
 multi_entity
 
 nn
 
 notifications
 

Classes

struct  CaptureDetectFocusLoopConfiguration
 
class  CscEntityAlertIdentificationService
 
class  CscEntityAlertIdentificationState
 
class  CscEntityClient
 
class  CscEntityClientReal
 
class  CscEntityClientSimulated
 
class  CscEntityDetectionState
 
struct  CscEntityIdentity
 
struct  CscEntityProcessCommandOptions
 
class  CscEntityReflexion
 
struct  CscEntityReflexionActivity
 
class  CscEntityReflexionDetectionParameters
 
class  CscEntityReflexionParameters
 
class  CscEntityReflexions
 
class  CscEntityReflexionStartedEvent
 
class  CscEntityReflexionStoppedEvent
 
class  CscMoveForwardInGroupTarget
 
class  CscMoveForwardInGroupTargetEntity
 
class  CscMoveForwardInGroupTargetObject
 
class  CscMrptAutonomousExploration
 
class  CscSimulationWorld
 
struct  EntitySensorValues
 
struct  FocusParameter
 
struct  HumanDecision
 
struct  IkFocusParam
 
struct  LiveEnvironmentDetectedObject
 
struct  MrptGrid
 
struct  NodeHash
 
class  TrackedObject
 
struct  TrackHit
 
struct  VisionDetectionTargetObjectOffset
 

Typedefs

typedef function< void(bool accept)> Answer
 
typedef function< void(vector< ptr< const LiveEnvironmentDetectedObject >> detectedObjects)> LiveEnvironmentUpdateListener
 
typedef function< void(CscSequence *sequence)> SequenceProcessorSendSequenceListener
 
typedef uint64_t CscEntityStatusFlags
 

Enumerations

enum  CscDetectionStatsType { MotorizedVehicleCount, UnmotorizedVehicleCount, PersonCount }
 
enum  FocusType { INVERSE_KINEMATIC = 0, PAN_TILT = 1 }
 
enum  CscEntityStatusFlagsList : CscEntityStatusFlags {
  NONE = 0, READY = 1ULL << 0, CONSCIENCE_START = 1ULL << 1, WAITING_CLIENT_CONNECTION = 1ULL << 2,
  POSITION_ACCURACY_TOO_LARGE = 1ULL << 3, RECEIVE_MESSAGE = 1ULL << 4, SEND_MESSAGE_CHUNKED = 1ULL << 5, PROCESS_COMMAND = 1ULL << 6,
  SEND_TCP_MESSAGE = 1ULL << 7, RECIEVE_ENGINE_RESPONSE = 1ULL << 8, CHECKING_UPGRADE = 1ULL << 9, UPGRADE_IN_PROGRESS = 1ULL << 10,
  OBSTACLE_IN_RANGE = 1ULL << 11, POSITION_MANAGER_NOT_READY = 1ULL << 12, SEQUENCE_PROCESSOR_SEQUENCE_IN_PROGRESS = 1ULL << 13, SEQUENCE_PROCESSOR_SEQUENCE_IN_PAUSE = 1ULL << 14,
  SEQUENCE_PROCESSOR_SEQUENCE_UPLOADING = 1ULL << 15, SEQUENCE_PROCESSOR_SEQUENCE_TERMINATE = 1ULL << 16, ENTITY_BLOCKED_GYRO = 1ULL << 17, ENTITY_BLOCKED_GPS = 1ULL << 18,
  ENTITY_DISTANT_REALITY_MOVE = 1ULL << 19, ENTITY_BLOCKED_OBSTACLES = 1ULL << 20, ENTITY_EXPLORATION_RESTORE_MOVE = 1ULL << 61, ENTITY_EXPLORATION_NO_FRONTIERS = 1ULL << 62
}
 
enum  PickFrontierMode { PickFrontierMode_Closest, PickFrontierMode_Furthest }
 

Functions

float shortDistance (CscVector line_point1, CscVector line_point2, CscVector point)
 
float getShortDistance (map< CscInputType, float > inputsIn, map< CscInputType, float > inputsTargetValuesMember)
 
void doRemoveDecision (map< string, ptr< HumanDecision >> &ongoingDecisions, const string &decisionUid)
 
void exportMapToText (const mrpt::maps::COccupancyGridMap2D *map, const std::string &filename="slam_map.txt")
 
MrptGrid fromMap (const COccupancyGridMap2D &m)
 
bool xy2ij (const MrptGrid &g, double x, double y, int &i, int &j)
 
void ij2xy (const MrptGrid &g, int i, int j, double &x, double &y)
 
double normAng (double a)
 
fs::path generateOutPath (const std::string &filenameSuffix, const string &ext)
 
static pair< size_t, TPoint2D > pickFrontier (const std::vector< TPoint2D > &fs, const TPose2D &robotPose)
 
static void eraseFrontier (std::vector< TPoint2D > &fs, const TPoint2D &f)
 
static void eraseFrontier (std::vector< TPoint2D > &fs, size_t idx)
 
void clusterFrontiers (std::vector< TPoint2D > &frontiers, double maxDist)
 
void filterCloseFrontiers (std::vector< TPoint2D > &frontiers, const TPose2D &pose, double minDist)
 
string gridToJson (const Grid &grid)
 
vector< TPose2D > planHybridAStar (const TPose2D &robotPose, const TPoint2D &targetPose, const COccupancyGridMap2D &map, CscSlamEngine *slamEngine, const CscPoint2d &robotDimensions)
 
bool compByUsage (CscObjectiveAi *a, CscObjectiveAi *b)
 

Variables

static int entityIdentityInstanceNumber = 0
 
struct CSC_DLL_IMPORTEXPORT TrackHit
 
static const vector< CscEntityStatusFlagsListENTITY_STATUSES_BLOCKED = {CscEntityStatusFlagsList::ENTITY_BLOCKED_GYRO, CscEntityStatusFlagsList::ENTITY_BLOCKED_GPS, CscEntityStatusFlagsList::ENTITY_BLOCKED_OBSTACLES}
 
unique_ptr< CscLoggerlogger = CscLogger::getForCategory("CscMrptAutonomousExploration")
 
const double maxLinearSpeed = 0.4
 
const double maxAngularSpeed = 0.8
 
const double obstacleClearance = 0.05
 
const double occThreshold = 0.22
 
const size_t minFrontierSize = 3
 
const double replanCooldownSeconds = 8
 
const size_t noFrontiersStopThreshold = 40
 
const double restoreExplorationMoveFactor = .35
 
constexpr int pathFindingMarginCells = 0
 
constexpr bool savePathFindingDebugFilesEnabled = false
 
constexpr bool saveExplorationDebugFilesEnabled = false
 
constexpr PickFrontierMode pickFrontierMode = PickFrontierMode_Closest
 
unsigned long long last = 0
 

Typedef Documentation

◆ Answer

typedef function<void(bool accept)> conscience_core::ai::Answer

◆ CscEntityStatusFlags

◆ LiveEnvironmentUpdateListener

typedef function<void(vector<ptr<const LiveEnvironmentDetectedObject>> detectedObjects)> conscience_core::ai::LiveEnvironmentUpdateListener

◆ SequenceProcessorSendSequenceListener

Enumeration Type Documentation

◆ CscDetectionStatsType

Enumerator
MotorizedVehicleCount 
UnmotorizedVehicleCount 
PersonCount 

◆ CscEntityStatusFlagsList

Enumerator
NONE 
READY 

Conscience FW is Ready

CONSCIENCE_START 

Conscience FW starting

WAITING_CLIENT_CONNECTION 

No Client connected

POSITION_ACCURACY_TOO_LARGE 

the accuracy exceeds the allowed accuracy

RECEIVE_MESSAGE 

receive large command

SEND_MESSAGE_CHUNKED 

sending UDP chunked message

PROCESS_COMMAND 

processing command

SEND_TCP_MESSAGE 

sending TCP message

RECIEVE_ENGINE_RESPONSE 

receive engine response

CHECKING_UPGRADE 

Entity Check if can upgrade

UPGRADE_IN_PROGRESS 

FW Entity Upgrading

OBSTACLE_IN_RANGE 

Obstacle too close of the entity

POSITION_MANAGER_NOT_READY 

position manager isn't ready

SEQUENCE_PROCESSOR_SEQUENCE_IN_PROGRESS 

indicate if the entity is processing a sequence

SEQUENCE_PROCESSOR_SEQUENCE_IN_PAUSE 

indicate if the entity is in pause in its sequence

SEQUENCE_PROCESSOR_SEQUENCE_UPLOADING 

indicate upload of sequence

SEQUENCE_PROCESSOR_SEQUENCE_TERMINATE 

indicate if the entity has finished its sequence

ENTITY_BLOCKED_GYRO 

If the entity is too tilted it should stop (to prevent a fall or heating engines)

ENTITY_BLOCKED_GPS 

If the entity keeps being on the same place despite the wheels moving it should stop (prevent overheating)

ENTITY_DISTANT_REALITY_MOVE 

If Entity move with Distant Reality

ENTITY_BLOCKED_OBSTACLES 

If the entity too close

ENTITY_EXPLORATION_RESTORE_MOVE 
ENTITY_EXPLORATION_NO_FRONTIERS 

◆ FocusType

Enumerator
INVERSE_KINEMATIC 
PAN_TILT 

◆ PickFrontierMode

Enumerator
PickFrontierMode_Closest 
PickFrontierMode_Furthest 

Function Documentation

◆ clusterFrontiers()

void conscience_core::ai::clusterFrontiers ( std::vector< TPoint2D > &  frontiers,
double  maxDist 
)

◆ compByUsage()

bool conscience_core::ai::compByUsage ( CscObjectiveAi a,
CscObjectiveAi b 
)

◆ doRemoveDecision()

void conscience_core::ai::doRemoveDecision ( map< string, ptr< HumanDecision >> &  ongoingDecisions,
const string &  decisionUid 
)

◆ eraseFrontier() [1/2]

static void conscience_core::ai::eraseFrontier ( std::vector< TPoint2D > &  fs,
const TPoint2D &  f 
)
static

◆ eraseFrontier() [2/2]

static void conscience_core::ai::eraseFrontier ( std::vector< TPoint2D > &  fs,
size_t  idx 
)
static

◆ exportMapToText()

void conscience_core::ai::exportMapToText ( const mrpt::maps::COccupancyGridMap2D *  map,
const std::string &  filename = "slam_map.txt" 
)

◆ filterCloseFrontiers()

void conscience_core::ai::filterCloseFrontiers ( std::vector< TPoint2D > &  frontiers,
const TPose2D &  pose,
double  minDist 
)

◆ fromMap()

MrptGrid conscience_core::ai::fromMap ( const COccupancyGridMap2D &  m)
inline

◆ generateOutPath()

fs::path conscience_core::ai::generateOutPath ( const std::string &  filenameSuffix,
const string &  ext 
)
inline

◆ getShortDistance()

float conscience_core::ai::getShortDistance ( map< CscInputType, float >  inputsIn,
map< CscInputType, float >  inputsTargetValuesMember 
)

◆ gridToJson()

string conscience_core::ai::gridToJson ( const Grid grid)

◆ ij2xy()

void conscience_core::ai::ij2xy ( const MrptGrid g,
int  i,
int  j,
double &  x,
double &  y 
)
inline

◆ normAng()

double conscience_core::ai::normAng ( double  a)
inline

◆ pickFrontier()

static pair<size_t, TPoint2D> conscience_core::ai::pickFrontier ( const std::vector< TPoint2D > &  fs,
const TPose2D &  robotPose 
)
static

◆ planHybridAStar()

vector<TPose2D> conscience_core::ai::planHybridAStar ( const TPose2D &  robotPose,
const TPoint2D &  targetPose,
const COccupancyGridMap2D &  map,
CscSlamEngine slamEngine,
const CscPoint2d robotDimensions 
)

◆ shortDistance()

float conscience_core::ai::shortDistance ( CscVector  line_point1,
CscVector  line_point2,
CscVector  point 
)

◆ xy2ij()

bool conscience_core::ai::xy2ij ( const MrptGrid g,
double  x,
double  y,
int &  i,
int &  j 
)
inline

Variable Documentation

◆ ENTITY_STATUSES_BLOCKED

const vector<CscEntityStatusFlagsList> conscience_core::ai::ENTITY_STATUSES_BLOCKED = {CscEntityStatusFlagsList::ENTITY_BLOCKED_GYRO, CscEntityStatusFlagsList::ENTITY_BLOCKED_GPS, CscEntityStatusFlagsList::ENTITY_BLOCKED_OBSTACLES}
static

◆ entityIdentityInstanceNumber

int conscience_core::ai::entityIdentityInstanceNumber = 0
static

◆ last

unsigned long long conscience_core::ai::last = 0

◆ logger

unique_ptr<CscLogger> conscience_core::ai::logger = CscLogger::getForCategory("CscMrptAutonomousExploration")

◆ maxAngularSpeed

const double conscience_core::ai::maxAngularSpeed = 0.8

◆ maxLinearSpeed

const double conscience_core::ai::maxLinearSpeed = 0.4

◆ minFrontierSize

const size_t conscience_core::ai::minFrontierSize = 3

◆ noFrontiersStopThreshold

const size_t conscience_core::ai::noFrontiersStopThreshold = 40

◆ obstacleClearance

const double conscience_core::ai::obstacleClearance = 0.05

◆ occThreshold

const double conscience_core::ai::occThreshold = 0.22

◆ pathFindingMarginCells

constexpr int conscience_core::ai::pathFindingMarginCells = 0
constexpr

◆ pickFrontierMode

constexpr PickFrontierMode conscience_core::ai::pickFrontierMode = PickFrontierMode_Closest
constexpr

◆ replanCooldownSeconds

const double conscience_core::ai::replanCooldownSeconds = 8

◆ restoreExplorationMoveFactor

const double conscience_core::ai::restoreExplorationMoveFactor = .35

◆ saveExplorationDebugFilesEnabled

constexpr bool conscience_core::ai::saveExplorationDebugFilesEnabled = false
constexpr

◆ savePathFindingDebugFilesEnabled

constexpr bool conscience_core::ai::savePathFindingDebugFilesEnabled = false
constexpr

◆ TrackHit