Auto-grader, visualization, and other tools for ASEN 5254 (Algorithmic Motion Planning) at CU Boulder.
Two build scripts and a grader script are included for your convenience. You can call them using bash:
bash <script_name>.sh
build.sh: Compile your workspace.build_and_run.sh <project>: Compile your workspace and run yourmain.cppexecutable in<project>(this script is auto-generated by thebuild.shscript, so make sure to run that one first).grade.sh <project>: Grade you homework using<project>. Flags:--hw#(e.g.--hw2) dictates which homework should be graded. Outputs a zip filefile_dump/out/hw#_report_card.zipfor you to submit. Make sure to callHW#::grade()somewhere in your main function. SEE SUBMISSION INSTRUCTIONS BELOW
-ror--rebuild: rebuilds from scratch.
-ror--rebuild: rebuilds from scratch-dor--debug-bt: builds the code inDebugmode (includes-gflag)-qor--quiet: removes any logging messages from your code--exclude-vis: removes the visualizer-vor--valgrind: runs the valgrind memory checker/debugger on your executable (must have valgrind installed, NOTE: this automatically removes the visualizer).
After installation, verify the build_and_run.sh script works.
NOTE: The compiling your workspace will automatically compile the visualizer using your current Python interpreter. Make sure that you installed requirements.txt using the same interpreter that your build your project with. Otherwise you may experience missing modules. To check which interpreter you are using: which python3. If you switch your interpreter or virtual environment, e.g. conda deactivate/conda activate, you will need to rebuild from scratch (see flags above).
The workspace direction ws/ is where you will put all of your code. You will find a main.cpp file which contains your main() function. Feel free to add any headers .h and class definition files .cpp into that directory. They will automatically be linked to main.cpp. NOTE: to skip building a project, make a file in the project directory named IGNORE (e.g. ws/my_project/IGNORE).
This directory includes all of the header files you need. The files contain documentation that will help you understand the classes and methods. Do not edit these files, this will cause build errors.
Figures that you create will be saved to this directory
Forking the https://github.com/peteramorese/AMP-Tools-public is preferred, especially if you would like to commit your changes to GitHub. If you would not like to fork the repository, you can directly clone the repository.
NOTE: Please clone via ssh protocol if you are not doing so already. The submodule url uses the ssh-protocol, so even if you are able to clone the repository using HTTPS, you will not be able to update the submodule. If you have not setup and/or used a ssh key for github:
Creating an ssh key: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Adding the ssh key to your github account: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account
Currently supported OS:
- Ubuntu 20.04 (including WSL Ubuntu 20.04 on Windows - you may experience issues with the visualizer, see "Troubleshooting (linux)")
- Ubuntu 22.04 (including WSL Ubuntu 22.04 on Windows)
- macOS x86
- macOS arm64
If your OS is not supported, and the project does not compile, you can use Docker.
Using Docker with VSCode is recommended for avoiding dependency issues. NOTE: If you want separate figure windows to pop up, Docker generally does not support this, so you must use a traditional installation (see below).
Download the Dev Containers extension in VSCode. Open the AMP-Tools-public directory in VSCode. Press ctrl+shift+p to open a menu at the top of VSCode. Type in Dev Containers: Rebuild and Reopen in Container. Select this option, and VSCode should open a new window inside the docker container where you can work.
To close the container, click the small icon that resembles "><" in the bottom left of VSCode. Then select Close Connection.
On Ubuntu (or WSL), first install Eigen 3.3.7 (C++ matrix library), and OpenSSL, and the python3 GUI backend
sudo apt update
sudo apt install cmake build-essential libeigen3-dev libssl-dev python3-tk zip
Now install the python3.x-dev library for your system. To determine which version of python you are using:
python3 --version
For example, if you see Python 3.10.6, install python3.10-dev
sudo apt install python3.x-dev
To make sure you have a suitable version of Eigen
pkg-config --modversion eigen3
and verify the output is at least 3.3.7 (this should be the case if you are using Ubuntu 20.04 or newer)
Clone the forked repository anywhere you want:
git clone <forked AMP-Tools-public repo url>
cd AMP-Tools-public
Update the submodules (yaml-cpp)
git submodule update --init --recursive
Install the python dependencies
pip3 install -r requirements.txt
Try building
bash build.sh
Refer to the solution here: https://stackoverflow.com/questions/43397162/show-matplotlib-plots-and-other-gui-in-ubuntu-wsl1-wsl2. If you are running Ubuntu 22.04, this solution seems to fix graphical issues. If you are running Ubuntu 20.04, I have not been able to find a fix for this issue yet - consider instead using 22.04 if possible.
Specifically:
- Install VcXsrv (https://sourceforge.net/projects/vcxsrv/)
- Run VcXsrv with default settings, except make sure to check "Disable Access Control"
- In your WSL terminal, run this:
export DISPLAY=\grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0` - Try build_and_run.sh again, if you see figures, make sure to add the previous command to the end of your
~/.bashrcso that it runs every time you open a new terminal.
Install homebrew if you do not already have it
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install CMake, Eigen 3.3.7, and OpenSSL.
brew install cmake
brew install eigen
brew install openssl
The python headers should already be installed on your system.
Clone the forked repository anywhere you want:
git clone <forked AMP-Tools-public repo url>
cd AMP-Tools-public
Update the submodules (yaml-cpp)
git submodule update --init --recursive
Install the python dependencies
pip3 install -r requirements.txt
Try building
bash build.sh
The python headers should already be installed, however, if you receive a CMake error similar to
CMake Error... Cound NOT find PythonLibs
install the PythonLibs
brew install python3
- Each homework will have a
HW#::grade()method that will test your code/algorithms and assess your score. Include this method somewhere inmain.cppin your project (e.g.HW2::grade(algo, "nonhuman.biologic@myspace.edu", argc, argv);) and make sure to change your email to your colorado email. If you run your project, you will now see logging output that shows the grading result when the tests are finished. No output file will be generated. - In order to generate the submission file
hw#_report_card.zip, you will need to runbash grade.sh <project> --hw#(e.g. for HW2:bash grade.sh hw2 --hw2). This will recompile your workspace and run your main function. If you don't see any errors, you should then find a report card file in/file_dump/out/hw#_report_card.zip. - Submit this
hw#_report_card.zip. If you are in WSL, you may want to move this file outside of the WSL environment and into Windows to submit it (this may help: https://stackoverflow.com/questions/42586120/copy-files-from-windows-to-windows-subsystem-for-linux-wsl)
Do not edit/tamper with the hw#_report_card.zip file, doing so is a violation of the Honor Code. However, I've spent (way too many) hours making sure this process is literally Fort Knox-grade tamper-proof so even if you have the inclination to test your academic integrity, good luck!! >:D
Please feel free to raise issues on the GitHub page as they arise. If you experience an issue and are unsure if it is caused by a bug, don't hesitate to reach out to me at peter.amorese@colorado.edu.
I hope you enjoy this toolbox!
, ,
(\____/)
( @ @ )
( " )
- - -