Skip to content

Commit

Permalink
implement work_y
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes-Thiel committed Sep 9, 2024
1 parent fd54f8b commit c2c382c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/f15_config_f15/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'wheel_distance': 0.47,
'antenna_offset': 0.205,
'work_x': 0.147,
'work_y': 0.0,
'drill_radius': 0.025,
'tool': 'weed_screw',
}
3 changes: 2 additions & 1 deletion field_friend/automations/puncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ async def punch(self,
turns: float = 2.0,
with_open_tornado: bool = False,
) -> None:
y += self.field_friend.WORK_Y
self.log.info(f'Punching at {y} with depth {depth}...')
rest_position = 'reference'
if self.field_friend.y_axis is None or self.field_friend.z_axis is None:
Expand Down Expand Up @@ -120,7 +121,7 @@ async def clear_view(self) -> None:
await self.field_friend.y_axis.return_to_reference()
return
elif isinstance(self.field_friend.y_axis, Axis):
if isinstance(self.field_friend.z_axis,Axis):
if isinstance(self.field_friend.z_axis, Axis):
if self.field_friend.z_axis.position != 0:
await self.field_friend.z_axis.return_to_reference()
y = self.field_friend.y_axis.min_position if self.field_friend.y_axis.position <= 0 else self.field_friend.y_axis.max_position
Expand Down
1 change: 1 addition & 0 deletions field_friend/hardware/field_friend.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class FieldFriend(rosys.hardware.Robot):
WHEEL_DIAMETER = 0.041 * 17 / np.pi
M_PER_TICK = WHEEL_DIAMETER * np.pi / MOTOR_GEAR_RATIO
WORK_X = 0.118
WORK_Y = 0.0
DRILL_RADIUS = 0.025
CHOP_RADIUS = 0.07
WORK_X_CHOP = 0.04
Expand Down
5 changes: 4 additions & 1 deletion field_friend/hardware/field_friend_hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def __init__(self) -> None:
implement: str = config_params['tool']
if implement in ['tornado', 'weed_screw', 'none']:
self.WORK_X: float = config_params['work_x']
if 'work_y' in config_params:
self.WORK_Y: float = config_params['work_y']
self.DRILL_RADIUS: float = config_params['drill_radius']
elif implement in ['dual_mechanism']:
self.WORK_X_CHOP: float = config_params['work_x_chop']
Expand All @@ -59,7 +61,8 @@ def __init__(self) -> None:

communication = rosys.hardware.SerialCommunication()
if 'enable_esp_on_startup' in config_robotbrain['robot_brain']:
robot_brain = rosys.hardware.RobotBrain(communication,enable_esp_on_startup=config_robotbrain['robot_brain']['enable_esp_on_startup'])
robot_brain = rosys.hardware.RobotBrain(
communication, enable_esp_on_startup=config_robotbrain['robot_brain']['enable_esp_on_startup'])
else:
robot_brain = rosys.hardware.RobotBrain(communication)
robot_brain.lizard_firmware.flash_params += config_robotbrain['robot_brain']['flash_params']
Expand Down
2 changes: 2 additions & 0 deletions field_friend/hardware/field_friend_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def __init__(self, robot_id) -> None:
tool = config_params['tool']
if tool in ['tornado', 'weed_screw', 'none']:
self.WORK_X = config_params['work_x']
if 'work_y' in config_params:
self.WORK_Y = config_params['work_y']
self.DRILL_RADIUS = config_params['drill_radius']
elif tool in ['dual_mechanism']:
self.WORK_X_CHOP = config_params['work_x_chop']
Expand Down

0 comments on commit c2c382c

Please sign in to comment.