Conscience Core
CommandFollowTrajectoryAndProject.h
Go to the documentation of this file.
1 // ConscienceRobotManager
2 //
3 // Created by Hazar Zaoui on 06/10/2020.
4 // Copyright © 2020 IliesZaoui. All rights reserved.
5 //
6 
7 #ifndef ConscienceCommandFollowTrajectoryAndProject_h
8 #define ConscienceCommandFollowTrajectoryAndProject_h
9 
10 #include "./Command.h"
14 
16 #include "CoreObjects/CscMember.h"
18 
19 #include <iostream>
20 #include <fstream>
21 
23 using namespace conscience_core::detector_engine;
24 
26  public:
27 
28  CscTrajectoryPoint3d(float x, float y, float z, float yaw, float pitch, float roll, int duration){
29  this->pointOriented = new CscPoint3dOriented(x, y, z, yaw, pitch, roll);
30  this->duration = duration;
31  }
32 
34  int duration;
35 };
36 
38 
39 
41 
42  public:
43  inline static const CommandTypeId COMMAND_ID = "FOLLOW_TRAJECTORY_AND_PROJECT";
44  CommandFollowTrajectoryAndProject(ptr<CscEntityReflexion> entityReflexion, string objectName, string trajectoryFileName);
45 
46  protected:
47  const CscCommandExecutionResultFile * doExecute(CscEnvironmentSimulator &environmentSimulator) override;
48  std::unique_ptr<CscLogger> logger;
50  return entityReflexion;
51  }
52 
53  private:
54 
55  const string followTrajectoryAndProjectDataDir = "../followTrajectoryAndProject";
56  const fs::path outputDaePath = followTrajectoryAndProjectDataDir + "/Ariel-Proceed" + to_string(nowMillis()) + ".dae";
57 
58  vector<ptr<CscTrajectoryPoint3d>> trajectory;
59  string objectName;
60  string trajectoryFilePath;
61  ptr<CscEntityReflexion> entityReflexion;
62 
63  void parseDataFile(string fileName);
64 
68  void transformToSimulatorPositions(CscEnvironmentSimulator &environmentSimulator, vector<CscWorldObject *> &detectedObjects, CscPoint3dOriented* camera);
69 
70  ptr<DetectionResult> performDetection(cv::Mat image, detector_engine::CscDetectorEngine* detector);
71 
72 
73  void addObjectToDAE(vector<CscWorldObject *> * objects, CscWorldObject initialArielObject);
74 
75  const string fileMaterialPaternPath = followTrajectoryAndProjectDataDir + "/material_patern.txt";
76  const string fileEffectPaternPath = followTrajectoryAndProjectDataDir + "/effect_patern.txt";
77  const string fileGeometryPaternPath = followTrajectoryAndProjectDataDir + "/geometry_patern.txt";
78  const string fileInstanceGeometryPaternPath = followTrajectoryAndProjectDataDir + "/instance_geometry_patern.txt";
79 
80  };
81 
82 COMMAND_REGISTER(CommandFollowTrajectoryAndProject, ptr<CscEntityReflexion>, string, string)
83 }
84 
85 #endif
nlohmann::to_string
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values
Definition: json.hpp:26470
conscience_core::detector_engine::CscDetectorEngine
Definition: CscDetectorEngine.h:107
CSC_DLL_IMPORTEXPORT
#define CSC_DLL_IMPORTEXPORT
Definition: os.h:34
CscWorldObject
Definition: CscWorldObject.h:26
conscience_core::bridging::commands::CommandFollowTrajectoryAndProject::getEntityReflexion
ptr< CscEntityReflexion > getEntityReflexion() const override
Definition: CommandFollowTrajectoryAndProject.h:49
CscDetectorEngineColorExtractor.h
CscTrajectoryPoint3d::CscTrajectoryPoint3d
CscTrajectoryPoint3d(float x, float y, float z, float yaw, float pitch, float roll, int duration)
Definition: CommandFollowTrajectoryAndProject.h:28
conscience_core::detector_engine
Definition: ConscienceVisionDetectorRepository.cpp:30
Command.h
CscMember.h
conscience_utils::nowMillis
unsigned long long nowMillis()
Definition: conscience_util.cpp:294
conscience_core::bridging::commands::CommandTypeId
string CommandTypeId
Definition: Command.h:29
CommandExecutionResultNone.h
CscTrajectoryPoint3d::duration
int duration
Definition: CommandFollowTrajectoryAndProject.h:34
CscEntityReflexion.h
ConscienceVisionDetectorRepository.h
conscience_core::bridging::commands::result::CscCommandExecutionResultFile
Definition: CommandExecutionResultFile.h:11
conscience_core::bridging::commands
Definition: cartographyCommands.cpp:4
conscience_core::bridging::commands::CommandFollowTrajectoryAndProject
Definition: CommandFollowTrajectoryAndProject.h:40
conscience_core::bridging::commands::CscCommand
Definition: Command.h:40
COMMAND_REGISTER
#define COMMAND_REGISTER(COMMAND_REGISTER_className,...)
Definition: CscCommandAutoParse.h:477
CscTrajectoryPoint3d
Definition: CommandFollowTrajectoryAndProject.h:25
conscience_core::bridging::commands::CommandFollowTrajectoryAndProject::logger
std::unique_ptr< CscLogger > logger
Definition: CommandFollowTrajectoryAndProject.h:48
CscEnvironmentSimulator
Definition: CscEnvironmentSimulator.h:31
conscience_utils::logging::CscLogger
Definition: conscience_log.h:121
CscCommandAutoParse.h
CscTrajectoryPoint3d::pointOriented
CscPoint3dOriented * pointOriented
Definition: CommandFollowTrajectoryAndProject.h:33
conscience_core::axiomes::CscPoint3dOriented
Definition: Csc3dTypes.h:265
ptr
std::shared_ptr< T > ptr
Definition: CscCommon.h:29