Skip to content

Commit

Permalink
Merge branch 'main' into reference_distance_warning
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasBaecker committed Sep 6, 2024
2 parents 8dfe43e + e04b839 commit 09cab04
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion config/f15_config_f15/robotbrain.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
configuration = {'robot_brain': {
'flash_params': ['orin', 'v05', 'nand']
'flash_params': ['orin', 'v05', 'nand'],
'enable_esp_on_startup':False,
}}
2 changes: 1 addition & 1 deletion field_friend/hardware/axis_D1.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ async def stop(self):

async def move_to(self, position: float, speed: int | None = None) -> None:
if self.is_referenced:
await self.robot_brain.send(f'{self.name}_motor.profile_position({self.compute_steps(position)});')
await self.robot_brain.send(f'{self.name}_motor.profile_position({self._compute_steps(position)});')
if not self.is_referenced:
self.log.error(f'AxisD1 {self.name} is not refernced')
return
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 @@ -58,7 +58,10 @@ def __init__(self) -> None:
raise NotImplementedError(f'Unknown FieldFriend implement: {implement}')

communication = rosys.hardware.SerialCommunication()
robot_brain = rosys.hardware.RobotBrain(communication)
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'])
else:
robot_brain = rosys.hardware.RobotBrain(communication)
robot_brain.lizard_firmware.flash_params += config_robotbrain['robot_brain']['flash_params']
bluetooth = rosys.hardware.BluetoothHardware(robot_brain,
name=config_hardware['bluetooth']['name'],
Expand Down
6 changes: 3 additions & 3 deletions field_friend/hardware/safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def __init__(self, robot_brain: rosys.hardware.RobotBrain, *,
for name in estop.pins:
lizard_code += f'when estop_{name}.level == 0 then stop(); end\n'
if isinstance(bumper, rosys.hardware.BumperHardware):
lizard_code += 'when ' + \
' or '.join(f'{bumper.name}_{pin}.level == 1' for pin in bumper.pins) + \
f' then {wheels.name}.off(); end\n'
for name in bumper.pins:
lizard_code += f'bumper_{name}.level = 0\n'
lizard_code += f'when bumper_{name}.level == 1 then stop(); end\n'

# implement stop call for "ground check" reference sensors
if isinstance(y_axis, ChainAxisHardware):
Expand Down
4 changes: 2 additions & 2 deletions field_friend/interface/components/camera_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ def build_svg_for_implement(self) -> str:
def build_svg_for_plant_provider(self) -> str:
if self.camera is None or self.camera.calibration is None:
return ''
position = rosys.geometry.Point(x=self.camera.calibration.extrinsics.translation[0],
y=self.camera.calibration.extrinsics.translation[1])
position = rosys.geometry.Point3d(x=self.camera.calibration.extrinsics.translation[0],
y=self.camera.calibration.extrinsics.translation[1])
svg = ''
for plant in self.plant_provider.get_relevant_weeds(position):
position_3d = rosys.geometry.Point3d(x=plant.position.x, y=plant.position.y, z=0)
Expand Down
2 changes: 1 addition & 1 deletion field_friend/interface/components/plant_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, plant_provider: PlantProvider, weed_category_names: list[str]
self.plant_provider.PLANTS_CHANGED.register_ui(self.update)

def update(self) -> None:
origin = rosys.geometry.Point(x=0, y=0)
origin = rosys.geometry.Point3d(x=0, y=0, z=0)
in_world = {p.id: p for p in
self.plant_provider.get_relevant_weeds(origin, max_distance=1000) +
self.plant_provider.get_relevant_crops(origin, max_distance=1000)}
Expand Down

0 comments on commit 09cab04

Please sign in to comment.