Make Unity look nice
Make PCB
Build
RC.c is current most up to date and working file.
Running PoseClient after starting the scene will run a test client
Up arrow and down arrow control trigger forward/backward in the XR sim
Trigger 0, 1, and 2 mean backward, still, and forward respectively.
TCP Listener (Server) is run from Unity
TCP Client (Client) is RC.c, or the RC executable
Make sure that inbound firewalls are open for Unity on the computer running it.
Connect to the Radxa access point from the server computer, and use ipconfig to find the IP that is used in RC.c.
wsl
gcc -o RC RC.c -lgpiod -lmraa -lpthread
./RC
Update IP or set IPV4 environment var and recompile before running
telnet [IPV4] 8080
Turn firewall off (?)
Turn on host wifi, "AP" is designated name of connection (https://docs.radxa.com/en/zero/zero3/radxa-os/ap <- Shell tab)
sudo nmcli connection up AP
FFMPEG video stream command (FFMPEG must be compiled and set up correctly before hand https://docs.radxa.com/en/zero/zero3/app-development/rtsp)
Old:
nohup ./mediamtx & sudo ffmpeg -fflags nobuffer -fflags discardcorrupt -flags low_delay -re -f v4l2 -i /dev/video0 -preset ultrafast -tune zerolatency -c:v hevc_rkmpp_encoder -omit_video_pes_length 1 -rc_mode 0 -r 30 -level 30 -f rtsp rtsp://10.42.0.1:8554/stream
New:
nohup ./mediamtx & sudo ffmpeg -fflags nobuffer -fflags discardcorrupt -flags low_delay -f v4l2 -input_format yuyv422 -video_size 1920x1080 -i /dev/video0 -preset ultrafast -tune zerolatency -c:v hevc_rkmpp_encoder -g 30 -pix_fmt yuv420p -omit_video_pes_length 1 -rc_mode 0 -r 30 -level 30 -f rtsp rtsp://10.42.0.1:8554/stream
nohup ./mediamtx & sudo ffmpeg -fflags nobuffer -fflags discardcorrupt -flags low_delay -re -f v4l2 -i /dev/video0 -preset ultrafast -tune zerolatency -c:v hevc_rkmpp_encoder -omit_video_pes_length 1 -rc_mode 0 -r 30 -level 30 -f rtsp rtsp://10.42.0.1:8554/stream
nohup ./mediamtx &
sudo ffmpeg -fflags nobuffer -fflags discardcorrupt -flags low_delay
-f v4l2 -input_format yuyv422 -video_size 1920x1080 -i /dev/video0
-preset ultrafast -tune zerolatency
-c:v hevc_rkmpp_encoder -g 30 -pix_fmt yuv420p -omit_video_pes_length 1 -rc_mode 0 -r 30 -level 30
-f rtsp rtsp://10.42.0.1:8554/stream
(10.42.0.1 (Direct) or 192.168.1.35)
FFPLAY (Client side, install FFMPEG through "choco install ffmpeg" in windows terminal [install chocolatey if needed])
ffplay -probesize 32 -analyzeduration 0 -sync ext -fflags nobuffer -fflags discardcorrupt -flags low_delay -tune zerolatency -flags2 fast -preset ultrafast -framedrop -avioflags direct -strict experimental -rtsp_transport udp rtsp://10.42.0.1:8554/stream
(10.42.0.1 (Direct) or 192.168.1.35)
Desktop switch
CLI: systemctl set-default multi-user.target.
GUI: systemctl set-default graphical.target
Compilation:
gcc -o [file] [file].c -lgpiod -lpthread -O3 -march=armv8.2-a -mtune=cortex-a55 -ffast-math -fomit-frame-pointer
sudo chrt -f 99 ./[file] taskset -c 3 ./your_program sudo chrt -f 99 taskset -c 3 nice -n -20 ionice -c 1 -n 0 ./your_program
Set CPU governor to perfomance & both min and max freq to 1.42GHz to avoid undefined behavior through cpufreq
sudo apt-get install cpufrequtils
sudo nano /etc/default/cpufrequtils
GOVERNOR="performance"
MIN_SPEED="1.42GHz"
MAX_SPEED="1.42GHz"
sudo systemctl enable cpufrequtils
sudo systemctl restart cpufrequtils
For motor testing:
- Go by wire colors
white is PWM
orange -> yellow is brake
expects 12V, freq from 4khz - 16khz, digital low is on, high is off. Full range pwm/
For servo:
Expects 5v, 20ms period (50hz), expects duty cycle from .5ms - 2.5ms
Camera setup: https://docs.radxa.com/en/zero/zero3/accessories/camera
External antenna: https://docs.radxa.com/en/zero/zero3/accessories/zero3w-antenna
GPIO usage: https://docs.radxa.com/en/zero/zero3/app-development/gpiod
MRAA usage: https://docs.radxa.com/en/zero/zero3/app-development/mraa
Getting started: https://docs.radxa.com/en/zero/zero3/getting-started