for the course UESTC3010: Team Design and Project Skills (TDPS)
IMPORTANT NOTICE: THIS IS A COURSE PROJECT. ANY USES OF THE CODE THAT MIGHT CONSTITUDE PLAGIARISM FOR EITHER THIS COURSE OR ANY OTHER COURSES ARE NOT ALLOWED.
Name | Group | Responsibility |
---|---|---|
ZHANG Keyu | Hardware | Team Leader / Hardware Group Manager |
LIANG Sidi | Vision | Project Manager / Vision Group Manager |
DIAN Mingqian | Control | Control Group Manager |
ZHANG Yuxin | Hardware | |
HUANG Yukun | Hardware | |
LIU Yicong | Hardware | |
LI Chenjun | Control | |
LIU Yi | Control | |
YU Yunke | Vision | |
SUN Qihao | Vision |
The modules contained in this repository are built by Liang Sidi and Yu Yunke.
Important Files:
- main.py
- messaging.py
- HCSR04
- __init__.py
- Navigation
- __init__.py
- odometer.py
The specified parameters for UART communication to the main control board are as follows:
- Baudrate: 115200
- Bits: 8
- Parity: None
- Stop: 1
The communication protocol involves the exchange of frames, each consisting of specific byte sequences. The frames convey different messages based on their content. The meanings of key byte sequences are explained below:
- 0xCC: Acknowledgment (ACK)
- 0xDD: Retransmission Request
The actual message content is structured as follows:
- Start Marker: 0xAA, 0x55
- Message Length
- Message Content (in JSON format)
- Send:
0xCD
- Receive:
0xAA
,0x55
,{length of message n}
,{message n}
,0xCC
(if correct) or0xDD
(if incorrect) - Send:
0xCC
(if correct) or0xDD
(if incorrect) - Receive:
0xAA
,0x55
,{length of message m}
,{message m}
,0xCC
(if correct) or0xDD
(if incorrect) - Send:
0xCC
(if correct) or0xDD
(if incorrect) - Repeat the sequence...
Sender | Receiver | Message Type | Byte Sequence | Note |
---|---|---|---|---|
Nav | Master | Control | 0xCD |
Initiates the communication |
Master | Nav | Data | 0xAA, 0x55, {length of message n}, {message n} |
- |
Nav | Master | Acknowledgment | 0xCC (0xDD if incorrect) |
- |
Master | Nav | Data | 0xAA, 0x55, {length of message m}, {message m} |
- |
Nav | Master | Acknowledgment | 0xCC (0xDD if incorrect) |
- |
Master | Nav | Control | 0xCD |
Initiates another round of communication |
Nav | Master | Data | 0xAA, 0x55, {length of message n+1}, {message n+1} |
- |
... | ... | ... | ... | ... |
The message content, ranging from the 4th byte onward, is expected to be in JSON format. Below are examples of the expected JSON structures for the OpenMV line-following section:
{
"Info_Task": 0,
"Info_Patio": 1,
"Info_Stage": 2,
"Control_Angle": 45,
"Control_Velocity": 10,
"Control_PID": 3,
"Control_Cam_Pitch": 1,
"Control_Ball": 0,
"Control_Comm": 1
}
{
"Info_Encoder_A": 123.45,
"Info_Encoder_B": 67.89,
"Info_Encoder_C": 101.23,
"Info_Encoder_D": 54.32,
"Info_Cam_Pitch": 1,
"Info_Ball": 0,
"Info_Comm": 1
}