distance to tag

This commit is contained in:
ackimixs
2024-04-29 16:51:37 +02:00
parent 6f481a9247
commit f82cf53358

View File

@@ -673,12 +673,12 @@ void TCPServer::goToAruco(const ArucoTag &arucoTag, const int pince) {
double yPrime = arucoTag.pos()[1];
double roll = arucoTag.rot()[1];
auto centerPlantX = (20 * std::cos(roll)) + xPrime - 50;
auto centerPlantX = (20 * std::cos(roll)) + xPrime;
auto centerPlantY = (-20 * std::sin(roll)) + yPrime + decalage;
double thetaPrime = std::atan2(centerPlantY, centerPlantX);
this->rotate(this->robotPose.theta + rotate - thetaPrime);
this->rotate(this->robotPose.theta /*+ rotate*/ - thetaPrime);
awaitRobotIdle();
double robotPosForPotX = (centerPlantX * std::cos(theta) + centerPlantY * std::sin(theta)) + robotPosX;