Attention
This is older information related to ROS2 Humble. Newer versions, such as Jazzy, are part of the ongoing versions of this tutorial.
Note
This section is optional, the ROS2 tutorial starts at ROS2 Installation.
Python Basics
- Installing Python on Ubuntu
- Editing Python source (with VS Code)
- Editing Python source (with PyCharm)
- (Murilo’s) Python Best Practices
- Terminology
- Use a
venv - Minimalist package: something to start with
- Minimalist script
- Running a Python script on the terminal
- When using
if __name__=="__main__":, just call the realmain() - It’s dangerous to go alone: Always wrap the contents of
mainfunction on a try–except block - Minimalist class: Use classes profusely
- Not a matter of taste: Code style
- Take the (type) hint: Always use type hints
- Document your code with Docstrings
- Unit tests: always test your code
- Python’s
asyncio - Making your Python package installable