mirror of
https://github.com/modelec/TCPSocketServer.git
synced 2026-03-23 08:00:35 +01:00
aruco pos
This commit is contained in:
@@ -364,12 +364,12 @@ void TCPServer::goToAruco(const ArucoTagPos &arucoTagPos, const int pince) {
|
||||
this->broadcastMessage(toSend);
|
||||
|
||||
double xPrime = arucoTagPos.pos.first[0] - 95;
|
||||
double yPrime = arucoTagPos.pos.first[1];
|
||||
double yPrime = arucoTagPos.pos.first[1] - decalage;
|
||||
|
||||
std::cout << "Aruco position1 " << xPrime << " " << yPrime << std::endl;
|
||||
|
||||
double posV200X = (xPrime * std::cos(theta) + (yPrime - decalage) * std::sin(theta)) + robotPosX;
|
||||
double posV200Y = (-xPrime * std::sin(theta) + (yPrime - decalage) * std::cos(theta)) + robotPosY;
|
||||
double posV200X = (xPrime * std::cos(theta) + yPrime * std::sin(theta)) + robotPosX;
|
||||
double posV200Y = (-xPrime * std::sin(theta) + yPrime * std::cos(theta)) + robotPosY;
|
||||
|
||||
toSend = "strat;arduino;go;" + std::to_string(static_cast<int>(posV200X)) + "," + std::to_string(static_cast<int>(posV200Y)) + "\n";
|
||||
this->broadcastMessage(toSend);
|
||||
@@ -377,10 +377,10 @@ void TCPServer::goToAruco(const ArucoTagPos &arucoTagPos, const int pince) {
|
||||
this->broadcastMessage("strat;arduino;speed;150\n");
|
||||
usleep(500'000);
|
||||
|
||||
xPrime += 95;
|
||||
xPrime += 90;
|
||||
|
||||
double robotPosForPotX = (xPrime * std::cos(theta) + (yPrime - decalage) * std::sin(theta)) + robotPosX;
|
||||
double robotPosForPotY = (-xPrime * std::sin(theta) + (yPrime - decalage) * std::cos(theta)) + robotPosY;
|
||||
double robotPosForPotX = (xPrime * std::cos(theta) + yPrime * std::sin(theta)) + robotPosX;
|
||||
double robotPosForPotY = (-xPrime * std::sin(theta) + yPrime * std::cos(theta)) + robotPosY;
|
||||
|
||||
std::cout << "Aruco position " << robotPosForPotX << " " << robotPosForPotY << std::endl;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user