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

Add endpoint that follows mavlink2rest #29

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

patrickelectric
Copy link
Member

No description provided.

Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the idea, I made some considerations to improve it

src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/stats/mod.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
DATA.messages
.lock()
.unwrap()
.update(MAVLinkMessage { header, message });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.update(MAVLinkMessage { header, message });
.update(Arc::new(MAVLinkMessage { header, message }));

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the arc here ?

Copy link
Member

@joaoantoniocardoso joaoantoniocardoso Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need it (referring to using Arc here). I was trying to make the clone cheaper if we couldn't avoid them, but we can almost completely avoid them, making the clone only when inserting, not when updating.

src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some changes mainly to reduce the clones

src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
src/drivers/rest/data.rs Outdated Show resolved Hide resolved
DATA.messages
.lock()
.unwrap()
.update(MAVLinkMessage { header, message });
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso Oct 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need it (referring to using Arc here). I was trying to make the clone cheaper if we couldn't avoid them, but we can almost completely avoid them, making the clone only when inserting, not when updating.

Signed-off-by: Patrick José Pereira <[email protected]>
Create path for mavlink2rest

Signed-off-by: Patrick José Pereira <[email protected]>
Copy link
Member

@joaoantoniocardoso joaoantoniocardoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect!

@joaoantoniocardoso joaoantoniocardoso merged commit cb792cc into bluerobotics:master Oct 2, 2024
8 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.

2 participants