I am writing a control program for a robot (the Create robot from iRobot).
One of the things we need to do is to create a map of the robot's suroundings, and to display it to the user.
The map is done by polling a sensor and updating a matrix wich contains the information about obstacles and about the robot's location. So far, so good.
The problem we encountered was displaying the map to the user in an aesthetic way. Currently we use the ZedGraph set of classes, but the result is somewhat ugly...
the matrix of the map ( MapMat ) is 80 by 40 cells, each one representing a 5 cm square. It contains zeros for clear path, ones for obstacles and 2 for the robot's location, and we implemented it using a list - namely, the PointPairList from the ZedGraph library. we then proceeded drawing it as a graph using the library's methods:
// // The Obstacles and myLocation are lists containing Points // (X and Y coords). // The three points below signify that the lists are being updated as // the robot goes, by reading the MapMat matrix and adding // obstacles to cells containing 1 and updating the robot's location // to the cell containing 2. // PointPairList Obstacles = new PointPairList(); PointPairList myLocation = new PointPairList(); ... LineItem DrawObstacles = myPane.AddCurve("Obstacle", Obstacles, Color.Crimson, SymbolType.Plus); LineItem DrawLocation = myPane.AddCurve("Robot's Location",myLocation, Color.BlueViolet, SymbolType.Circle);
We also tried using the dataGridView control, but that is ugly also...
Currently we have pretty much ran out of ideas, and would appreciate your input in that.
Thanks for the time and effort!
This post has been edited by yarok: 10 February 2011 - 03:58 PM