Thanks, this really helped me get started.
Here are my current build notes in case it helps anyone else. Note, I’m taking extra steps to avoid running code with sudo in my finished product, which may turn out to be a fool’s errand, but so far seems to be working. Second note, watch the ““ I tripped on them getting converted:
init raspbian OS with pi Imager
enable VNC and i2c
sudo raspi-config
Update and install prerequisites
sudo apt updatesudo apt upgradesudo apt install git python3-pip python3-setuptools python3-smbus
install robot-hat
cd ~/git clone -b v2.0 cd robot-hatsudo python3 setup.py install
install vilib
cd ~/git clone -b picamera2 cd vilibsudo python3 install.py
install picar-x
cd ~/git clone -b v2.0 --depth 1cd picar-xsudo python3 setup.py install
setup sound
cd ~/picar-xsudo bash i2samp.sh
calibrate
cd ~/picar-x/example/calibrationsudo python3 calibration.py
cd ~/picar-x/example/calibrationsudo python3 grayscale_calibration.py
increase swap
sudo apt install zram-toolssudo dphys-swapfile swapoffsudo nano /etc/dphys-swapfilesudo dphys-swapfile setupsudo dphys-swapfile swapon
install prerequisites
sudo apt install -y git colcon python3-rosdep2 vcstool wget python3-flake8-docstrings python3-pip python3-pytest-cov python3-flake8-blind-except python3-flake8-builtins python3-flake8-class-newline python3-flake8-comprehensions python3-flake8-deprecated python3-flake8-import-order python3-flake8-quotes python3-pytest-repeat python3-pytest-rerunfailures python3-vcstools libx11-dev libxrandr-dev libasio-dev libtinyxml2-dev
create directory
mkdir -p ~/ros2_jazzy/srccd ~/ros2_jazzy
vcs import --input https://raw.githubusercontent.com/ros2/ros2/jazzy/ros2.repos srcsudo rm /etc/ros/rosdep/sources.list.d/20-default.listsudo apt upgradesudo rosdep initrosdep updaterosdep install --from-paths src --ignore-src --rosdistro jazzy -y --skip-keys “fastcdr rti-connext-dds-6.0.1 urdfdom_headers python3-vcstool”colcon build --symlink-install --parallel-workers 8echo “source ~/ros2_jazzy/install/local_setup.bash” >> ~/.bashrcsource ~/.bashrc
fix sound without sudo
audio for /dev/snd/*
sudo usermod -aG audio $USER
video is often needed on Pi for some stacks; harmless to add
sudo usermod -aG video $USER
if your code touches GPIO/I²C, add these so you don’t need sudo for pins/bus
sudo usermod -aG gpio $USERsudo usermod -aG i2c $USER
allow user code to connect to pins
sudo systemctl enable --now pigpiod
ideally, I should track down what is starting aplay, probably vnc, but for now, just kill it on reboot, I run fix_sound.sh, which runs:
sudo systemctl stop aplay.servicesudo systemctl disable aplay.servicesudo systemctl mask aplay.serviceps -ef | grep aplaypactl list short sinks#pactl set-default-sink alsa_output.platform-soc_107c000000_sound.stereo-fallbackpinctrl set 20 op dh
Now I just need to to get to work on actually making it do something: GitHub - coreyt429/rover_ros2: Personal project to give picar-x an ROS2 brain.