Conscience Core
CommandNNControlledMemberInstruction.h
Go to the documentation of this file.
1 /*
2  * NNControlledMemberInstruction.h
3  *
4  * Created on: 04 juillet 2024
5  * Author: Max Lhermitte
6  */
7 
8 #ifndef NNControlledMemberInstruction_h
9 #define NNControlledMemberInstruction_h
10 
11 #include "CommandCommons.h"
13 
14 const string SAVING_FILE_CSCNN_PATH_IN_RESOURCES = "TF_Persistence";
15 
16 /*
17  The command receives the id of the member it wants to be able to move as it wishes. And a file .cscnn, describing the neural network producted, is saved to be use later
18  */
20 
25 
26 public:
27  inline static const CommandTypeId COMMAND_ID = "NN_CONTROLLED_MEMBER_INSTRUCTION";
28 
30  const ptr<CscEntityReflexion> &entityReflexion,
31  int memberToControlId,
32  const vector<int> &pivotsIdToIgnoreForMovement,
33  const vector<float> &targetPosition);
34 
36 
37 protected:
38  const CscCommandExecutionResultNone *doExecute(CscEnvironmentSimulator &environmentSimulator) override;
39  ptr<CscEntityReflexion> getEntityReflexion() const override;
40 
41 private:
42  ptr<CscEntityReflexion> entityReflexion;
43  int memberToControlId;
44  vector<int> pivotsIdToIgnoreForMovement;
45  vector<float> targetPosition;
46 
47  string stringNeuralNetworkModelFileName();
48  float** getValuesToReach(CscState *currentState);
49  CscState *launchCurrentNeuralNetworkModelInSimulator(fs::path pathFileNeuralNetwork, CscState *currentState, float** valuesToReach);
50 };
51 
52 COMMAND_REGISTER(CommandNNControlledMemberInstruction, const ptr<CscEntityReflexion> &, int, const vector<int> &, const vector<float> &)
53 COMMAND_TYPE_BUILDER(NNControlledMemberInstruction, CommandNNControlledMemberInstruction, ptr<CscEntityReflexion>, int, vector<int>, vector<float>)
54 
55 }
56 
57 #endif // CommandLearnToControlMember_h
conscience_core::bridging::commands::result::CscCommandExecutionResultNone
Definition: CommandExecutionResultNone.h:11
CSC_DLL_IMPORTEXPORT
#define CSC_DLL_IMPORTEXPORT
Definition: os.h:34
conscience_core::bridging::commands::CommandTypeId
string CommandTypeId
Definition: Command.h:29
CscKeyDirectories.h
conscience_core::bridging::commands
Definition: cartographyCommands.cpp:4
conscience_core::bridging::commands::CommandNNControlledMemberInstruction
Definition: CommandNNControlledMemberInstruction.h:24
CscState
Definition: CscState.h:24
conscience_core::bridging::commands::CscCommand
Definition: Command.h:40
SAVING_FILE_CSCNN_PATH_IN_RESOURCES
const string SAVING_FILE_CSCNN_PATH_IN_RESOURCES
Definition: CommandNNControlledMemberInstruction.h:14
COMMAND_TYPE_BUILDER
#define COMMAND_TYPE_BUILDER(PREFIX, COMMAND_REGISTER_className,...)
Definition: CscCommandAutoParse.h:515
CscEnvironmentSimulator
Definition: CscEnvironmentSimulator.h:31
conscience_core::bridging::commands::COMMAND_REGISTER
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)
CommandCommons.h
ptr
std::shared_ptr< T > ptr
Definition: CscCommon.h:29