From 556b2894a1571dc1624457fe69742bddb1f08390 Mon Sep 17 00:00:00 2001 From: "Johannes T." <119115663+Johannes-Thiel@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:41:16 +0200 Subject: [PATCH] make a enable on startup param (#175) --- config/f15_config_f15/robotbrain.py | 3 ++- field_friend/hardware/field_friend_hardware.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/f15_config_f15/robotbrain.py b/config/f15_config_f15/robotbrain.py index 15e1d283..33b7e534 100644 --- a/config/f15_config_f15/robotbrain.py +++ b/config/f15_config_f15/robotbrain.py @@ -1,3 +1,4 @@ configuration = {'robot_brain': { - 'flash_params': ['orin', 'v05', 'nand'] + 'flash_params': ['orin', 'v05', 'nand'], + 'enable_esp_on_startup':False, }} \ No newline at end of file diff --git a/field_friend/hardware/field_friend_hardware.py b/field_friend/hardware/field_friend_hardware.py index b4fca00b..9849dde7 100644 --- a/field_friend/hardware/field_friend_hardware.py +++ b/field_friend/hardware/field_friend_hardware.py @@ -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'],