public void SetCoordinates(SSL_WrapperPacket data) { try { Data = data; if (IsYellow) { CurrentX = data.detection.robots_yellow[Id].x; CurrentY = data.detection.robots_yellow[Id].y; CurrentAngle = data.detection.robots_yellow[Id].orientation; } else { CurrentX = data.detection.robots_blue[Id].x; CurrentY = data.detection.robots_blue[Id].y; CurrentAngle = data.detection.robots_blue[Id].orientation; } BallX = data.detection.balls[0].x; BallY = data.detection.balls[0].y; } catch (Exception ex) { _controller.PrintErrorMessage(ex); } SetBallPossesed(); }
public void SetCoordinates(SSL_WrapperPacket data) { Data = data; }
private static void InitializeData() { _data = new SSL_WrapperPacket { detection = new SSL_DetectionFrame { robots_yellow = { new SSL_DetectionRobot { robot_id = 0, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 1, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 2, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 3, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 4, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 5, x = 0, y = 0 } } , robots_blue = { new SSL_DetectionRobot { robot_id = 0, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 1, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 2, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 3, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 4, x = 0, y = 0 }, new SSL_DetectionRobot { robot_id = 5, x = 0, y = 0 } }, balls = {new SSL_DetectionBall {x = 0, y = 0, z = 0}} } }; }