Fully (but not so fully) self driving Raspberry Pi car.
- Remote connections
- Reopen in container
- Run source /opt/ros/$ROS_DISTRO/setup.bash or . install/setup.bash
- Run ros2
- VSCODE ssh into rpi
- VSCODE reopen in container
- Run source /opt/ros/$ROS_DISTRO/setup.bash
- Run ros2
Update setup.py.
rosdep install -i --from-path src --rosdistro jazzy -y
colcon build --packages-select self_driving_pkg
source ./install/setup.bash
ros2 run self_driving_pkg motor_node ros2 topic pub /motor/cmd std_msgs/msg/String '{"data": "{"action": "move", "angle": 0, "speed": 70}"}
The goal is to effectively follow a line by supplying angle commands to a motor based on the results of a deep learning model for lane detection.
sudo apt update sudo apt install python3-virtualenv sudo chmod 666 /dev/i2c-1 virtualenv --version virtualenv -p python3 ./envx source ./envx/bin/activate touch ./envx/COLCON_IGNORE python3 -m pip install smbus2 export PYTHONPATH="/home/aqil/envx/lib/python3.12/site-packages" # NOTE ensure this is right for your system source /opt/ros/$ROS_DISTRO/setup.bash colcon build --packages-select self_driving_pkg source ./install/setup.bash ros2 run self_driving_pkg motor_node
Before running
- Ensure the power to motors is turned on
To test
- Open another terminal
- source /opt/ros/$ROS_DISTRO/setup.bash
- ros2 topic pub /motor/cmd std_msgs/msg/String "{data: '{"action": "move", "angle": 0, "speed": 70}'}"
- ros2 topic pub /motor/cmd std_msgs/msg/String "{data: '{"action": "move", "angle": 0, "speed": 0}'}" sudo apt install libgl1
- Open car utils
- Run camera.py