Skip to content

Commit

Permalink
Support set mow speed and goto speed over api
Browse files Browse the repository at this point in the history
  • Loading branch information
EinEinfach committed Aug 6, 2024
1 parent ac44cd5 commit 845a452
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 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.121.0 Robot shutdown and reboot over api possible
#Version:0.122.0 Mow speed and goto speed over api
# package imports
import os
import sys
Expand Down
8 changes: 7 additions & 1 deletion CaSSAndRA/src/backend/comm/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def check_maps_cmd(self, buffer: dict) -> None:
return

def check_robot_cmd(self, buffer: dict) -> None:
allowed_cmds = ['mow', 'stop', 'dock', 'move', 'reboot', 'shutdown']
allowed_cmds = ['mow', 'stop', 'dock', 'move', 'reboot', 'shutdown', 'set mow speed', 'set goto speed']
if 'command' in buffer:
command = [buffer['command']]
command = list(set(command).intersection(allowed_cmds))
Expand Down Expand Up @@ -337,6 +337,12 @@ def perform_robot_cmd(self, buffer) -> None:
cmdlist.cmd_reboot = True
elif self.command == 'shutdown':
cmdlist.cmd_shutdown = True
elif self.command == 'set mow speed':
robot.mowspeed_setpoint = buffer['value'][0]
cmdlist.cmd_changemowspeed = True
elif self.command == 'set goto speed':
robot.gotospeed_setpoint = buffer['value'][0]
cmdlist.cmd_changegotospeed = True
else:
logger.warning(f'No valid command in api message found. Aborting')
except Exception as e:
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.121.0'
version = '0.122.0'

0 comments on commit 845a452

Please sign in to comment.