Skip to content

Commit

Permalink
refactor: コメントアウト文の追加
Browse files Browse the repository at this point in the history
  • Loading branch information
keiya121 committed Nov 10, 2024
1 parent 3b8af42 commit 7765cba
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions module/Motion/CameraAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ using namespace std;
// countShootFigureの初期化
int CameraAction::countShootFigure = 0;

CameraAction::CameraAction(Subject _subject) : subject(_subject){};
CameraAction::CameraAction(Subject _subject) : subject(_subject) {};

void CameraAction::run()
{
Expand All @@ -36,32 +36,36 @@ void CameraAction::run()
printf("%s\n", cmd);

// Fig_1の場合、物体検出を行うエンドポイントに画像をアップロードする
// それ以外の場合、画像をアップロードする処理をバックグラウンドで行う
// 実行コマンドの最後に「&」をつけることでバックグラウンドで実行する
// 参考:https://qiita.com/inosy22/items/341cfc589494b8211844
char uploadImageName[20] = "Fig_1.jpeg";
if(subject == CameraAction::Subject::FIGURE && strcmp(imageName, uploadImageName) == 0) {
snprintf(cmd, 256,
"cd etrobocon2024 && make upload-detect FILE_PATH=front_camera/image_data/%s && cd ..",
imageName);
system(cmd);
printf("%s\n", cmd);
} else if(subject == CameraAction::Subject::FIGURE){
snprintf(cmd, 256,
"(cd etrobocon2024 && make upload-image FILE_PATH=front_camera/image_data/%s && cd ..) &",
imageName);
system(cmd);
printf("%s\n", cmd);
} else if(subject == CameraAction::Subject::FIGURE) {
snprintf(
cmd, 256,
"(cd etrobocon2024 && make upload-image FILE_PATH=front_camera/image_data/%s && cd ..) &",
imageName);
system(cmd);
printf("%s\n", cmd);
}

// PLARAILが指定された場合には、画像の切り出し処理を行い無線通信デバイスに送信する処理を順番に行う
// PLARAILが指定された場合には、画像の切り出し処理を行い無線通信デバイスに送信する処理をバックグラウンドで行う
if(subject == CameraAction::Subject::PLARAIL) {
sprintf(makeImageCommand, "plarail-image");
snprintf(cmd, 256,
"(cd etrobocon2024/front_camera && make %s && cd ../.. &&"
"cd etrobocon2024 && make upload-image FILE_PATH=front_camera/image_data/%s && cd .., makeImageCommand) &",
makeImageCommand, imageName);
"(cd etrobocon2024/front_camera && make %s && cd ../.. &&"
"cd etrobocon2024 && make upload-image FILE_PATH=front_camera/image_data/%s && cd .., "
"makeImageCommand) &",
makeImageCommand, imageName);
system(cmd);
printf("%s\n", cmd);
printf("%s\n", cmd);
}

}

void CameraAction::logRunning()
Expand Down

0 comments on commit 7765cba

Please sign in to comment.