You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make the special sensor class for the Infrared Sensor include IR-SEEK #302
However the Infrared Sensor has only the one property: proximity. There is no support for the IR-SEEK mode within the special sensor class. You can of course use the sensor values directly if you read the sensor page: http://www.ev3dev.org/docs/sensors/lego-ev3-infrared-sensor/
This approach is less elegant than first class properties / methods on the special sensor class. It makes IR-SEEK harder for new people to discover and makes the code feel more manual.
Maybe we could add a method to call
This other problem I've noticed with the manual approach is that it's a bit buggy. It has errors sometimes when there is difficulty communicating with the sensor. If fires errors often enough that I've started wrapping calls in try: expect: blocks just in case (can happen when setting the mode too). If you run enough tests you'll see an error thrown too. I'm guessing there is a bit of protection built in with things like .proximity because I never see errors with them. So I'd like the elegance of adding IR-SEEK and the protection from errors that seems to happen with .proximity. :)
Yet again happy to let others drive, just putting in the feature request.
We have a helper class for working with remote control (unimaginatively named "RemoteControl"). It takes the RC channel number to work with upon construction. So may be it would be more natural to add the beacon methods to this class instead of the InfraredSensor. Or even create new class (IRBeacon?) for this.
Yeah there is no clear cut answer to where it fits best. I see your point that it uses both the IR sensor and remote, but I'll say I don't think we should touch RemoteControl. The IR-REMOTE mode is all digital and pretty different for users. I think users see RemoteControl like Button and adding in an analog sensor would be confusing (personally). I'm flexible if you feel otherwise. So personally I think the best options are:
Add it to InfraredSensor (lumps together IR-PROX and IR-SEEK modes)
Create a new special sensor class, called perhaps IRBeacon just for IR-SEEK mode
I think my vote is to add it to the existing InfraredSensor class. Just feels more consistent with the ColorSensor auto mode stuff. I'm happy InfraredSensor and RemoteControl are separate as IR-REMOTE mode is pretty different, but I think the IR-SEEK and IR-PROX modes are close enough that we can lump them together, much like ColorSensor lumps things together. Fewer classes keeps things simpler. Just my two cents on what I think is easiest for users. Obviously we could go the RemoteControl route or IRBeacon route if you prefer.
Activity
ddemidov commentedon Feb 13, 2017
We have a helper class for working with remote control (unimaginatively named "
RemoteControl"). It takes the RC channel number to work with upon construction. So may be it would be more natural to add the beacon methods to this class instead of theInfraredSensor. Or even create new class (IRBeacon?) for this.fisherds commentedon Feb 13, 2017
Yeah there is no clear cut answer to where it fits best. I see your point that it uses both the IR sensor and remote, but I'll say I don't think we should touch RemoteControl. The IR-REMOTE mode is all digital and pretty different for users. I think users see RemoteControl like Button and adding in an analog sensor would be confusing (personally). I'm flexible if you feel otherwise. So personally I think the best options are:
I think my vote is to add it to the existing InfraredSensor class. Just feels more consistent with the ColorSensor auto mode stuff. I'm happy InfraredSensor and RemoteControl are separate as IR-REMOTE mode is pretty different, but I think the IR-SEEK and IR-PROX modes are close enough that we can lump them together, much like ColorSensor lumps things together. Fewer classes keeps things simpler. Just my two cents on what I think is easiest for users. Obviously we could go the RemoteControl route or IRBeacon route if you prefer.
Implement BeaconSeeker class
Implement BeaconSeeker class (#311)
ddemidov commentedon Mar 23, 2017
Resolved by #311