22 std::string singleLineConfigurationFile;
24 int * fileArgc =
new (std::nothrow)
int;
26 char *** fileArgv =
new (std::nothrow)
char **;
28 unsigned char rowCounter = 0;
32 while (inputFile >> singleLineConfigurationFile) {
33 (* fileArgv)[rowCounter] =
new (std::nothrow)
char [(
unsigned int) singleLineConfigurationFile.size()];
35 strcpy((* fileArgv)[rowCounter], singleLineConfigurationFile.c_str());
123void FacadeSingleton::startEnvironment (rs2::pipeline & pipelineStream,
struct rs2_intrinsics & color_intrin,
float * scale,
unsigned short int resX,
unsigned short int resY,
const char * destinationKafkaTopic,
Room room) {
142 delete openPoseCommand;
154 for (
unsigned int nFrame = 0; nFrame < user_nFrame; nFrame++) {
155 Json::Value currentJSON;
156 std::stringstream outputJsonFilePath;
157 currentImageID = frameID - user_nFrame + nFrame;
158 outputJsonFilePath << outputFolder <<
"movement/frame" << currentImageID <<
"_skeletonsPoints3D.json";
159 if (myOutputManagerJSON->
loadJSON(outputJsonFilePath.str(), currentJSON)) {
160 std::string key = std::to_string(currentImageID);
The CleanCommand class is a class that implements a command to clean the build folder by deleting old...
The CoordinateMappingManager class is a class that is responsible for converting coordinates values f...
FacadeSingleton class is used as a single access point to a simplified interface.
RealSenseManager * cameraManager
A pointer to RealSenseManager object. A RealSenseManager object is responsible for handling the camer...
CoordinateMappingManager * getCoordinateMappingManager(void)
Get the CoordinateMappingManager pointer.
void showSkeletons(unsigned int user_nFrame, const float skeletonThreshold)
Retrieve OpenPose's output, convert it to RealSense coordinate's space, show results and save them.
void setOutputManager(OutputManager *outputManager)
Set the OutputManager pointer.
void setUsageManager(UsageManager *usageManager)
Set the UsageManager pointer.
CoordinateMappingManager * coordinateMappingManager
A pointer to CoordinateMappingManager object. A CoordinateMappingManager object is responsible for tr...
void startEnvironment(rs2::pipeline &pipelineStream, struct rs2_intrinsics &color_intrin, float *scale, unsigned short int resX, unsigned short int resY, const char *destinationKafkaTopic, Room room)
This method is useful to invoke at the boot of the program where we want to initialize the different ...
void setImageManager(ImageManager *imageManager)
Set the ImageManager pointer.
OpenCV_Manager * getOpenCV_Manager(void)
Get the OpenCV_Manager pointer.
ImageManager * getImageManager(void)
Get the ImageManager pointer.
KafkaManager * kafkaManager
A pointer to KafkaManager object. A KafkaManager object is responsible for sending previously produce...
ImageManager * imageManager
A pointer to CoordinateMappingManager object. A CoordinateMappingManager object is responsible for br...
static std::mutex singletonMutex
Mutex for thread-safe access.
void setCoordinateMappingManager(CoordinateMappingManager *coordinateMappingManager)
Set the CoordinateMappingManager pointer.
OutputManager * outputManager
A pointer to OutputManager object. An OutputManager object is responsible for handling the final outp...
void setOpenCV_Manager(OpenCV_Manager *openCV_Manager)
Set the OpenCV_Manager pointer.
void setKafkaManager(KafkaManager *kafkaManager)
Set the KafkaManager pointer.
UsageManager * usageManager
A pointer to UsageManager object. An UsageManager object is responsible for checking if the parameter...
void getVideoBodyKeyPoints(int *argc, char ***argv)
Start and execute OpenPose submodule.
static FacadeSingleton * sharedInstance
The field for storing the singleton instance.
~FacadeSingleton(void)
Destroy the Facade Singleton object.
OpenCV_Manager * openCV_Manager
A pointer to OpenCV_Manager object. An OpenCV_Manager object is responsible for converting camera fra...
OutputManager * getOutputManager(void)
Get the OutputManager pointer.
void setCameraManager(RealSenseManager *cameraManager)
Set the RealSenseManager pointer.
UsageManager * getUsageManager(void)
Get the UsageManager pointer.
void getVideoFrames(unsigned int user_nFrame, rs2::pipeline &pipelineStream, float scale, const unsigned short int framesToSkip)
Get user_nFrame video frames from the pipeline by applying a specific scaling factor.
RealSenseManager * getCameraManager(void)
Get the RealSenseManager pointer.
void cleanBuildFolder(void)
This method cleans the build folder, in order to prepare the environment for the next loop iteration....
FacadeSingleton(const int expected_argc=0, const char *expectedUsageMessage=nullptr)
Construct a new Facade Singleton object.
void sendData(unsigned int user_nFrame)
Send saved results by getVideoBodyKeyPoints(...) via Kafka using the KafkaManager.
static FacadeSingleton * getInstance(void)
Get the unique class instance. This methods should be called in the following scenario: when we just ...
KafkaManager * getKafkaManager(void)
Get the KafkaManager pointer.
ImageManager class is a general-purpose class useful for operations on images such as loading,...
Kafka class is a class that is responsible to send all generated output data, via Apache Kafka techno...
void sendData(const char *key, Json::Value root)
Send data contained in root via Kafka with ID equal to key.
OpenCV_Manager class is used for general-purpose tasks on the captured frames.
void getVideoFramesCV(unsigned int user_nFrame, rs2::pipeline &pipelineStream, float scale, const unsigned short int framesToSkip)
Get user_nFrame video frames from the pipeline by applying a specific scaling factor.
void showSkeletonsCV(unsigned int user_nFrame, const float skeletonThreshold)
Retrieve OpenPose's output, convert it to RealSense coordinate's space, show results and save them.
The OpenPoseCommand class is a class that implements a command to start and run OpenPose.
OutputManagerJSON class is a class that abstracts final JSON output-producing operations.
bool loadJSON(std::string filePathJSON, Json::Value ¤tJSON)
Loads a JSON file and returns it as a reference. The JSON file path on disk is given.
OutputManager class is a class that abstracts final output-producing operations. An output format inh...
RealSenseD435Manager class is a class that abstracts the behavior of an Intel RealSense D435 Camera,...
RealSenseManager class is a class that abstracts the behavior of an Intel RealSense Camera,...
virtual void startEnvironment(rs2::pipeline &pipelineStream, struct rs2_intrinsics &color_intrin, float *scale, unsigned short int resX, unsigned short int resY, bool firstBoot)=0
This method is useful to invoke at the boot of the program where we want to initialize the different ...
unsigned int getFrameID(void)
Get the current frame ID value.
Room class represents the Room abstraction. A Room object has different specifications,...
SystemCommand class is a class that represents a command given by the program to the system.
void executeCommand(int *argc, char ***argv)
This method is responsible for executing commands on the system based on the filled command string....
The UnityCoordinateMappingManager class is a class that is responsible for converting coordinates val...
UsageManager class is a utility class that helps with configuration parameters.
char *** get_argv(void)
Get the argv's pointer.
static UsageManager * getInstance(void)
Get the unique class instance. This methods should be called in the following scenario: when we just ...
static const char * CONF_FILE_PATH
static const bool FIRST_BOOT
static const short int totalFileParameters
static const short int outputFolderOffset
static const short int NEW_ALLOC_ERROR
static const char * NEW_ALLOC_SCOPE
const char * expectedUsageMessage