Jetson 26 Introduction to Main Program Architecture

From Waveshare Wiki
Jump to: navigation, search

Introduction to Main Program Architecture

File Structure and Functionality Introduction

  • ugv_jetson
    • [file folder] media (README.MD)
    • [file folder] models (pre-training model)]
    • [file folder] sounds (Used to store audio files, where voice packs can be configured)
    • [file folder] templates (The information, photos and videos related to the web application also store in this source)
    • [file folder] tutorial_cn (Interactive tutorial in Chinese)
    • [file folder] tutorial_en (Interactive tutorial in English)
    • LICENSE (GPL-3.0 open-source tutorial)
    • app.py (main demo, including webRTC, web-socket and flask related functions)
    • asound.conf (sound card config file)
    • audio_ctrl.py (Audio function related libraries)
    • autorun.sh (Configure the product master and jupyterlab boot autorun scripts)
    • base_camera.py (flask real-time video of the underlying multi-threaded capture library, the original project for flask-video-streaming)
    • base_ctrl.py (the library to communicate with the slave, communicate with the slave through the serial port)
    • config.yaml (Configuration file to configure some parameters)
    • cv_ctrl.py (the related OpenCV functions)
    • os_info.py (for obtaining system information)
    • requirements.txt (python project dependency library)
    • setup.sh (auto-installation script)
    • start_jupyter.sh (enable jupyterlab server)
    • sunny (sunny-ngrok demo)

Install Script

There is a file named setup.sh in the project folder, written in a shell, that helps to automatically configure the robotics product's uploader, including setting up the serial port, setting up the camera, creating the project's virtual environment, and installing dependency libraries. All these steps are already configured in the image on the SD card we shipped.

Installation script usage, the installation process needs to download and install a lot of dependent libraries from the network, for areas with special network environment we recommend you to use the method of downloading the image file directly from our official website to install the product.

setup.sh should run with root permission.

cd ugv_jetson/
sudo chmod +x setup.sh
sudo ./setup.sh


Auto-running Demo

autorun.sh in the project folder is used to configure the product main program (app.py) and jupyterlab (start_jupyter.sh) to autorun on power-up (as user instead of root), as well as to generate the configuration file for jupyterlab.

autorun.sh should run with user permission.

sudo chmod +x autorun.sh ./autorun.sh


Update Project

This project will be updated for a long time, when you need to update it, just navigate to the project folder and use the git pull command to update it, note that this operation will replace the changes you made before, after updating it, you need to change the parameters in config.yaml, set the type of the chassis and the type of the module, and you can also use the command line tool in the WEB control interface to configure the type of the product.


cd ugv_jetson/
git pull

After restarting the device, open the WEB control interface and enter the command used to set the product type, for example: s 20

The first digit 2 represents chassis type, the second digit 0 represents no module or PTZ module.

The first digit:

  • 1: RaspRover
  • 2: UGV Rover
  • 3: UGV Beast

The second digit:

  • 0: None/PT
  • 1: RoArm
  • 2: Pan-Tilt

This configuration needs to be configured only once after an update or reinstallation and will be saved in config.yaml.

Open-source Project

This project is open source under the GPL-3.0 agreement , you can realize your project according to our project, we will also continue to update more features.

Project address: https://github.com/waveshareteam/ugv_jetson