Versions Compared

Key

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

...

  1. If you haven’t already, create an account on GitHub. You can use either your UW email or something else. Otherwise, log in with the GitHub account you would like to use with WARG.

  2. Visit: https://github.com/UWARG/autonomy-bootcamp-2023

  3. Click on the Fork button (towards the top right, above the About section).

  4. Click on the green Create fork button.

  5. GitHub redirects you to your own copy of the repository.

Git setup (General for all autonomy projects)

Include Page
CV:Git setup
CV:Git setup

...

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

  2. Follow the instructions in the tasks below.

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

    1. Ask questions if you need help!

    2. Linter Make sure the linter and formatter commands for reference:pass:

      1. Running Black is sufficient for it to pass: black .

      2. Flake8 outputting nothing is a pass: flake8 .

      3. Pylint outputting a code rating of 10.00/10 is a pass (9.99/10 is not passing): 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.

...

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:.

Name

Command

Description

Passing criteria

Black

...

black .

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

...

Running Black is sufficient for it to pass.

Flake8

flake8 .

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

Flake8 outputting nothing is a pass.

Pylint

...

pylint modules

Pylint is a general linter.

Pylint outputting a code rating of 10.00/10 is a pass. It must be exactly 10.00 , so 9.99/10 is not passing.

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.

...

Note

Hints:

  • You can use the debugger and set breakpoints to see the object and its attibutes returned by predict() .

  • A confidence threshold value of 0.7 works. Other values are also acceptable as long as it’s not too low or high.

  • Ultralytics documentation is slightly out of date, so some of the requested settings are not included. Try searching outside of the documentation!

  • Think about what you’re returning. Is it safe to assume that the code that will end up using your returned values has a check for None ? After all, the method signature promises to return a list of BoundingBox , not a list of BoundingBox | None .

  • Look at the definition of BoundingBox.create(), what do we want to return if the creation of a BoundingBox fails?

Task 2: Running the simulator

...

Your task is to implement the code in __init__() and run() to travel to and land at the designated waypoint if the drone is within self.acceptance_radius.

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.

Note

Bonus:

  • While the simulated drone will always successfully complete its movement, what if it was possible for the drone to halt at any time (without your input)? Does your code handle this case?

  • A real drone, unlike the simulation, might fail to halt on exactly top of a waypoint (due to wind and other external factors). Does your code handle this case?

...

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.

...