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.
0x01
PID request0x02
config request - wtf?
Packet used for controlling jetson movement.
0x01
pad data - int[5] - roll, pitch, yaw , forward, vertical0x02
mode acro - sending this packet will change PID controller mode to acro0x03
mode stable - sending this packet will change PID controller mode to stable
0x01
arm0x02
disarm0x03
start autonomy0x04
stop autonomy0x05
start telemetry0x06
start detector0x07
stop detector0x08
set motors int[6]
0x01
PID - 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.
0x01
motors - float[6]0x02
IMU - float[13], attitude, acc, gyro, mag, depth0x03
movement info - float[9], position, velocity, acceleration0x04
Battery
0x01
PID -double[16] with pid values in order: roll, pitch,yaw, depth0x02
arm confirm0x03
disarm confirm
0x01
detection0x02
autonomy started0x03
autonomy stoped0x04
detector started0x05
detector stoped
0x01
loggs0x02
sensor statur0x03
task_manager0x04
mode pc_simulation0x05
mode jetson_stm0x06
mode jetson_simulation