Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris committed Jan 28, 2025
1 parent 74fdeeb commit 2705bd0
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 deletions.
5 changes: 3 additions & 2 deletions communicator/communicator_raw.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import time
import threading
import time

import mygpio as pigpio
# import mygpio as pigpio
import pigpio

from controller.sjoel_controller_base import MovementDirection
from settings.raw_controls_settings import RawControlsSettings
Expand Down
2 changes: 1 addition & 1 deletion joystick/sjoel_joystick_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pigpio

from controller.sjoel_controller_base import SjoelControllerBase, MovementDirection
from settings.joystick_settings import JoystickSettings, PullDirection
from settings.joystick_settings import JoystickSettings


class SjoelJoystickSimple:
Expand Down
8 changes: 3 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import argparse
import time

from communicator.communicator_raw import CommunicatorRaw
from controller.sjoel_controller_raw import SjoelControllerRaw
from joystick.sjoel_joystick_simple import SjoelJoystickSimple
from server.sjoel_server_socket import SjoelServerSocket
from settings.device_settings import DeviceSettings
from settings.hosting_settings import HostingSettings
from communicator.communicator_raw import CommunicatorRaw
from controller.sjoel_controller_raw import SjoelControllerRaw


def parse_hosting_settings() -> HostingSettings:
Expand All @@ -15,13 +15,11 @@ def parse_hosting_settings() -> HostingSettings:
parser.add_argument('--interface', default='0.0.0.0', type=str,
help='Override interface to listen on, default: 0.0.0.0')
parser.add_argument('--port', default=5000, type=int, help='Override port to listen on, default: 5000')
parser.add_argument('--serial', type=str, help='Override the serial port the robot is connected to')
parser.add_argument('--baud', type=int, help='Override the baud rate of the serial connection')
parser.add_argument('--debug', help='Enables debug logging', action='store_true')
parser.add_argument('--mock', help='Enables the mock controller', action='store_true')
args = parser.parse_args()

return HostingSettings(args.config, args.interface, args.port, args.debug, args.mock, args.serial, args.baud)
return HostingSettings(args.config, args.interface, args.port, args.debug, args.mock)


def create_app(config: HostingSettings | None = None):
Expand Down
2 changes: 1 addition & 1 deletion mygpio/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .pi import OUTPUT, INPUT
from .pi import pi
from .pi import OUTPUT, INPUT
3 changes: 0 additions & 3 deletions settings/device_settings.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import enum

import toml
from pydantic import BaseModel

from settings.gcode_settings import GcodeSettings
from settings.joystick_settings import JoystickSettings
from settings.raw_controls_settings import RawControlsSettings

Expand Down
2 changes: 1 addition & 1 deletion shutdown_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import time
import os
import threading
import time


class ShutdownHelper:
Expand Down

0 comments on commit 2705bd0

Please sign in to comment.