mirror of
https://github.com/modelec/TCPSocketServer.git
synced 2026-01-19 00:47:36 +01:00
lidar
This commit is contained in:
@@ -1615,7 +1615,16 @@ void TCPServer::getLidarPos() {
|
||||
|
||||
usleep(1'000'000);
|
||||
|
||||
this->setPosition(this->robotPose, this->lidarSocket);
|
||||
|
||||
std::string toSend;
|
||||
if (this->robotPose.theta < 0) {
|
||||
toSend = "strat;lidar;set pos;" + std::to_string(static_cast<int>(this->robotPose.pos.x)) + "," + std::to_string(static_cast<int>(this->robotPose.pos.y)) + "," + std::to_string(static_cast<int>((this->robotPose.theta + 2 * PI) * 100)) + "\n";
|
||||
}
|
||||
else {
|
||||
toSend = "strat;lidar;set pos;" + std::to_string(static_cast<int>(this->robotPose.pos.x)) + "," + std::to_string(static_cast<int>(this->robotPose.pos.y)) + "," + std::to_string(static_cast<int>(this->robotPose.theta * 100)) + "\n";
|
||||
}
|
||||
|
||||
this->broadcastMessage(toSend);
|
||||
|
||||
usleep(100'000);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user