Skip to content

Commit

Permalink
Fixed api commands stop and dock
Browse files Browse the repository at this point in the history
  • Loading branch information
EinEinfach committed May 22, 2024
1 parent 1433754 commit 90549a2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CaSSAndRA/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

#Version:0.113.0 Removed updating... message in browser
#Version:0.113.1 Fixed api commands stop and dock
# package imports
import os
import sys
Expand Down
27 changes: 13 additions & 14 deletions CaSSAndRA/src/backend/comm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,21 +293,20 @@ def perform_maps_cmd(self, buffer: dict) -> None:
logger.debug(f'{e}')

def perform_robot_cmd(self, buffer) -> None:
if 'value' in buffer:
allowed_values = ['mow', 'stop', 'dock']
try:
allowed_values = ['mow', 'stop', 'dock']
try:
if self.command == 'stop':
cmdlist.cmd_stop = True
elif self.command == 'dock':
cmdlist.cmd_dock = True
elif self.command == 'mow':
self.value = buffer['value'][0]
if self.command == 'mow':
self.perform_mow_cmd()
elif self.command == 'stop':
cmdlist.cmd_stop = True
elif self.command == 'dock':
cmdlist.cmd_dock = True
else:
logger.info(f'No valid command in api message found. Allowed values: {allowed_values}. Aborting')
except Exception as e:
logger.info(f'No valid value in api message found. Allowed values: {allowed_values}. Aborting')
logger.debug(f'{e}')
self.perform_mow_cmd()
else:
logger.info(f'No valid command in api message found. Allowed values: {allowed_values}. Aborting')
except Exception as e:
logger.info(f'No valid value in api message found. Allowed values: {allowed_values}. Aborting')
logger.debug(f'{e}')

def perform_mow_cmd(self) -> None:
allowed_values = ['resume', 'task', 'all', 'selection']
Expand Down
2 changes: 1 addition & 1 deletion CaSSAndRA/src/backend/data/appdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logging
logger = logging.getLogger(__name__)

version = '0.113.0'
version = '0.113.1'

0 comments on commit 90549a2

Please sign in to comment.