Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before embarking on this subteam bootcamp, please ensure you’ve completed these instructions: Bootcamper Onboarding. Please notify the team by creating a post in the auto-bootcamps forum to get started! You can ask for help here and notify reviewers when you are done.

This bootcamp is in effect starting 2023-09-06 . If you are doing the Autonomy bootcamp, you are at the right place!

...

Create a post in the #auto-bootcamps forum to get started! You can ask for help there and notify the Autonomy bootcamp reviewers when you are done.

Setup

Dear WARG Bootcamper,

Congratulations and welcome to the AutoBots family! We're excited to have you on the team. I'll be sending you our onboarding documents soon, please feel free to get a head start on that.

Yours sincerely,

Jane Doe
VP of Human Resources
AutoBots

...

  1. Open requirements.txt

    1. MacOS: Remove +cu117 from both torch and torchvisionthe line containing --extra-index-url [link]

    2. Windows and Linux:

      1. If you have a CUDA capable GPU but don’t want to use it for some reason, change +cu117 to +cpu for both torch and torchvisionremove the line containing --extra-index-url [link]

      2. If you don’t have a CUDA capable GPU, don’t change anything.

  2. If you haven’t already, activate the virtual environment.

  3. Download and install required packages: pip install -r requirements.txt

    1. This will install in your virtual environment under venv . The rest of your system is unaffected.

  4. Done!

...

  1. If you haven’t already, activate the virtual environment:

    1. Windows command prompt: venv\Scripts\activate.bat

    2. Windows Powershell: .\venv\Scripts\Activate.ps1

    3. Linux and MacOS: source venv/bin/activate

    You should now see (venv) in the prompt line.

  2. Follow the instructions in the tasks below.

  3. Code away! Run the tests! Please try to follow our style guide: Python Style Convention

    1. Ask questions if you need help!

    Make a commit:

    1. Check which files Linter and formatter commands for reference:

      1. black .

      2. flake8 .

      3. pylint modules

  4. Make a commit:

    1. Check which files have changed: git status

    2. Run: git add [files you changed] , where [files you changed] are the files you want to add to the commit.

      1. Use git add . if you want to add all of them (the dot means wildcard in Git).

    3. Run: git commit -m "Your commit message"

    4. When you’re ready to push your latest commits to GitHub: git push

      1. No harm in doing this after every commit.

  5. When you’re done, make sure to either close the terminal or run:

    1. Windows command prompt: venv\Scripts\deactivate.bat

    2. Everything else: deactivate

    3. This is important to avoid going to a different project and then accidentally polluting your current project’s virtual environment.

...

  1. Navigate to WARG’s copy of the repository: https://github.com/UWARG/autonomy-bootcamp-2023

  2. At the top, click Pull requests.

  3. To the right, click the green New pull request button.

  4. Under Compare changes, click the “compare across forks” link.

  5. The 3rd from the left: Click the head repository dropdown and select your repository (you can search for your username).

  6. The 4th from the left: Click the compare dropdown and select the branch you want to submit.

    1. Do not open more than 1 pull request! The branch you select should contain (or eventually contain) all tasks which will be reviewed.

    2. Once you have an open PR, you can keep updating the same branch as you get feedback. You do not need to open another PR.

  7. Click on the green Create pull request button.

  8. Once you have an open PR and are ready for review, go to your Discord bootcamp thread and send this message: @Autonomy Lead My PR for the @AUTO-Bootcamp Reviewer My bootcamp is ready for review: [link to your PR on GitHub] .

  9. The

    @Autonomy Lead ping is bright pink.

    The Autonomy Leads and/or bootcamp maintainers reviewers will review your PR (a message will be sent on Discord, and the comments will be on GitHub).

  10. Read the feedback and go back to development. If any of the feedback is unclear or confusing, don’t hesitate to ask for clarification (make sure to send a message on Discord as well for visibility (e.g. I asked some questions as replies on GitHub ).

    1. Please do not click on Resolve conversation for any of the comments that the reviewers may leave! It causes confusion for the reviewers since they use the resolved/unresolved state to confirm that the code meets the quality to their satisfaction. Instead, you can use a reaction or reply to the comment for your own tracking purposes.

    2. If you are ready for another review, repeat step 8 (you do not need to open a new PR).

  11. Once your review is fully complete and you’re done with the bootcamp, please follow the steps in New Member Onboarding to onboard to the team.

...

From the repository root, try running pytest modules/bootcamp/tests/test_detect_landing_pad.py . pylint modules . You will notice that all the unit tests fail, because of the raised NotImplementedError exceptionthere are no issues and the code is rated 10.00/10 . Remove the Pylint ignore near the top of the file and run the command again. You will notice that the linter now reports several issues.

Info

What are unit testsis a linter?Unit tests are used to test individual components of a system independently. This makes debugging much easier

Linters and formatters are tools that enforce a specific coding style. While there are several permutations of source code that result in the same program, standardization of the coding style is important for readability. Readability is important for collaboration, because others (including your future self) will be reading your code.

However, linters and formatters are not magic; it is still possible to write bad code that follows the coding style.

From the repository root, try running pytest modules/bootcamp/tests/test_detect_landing_pad.py . You will notice that some of the unit tests fail.

Info

What are unit tests?

Unit tests are used to test individual components of a system independently. This makes debugging much easier and faster by quickly narrowing the scope of problems that will develop from a system's increasing scope and complexity. There are many unit test frameworks out there; the most popular are Google Test (for C++) and Pytest (for Python). Autonomy uses Pytest, which you can see in modules/bootcamp/tests/test_detect_landing_pad.py .

Your task is to implement the code in run() to correctly identify landing pads. You can remove or comment out the NotImplementedError line.

Once your code is correctly implemented, all tests should pass.

Info

Machine learning uses a LOT of memory (approximately 3-4GB of RAM). Make sure your computer has enough to spare._pad.py .

Your task is to implement the code in run() to correctly identify landing pads.

Once your code is correctly implemented, all tests should pass.

Info

Machine learning uses a LOT of memory (approximately 3-4GB of RAM). Make sure your computer has enough to spare.

The linters and formatters should also pass:

  • Black: black .

    • Black is a formatter that edits the code layout (e.g. indentation, multiline).

  • Flake8: flake8 .

    • Flake8 is a linter that reports whether function and methods are correctly type annotated.

  • Pylint: pylint modules

    • Pylint is a general linter.

Info

I don’t know what to do! I have no idea what’s going on!

When you get stuck, the first thing to do is to find documentation and examples. Then, experiment! Use the debugger and print statements to figure out what’s going on. If you’re still stuck, then reach out for help, bringing the information of what you tried and what worked/didn’t work.

Independence and problem solving skills are important for the Autonomy subteam, as members are students volunteering their limited time, and often themselves don’t know either. That being said, we don’t expect you to know everything about the system from day 1, so asking questions is expected.

...

Your task is to implement the code in __init__() and run() to travel to and land at the designated waypoint. You can remove or comment out the NotImplementedError line.

Once your code is implemented, the simulator should exit after the drone lands, which should occur within 60 seconds of start. The difference between the coordinates of the drone position and waypoint under the text file in log/ should be less than 0.1 . You can also confirm with the screenshot.

The linters and formatters should also pass.

Note

Hints:

  • You do not need to use landing_pad_locations in this task.

  • You can use the drone report’s destination to see if your relative command is correct.

  • Ideally, the drone will report Halted at the beginning of the simulation and when it reaches the waypoint. The rest of the time, it will report something that isn’t Halted.

    • So you’ll have to find a way to know the difference between Halted at initial position and Halted at the waypoint.

...

Once your code is implemented, the simulator should exit after the drone lands, which should occur within 60 seconds of start. The difference between the coordinates of the drone position and the landing pad under the text file in log/ should be less than 0.1 . You can also confirm with the screenshot.

The linters and formatters should also pass.

Note

Hints:

  • You can write a helper function to calculate the distance between 2 Location objects. This will make the finding closest landing pad code easier to read and write.

  • You can initialize the distance value with a very large number (e.g. infinity). Then the first landing pad’s distance will definitely be smaller than this. Details of the loop and logic are for you to implement…

    • Don’t constantly recalculate the distances if you don’t need to.

  • What if the closest landing pad is directly on the waypoint? Your code needs to handle this case.

...