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

Upload connector_version value #34

Merged
merged 3 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 3 additions & 2 deletions mir_connector/inorbit_mir_connector/src/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from .mir_api import MirWebSocketV2
from .mission import MirInorbitMissionTracking
from ..config.mir100_model import MiR100Config
from .. import __version__


# Available MiR states to select via actions
Expand Down Expand Up @@ -113,8 +114,8 @@ def _inorbit_command_handler(self, command_name, args, options):
- `metadata` is reserved for the future and will contains additional
information about the received command request.
"""
self._logger.info(f"Received '{command_name}'!. {args}")
if command_name == COMMAND_CUSTOM_COMMAND:
self._logger.info(f"Received '{command_name}'!. {args}")
if len(args) < 2:
self._logger.error("Invalid number of arguments: ", args)
options["result_function"](
Expand Down Expand Up @@ -194,7 +195,6 @@ def _inorbit_command_handler(self, command_name, args, options):
# Return '0' for success
options["result_function"]("0")
elif command_name == COMMAND_NAV_GOAL:
self._logger.info(f"Received '{command_name}'!. {args}")
pose = args[0]
self.send_waypoint_over_missions(pose)
elif command_name == COMMAND_MESSAGE:
Expand Down Expand Up @@ -264,6 +264,7 @@ def _execution_loop(self):
# publish key values
# TODO(Elvio): Move key values to a "values.py" and represent them with constants
key_values = {
"connector_version": __version__,
"battery percent": self.status["battery_percentage"],
"battery_time_remaining": self.status["battery_time_remaining"],
"uptime": self.status["uptime"],
Expand Down
2 changes: 2 additions & 0 deletions mir_connector/inorbit_mir_connector/tests/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from inorbit_mir_connector.src.mir_api import MirApiV2
from inorbit_mir_connector.src.connector import Mir100Connector
from inorbit_mir_connector.config.mir100_model import MiR100Config
from .. import __version__


@pytest.fixture
Expand Down Expand Up @@ -366,6 +367,7 @@ def run_loop_once():
)
assert connector._robot_session.publish_key_values.call_args == call(
{
"connector_version": __version__,
"battery percent": 93.5,
"battery_time_remaining": 89725,
"uptime": 3552693,
Expand Down
Loading