Closed shamlian closed 7 months ago
NOTE: you can shorten the touch handler any
operation. The not event.condition
can pulled out as such...
not event.condition and (self.touch_sensors.front_left or self.touch_sensors.front_right or self.touch_sensors.back_left or self.touch_sensors.back_right)
This will fail off the start for event.condition, not having extra checks will increase speed.
Good point. Would you agree that the two other checks on the value of any
in the elif
statements just below are redundant? I think if we make it to those elif
s, any
is guaranteed to be False
.
yes I was just looking at that too. agreed
All right, I'll be pushing a fix to the branch for this soon.
get_touch_sensors
is defined in theRobot
class to return four sensors, which doesn't make sense for Create 3. Someone should fix that.See original post by @shamlian in https://github.com/iRobotEducation/irobot-edu-python-sdk/issues/35#issuecomment-1889886568