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

Namespaces

 align_images
 
 area_path_generate_for_pictures
 
 cartography
 
 doc
 
 entity_reflexion
 
 environment_entities
 
 environment_objects
 
 environment_places
 
 
 result
 

Classes

class  BaseCommandParams
 
class  CommandActivateLifiSignal
 
class  CommandActivateRs
 
class  CommandAreaAnalysis
 This class is made to allow entities to explore a given area. An entity will follow a "boustrophedon path" for each trapezoidal cell in an area, it will start from a corner of a cell, following the boundary in a straight line, it will reach another corner, there it will rotate 180° and follow a straight line parallel to the first, and it will repeat these actions as soons as it reach a boundary. More...
 
class  CommandAreaAnalysisSimple
 
class  CommandConsumeVideoSource
 
struct  CommandDataJsonSerializersMutexUniqueType
 
class  CommandDetectStop
 
class  CommandDivideTarget
 
class  CommandDrilling
 
class  CommandEmergencyStopRs
 
class  CommandEntitiesRealListAvailable
 
class  CommandEntityFollowPath
 
class  CommandEntityModelMembersGet
 
class  CommandEntityObstacleStrategySet
 
class  CommandEntityToLocationTag
 
class  CommandEntityToObject
 
class  CommandEnvironmentObjectAnalysis
 
class  CommandEnvironmentObjectRemove
 
class  CommandEnvironmentObjectUpdate
 
class  CommandExecutionException
 
class  CommandExportSequenceCsv
 
class  CommandFocusObject
 
class  CommandFollowEntity
 
struct  CommandFollowEntityParams
 
struct  CommandFollowEntityResult
 
struct  CommandFollowEntityResultStatus
 
class  CommandFollowKinematicTrajectory
 
class  CommandFollowTrajectoryAndProject
 
class  CommandGenerateCircularGeolocatedPath
 
class  CommandGenerateCompletePath
 
class  CommandJacobianInverseKinematicMovement
 
class  CommandKinematicMovement
 
class  CommandLearnToControlMember
 
class  CommandLidarLocalizationControl
 
class  CommandLidarLocalizationForcePosition
 
class  CommandLoadVideo
 
class  CommandLocateTargetMinus
 
class  CommandLocateTargets
 
class  CommandMazeExploration
 
class  CommandMemberFocusState
 
class  CommandMemberToObjectFromMember
 
class  CommandMemberToState
 
class  CommandMemberToStateFromMember
 
class  CommandMemberToStateFromMemberTrigo
 
class  CommandMemberToStateTeleport
 
class  CommandMemberToStateTeleportEulersOnly
 
class  CommandMemberToStateTeleportStrict
 
class  CommandMultiPodWalk
 
class  CommandNNControlledMemberInstruction
 
class  CommandObjectsDetect
 
class  CommandOptionalOfObject
 
class  CommandPathCutEntityDeplacements
 
class  CommandPathOptimization
 
class  CommandPing
 
class  CommandPlayNamedSequence
 
class  CommandPlaySequence
 
class  CommandPlayStateOutputs
 
class  CommandPurgeObjectives
 
class  CommandRsStopAllMovment
 
class  CommandSaveConfigurationToModelMembers
 
class  CommandSaveConfigurationToModelParams
 
class  CommandSaveConfigurationToModelPivot
 
class  CommandSaveConfigurationToModelPropeller
 
class  CommandSaveConfigurationToModelTranslation
 
class  CommandSaveConfigurationToModelWheel
 
class  CommandSimple
 
class  CommandSimpleWithMap
 
class  CommandSimpleWithOptional
 
class  CommandSimpleWithVectorOfObjects
 
struct  CommandsMetadataByIdMutexUniqueType
 
struct  CommandSpecification
 
class  CommandStopFollowObject
 
struct  CommandStopFollowObjectParams
 
struct  CommandStopFollowObjectResult
 
class  CommandTargetToSand
 
class  CommandTellThis
 
class  CommandTerrassement
 
class  CommandTerrassementDropOff
 
class  CommandTerrassementPickUp
 
class  CommandTest
 
class  CommandTest2
 
struct  CommandTypesMetadataByTypeNameMutexUniqueType
 
class  CommandUpdateConfigurationMember
 
class  CommandUpdateConfigurationPivot
 
class  CommandUpdateConfigurationTranslation
 
class  CommandUpdateFloorRotation
 
class  CommandUpdatePropellers
 
class  CommandUpdateStateOutputsFromReal
 
class  CommandUpdateTranslations
 
class  CommandUpdateWheels
 
class  CommandUpdateWheelsPower
 
class  CommandVideoRecord
 
class  CommandVideoRecordStop
 
class  CommandVisionDetect
 
struct  CommandVisionDetectParams
 
class  CscCommand
 
class  CscCommandAutoParseMetadata
 
class  CscCommandDataTypeBase
 
class  CscCommandDataTypeMetadata
 
class  CscCommandDataTypeNodeMetadata
 
struct  CscCommandParseContext
 
struct  CscEnumInfos
 
class  CscEnvironmentInteractionCommandParser
 
struct  CscStringCommandParts
 
class  CustomCommandTemplate
 
struct  EntityObstacleStrategyParamsCommandDataType
 
class  EntityReflexionNotFoundException
 
class  FunctionCommandWrapper
 
class  InvalidEnvironmentInteractionCommandString
 
class  MissingCommandDataTypeException
 
class  MissingCommandMetadataException
 
struct  MyParamsCommandDataType
 
struct  PathOptimizationResult
 
struct  PathSegmentCommandDataType
 Represents a path segment defined by two 3D points ( start and end ). More...
 
struct  SegmentMargins
 Represents a pair of segments offset to the left and right of a central segment. More...
 
class  TestCommandWithStruct
 
struct  TestSub1CommandDataType
 
struct  TestSub2CommandDataType
 
struct  TestSub3CommandDataType
 
class  WrongCommandDataTypeDuringParseException
 
class  WrongCommandParamsSizeDuringParseException
 

Typedefs

typedef string CommandTypeId
 
typedef function< const CscCommandExecutionResult *(CscEnvironmentSimulator &environmentSimulator)> FunctionCommand
 
using CommandTypesMetadataByTypeNameMutex = shared_recursive_mutex_t< CommandTypesMetadataByTypeNameMutexUniqueType >
 
using CommandsMetadataByIdMutex = shared_recursive_mutex_t< CommandsMetadataByIdMutexUniqueType >
 
using CommandDataJsonSerializersMutex = shared_recursive_mutex_t< CommandDataJsonSerializersMutexUniqueType >
 
using CommandVisionDetectNotificationParams = CscEntityReflexionDetectionParameters::DetectionNotificationParameters
 
typedef function< void(const CscCommand *command, const CscCommandExecutionResult *result)> CommandExecutedListener
 
typedef void(* OnStatePlayed) (const char *entitySerialNumber, double *encodeState, unsigned long encodedStateSize, int duration, int delay, int areValuesRelative)
 
typedef function< void *(const map< string, any > &paramsValues, const vector< string > &paramNames)> CommandTypeBuilder
 

Enumerations

enum  CscCommandPtrType { CommandPtrType_STAR, CommandPtrType_SHARED, CommandPtrType_REF, CommandPtrType_PLAIN }
 

Functions

void exportObjectScanPointsFromPosition (const string &modelId, CscEnvironmentSimulator &environmentSimulator, double currentX, double currentY, double currentZ, double offsetX, double offsetY, double offsetZ, int strategy)
 
 COMMAND_REGISTER (CommandFollowKinematicTrajectory, ptr< CscEntityReflexion >, int, const CscState *, string, string, string, string, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)
 
CscWorldElementModelSourceSpec getObjectModelSource (const string &objectId)
 
string commandTypeToPascalCase (const string &input)
 
bool isCoreFile (const fs::path &filePath)
 
std::pair< float **, float ** > createDataForTraining (ptr< CscEntityReflexion > entityReflexion, CscState *initialState, const int nbData, CscEnvironmentSimulator *environment, int stationaryPivotId, int memberToControlId, vector< int > pivotsIdsToGet)
 
any parseCommandParamValue (const CscCommandDataTypeNodeMetadata *paramInfo, const string &paramStringValueInCommand, bool resolveObjects, bool permissive)
 
any parseCommandParamValueFromJson (yyjson_val *jsonElement, const CscCommandDataTypeNodeMetadata *elementsInfo, bool resolveObjects, bool permissive)
 
const CscCommandDataTypeNodeMetadataparseMetadataTypeNode (const string &name, const string &typeString)
 
void sanitizeTypeToken (string &typeToken)
 
string getWrongCommandDataTypeDuringParseExceptionMessage (const string &name, CommandParamMetaType expectedType, int actualType)
 
string resolveHeaderRelativePath (const string &headerFileFullPath)
 
optional< string > getStringFromJsonValue (yyjson_val *jsonElement, const string &paramName, CommandParamMetaType type, bool permissive)
 
template<class T >
any checkTypeAndGetNumericValueFromJson (yyjson_val *jsonElement, const CscCommandDataTypeNodeMetadata *elementInfo, bool permissive)
 
string getStringParamValue (const string &input)
 
map< string, any > parseCommandParametersAsMap (const string &commandId, const vector< string > &commandStringArguments, optional< int > knowledgeId, bool objectsAsMap, bool resolveObjects, bool permissive)
 
void listCommandsWithDocumentedParams ()
 
bool hasCommandTypeMetadataForName (const string &qualifiedTypeName)
 
const CscCommandDataTypeMetadatagetCommandTypeMetadataByName (const string &qualifiedTypeName)
 
const CscCommandDataTypeMetadataupdateCommandTypeMetadataByName (const string &headerFileRelativePath, const string &classQualifiedName, const string &classSimpleName, const string &doc, const vector< const CscCommandDataTypeNodeMetadata * > &paramsMetadata, optional< string > commandId)
 
void registerCommandTypeMetadata (CscCommandDataTypeMetadata *typeMetadata)
 
void registerCommandMetadataTypeById (const CscCommandDataTypeMetadata *typeMetadata)
 
fs::path resolveCommandFileAbsolutePathFromRelative (const fs::path &headerFileRelativePath, const string &forCommandId)
 
 ENUM (CommandParamMetaType, CommandParamMetaType_double, CommandParamMetaType_float, CommandParamMetaType_int, CommandParamMetaType_long, CommandParamMetaType_unsigned_long_long, CommandParamMetaType_bool, CommandParamMetaType_string, CommandParamMetaType_list, CommandParamMetaType_map, CommandParamMetaType_object, CommandParamMetaType_optional, CommandParamMetaType_enum, CommandParamMetaType_entityReflexion, CommandParamMetaType_entityModel, CommandParamMetaType_placeModel, CommandParamMetaType_objectModel)
 
bool isNullableObjectType (CscCommandPtrType refType)
 
CommandTypesMetadataByTypeNameMutexcommandTypesMetadataByTypeNameMutex ()
 
map< string, CscCommandDataTypeMetadata * > & commandTypesMetadataByTypeName ()
 
CommandsMetadataByIdMutexcommandsMetadataByIdMutex ()
 
map< string, const CscCommandDataTypeMetadata * > & commandsMetadataById ()
 
CommandDataJsonSerializersMutexcommandDataJsonSerializersMutex ()
 
map< const type_info *, function< optional< JsonSerializableData >const any &object)> > & getCommandDataJsonSerializers ()
 
bool registerCommandDataJsonSerializer (const type_info &typeInfo, function< optional< JsonSerializableData >(const any &object)> serializer)
 
template<typename TData >
function< optional< JsonSerializableData >const any &object)> getCommandDataJsonSerializer ()
 
template<typename T >
field_value_any_cast (any anyValue)
 
template<IsMap TMap>
TMap field_value_any_cast (any anyValue)
 
template<IsOptional TOptional>
TOptional field_value_any_cast (any anyValue)
 
template<IsVector TVector>
TVector field_value_any_cast (any anyValue)
 
template<typename T >
 requires (IsSharedPointer< std::remove_cvref_t< T >>) JsonSerializableData field_value_to_json_serializable(T value)
 
template<typename T >
 requires (IsStarPointer< std::remove_cvref_t< T >>) JsonSerializableData field_value_to_json_serializable(T value)
 
template<typename T >
JsonSerializableData field_value_to_json_serializable (optional< T > value)
 
template<IsVector TVector>
JsonSerializableData field_value_to_json_serializable (TVector value)
 
template<IsMap TMap>
JsonSerializableData field_value_to_json_serializable (TMap value)
 
template<typename T >
JsonSerializableData field_value_to_json_serializable (T value)
 
bool isUserCommand (const string &commandId)
 
void onCommandExecutionStartOnEntity (const CscCommand *command, const string &entitySerialNumber)
 
void withLastCommandExecutionResultOnEntity (const string &entitySerialNumber, const function< void(const CscCommandExecutionResult *result)> &action)
 
void onCommandExecutedOnEntity (const CscCommand *command, const string &entitySerialNumber, const CscCommandExecutionResult *result, CscEnvironmentSimulator &environmentSimulator)
 
optional< string > getCommandResultByCommandIndex (const string &commandIndex)
 
void addCommandExecutedOnEntityListener (const string &entitySerialNumber, CommandExecutedListener listener)
 
void onApplicationStarted ()
 
CscEnvironmentSimulatorgetEnvironmentSimulator ()
 
void setEnvironmentSimulator (CscEnvironmentSimulator *newGlobalEnvironmentSimulator)
 
float * getStatusAiObjectives (const char *entitySerialNumber)
 
void EnvironmentSimulator_dump (const char *outPathChars)
 
void EnvironmentSimulator_setOnStatePlayedListener (OnStatePlayed listener)
 
void interpolateCommandPlaceholders (string &command, const char *entitySerialNumberChars)
 
const CscCommandExecutionResultrelayCommandToEntity (const string &commandString, const optional< string > &entitySerialNumber)
 
const CscCommandExecutionResultprocessKnowledgeItemCommand (const string &commandStringRef, optional< string > entitySerialNumber, string *outCommandId)
 
bool checkIfCommandUsesEntityPlaceholders (const string &command)
 
vector< const CscCommandExecutionResult * > processKnowledgeItemCommands (const vector< string > &commands, optional< string > entitySerialNumber)
 
double * processKnowledgeItemCommandAndEncodeResult (const char *commandChars, const char *entitySerialNumberChars)
 
void processKnowledgeItemCommandAndEncodeResultToBytes (const char *commandChars, const unsigned char **outBytes, unsigned long long *outBytesCount, const char *entitySerialNumberChars, bool addPrefixCommandId)
 
const vector< string > getListLastExecutedCommands ()
 
ptr< CscEntityReflexiongetEntityReflexionFromAny (std::any anyValue, const string &argName)
 
map< const std::type_info *, CommandTypeBuilder > & commandTypeBuilders ()
 
void registerCommandTypeBuilder (const std::type_info &type, const CommandTypeBuilder &builder)
 
optional< CommandTypeBuildergetCommandTypeBuilder (const std::type_info &type)
 
template<IsMap TMap>
TMap convertMapValueToArg (const std::any &anyValue, const string &argName, size_t argIndex)
 
template<IsOptional TOptional>
requires(IsStarPointer< std::remove_cvref_t< T >>) T convertMapValueToArg(const std requires(IsSharedPointer< std::remove_cvref_t< T >>) T convertMapValueToArg(const std TOptional convertMapValueToArg (const std::any &anyValue, const string &argName, size_t argIndex)
 
template<IsVector TVector>
TVector convertMapValueToArg (const std::any &anyValue, const string &argName, size_t argIndex)
 
template<IsEnum TEnum>
requires(IsStdFixedArray< TArray >) TArray convertMapValueToArg(const std TEnum convertMapValueToArg (const std::any &anyValue, const string &argName, size_t argIndex)
 
template<IsOptional TOptional>
TOptional convertMapValueToArg (const std::any &anyValue, const string &argName, size_t argIndex)
 
template<typename TNumber >
TNumber getNumberFromString (const string &strValue)
 
template<typename TArray >
 requires (IsStdFixedArray< TArray >) TArray convertMapValueToArg(const std
 
template<typename Tuple , typename Map , std::size_t... Is>
Tuple extractArgsHelper (const Map &paramMap, const std::vector< std::string > &paramNames, std::index_sequence< Is... >)
 
template<typename Tuple >
Tuple extractArgs (const std::map< std::string, std::any > &paramMap, const std::vector< std::string > &paramNames)
 
template<typename T , typename... Params>
T * createInstance (const std::map< std::string, std::any > &paramMap, const std::vector< std::string > &paramNames)
 
template<typename T >
bool doesAnyContainStarPointer (const std::any &anyValue)
 
template<typename T >
bool doesAnyContainSharedPtr (const std::any &anyValue)
 
template<typename TObject >
constexpr bool isCommandBuiltinObjectType ()
 
template<typename TTargetType >
 requires (!IsStdFixedArray< TTargetType > &&!IsOptional< TTargetType > &&!IsEnum< TTargetType > &&!IsVector< TTargetType > &&!IsMap< TTargetType > &&!IsSharedPointer< TTargetType > &&!IsStarPointer< TTargetType >) TTargetType convertMapValueToArg(const std
 

Variables

std::unique_ptr< CscLoggerlogger = CscLogger::getForCategory("Commands")
 
static CscEntityModelsRepositoryentityModelsRepository = CscEntityModelsRepository::getInstance()
 
static CscResourcesresources = CscResources::Instance()
 
static ptr< CscEntityReflexionsentityReflexions = CscEntityReflexions::getInstance()
 
const float factorInchToMicron = 1000.0 * 25.4
 
const float factorInchToMillimeter = 25.4
 
const float factorCmToMillimeter = 10.0
 
const float PI = 3.14159265359
 
const float staticTmpHeight = 630000
 
const string MAZE_PLACE_MODEL_ID = "91"
 
static ptr< CscEntityReflexionsentityReflexions = CscEntityReflexions::getInstance()
 
static auto paramsSpecLogger = CscLogger::getForCategory("CommandParamsSpec")
 
template<typename T >
concept IsCommandParams = std::is_base_of<BaseCommandParams, T>::value
 
CscEnvironmentInteractionCommandParsercommandParser = CscEnvironmentInteractionCommandParser::getInstance()
 
auto encoder = ConscienceEncoder::getInstance()
 
CscEnvironmentSimulatorglobalEnvironmentSimulator = nullptr
 
static mutex entityCommandsHistoryMutex
 
static map< string, const CscCommandExecutionResult * > lastEntitiesCommandExecutionResultBySerialNumber
 
static mutex commandsResultsMutex
 
static map< string, const string * > commandResults
 
static constexpr size_t COMMANDS_RESULTS_HISTORY_SIZE = 50
 
static mutex commandExecutedOnEntityListenersMutex
 
static map< string, vector< CommandExecutedListener > > commandExecutedOnEntityListeners
 
const bool addToListLastCommandExecuted = true
 
vector< string > listLastExecutedCommands
 
mutex listLastExecutedCommandsMutex
 
const string relayCommandToEntityNoEntity = "__CSC_MSG_NO_SELECTED_ENTITY"
 
unsigned long long executedCommandCounter = 0
 
template<IsEnum TEnum>
requires(!IsStdFixedArray< TTargetType > &&!IsOptional< TTargetType > &&!IsEnum< TTargetType > &&!IsVector< TTargetType > &&!IsMap< TTargetType > &&!IsSharedPointer< TTargetType > &&!IsStarPointer< TTargetType >) TTargetType convertMapValueToArg(const std TEnum convertMapValueToArg (const std::any &anyValue, const string &argName, size_t argIndex)
 

Typedef Documentation

◆ CommandDataJsonSerializersMutex

◆ CommandExecutedListener

◆ CommandsMetadataByIdMutex

◆ CommandTypeBuilder

typedef function<void *(const map<string, any> &paramsValues, const vector<string> &paramNames)> conscience_core::bridging::commands::CommandTypeBuilder

◆ CommandTypeId

◆ CommandTypesMetadataByTypeNameMutex

◆ CommandVisionDetectNotificationParams

◆ FunctionCommand

◆ OnStatePlayed

typedef void(* conscience_core::bridging::commands::OnStatePlayed) (const char *entitySerialNumber, double *encodeState, unsigned long encodedStateSize, int duration, int delay, int areValuesRelative)

const char* entitySerialNumber float* encodeState (use Conscience standard , see ConscienceEncoder) unsigned long encodedStateSize int duration int delay bool relativeValues

Enumeration Type Documentation

◆ CscCommandPtrType

Enumerator
CommandPtrType_STAR 
CommandPtrType_SHARED 
CommandPtrType_REF 
CommandPtrType_PLAIN 

This corresponds to a plain object (passed by copy), not a pointer or a ref

Function Documentation

◆ addCommandExecutedOnEntityListener()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::addCommandExecutedOnEntityListener ( const string &  entitySerialNumber,
CommandExecutedListener  listener 
)

◆ checkIfCommandUsesEntityPlaceholders()

CSC_DLL_IMPORTEXPORT bool conscience_core::bridging::commands::checkIfCommandUsesEntityPlaceholders ( const string &  command)
Parameters
command-> if contains placeholder serial number returns true

◆ checkTypeAndGetNumericValueFromJson()

template<class T >
any conscience_core::bridging::commands::checkTypeAndGetNumericValueFromJson ( yyjson_val *  jsonElement,
const CscCommandDataTypeNodeMetadata elementInfo,
bool  permissive 
)

◆ COMMAND_REGISTER()

conscience_core::bridging::commands::COMMAND_REGISTER ( CommandFollowKinematicTrajectory  ,
ptr< CscEntityReflexion ,
int  ,
const CscState ,
string  ,
string  ,
string  ,
string  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float  ,
float   
)

◆ commandDataJsonSerializersMutex()

CommandDataJsonSerializersMutex& conscience_core::bridging::commands::commandDataJsonSerializersMutex ( )
inline

◆ commandsMetadataById()

map<string, const CscCommandDataTypeMetadata *>& conscience_core::bridging::commands::commandsMetadataById ( )
inline

◆ commandsMetadataByIdMutex()

CommandsMetadataByIdMutex& conscience_core::bridging::commands::commandsMetadataByIdMutex ( )
inline

◆ commandTypeBuilders()

map<const std::type_info *, CommandTypeBuilder>& conscience_core::bridging::commands::commandTypeBuilders ( )
inline

◆ commandTypesMetadataByTypeName()

map<string, CscCommandDataTypeMetadata *>& conscience_core::bridging::commands::commandTypesMetadataByTypeName ( )
inline
Note
do not use directly, prefer getCommandTypeMetadataByName which provides a const / safe version

◆ commandTypesMetadataByTypeNameMutex()

CommandTypesMetadataByTypeNameMutex& conscience_core::bridging::commands::commandTypesMetadataByTypeNameMutex ( )
inline

◆ commandTypeToPascalCase()

CSC_DLL_IMPORTEXPORT string conscience_core::bridging::commands::commandTypeToPascalCase ( const string &  input)

◆ convertMapValueToArg() [1/5]

template<IsOptional TOptional>
requires (IsStarPointer<std::remove_cvref_t<T>>) T convertMapValueToArg( const std requires (IsSharedPointer<std::remove_cvref_t<T>>) T convertMapValueToArg( const std TOptional conscience_core::bridging::commands::convertMapValueToArg ( const std::any &  anyValue,
const string &  argName,
size_t  argIndex 
)

◆ convertMapValueToArg() [2/5]

template<IsEnum TEnum>
requires (IsStdFixedArray<TArray>) TArray convertMapValueToArg( const std TEnum conscience_core::bridging::commands::convertMapValueToArg ( const std::any &  anyValue,
const string &  argName,
size_t  argIndex 
)

◆ convertMapValueToArg() [3/5]

template<IsOptional TOptional>
TOptional conscience_core::bridging::commands::convertMapValueToArg ( const std::any &  anyValue,
const string &  argName,
size_t  argIndex 
)

◆ convertMapValueToArg() [4/5]

template<IsMap TMap>
TMap conscience_core::bridging::commands::convertMapValueToArg ( const std::any &  anyValue,
const string &  argName,
size_t  argIndex 
)

◆ convertMapValueToArg() [5/5]

template<IsVector TVector>
TVector conscience_core::bridging::commands::convertMapValueToArg ( const std::any &  anyValue,
const string &  argName,
size_t  argIndex 
)

◆ createDataForTraining()

std::pair<float **, float **> conscience_core::bridging::commands::createDataForTraining ( ptr< CscEntityReflexion entityReflexion,
CscState initialState,
const int  nbData,
CscEnvironmentSimulator environment,
int  stationaryPivotId,
int  memberToControlId,
vector< int >  pivotsIdsToGet 
)

◆ createInstance()

template<typename T , typename... Params>
T* conscience_core::bridging::commands::createInstance ( const std::map< std::string, std::any > &  paramMap,
const std::vector< std::string > &  paramNames 
)

◆ doesAnyContainSharedPtr()

template<typename T >
bool conscience_core::bridging::commands::doesAnyContainSharedPtr ( const std::any &  anyValue)

◆ doesAnyContainStarPointer()

template<typename T >
bool conscience_core::bridging::commands::doesAnyContainStarPointer ( const std::any &  anyValue)

◆ ENUM()

conscience_core::bridging::commands::ENUM ( CommandParamMetaType  ,
CommandParamMetaType_double  ,
CommandParamMetaType_float  ,
CommandParamMetaType_int  ,
CommandParamMetaType_long  ,
CommandParamMetaType_unsigned_long_long  ,
CommandParamMetaType_bool  ,
CommandParamMetaType_string  ,
CommandParamMetaType_list  ,
CommandParamMetaType_map  ,
CommandParamMetaType_object  ,
CommandParamMetaType_optional  ,
CommandParamMetaType_enum  ,
CommandParamMetaType_entityReflexion  ,
CommandParamMetaType_entityModel  ,
CommandParamMetaType_placeModel  ,
CommandParamMetaType_objectModel   
)

◆ EnvironmentSimulator_dump()

void conscience_core::bridging::commands::EnvironmentSimulator_dump ( const char *  outPathChars)

◆ EnvironmentSimulator_setOnStatePlayedListener()

void conscience_core::bridging::commands::EnvironmentSimulator_setOnStatePlayedListener ( OnStatePlayed  listener)

◆ exportObjectScanPointsFromPosition()

void conscience_core::bridging::commands::exportObjectScanPointsFromPosition ( const string &  modelId,
CscEnvironmentSimulator environmentSimulator,
double  currentX,
double  currentY,
double  currentZ,
double  offsetX,
double  offsetY,
double  offsetZ,
int  strategy 
)

◆ extractArgs()

template<typename Tuple >
Tuple conscience_core::bridging::commands::extractArgs ( const std::map< std::string, std::any > &  paramMap,
const std::vector< std::string > &  paramNames 
)

◆ extractArgsHelper()

template<typename Tuple , typename Map , std::size_t... Is>
Tuple conscience_core::bridging::commands::extractArgsHelper ( const Map &  paramMap,
const std::vector< std::string > &  paramNames,
std::index_sequence< Is... >   
)

◆ field_value_any_cast() [1/4]

template<typename T >
T conscience_core::bridging::commands::field_value_any_cast ( any  anyValue)

◆ field_value_any_cast() [2/4]

template<IsMap TMap>
TMap conscience_core::bridging::commands::field_value_any_cast ( any  anyValue)

◆ field_value_any_cast() [3/4]

template<IsOptional TOptional>
TOptional conscience_core::bridging::commands::field_value_any_cast ( any  anyValue)

◆ field_value_any_cast() [4/4]

template<IsVector TVector>
TVector conscience_core::bridging::commands::field_value_any_cast ( any  anyValue)

◆ field_value_to_json_serializable() [1/4]

template<typename T >
JsonSerializableData conscience_core::bridging::commands::field_value_to_json_serializable ( optional< T >  value)

◆ field_value_to_json_serializable() [2/4]

template<typename T >
JsonSerializableData conscience_core::bridging::commands::field_value_to_json_serializable ( value)

◆ field_value_to_json_serializable() [3/4]

template<IsMap TMap>
JsonSerializableData conscience_core::bridging::commands::field_value_to_json_serializable ( TMap  value)

◆ field_value_to_json_serializable() [4/4]

template<IsVector TVector>
JsonSerializableData conscience_core::bridging::commands::field_value_to_json_serializable ( TVector  value)

◆ getCommandDataJsonSerializer()

template<typename TData >
function<optional<JsonSerializableData>const any &object)> conscience_core::bridging::commands::getCommandDataJsonSerializer ( )
inline

◆ getCommandDataJsonSerializers()

map<const type_info *, function<optional<JsonSerializableData>const any &object)> >& conscience_core::bridging::commands::getCommandDataJsonSerializers ( )
inline

◆ getCommandResultByCommandIndex()

CSC_DLL_IMPORTEXPORT optional< string > conscience_core::bridging::commands::getCommandResultByCommandIndex ( const string &  commandIndex)

◆ getCommandTypeBuilder()

optional<CommandTypeBuilder> conscience_core::bridging::commands::getCommandTypeBuilder ( const std::type_info &  type)
inline

◆ getCommandTypeMetadataByName()

const CSC_DLL_IMPORTEXPORT CscCommandDataTypeMetadata * conscience_core::bridging::commands::getCommandTypeMetadataByName ( const string &  qualifiedTypeName)

◆ getEntityReflexionFromAny()

ptr< CscEntityReflexion > conscience_core::bridging::commands::getEntityReflexionFromAny ( std::any  anyValue,
const string &  argName 
)

◆ getEnvironmentSimulator()

CSC_DLL_IMPORTEXPORT CscEnvironmentSimulator & conscience_core::bridging::commands::getEnvironmentSimulator ( )
Returns
global environment simulator (shared)

◆ getListLastExecutedCommands()

const CSC_DLL_IMPORTEXPORT vector< string > conscience_core::bridging::commands::getListLastExecutedCommands ( )

◆ getNumberFromString()

template<typename TNumber >
TNumber conscience_core::bridging::commands::getNumberFromString ( const string &  strValue)

◆ getObjectModelSource()

CscWorldElementModelSourceSpec conscience_core::bridging::commands::getObjectModelSource ( const string &  objectId)
inline

◆ getStatusAiObjectives()

float * conscience_core::bridging::commands::getStatusAiObjectives ( const char *  entitySerialNumber)

◆ getStringFromJsonValue()

optional<string> conscience_core::bridging::commands::getStringFromJsonValue ( yyjson_val *  jsonElement,
const string &  paramName,
CommandParamMetaType  type,
bool  permissive 
)
inline

◆ getStringParamValue()

string conscience_core::bridging::commands::getStringParamValue ( const string &  input)
inline

◆ getWrongCommandDataTypeDuringParseExceptionMessage()

string conscience_core::bridging::commands::getWrongCommandDataTypeDuringParseExceptionMessage ( const string &  name,
CommandParamMetaType  expectedType,
int  actualType 
)

◆ hasCommandTypeMetadataForName()

CSC_DLL_IMPORTEXPORT bool conscience_core::bridging::commands::hasCommandTypeMetadataForName ( const string &  qualifiedTypeName)
Parameters
qualifiedTypeNamequalified class name, as specified by CscCommandDataTypeMetadata::getClassName(true)
See also
commandTypesMetadataByTypeName()

◆ interpolateCommandPlaceholders()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::interpolateCommandPlaceholders ( string &  command,
const char *  entitySerialNumberChars 
)

◆ isCommandBuiltinObjectType()

template<typename TObject >
constexpr bool conscience_core::bridging::commands::isCommandBuiltinObjectType ( )
constexpr

◆ isCoreFile()

CSC_DLL_IMPORTEXPORT bool conscience_core::bridging::commands::isCoreFile ( const fs::path &  filePath)

◆ isNullableObjectType()

bool conscience_core::bridging::commands::isNullableObjectType ( CscCommandPtrType  refType)
inline

◆ isUserCommand()

bool conscience_core::bridging::commands::isUserCommand ( const string &  commandId)
inline
Returns
true if the given command ID is a user custom command based on the existence of its file on the local FS

◆ listCommandsWithDocumentedParams()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::listCommandsWithDocumentedParams ( )

◆ onApplicationStarted()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::onApplicationStarted ( )

◆ onCommandExecutedOnEntity()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::onCommandExecutedOnEntity ( const CscCommand command,
const string &  entitySerialNumber,
const CscCommandExecutionResult result,
CscEnvironmentSimulator environmentSimulator 
)

◆ onCommandExecutionStartOnEntity()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::onCommandExecutionStartOnEntity ( const CscCommand command,
const string &  entitySerialNumber 
)

◆ parseCommandParametersAsMap()

CSC_DLL_IMPORTEXPORT map< string, any > conscience_core::bridging::commands::parseCommandParametersAsMap ( const string &  commandId,
const vector< string > &  commandStringArguments,
optional< int >  knowledgeId,
bool  objectsAsMap,
bool  resolveObjects = true,
bool  permissive = false 
)

Parse command parameters objects from given commandId and arguments note: Usually, a command is COMMAND_ID;ARG1;ARG2

Parameters
objectsAsMapif true, objects will be encoded as maps, and not instance of object
resolveObjectsif false, special objects won't be resolved (entityModel, entityReflexion..), original value will be kept
permissiveif true, won't cause error if non-optional value is missing (it will make process continue in a best-effort mode)

◆ parseCommandParamValue()

any conscience_core::bridging::commands::parseCommandParamValue ( const CscCommandDataTypeNodeMetadata paramInfo,
const string &  paramStringValueInCommand,
bool  resolveObjects,
bool  permissive 
)
Parameters
resolveObjectssee parseCommandParametersAsMap header doc
permissivesee parseCommandParametersAsMap header doc
resolveObjectssee parseCommandParametersAsMap header doc

◆ parseCommandParamValueFromJson()

any conscience_core::bridging::commands::parseCommandParamValueFromJson ( yyjson_val *  jsonElement,
const CscCommandDataTypeNodeMetadata elementInfo,
bool  resolveObjects,
bool  permissive 
)
Parameters
resolveObjectssee parseCommandParametersAsMap header doc
permissivesee parseCommandParametersAsMap header doc
resolveObjectssee parseCommandParametersAsMap header doc

◆ parseMetadataTypeNode()

const CSC_DLL_IMPORTEXPORT CscCommandDataTypeNodeMetadata * conscience_core::bridging::commands::parseMetadataTypeNode ( const string &  name,
const string &  typeString 
)

◆ processKnowledgeItemCommand()

const CSC_DLL_IMPORTEXPORT CscCommandExecutionResult * conscience_core::bridging::commands::processKnowledgeItemCommand ( const string &  command,
optional< string >  entitySerialNumber,
string *  outCommandId = nullptr 
)
Parameters
entitySerialNumber-> if not empty, will be used to interpolate command placeholders
outCommandIdif not null, will be set to detected commandId (if possible, empty otherwise)

◆ processKnowledgeItemCommandAndEncodeResult()

CSC_DLL_IMPORTEXPORT double * conscience_core::bridging::commands::processKnowledgeItemCommandAndEncodeResult ( const char *  command,
const char *  entitySerialNumber 
)

Executes command and encodes result to a double array.

Parameters
entitySerialNumber-> if not empty, will be used to interpolate command placeholders

◆ processKnowledgeItemCommandAndEncodeResultToBytes()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::processKnowledgeItemCommandAndEncodeResultToBytes ( const char *  commandChars,
const unsigned char **  outBytes,
unsigned long long *  outBytesCount,
const char *  entitySerialNumber,
bool  addPrefixCommandId = true 
)

Executes command and encodes result to a byte array.

Parameters
entitySerialNumber-> if not empty, will be used to interpolate command placeholders

◆ processKnowledgeItemCommands()

CSC_DLL_IMPORTEXPORT vector< const CscCommandExecutionResult * > conscience_core::bridging::commands::processKnowledgeItemCommands ( const vector< string > &  commands,
optional< string >  entitySerialNumber 
)
Parameters
entitySerialNumber-> if not empty, will be used to interpolate command placeholders

◆ registerCommandDataJsonSerializer()

bool conscience_core::bridging::commands::registerCommandDataJsonSerializer ( const type_info &  typeInfo,
function< optional< JsonSerializableData >(const any &object)>  serializer 
)
inline

◆ registerCommandMetadataTypeById()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::registerCommandMetadataTypeById ( const CscCommandDataTypeMetadata typeMetadata)

Registers given type metadata by command id

See also
commandsMetadataById()

◆ registerCommandTypeBuilder()

void conscience_core::bridging::commands::registerCommandTypeBuilder ( const std::type_info &  type,
const CommandTypeBuilder builder 
)
inline

◆ registerCommandTypeMetadata()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::registerCommandTypeMetadata ( CscCommandDataTypeMetadata typeMetadata)

Registers given type metadata by name

See also
commandTypesMetadataByTypeName()

◆ relayCommandToEntity()

const CscCommandExecutionResult* conscience_core::bridging::commands::relayCommandToEntity ( const string &  commandString,
const optional< string > &  entitySerialNumber 
)
inline

◆ requires() [1/4]

template<typename TTargetType >
conscience_core::bridging::commands::requires ( !IsStdFixedArray< TTargetType > &&!IsOptional< TTargetType > &&!IsEnum< TTargetType > &&!IsVector< TTargetType > &&!IsMap< TTargetType > &&!IsSharedPointer< TTargetType > &&!IsStarPointer< TTargetType >  ) const

◆ requires() [2/4]

template<typename T >
conscience_core::bridging::commands::requires ( IsSharedPointer< std::remove_cvref_t< T >>  )

◆ requires() [3/4]

template<typename T >
conscience_core::bridging::commands::requires ( IsStarPointer< std::remove_cvref_t< T >>  )

◆ requires() [4/4]

template<typename TArray >
conscience_core::bridging::commands::requires ( IsStdFixedArray< TArray >  ) const

◆ resolveCommandFileAbsolutePathFromRelative()

CSC_DLL_IMPORTEXPORT fs::path conscience_core::bridging::commands::resolveCommandFileAbsolutePathFromRelative ( const fs::path &  headerFileRelativePath,
const string &  forCommandId 
)

If file is available on local FS, returns absolute path to this file, in the context of the given command ID. Otherwise, it will just return the given path.

Note
could be any file used by the command: type, enum, the command itself
Parameters
forCommandIdsome files can be specific to user commands, so we need to know commandId to resolve file path

◆ resolveHeaderRelativePath()

string conscience_core::bridging::commands::resolveHeaderRelativePath ( const string &  headerFileFullPath)
inline

◆ sanitizeTypeToken()

void conscience_core::bridging::commands::sanitizeTypeToken ( string &  typeToken)
inline

◆ setEnvironmentSimulator()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::setEnvironmentSimulator ( CscEnvironmentSimulator newGlobalEnvironmentSimulator)

◆ updateCommandTypeMetadataByName()

const CSC_DLL_IMPORTEXPORT CscCommandDataTypeMetadata * conscience_core::bridging::commands::updateCommandTypeMetadataByName ( const string &  headerFileRelativePath,
const string &  classQualifiedName,
const string &  classSimpleName,
const string &  doc,
const vector< const CscCommandDataTypeNodeMetadata * > &  paramsMetadata,
optional< string >  commandId 
)

◆ withLastCommandExecutionResultOnEntity()

CSC_DLL_IMPORTEXPORT void conscience_core::bridging::commands::withLastCommandExecutionResultOnEntity ( const string &  entitySerialNumber,
const function< void(const CscCommandExecutionResult *result)> &  action 
)

Variable Documentation

◆ addToListLastCommandExecuted

const bool conscience_core::bridging::commands::addToListLastCommandExecuted = true

◆ commandExecutedOnEntityListeners

map<string, vector<CommandExecutedListener> > conscience_core::bridging::commands::commandExecutedOnEntityListeners
static

◆ commandExecutedOnEntityListenersMutex

mutex conscience_core::bridging::commands::commandExecutedOnEntityListenersMutex
static

◆ commandParser

◆ commandResults

map<string, const string *> conscience_core::bridging::commands::commandResults
static

◆ COMMANDS_RESULTS_HISTORY_SIZE

constexpr size_t conscience_core::bridging::commands::COMMANDS_RESULTS_HISTORY_SIZE = 50
staticconstexpr

◆ commandsResultsMutex

mutex conscience_core::bridging::commands::commandsResultsMutex
static

◆ convertMapValueToArg

template<IsEnum TEnum>
requires (!IsStdFixedArray<TTargetType> && !IsOptional<TTargetType> && !IsEnum<TTargetType> && !IsVector<TTargetType> && !IsMap<TTargetType> && !IsSharedPointer<TTargetType> && !IsStarPointer<TTargetType>) TTargetType convertMapValueToArg( const std TEnum conscience_core::bridging::commands::convertMapValueToArg(const std::any &anyValue, const string &argName, size_t argIndex)

◆ encoder

auto conscience_core::bridging::commands::encoder = ConscienceEncoder::getInstance()

◆ entityCommandsHistoryMutex

mutex conscience_core::bridging::commands::entityCommandsHistoryMutex
static

◆ entityModelsRepository

CscEntityModelsRepository* conscience_core::bridging::commands::entityModelsRepository = CscEntityModelsRepository::getInstance()
static

◆ entityReflexions [1/2]

ptr<CscEntityReflexions> conscience_core::bridging::commands::entityReflexions = CscEntityReflexions::getInstance()
static

◆ entityReflexions [2/2]

ptr<CscEntityReflexions> conscience_core::bridging::commands::entityReflexions = CscEntityReflexions::getInstance()
static

◆ executedCommandCounter

unsigned long long conscience_core::bridging::commands::executedCommandCounter = 0

◆ factorCmToMillimeter

const float conscience_core::bridging::commands::factorCmToMillimeter = 10.0

◆ factorInchToMicron

const float conscience_core::bridging::commands::factorInchToMicron = 1000.0 * 25.4

◆ factorInchToMillimeter

const float conscience_core::bridging::commands::factorInchToMillimeter = 25.4

◆ globalEnvironmentSimulator

CscEnvironmentSimulator* conscience_core::bridging::commands::globalEnvironmentSimulator = nullptr

◆ IsCommandParams

template<typename T >
concept conscience_core::bridging::commands::IsCommandParams = std::is_base_of<BaseCommandParams, T>::value

◆ lastEntitiesCommandExecutionResultBySerialNumber

map<string, const CscCommandExecutionResult *> conscience_core::bridging::commands::lastEntitiesCommandExecutionResultBySerialNumber
static

◆ listLastExecutedCommands

vector<string> conscience_core::bridging::commands::listLastExecutedCommands

◆ listLastExecutedCommandsMutex

mutex conscience_core::bridging::commands::listLastExecutedCommandsMutex

◆ logger

auto conscience_core::bridging::commands::logger = CscLogger::getForCategory("Commands")

◆ MAZE_PLACE_MODEL_ID

const string conscience_core::bridging::commands::MAZE_PLACE_MODEL_ID = "91"

◆ paramsSpecLogger

auto conscience_core::bridging::commands::paramsSpecLogger = CscLogger::getForCategory("CommandParamsSpec")
static

◆ PI

const float conscience_core::bridging::commands::PI = 3.14159265359

◆ relayCommandToEntityNoEntity

const string conscience_core::bridging::commands::relayCommandToEntityNoEntity = "__CSC_MSG_NO_SELECTED_ENTITY"

◆ resources

CscResources& conscience_core::bridging::commands::resources = CscResources::Instance()
static

◆ staticTmpHeight

const float conscience_core::bridging::commands::staticTmpHeight = 630000