Skip to content

#KL25-143 エクセレントランディングのための動作#44

Open
nishijima515 wants to merge 50 commits into
work-KL25-107-2from
ticket-KL25-143
Open

#KL25-143 エクセレントランディングのための動作#44
nishijima515 wants to merge 50 commits into
work-KL25-107-2from
ticket-KL25-143

Conversation

@nishijima515

@nishijima515 nishijima515 commented Nov 11, 2025

Copy link
Copy Markdown
Contributor

チェックリスト

  • clang-format している
  • コーディング規約に準じている
  • チケットの完了条件を満たしている

変更点

  • カメラで距離を算出するクラスCameraDistanceCalculatorの追加
  • ボトルランディングの複合動作クラス(カメラ距離算出+IDS)BottleLandingActionの追加
  • 2本目のボトルキャッチを担当する複合動作クラスBottleTwoCatchActionの追加

動作テスト

Notion

実験方法

実験データ

修正前 修正後
- -
- -

実験結果

添付資料

nishijima515 and others added 30 commits October 30, 2025 09:49
@nishijima515
nishijima515 requested a review from a team November 11, 2025 16:34
@notion-workspace

Copy link
Copy Markdown

@nishijima515 nishijima515 self-assigned this Nov 11, 2025

@molpui0726 molpui0726 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

担当者の贖罪レビュー

Comment thread .vscode/settings.json Outdated
"typeinfo": "cpp",
"variant": "cpp"
}
} No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これはミス? VSCode の設定ファイルだから、あってもいいけどね。

Comment thread modules/EtRobocon2025.cpp Outdated
Comment on lines +36 to +42
Area lineTraceArea = Area::LineTrace;
AreaMaster lineTraceAreaMaster(robot, lineTraceArea, isLeftCourse, targetBrightness);
lineTraceAreaMaster.run();
// Area lineTraceArea = Area::LineTrace;
// AreaMaster lineTraceAreaMaster(robot, lineTraceArea, isLeftCourse, targetBrightness);
// lineTraceAreaMaster.run();

Area doubleLoopArea = Area::DoubleLoop;
AreaMaster doubleLoopAreaMaster(robot, doubleLoopArea, isLeftCourse, targetBrightness);
doubleLoopAreaMaster.run();
// Area doubleLoopArea = Area::DoubleLoop;
// AreaMaster doubleLoopAreaMaster(robot, doubleLoopArea, isLeftCourse, targetBrightness);
// doubleLoopAreaMaster.run();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

マージするまでにここはコメントを外した方がいいかな

Comment thread modules/MotionParser.cpp
detectionRequest.resolution = cv::Size(640, 480);
}

auto btca = new BottleTwoCatchAction(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

あのとき気づいてなかったけど、2つ目だったら、SecondBottleCatchAction の方がいいかもね


/**
* @brief カメラ画像を使って、走行体からバウンディングボックスの中心までの距離を計算する
* @param response カメラサーバーからの応答

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param response カメラサーバーからの応答
* @param response カメラサーバーからの応答
* @param offsetDistance 距離補正値 [mm]

コメントの引数漏れ


SocketClient& client = robot.getSocketClient();
CameraServer::BoundingBoxDetectorResponse response;
bool success = client.executeLineDetection(detectionRequest, response);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

未使用変数?
エラー処理が抜けてないか確認してほしい。

Comment thread modules/motions/GetCorrectionAngle.cpp Outdated
Comment on lines +32 to +41
// // 回頭方向を計算
// if(currentX >= targetXCoordinate && isleftCorse.getIsLeftCourse() == true) {
// correctionResult.isClockwise = true;
// } else if(currentX >= targetXCoordinate && isleftCorse.getIsLeftCourse() == false) {
// correctionResult.isClockwise = false;
// } else if(currentX < targetXCoordinate && isleftCorse.getIsLeftCourse() == true) {
// correctionResult.isClockwise = false;
// } else {
// correctionResult.isClockwise = true;
// }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここはいらないやつ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetCorrectionAngleは現在使っていなくて、プルリクを上げる前に消しておくべきでしたが、忘れていました。後で消しておきます。GetCorrectionAngle関係は一旦無視してもらえるとありがたいです。申し訳ないです。

Comment thread modules/motions/GetCorrectionAngle.cpp Outdated
Comment on lines +53 to +57
if(correctionResult.correctionAngle < 0) {
correctionResult.correctionAngle = correctionResult.correctionAngle * (-1);
}

return correctionResult;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abs で絶対値取るだと不都合がある?

Comment thread modules/motions/GetCorrectionAngle.cpp Outdated

// 補正角度を計算
correctionResult.correctionAngle
= atan2(currentX - targetXCoordinate, targetXCoordinate) * 180.0 / M_PI;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これよく思いついたね。翁長さんの卒論以来に arctan 聞いた

Comment thread modules/motions/GetCorrectionAngle.h Outdated
Comment on lines +16 to +17
bool isClockwise; // 回頭方向 true:時計回り, false:反時計回り
double correctionAngle; // 補正角度

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通信処理に失敗したときを書いてたけど、こういう .h の変数は初期化した方がいいかもね

Comment thread modules/motions/GetCorrectionAngle.h Outdated
Comment on lines +30 to +31
* @param detectionRequest カメラサーバーへの検出リクエスト
* @param targetXCoordinate 目標X座標

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param detectionRequest カメラサーバーへの検出リクエスト
* @param targetXCoordinate 目標X座標
* @param targetXCoordinate 目標X座標
* @param detectionRequest カメラサーバーへの検出リクエスト

逆かな

@takuchi17 takuchi17 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原くんも含めて、長い間ありがとう🙏

実装上の問題が少しありそうなので、対応お願いします🙇‍♂️

Comment thread modules/MotionParser.cpp
Comment thread modules/calculators/CameraDistanceCalculator.cpp Outdated
Comment thread modules/calculators/CameraDistanceCalculator.h
Comment thread modules/motions/BottleLandingAction.cpp Outdated
Comment thread modules/motions/BottleTwoCatchAction.cpp
Comment thread modules/motions/BottleTwoCatchAction.cpp Outdated
Comment thread modules/motions/BottleTwoCatchAction.cpp
Comment thread modules/motions/BottleTwoCatchAction.h Outdated
Comment thread modules/motions/PictureColorDistanceStraight.cpp
Comment thread modules/motions/PictureColorDistanceStraight.cpp

@aridome222 aridome222 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いくつか指摘したので、修正お願いします。

double initialLeftMotorCount = robot.getMotorControllerInstance().getLeftMotorCount();
double initialDistance = Mileage::calculateMileage(initialRightMotorCount, initialLeftMotorCount);

double initialAngle = robot.getIMUControllerInstance().getAngle(); // 動作開始時の角度

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initialAngleっていう変数どこで使われてる?
検索かけた感じ使われてないような。

double currentLeftMotorCount = robot.getMotorControllerInstance().getLeftMotorCount();
double currentDistance = Mileage::calculateMileage(currentRightMotorCount, currentLeftMotorCount);

double totalAngleToTurn = robot.getIMUControllerInstance().getAngle();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここで、initialAngleを使う予定だった?

Suggested change
double totalAngleToTurn = robot.getIMUControllerInstance().getAngle();
double totalAngleToTurn = robot.getIMUControllerInstance().getAngle() - initialAngle;

Comment thread modules/motions/BottleLandingAction.h Outdated

private:
CameraServer::BoundingBoxDetectorRequest detectionRequest; // 検出リクエスト
BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

検出結果は、CameraServer::BoundingBoxDetectorResponse型のresponse、response.resultでアクセスしてるから、このメンバー変数は必要ないかな。

Suggested change
BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体

Comment thread modules/motions/BottleTwoCatchAction.h Outdated

private:
CameraServer::BoundingBoxDetectorRequest detectionRequest; // 検出リクエスト
BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここも。

Suggested change
BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体

@takuchi17 takuchi17 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMMM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants