| Assignment 3 Information |
If, for some reason, you've implemented these in the same directory, upload your code to the first submission page only.
You should be able to use this program without any modifications to generate simulated sonar data. You must provide a world and commands to the robot. There are several examples included.
After compiling the program, you can run it with a single argument:
$ ./simsonar Problem1.txtBy pressing 'n', the robot will execute the next command. Its position and sonar readings will be printed to the screen. You will see the robot and the sonar readings displayed on the screen. Note that the sonar cones are approximated by triangles for purposes of display. Also note that they overlap.
You may want to capture the output to a file like so:
./simsonar Problem1.txt > Sonar1.txtThen press 'n' until nothing more happens on the screen.
To make this into a file you can use with your assign3 program, you will have to edit it to remove extraneous stuff the program prints and add the proper "header" information. See one of the sonar data files from the assignment 3 support code for examples.
This program will read in an image (saved from your assign3 program), a set of problem files (same as for assign3), and a world file.
The main thing it provides (other that this basic framework) is a procedure that calculates the area of intersection between a bounding box and a convex polygon.
Of course, you can only use this with sonar data for which you have the corresponding world file. The sonar simulator should be out soon...
This adds a "sonarWidth()" method to the sonar data class. It adds a little stuff in the assign3.cpp file to print some of this information out. Also included is a second data set (with REAL data!)
This code uses the dolt, filereader, and CGAL libraries. I think the support code should be pretty self explanatory. Try running the program and pressing 'h' to get the keybinding help. You should write your code in the sonarmapping.cpp file.