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 heartbeat to Mission Control Protocol #261

Merged
merged 10 commits into from
Oct 10, 2023
Merged

Add heartbeat to Mission Control Protocol #261

merged 10 commits into from
Oct 10, 2023

Conversation

abhaybd
Copy link
Member

@abhaybd abhaybd commented Aug 23, 2023

This is a cleaned up version of functionality hacked together during CIRC 2023.

If the MC <-> Rover connection is severed (e.g. the cable disconnects) the disconnect handler isn't called, so the rover keeps running. This is unsafe behavior, since it might result in a runaway rover. We fix this by implementing a heartbeat in the websocket protocol. If enabled, then the rover will periodically ping MC and use pongs to feed a watchdog. If the watchdog starves, then the rover is E-stopped.

Note that this needs to be tested on the rover prior to being merged.

huttongrabiel
huttongrabiel previously approved these changes Sep 21, 2023
Copy link
Contributor

@huttongrabiel huttongrabiel left a comment

Choose a reason for hiding this comment

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

Here's the first review on this. I got sidetracked after doing this so I'll full review it again after this one.

src/utils/scheduler.h Outdated Show resolved Hide resolved
src/network/websocket/WebSocketServer.cpp Show resolved Hide resolved
src/utils/core.h Outdated Show resolved Hide resolved
src/utils/scheduler.h Outdated Show resolved Hide resolved
src/utils/scheduler.h Outdated Show resolved Hide resolved
src/network/websocket/WebSocketProtocol.h Show resolved Hide resolved
@huttongrabiel huttongrabiel dismissed their stale review September 21, 2023 17:48

Accidental approval

@abhaybd abhaybd merged commit eff6fd2 into master Oct 10, 2023
3 checks passed
@abhaybd abhaybd deleted the watchdog branch October 10, 2023 01:49
AyushKulk pushed a commit that referenced this pull request Oct 31, 2023
* Implement watchdog

* Use watchdog in MCP

* Address comments

* Update camera configs (#263)

* Update camera configs

* Add comment

* Report full attitude, fix lat/lon bug, report attitude even if no gps fix (#264)

* Report full attitude, fix lat/lon bug, report attitude even if no gps fix

* Address comments

* Format code

* Address comments
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