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

Remove external_mower from field_friend #271

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
2 changes: 0 additions & 2 deletions field_friend/automations/implements/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from .external_mower import ExternalMower
from .implement import Implement
from .recorder import Recorder
from .tornado import Tornado
from .weeding_implement import ImplementException, WeedingImplement
from .weeding_screw import WeedingScrew

__all__ = [
'ExternalMower',
'Implement',
'ImplementException',
'Recorder',
Expand Down
74 changes: 0 additions & 74 deletions field_friend/automations/implements/external_mower.py

This file was deleted.

4 changes: 0 additions & 4 deletions field_friend/hardware/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from .axis import Axis
from .chain_axis import ChainAxis
from .double_wheels import DoubleWheelsHardware
from .external_mower import Mower, MowerHardware, MowerSimulation
from .field_friend import FieldFriend
from .field_friend_hardware import FieldFriendHardware
from .field_friend_simulation import FieldFriendSimulation
Expand All @@ -26,9 +25,6 @@
'FlashlightPWMSimulation',
'FlashlightPWMV2',
'FlashlightV2',
'Mower',
'MowerHardware',
'MowerSimulation',
'TeltonikaRouter',
'Tornado',
'TornadoHardware',
Expand Down
130 changes: 0 additions & 130 deletions field_friend/hardware/external_mower.py

This file was deleted.

3 changes: 0 additions & 3 deletions field_friend/hardware/field_friend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from .axis import Axis
from .chain_axis import ChainAxis
from .external_mower import Mower
from .flashlight import Flashlight
from .flashlight_pwm import FlashlightPWM
from .flashlight_v2 import FlashlightV2
Expand Down Expand Up @@ -32,7 +31,6 @@ def __init__(
flashlight: Flashlight | FlashlightV2 | FlashlightPWM | None,
y_axis: Axis | ChainAxis | None,
z_axis: Axis | Tornado | None,
mower: Mower | None,
imu: rosys.hardware.Imu | None,
estop: rosys.hardware.EStop,
bumper: rosys.hardware.Bumper | None,
Expand All @@ -45,7 +43,6 @@ def __init__(
self.flashlight = flashlight
self.y_axis = y_axis
self.z_axis = z_axis
self.mower = mower
self.imu = imu
self.estop = estop
self.bumper = bumper
Expand Down
28 changes: 2 additions & 26 deletions field_friend/hardware/field_friend_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from .can_open_master import CanOpenMasterHardware
from .chain_axis import ChainAxisHardware
from .double_wheels import DoubleWheelsHardware
from .external_mower import MowerHardware
from .field_friend import FieldFriend
from .flashlight import FlashlightHardware
from .flashlight_pwm import FlashlightPWMHardware
Expand Down Expand Up @@ -51,9 +50,6 @@ def __init__(self) -> None:
self.WORK_X = config_params['work_x_drill']
self.DRILL_RADIUS = config_params['drill_radius']
self.CHOP_RADIUS: float = config_params['chop_radius']
elif implement in ['mower']: # front mower for trees
self.WORK_X = 0.0
self.DRILL_RADIUS = 0.0
else:
raise NotImplementedError(f'Unknown FieldFriend implement: {implement}')

Expand Down Expand Up @@ -304,25 +300,6 @@ def __init__(self) -> None:
else:
raise NotImplementedError(f'Unknown z_axis version: {config_hardware["z_axis"]["version"]}')

mower: MowerHardware | None
if 'external_mower' in config_hardware:
mower = MowerHardware(robot_brain=robot_brain,
can=can,
name=config_hardware['external_mower']['name'],
m0_can_address=config_hardware['external_mower']['m0_can_address'],
m1_can_address=config_hardware['external_mower']['m1_can_address'],
m2_can_address=config_hardware['external_mower']['m2_can_address'],
m_per_tick=self.M_PER_TICK,
speed=config_hardware['external_mower']['speed'],
is_m0_reversed=config_hardware['external_mower']['is_m0_reversed'],
is_m1_reversed=config_hardware['external_mower']['is_m1_reversed'],
is_m2_reversed=config_hardware['external_mower']['is_m2_reversed'],
odrive_version=config_hardware['external_mower'][
'odrive_version'] if 'odrive_version' in config_hardware['external_mower'] else 4,
)
else:
mower = None

estop = rosys.hardware.EStopHardware(robot_brain,
name=config_hardware['estop']['name'],
pins=config_hardware['estop']['pins'],
Expand Down Expand Up @@ -422,10 +399,10 @@ def __init__(self) -> None:
self.status_control = None

safety: SafetyHardware = SafetyHardware(robot_brain, estop=estop, wheels=wheels, bumper=bumper,
y_axis=y_axis, z_axis=z_axis, flashlight=flashlight, mower=mower)
y_axis=y_axis, z_axis=z_axis, flashlight=flashlight)

modules = [bluetooth, can, wheels, serial, expander, can_open_master, y_axis,
z_axis, mower, flashlight, bms, estop, self.battery_control, bumper, imu, eyes, self.status_control, safety]
z_axis, flashlight, bms, estop, self.battery_control, bumper, imu, eyes, self.status_control, safety]
active_modules = [module for module in modules if module is not None]
super().__init__(implement_name=implement,
wheels=wheels,
Expand All @@ -436,7 +413,6 @@ def __init__(self) -> None:
bms=bms,
safety=safety,
flashlight=flashlight,
mower=mower,
imu=imu,
modules=active_modules,
robot_brain=robot_brain)
Expand Down
16 changes: 2 additions & 14 deletions field_friend/hardware/field_friend_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from .axis import AxisSimulation
from .chain_axis import ChainAxisSimulation
from .external_mower import MowerSimulation
from .field_friend import FieldFriend
from .flashlight import FlashlightSimulation
from .flashlight_pwm_v2 import FlashlightPWMSimulationV2
Expand Down Expand Up @@ -38,9 +37,6 @@ def __init__(self, robot_id) -> None:
self.WORK_X = config_params['work_x_drill']
self.DRILL_RADIUS = config_params['drill_radius']
self.CHOP_RADIUS = config_params['chop_radius']
elif tool in ['mower']:
self.WORK_X: float = 0.0
self.DRILL_RADIUS: float = 0.0
else:
raise NotImplementedError(f'Unknown FieldFriend tool: {tool}')
wheels = rosys.hardware.WheelsSimulation(self.WHEEL_DISTANCE)
Expand Down Expand Up @@ -77,12 +73,6 @@ def __init__(self, robot_id) -> None:
else:
raise NotImplementedError(f'Unknown Z-Axis version: {config_hardware["z_axis"]["version"]}')

mower: MowerSimulation | None
if 'external_mower' in config_hardware:
mower = MowerSimulation()
else:
mower = None

flashlight: FlashlightSimulation | FlashlightSimulationV2 | FlashlightPWMSimulationV2 | None
if config_hardware['flashlight']['version'] == 'flashlight':
flashlight = FlashlightSimulation()
Expand All @@ -107,16 +97,14 @@ def __init__(self, robot_id) -> None:

imu = ImuSimulation(wheels=wheels, roll_noise=0.0, pitch_noise=0.0, yaw_noise=0.0)
bms = rosys.hardware.BmsSimulation()
safety = SafetySimulation(wheels=wheels, estop=estop, y_axis=y_axis,
z_axis=z_axis, flashlight=flashlight, mower=mower)
modules = [wheels, y_axis, z_axis, flashlight, bumper, imu, bms, estop, safety, mower]
safety = SafetySimulation(wheels=wheels, estop=estop, y_axis=y_axis, z_axis=z_axis, flashlight=flashlight)
modules = [wheels, y_axis, z_axis, flashlight, bumper, imu, bms, estop, safety]
active_modules = [module for module in modules if module is not None]
super().__init__(implement_name=tool,
wheels=wheels,
flashlight=flashlight,
y_axis=y_axis,
z_axis=z_axis,
mower=mower,
estop=estop,
bumper=bumper,
imu=imu,
Expand Down
Loading