AI Watch A1
Multi-person 3D skeleton detection using Intel RealSense and OpenPose with Kafka support.
CleanCommand.cpp
Go to the documentation of this file.
1//
2// CleanCommand.cpp
3// AI Watch A1
4//
5// Created by Denny Caruso on 23/07/22.
6//
7
8// License: Apache 2.0. See LICENSE file in root directory.
9// Copyright(c) 2022. All Rights Reserved.
10
11#include "SystemCommand.hpp"
12
13
14
15void CleanCommand::setCommand (int * argc, char *** argv) {
16 std::stringstream cleanTerminalCommand;
17 UsageManager * usageManagerInstance = UsageManager::getInstance();
18 if (usageManagerInstance == nullptr) CV_Error(USAGE_MANAGER_NULLPTR_ERROR, USAGE_MANAGER_NULLPTR_SCOPE);
19
20 char *** localArgv = usageManagerInstance->get_argv();
21 const char * imagesFolder = (* localArgv)[imagesFolderOffset];
22 const char * outputFolder = (* localArgv)[outputFolderOffset];
23 cleanTerminalCommand << "rm -r " << imagesFolder << "rgb/ > /dev/null && "
24 "rm -r " << imagesFolder << "d/ > /dev/null && "
25 "rm -r " << imagesFolder << "skeleton/ > /dev/null && "
26 "rm -r " << imagesFolder << "videoframe/ > /dev/null && "
27 "rm -r " << outputFolder << "op/ > /dev/null && "
28 "rm -r " << imagesFolder << "depth/ > /dev/null && "
29 "rm -r " << imagesFolder << "sk/ > /dev/null && "
30 "rm -r " << outputFolder << "movement/ > /dev/null && "
31 "mkdir " << imagesFolder << "rgb && "
32 "mkdir " << imagesFolder << "d && "
33 "mkdir " << imagesFolder << "videoframe && "
34 "mkdir " << imagesFolder << "skeleton && "
35 "mkdir " << imagesFolder << "depth && "
36 "mkdir " << imagesFolder << "sk && "
37 "mkdir " << outputFolder << "movement/ && "
38 "mkdir " << outputFolder << "op/";
39 SystemCommand::setCommand(std::string(cleanTerminalCommand.str()));
40}
void setCommand(int *argc, char ***argv) override
Set the string command to a cleaning command.
virtual void setCommand(int *argc, char ***argv)=0
Set the string command. The method is inherited from the subclasses and overridden in order to expres...
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 short int imagesFolderOffset
Definition: constants.hpp:64
static const short int USAGE_MANAGER_NULLPTR_ERROR
Definition: constants.hpp:35
static const short int outputFolderOffset
Definition: constants.hpp:65
static const char * USAGE_MANAGER_NULLPTR_SCOPE
Definition: constants.hpp:36