mirror of
https://github.com/modelec/TCPSocketServer.git
synced 2026-03-28 18:39:34 +01:00
add test for the angle
This commit is contained in:
@@ -474,12 +474,12 @@ void TCPServer::goToAruco(const ArucoTag &arucoTag, const int pince) {
|
||||
double xPrime = arucoTag.pos().first[0]/* - 5*/;
|
||||
double yPrime = arucoTag.pos().first[1] - decalage;
|
||||
|
||||
double testX = (xPrime * std::cos(theta) + yPrime * std::sin(theta)) + robotPosX;
|
||||
double testY = (-xPrime * std::sin(theta) + yPrime * std::cos(theta)) + robotPosY;
|
||||
double testX = (xPrime * std::cos(theta) + yPrime * std::sin(theta));
|
||||
double testY = (-xPrime * std::sin(theta) + yPrime * std::cos(theta));
|
||||
|
||||
// calculate the angle to be in front of the tag
|
||||
|
||||
double thetaPrime = std::atan2(testX, testY);
|
||||
double thetaPrime = std::atan2(testY, testX);
|
||||
|
||||
toSend = "strat;arduino;angle;" + std::to_string(static_cast<int>((this->robotPose.theta + rotate + thetaPrime) * 100)) + "\n";
|
||||
canMove = false;
|
||||
|
||||
Reference in New Issue
Block a user