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

[MIR] Connection check for InOrbit MQTT #22

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mir_connector/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
*.egg-info/
*.egg
__pycache__/
Expand Down
4 changes: 4 additions & 0 deletions mir_connector/inorbit_mir_connector/src/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def start(self):
except Exception:
self.logger.exception("Error reporting mission")

def inorbit_connected(self):
"""Check if the InOrbit MQTT session is connected."""
return self.inorbit_sess.client.is_connected()
Copy link
Member

Choose a reason for hiding this comment

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

Not a fan of accessing RobotSession.client externally but can't think of another way. To keep in mind for future development of InOrbit Edge.


def stop(self):
"""Exit the Connector cleanly."""
self._should_run = False
Expand Down
Loading