public void OnRawLidarBalisePointsReceived(object sender, EventArgsLibrary.RawLidarArgs e) { List <Point> ptListBalises = new List <Point>(); ptListBalises = e.PtList.Select(p => new Point(p.Angle, p.Distance)).ToList(); oscilloLidar.UpdatePointListOfLine(2, ptListBalises); }
public void OnRawLidarDataReceived(object sender, EventArgsLibrary.RawLidarArgs e) { List <Point> ptList = new List <Point>(); ptList = e.PtList.Select(p => new Point(p.Angle, p.Rssi)).ToList(); oscilloLidar.UpdatePointListOfLine(0, ptList); List <Point> ptList2 = new List <Point>(); ptList2 = e.PtList.Select(p => new Point(p.Angle, p.Distance)).ToList(); oscilloLidar.UpdatePointListOfLine(1, ptList2); }
public void OnRawLidarDataReceived(object sender, EventArgsLibrary.RawLidarArgs e) { if (localWorldMap == null || localWorldMap.robotLocation == null) { return; } if (RobotId == e.RobotId) { List <PointD> listPtLidar = new List <PointD>(); for (int i = 0; i < e.AngleList.Count; i++) { listPtLidar.Add(new PointD(localWorldMap.robotLocation.X + e.DistanceList[i] * Math.Cos(e.AngleList[i]), localWorldMap.robotLocation.Y + e.DistanceList[i] * Math.Sin(e.AngleList[i]))); } localWorldMap.lidarMap = listPtLidar; } }
public void OnRawLidarDataReceived(object sender, EventArgsLibrary.RawLidarArgs e) { if (localWorldMap == null || localWorldMap.robotLocation == null) { return; } if (localWorldMap.RobotId == e.RobotId && e.PtList.Count != 0) { List <PointDExtended> listPtLidar = new List <PointDExtended>(); try { listPtLidar = e.PtList.Select( pt => new PointDExtended( new PointD(localWorldMap.robotLocation.X + pt.Distance * Math.Cos(pt.Angle + localWorldMap.robotLocation.Theta), localWorldMap.robotLocation.Y + pt.Distance * Math.Sin(pt.Angle + localWorldMap.robotLocation.Theta)), System.Drawing.Color.White, 0.1)).ToList(); switch (e.Type) { case LidarDataType.RawData: localWorldMap.lidarMap = listPtLidar; break; //case LidarDataType.ProcessedData1: // localWorldMap.lidarMapProcessed1 = listPtLidar; // break; //case LidarDataType.ProcessedData2: // localWorldMap.lidarMapProcessed2 = listPtLidar; // break; //case LidarDataType.ProcessedData3: // localWorldMap.lidarMapProcessed3 = listPtLidar; // break; } } catch { }; } }
public void OnProcessedLidarDataReceived(object sender, EventArgsLibrary.RawLidarArgs e) { if (localWorldMap == null || localWorldMap.robotLocation == null) { return; } if (localWorldMap.RobotId == e.RobotId && e.PtList.Count != 0) { List <PointD> listPtLidar = new List <PointD>(); try { //for (int i = 0; i < 500; i++) //Stress test { listPtLidar = e.PtList.Select( pt => new PointD(localWorldMap.robotLocation.X + pt.Distance * Math.Cos(pt.Angle + localWorldMap.robotLocation.Theta), localWorldMap.robotLocation.Y + pt.Distance * Math.Sin(pt.Angle + localWorldMap.robotLocation.Theta))).ToList(); } } catch { }; localWorldMap.lidarMapProcessed = listPtLidar; } }