From 5ee3ebe7764d257fbe4837dd368fdf1f099bb825 Mon Sep 17 00:00:00 2001 From: WillB97 Date: Sun, 14 Jul 2024 22:26:36 +0100 Subject: [PATCH] Add a third reflectance sensor --- simulator/modules/sbot_interface/setup.py | 5 +++-- simulator/protos/SRObot.proto | 11 +++++++++-- simulator/protos/robot/ReflectanceSensor.proto | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/simulator/modules/sbot_interface/setup.py b/simulator/modules/sbot_interface/setup.py index 8b1dc22..e663b57 100644 --- a/simulator/modules/sbot_interface/setup.py +++ b/simulator/modules/sbot_interface/setup.py @@ -87,8 +87,9 @@ def setup_devices(log_level: int | str = logging.WARNING) -> SocketServer: MicroSwitch('front right bump sensor'), # pin 11 MicroSwitch('rear left bump sensor'), # pin 12 MicroSwitch('rear right bump sensor'), # pin 13 - ReflectanceSensor('reflectance sensor 1'), # pin A0 - ReflectanceSensor('reflectance sensor 2'), # pin A1 + ReflectanceSensor('left reflectance sensor'), # pin A0 + ReflectanceSensor('center reflectance sensor'), # pin A1 + ReflectanceSensor('right reflectance sensor'), # pin A2 ], asset_tag='Arduino1', ), diff --git a/simulator/protos/SRObot.proto b/simulator/protos/SRObot.proto index eb565fd..1970cbc 100755 --- a/simulator/protos/SRObot.proto +++ b/simulator/protos/SRObot.proto @@ -131,12 +131,19 @@ PROTO SRObot [ translation -0.12 -0.05 -0.008 } ReflectanceSensor { - name "reflectance sensor 1" + name "left reflectance sensor" translation 0.03 0.02 -0.03 + rotation 0 0 1 1.5708 } ReflectanceSensor { - name "reflectance sensor 2" + name "center reflectance sensor" + translation 0.03 0 -0.03 + rotation 0 0 1 1.5708 + } + ReflectanceSensor { + name "right reflectance sensor" translation 0.03 -0.02 -0.03 + rotation 0 0 1 1.5708 } BumpSensor { name "front left bump sensor" diff --git a/simulator/protos/robot/ReflectanceSensor.proto b/simulator/protos/robot/ReflectanceSensor.proto index 5ea6d06..14c33a4 100755 --- a/simulator/protos/robot/ReflectanceSensor.proto +++ b/simulator/protos/robot/ReflectanceSensor.proto @@ -27,7 +27,7 @@ PROTO ReflectanceSensor [ metalness 0 } geometry Box { - size 0.002 0.045 0.02 + size 0.002 0.045 0.015 } castShadows FALSE }