How many foot bumper could we use ?
In the following documentation it's written there are 4 foot bumper (2 per foot) :
And in the launch trigger conditions I use to write :
('LeftBumperPressed' == 1) && ('Launchpad/PreviousActivity'...
('RightBumperPressed' == 1) && ('Launchpad/PreviousActivity'...
How to use specific one of the both right/left foot bumper, in such a case ?
if you want to use specific right or left then you have to read the sensor value which name is in the doc.
The events that you use are for each foot global. If the right or left sensor is pressed on say the left foot then the LeftBumperPressed will fire.
There is no event for the specific right left sensors, but you can create one name it, subscribe to it and then use it as you use the LeftBumperPressed event.
Another way is to program a python script that will check for the sensor signal, a very short and simple example:
memory = ALProxy("ALMemory")
while memory.getData("Device/SubDeviceList/LFoot/Bumper/Right/Sensor/Value") < 0.5:
This small script polls the sensor value every half second and if the sensor is pressed the onStopped output is fired.
Thank you very much Fabio. I will try to do such a python script.
But, if I want to use the right Sensor of the left foot to launch my behaviour, is it really possible ? (in order to have 4 foor trigger in total to launch my programm).
From now, tu launch a behavior I use two different way :
- in a collaborative dialog (to launch the behaviour if NAO has got bleu eyes) :
I'm note sure if my explanation/request is clear to undertand.
concretely it's very difficult to activate only one side of one bumper, so a nice test to do is:
if( "Device/SubDeviceList/LFoot/Bumper/Right/Sensor/Value" or "Device/SubDeviceList/LFoot/Bumper/Left/Sensor/Value" ):
say( "someone press my left foot"
Conclusion: it's as there's only one logical bumper per foot.