Week | Main Topic | Sub Topic(s) |
---|---|---|
Day 1 | Intro | Introduction to Robotics, Introduction to ROS2 |
Day 2 | Computer Vision | Computer Vision, Project |
Day 3 | LiDAR | LiDAR, Project |
Day 4-5 | Workshop & Project |
Planning: link
Repository: https://github.com/PXLAIRobotics/ROS2JazzyDocker
Invite link: https://discord.gg/Nnt9ps3h
- 01 - Introduction to ROS
- 02 - ROS Concepts
- 03 - ROS: Publisher Subscriber
- 04 - Simulation Environments
- Start the gazebo sim
gz sim
...and start the Prius on Sonoma Raceway world.
- Create a ROS bridge for the
/cmd_vel
topic
ros2 run ros_gz_bridge parameter_bridge /cmd_vel@geometry_msgs/msg/Twist@gz.msgs.Twist
-
Create a Teleop Node that allows you to control the Prius using keyboard inputs.
-
Always remember to rebuild and source each time you change anything:
clean_and_rebuild_ros2_workspace
If that does not work, you can do it manually:
colcon build
source install/setup.bash
- Go nuts
- Start the gazebo sim
gz sim
...and start the Prius on Sonoma Raceway world.
- Create a ROS bridge for the
/front_camera
topic
ros2 run ros_gz_bridge parameter_bridge /front_camera@sensor_msgs/msg/Image@gz.msgs.Image
- Create a vision_controller package:
cd ~/Projects/ros2_workspace/src
ros2 pkg create --build-type ament_python vision_controller --dependencies rclpy image_transport cv_bridge sensor_msgs std_msgs opencv2
-
Add the
src/process_front_camera.py
script -
Always remember to rebuild and source each time you change anything:
clean_and_rebuild_ros2_workspace
If that does not work, you can do it manually:
colcon build
source install/setup.bash
- Drive autonomously along the racetrack. Use the Example OpenCV code for inspiration.
It's recommended to use a Miro board for your business idea (https://miro.com/) to collaborate easily.
Technology path
You can show code examples, but limit it to the most relevant sections, i.e.:
- Usage of a canny edge detector
- Contour detection
Focus on visuals, i.e:
- Screenshots or video of the results of computer vision transformations
- Live demo of the car driving
- ...
Innovation path
- Use the AI Business model canvas as a starting point, but you can convert it into a presentation. Your choice. Make it a striking presentation!
How to get an overview of all gazebo topics:
gz topic -l
Then you can use a ROS-Gazebo bridge for whatever topic you need.
ros2 run package_1 publisher
output:
Package 'package_1' not found
Solution: You forgot to...
cd ~/Projects/ros2_workspace
colcon build
source install/setup.bash
ros2 run package_1 subscriber
output:
No executable found
Solution: You forgot to add subscriber to setup.py
.
colcon build
output:
Summary: 0 packages finished [0.97s] 1 package failed: package_1 1 package aborted: example_package 1 package had stderr output: package_1 Command '['/usr/bin/python3', '-c', 'import sys;from contextlib import suppress;exec("with suppress(ImportError): from setuptools.extern.packaging.specifiers import SpecifierSet");exec("with suppress(ImportError): from packaging.specifiers import SpecifierSet");from distutils.core import run_setup;dist = run_setup( 'setup.py', script_args=('--dry-run',), stop_after='config');skip_keys = ('cmdclass', 'distclass', 'ext_modules', 'metadata');data = { key: value for key, value in dist.dict.items() if ( not key.startswith('_') and not callable(value) and key not in skip_keys and key not in dist.display_option_names )};data['metadata'] = { k: v for k, v in dist.metadata.dict.items() if k not in ('license_files', 'provides_extras')};sys.stdout.buffer.write(repr(data).encode('utf-8'))']' returned non-zero exit status 1.
Solution: You forgot a comma in your setup.py
file
Create a .wslconfig file in this location:
C:\Users\<UserName>\.wslconfig
Open the created .wslconfig file (with Notepad or VSCode), change your preferred memory usage for the container and number of logical processors:
Note
The default settings for WSL are:
- Memory: 50% of total memory on Windows.
- Processors: The same number of logical processors on Windows.
So to increase performance you want to set this to the maximum number of logical processors and more than 50% of the memory on your host device, otherwise the container will get less resources than before.
[wsl2]
memory=16GB
processors=8
Shutdown WSL in a terminal window:
wsl --shutdown
Restart Docker desktop.
Start the container again.
You can check if it works by entering docker stats
in a terminal window.