Skip to content
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

SITL: add ELRS simulator #26663

Merged
merged 6 commits into from
Apr 22, 2024
Merged

SITL: add ELRS simulator #26663

merged 6 commits into from
Apr 22, 2024

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Apr 1, 2024

This adds a simulator for a ELRS radio running the mavlink-rc branch. Nothing clever, just a data rate limit and some buffers with reporting via the RADIO_STATUS mavlink message. It creates its own HAL SITL UART driver so all the usual commands for addresses and ports should still work. I have been testing with: -A --serial2=sim:ELRS:tcp:3 which allows you to connect tcp to 5763 (the same as normal for serial 2). You also have to set the serial baud to 460. Now runs its own little TCP server.

The goal is to have a limited data link for testing both AP and GCS. EG (#26098)

A real ELRS setup:
image

This PR:
image

This also improves the UART data rate limiting by tracking the fractional number of bytes remainder on each call.

@IamPete1 IamPete1 requested a review from peterbarker April 1, 2024 02:31
@andyp1per
Copy link
Collaborator

Very, very cool!

@IamPete1
Copy link
Member Author

IamPete1 commented Apr 1, 2024

Implemented a buffers and rate limits within the simulator rather than using changing the UART driver, that makes it more representative and is less invasive in the UART driver.

@IamPete1
Copy link
Member Author

Rebased, squashed and moved from using the SITL UART driver to running a little TCP interface, this makes the diff much smaller.

@tridge tridge merged commit 30fdae8 into ArduPilot:master Apr 22, 2024
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants