This shows you the differences between two versions of the page.
projects:farmrobot:step-by-step-example [2021/02/27 16:27] jason |
projects:farmrobot:step-by-step-example [2021/04/01 02:25] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Step-by-step example ====== | ||
- | |||
- | The step-by-step example goes through the whole process of setting up and using an [[https:// | ||
- | |||
- | ===== - Setting up the NVIDIA Jetson Xavier NX ===== | ||
- | |||
- | To set up the [[https:// | ||
- | |||
- | [[https:// | ||
- | |||
- | ===== - Plugging in I/O devices ===== | ||
- | |||
- | After the [[https:// | ||
- | |||
- | You will need the following devices: | ||
- | |||
- | * Display (over HDMI or DisplayPort) | ||
- | * USB keyboard | ||
- | * CSI or USB camera (In this example: [[https:// | ||
- | * Configured Arduino | ||
- | |||
- | ===== - Preparing the NVIDIA Jetson Xavier NX ===== | ||
- | |||
- | First, you may want to head over to the system settings to turn off the automatic screen saver and screen lock. It may cause problems when you build the [[https:// | ||
- | |||
- | After that, it is recommended to update all packages on the system with: | ||
- | |||
- | <file shell> | ||
- | sudo apt update; sudo apt upgrade -y | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | You can quickly open a new terminal on [[https:// | ||
- | </ | ||
- | |||
- | ===== - Checking I/O devices ===== | ||
- | |||
- | ==== - Checking camera ==== | ||
- | |||
- | First, list all current devices on the system with: | ||
- | |||
- | <file shell> | ||
- | la /dev | ||
- | </ | ||
- | |||
- | You should be able to see a '' | ||
- | |||
- | The [[https:// | ||
- | |||
- | In this example we assume that we have connected a [[https:// | ||
- | |||
- | To test a USB camera with the '' | ||
- | |||
- | <file shell> | ||
- | nvgstcapture-1.0 --camsrc=0 --cap-dev-node=0 | ||
- | </ | ||
- | |||
- | You should now be able to see the camera' | ||
- | |||
- | <WRAP info> | ||
- | Consult the repository' | ||
- | </ | ||
- | |||
- | Furthermore, | ||
- | |||
- | The '' | ||
- | |||
- | <file shell> | ||
- | sudo apt install -y v4l-utils | ||
- | </ | ||
- | |||
- | If the installation was successful, you can go ahead and use it: | ||
- | |||
- | <file shell> | ||
- | v4l2-ctl -d /dev/video0 --list-formats-ext | ||
- | </ | ||
- | |||
- | For the camera used in this example ([[https:// | ||
- | |||
- | < | ||
- | ioctl: VIDIOC_ENUM_FMT | ||
- | Index : 0 | ||
- | Type : Video Capture | ||
- | Pixel Format: ' | ||
- | Name : Motion-JPEG | ||
- | Size: Discrete 1600x1200 | ||
- | Interval: Discrete 0.067s (15.000 fps) | ||
- | Size: Discrete 3264x2448 | ||
- | Interval: Discrete 0.067s (15.000 fps) | ||
- | Size: Discrete 2592x1944 | ||
- | Interval: Discrete 0.067s (15.000 fps) | ||
- | Size: Discrete 2048x1536 | ||
- | Interval: Discrete 0.067s (15.000 fps) | ||
- | Size: Discrete 1280x960 | ||
- | Interval: Discrete 0.067s (15.000 fps) | ||
- | Size: Discrete 1024x768 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 800x600 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 640x480 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 329x240 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 1600x1200 | ||
- | Interval: Discrete 0.067s (15.000 fps) | ||
- | |||
- | Index : 1 | ||
- | Type : Video Capture | ||
- | Pixel Format: ' | ||
- | Name : YUYV 4:2:2 | ||
- | Size: Discrete 1600x1200 | ||
- | Interval: Discrete 0.100s (10.000 fps) | ||
- | Size: Discrete 3264x2448 | ||
- | Interval: Discrete 0.067s (2.000 fps) | ||
- | Size: Discrete 2592x1944 | ||
- | Interval: Discrete 0.333s (3.000 fps) | ||
- | Size: Discrete 2048x1536 | ||
- | Interval: Discrete 0.333s (3.000 fps) | ||
- | Size: Discrete 1280x960 | ||
- | Interval: Discrete 0.100s (10.000 fps) | ||
- | Size: Discrete 1024x768 | ||
- | Interval: Discrete 0.100s (10.000 fps) | ||
- | Size: Discrete 800x600 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 640x480 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 329x240 | ||
- | Interval: Discrete 0.067s (30.000 fps) | ||
- | Size: Discrete 1600x1200 | ||
- | Interval: Discrete 0.100s (10.000 fps) | ||
- | </ | ||
- | |||
- | ==== - Checking configured Arduino ==== | ||
- | |||
- | List all current devices on the system with: | ||
- | |||
- | <file shell> | ||
- | la /dev | ||
- | </ | ||
- | |||
- | You should be able to see a '' | ||
- | |||
- | ===== - Setting up our custom implementation of YOLOv5 ===== | ||
- | |||
- | First, clone the [[https:// | ||
- | |||
- | <file shell> | ||
- | git clone https:// | ||
- | </ | ||
- | |||
- | Then, change into the repository' | ||
- | |||
- | <file shell> | ||
- | cd farm-robot-yolov5 | ||
- | |||
- | git clone https:// | ||
- | </ | ||
- | |||
- | Once this is set up, you are theoretically ready to build the [[https:// | ||
- | |||
- | The repository comes with a '' | ||
- | |||
- | <file shell> | ||
- | cp default_config.toml config.toml | ||
- | </ | ||
- | |||
- | The '' | ||
- | |||
- | In the newly created '' | ||
- | |||
- | <file shell> | ||
- | v4l2src device=/ | ||
- | </ | ||
- | |||
- | <WRAP warn> | ||
- | It is important to replace the '' | ||
- | </ | ||
- | |||
- | The configured '' | ||
- | |||
- | <file toml> | ||
- | [yolov5] | ||
- | # Input source. | ||
- | source = " | ||
- | |||
- | ... | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | Consult the repository' | ||
- | </ | ||