-
Notifications
You must be signed in to change notification settings - Fork 1
Added handling methods through mavlink #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Michal-Mankowski
commented
Jun 8, 2025
- Listening loop that read uart for the messages from mavlink.
- Checks the message id and does corresponding action.
- Sends ack after every method.
@@ -28,6 +29,7 @@ constexpr auto KGPS_UART_baudrate = B115200; | |||
constexpr auto kSystemId = 1; | |||
constexpr auto kComponentId = 200; | |||
constexpr auto kTime = 1000; | |||
constexpr auto kBufferSize = 12; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
czemu akurat 12?
skoro masz dostępne MAVLINK_MAX_PACKET_LEN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spojrzałem ile bitów trzeba wysłać przed i po wiadomości no i jakiej długości jest największa wiadomość. Wyszło mi 12 z tych szybkich obliczeń.
auto bytes_read_opt = uart_->Read(kBufferSize); | ||
if (!bytes_read_opt.has_value()) { | ||
continue; | ||
} | ||
auto bytes_read = bytes_read_opt.value(); | ||
for (uint8_t byte : bytes_read) { | ||
if (mavlink_parse_char(MAVLINK_COMM_0, byte, &msg, &status)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skoro i tak to potem dzielisz na uint8, to moze odczytywać po 1 bajcie z uart?
} | ||
} | ||
|
||
void RadioApp::SendAck(uint8_t msgId, uint8_t msgSeq, uint8_t status) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zmien argumenty na enumy z simba mavlink, jak bedziesz mial nowa wersje