#KL25-143 エクセレントランディングのための動作#44
Conversation
| "typeinfo": "cpp", | ||
| "variant": "cpp" | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
これはミス? VSCode の設定ファイルだから、あってもいいけどね。
| 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(); |
There was a problem hiding this comment.
マージするまでにここはコメントを外した方がいいかな
| detectionRequest.resolution = cv::Size(640, 480); | ||
| } | ||
|
|
||
| auto btca = new BottleTwoCatchAction( |
There was a problem hiding this comment.
あのとき気づいてなかったけど、2つ目だったら、SecondBottleCatchAction の方がいいかもね
|
|
||
| /** | ||
| * @brief カメラ画像を使って、走行体からバウンディングボックスの中心までの距離を計算する | ||
| * @param response カメラサーバーからの応答 |
There was a problem hiding this comment.
| * @param response カメラサーバーからの応答 | |
| * @param response カメラサーバーからの応答 | |
| * @param offsetDistance 距離補正値 [mm] |
コメントの引数漏れ
|
|
||
| SocketClient& client = robot.getSocketClient(); | ||
| CameraServer::BoundingBoxDetectorResponse response; | ||
| bool success = client.executeLineDetection(detectionRequest, response); |
There was a problem hiding this comment.
未使用変数?
エラー処理が抜けてないか確認してほしい。
| // // 回頭方向を計算 | ||
| // 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; | ||
| // } |
There was a problem hiding this comment.
GetCorrectionAngleは現在使っていなくて、プルリクを上げる前に消しておくべきでしたが、忘れていました。後で消しておきます。GetCorrectionAngle関係は一旦無視してもらえるとありがたいです。申し訳ないです。
| if(correctionResult.correctionAngle < 0) { | ||
| correctionResult.correctionAngle = correctionResult.correctionAngle * (-1); | ||
| } | ||
|
|
||
| return correctionResult; |
|
|
||
| // 補正角度を計算 | ||
| correctionResult.correctionAngle | ||
| = atan2(currentX - targetXCoordinate, targetXCoordinate) * 180.0 / M_PI; |
There was a problem hiding this comment.
これよく思いついたね。翁長さんの卒論以来に arctan 聞いた
| bool isClockwise; // 回頭方向 true:時計回り, false:反時計回り | ||
| double correctionAngle; // 補正角度 |
There was a problem hiding this comment.
通信処理に失敗したときを書いてたけど、こういう .h の変数は初期化した方がいいかもね
| * @param detectionRequest カメラサーバーへの検出リクエスト | ||
| * @param targetXCoordinate 目標X座標 |
There was a problem hiding this comment.
| * @param detectionRequest カメラサーバーへの検出リクエスト | |
| * @param targetXCoordinate 目標X座標 | |
| * @param targetXCoordinate 目標X座標 | |
| * @param detectionRequest カメラサーバーへの検出リクエスト |
逆かな
takuchi17
left a comment
There was a problem hiding this comment.
原くんも含めて、長い間ありがとう🙏
実装上の問題が少しありそうなので、対応お願いします🙇♂️
| double initialLeftMotorCount = robot.getMotorControllerInstance().getLeftMotorCount(); | ||
| double initialDistance = Mileage::calculateMileage(initialRightMotorCount, initialLeftMotorCount); | ||
|
|
||
| double initialAngle = robot.getIMUControllerInstance().getAngle(); // 動作開始時の角度 |
There was a problem hiding this comment.
initialAngleっていう変数どこで使われてる?
検索かけた感じ使われてないような。
| double currentLeftMotorCount = robot.getMotorControllerInstance().getLeftMotorCount(); | ||
| double currentDistance = Mileage::calculateMileage(currentRightMotorCount, currentLeftMotorCount); | ||
|
|
||
| double totalAngleToTurn = robot.getIMUControllerInstance().getAngle(); |
There was a problem hiding this comment.
ここで、initialAngleを使う予定だった?
| double totalAngleToTurn = robot.getIMUControllerInstance().getAngle(); | |
| double totalAngleToTurn = robot.getIMUControllerInstance().getAngle() - initialAngle; |
|
|
||
| private: | ||
| CameraServer::BoundingBoxDetectorRequest detectionRequest; // 検出リクエスト | ||
| BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体 |
There was a problem hiding this comment.
検出結果は、CameraServer::BoundingBoxDetectorResponse型のresponse、response.resultでアクセスしてるから、このメンバー変数は必要ないかな。
| BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体 |
|
|
||
| private: | ||
| CameraServer::BoundingBoxDetectorRequest detectionRequest; // 検出リクエスト | ||
| BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体 |
There was a problem hiding this comment.
ここも。
| BoundingBoxDetectionResult result; // バウンディングボックスの座標を格納する構造体 |
チェックリスト
変更点
CameraDistanceCalculatorの追加BottleLandingActionの追加BottleTwoCatchActionの追加動作テスト
Notion
実験方法
実験データ
実験結果
添付資料