Jetson v2 is software written with the purpose of controlling Okon - an AUV built by KNR AUV team. The target platform is Nvidia Jetson Nano.
Software includes:
- API for comunication with GUI
- Simulation web API client
- API for comunicating with Okon's control module
- PID controller intended to use with simulation
- Autonomy logic based on: zed camera, darknet, attitude estimation
To kick off with Jetson, you should set up Conda environment and install internal dependencies(simulation, GUI).
-
Create Conda Environment and Install Dependencies
conda env create -f environment.yml
-
Activate Conda Environment
conda activate jetson
-
Activate Conda Environment
conda activate jetson
-
Update Conda Environment Dependencies
conda env update -f environment.yml --prune
Okon can operate with and without GUI. Nevertheless they are some common requirements:
- Download release 2.3 of Simulation
- Download release 1.0.2 of GUI
In both cases it is nessecary to launch simulation first, than you can launch main_GUI.py. After that, you should run GUI. GUI in networking settings should have control port: 65531 and stream port: 8090 to allow you to connect to simulation and GUI.
Launching jetson without running simulation will fail. If program can't establish connection with simulation or GUI please make sure that IP adresses are corect. If problem still occurs try disabling your firewall. If you have low performance PC it is recomended to launch simulation on another desktop in LAN.
App comunicates with Jetson using TCP sockets:
- video default port is 8090
- control default port is 8080
Both ports can be adjusted in settings.
All control packets consist of header and data. Header is defined in following way:
| Data length | Packet type |
|---|---|
| 4 bytes (uint32) | 1 byte |
TODO: describe stream header
- Request
0x01 - Steering
0x02 - Control
0x03 - Settings
0x04
Packet used for requesting data from jetson. Jetson should respond with appropriate data.
0x01PID request0x02config request - wtf?
Packet used for controlling jetson movement.
0x01pad data - int[5] - roll, pitch, yaw , forward, vertical0x02mode acro - sending this packet will change PID controller mode to acro0x03mode stable - sending this packet will change PID controller mode to stable
0x01arm0x02disarm0x03start autonomy0x04stop autonomy0x05start telemetry0x06start detector0x07stop detector0x08set motors int[6]
0x01PID - data is double[16] with pid values in order: roll, pitch,yaw, depth
- Telemetry
0x01 - Request responce
0x02 - Autonomy
0x03 - Status
0x04 - Setting
0x05
Packets for sending telemetry data.
0x01motors - float[6]0x02IMU - float[13], attitude, acc, gyro, mag, depth0x03movement info - float[9], position, velocity, acceleration0x04Battery
0x01PID -double[16] with pid values in order: roll, pitch,yaw, depth0x02arm confirm0x03disarm confirm
0x01detection0x02autonomy started0x03autonomy stoped0x04detector started0x05detector stoped
0x01loggs0x02sensor statur0x03task_manager0x04mode pc_simulation0x05mode jetson_stm0x06mode jetson_simulation
