3

Is there a way to get the distance and the direction of the nearest detected obstacle?

I have tried with this "Navigation/AvoidanceNavigator/ObstacleDetected" event, but it never triggers event if I position the robot next to the wall and tell him to go 5 meters long in the wall direction.

stefan.stt
  • 2,357
  • 5
  • 24
  • 47

2 Answers2

2

There's no API for the "nearest obstacle, but the ALMotion/MoveFailed event may be what you want - it will tell you where the obstacle is and why it failed.

Emile
  • 2,946
  • 2
  • 19
  • 22
1

During navigation you can use the ObstacleDetected event to notify you of obstacles. The position i given in robotframe. You will get the x,y coordinates so you will have to calculate distance yourself.

Anders_K
  • 982
  • 9
  • 28
  • The problem is that event does not work for my robot, or at all, don't know. I have subscribed to it as I have subscribed to all other events I use, but this one and the other from the Navigation simply never raise. – stefan.stt Jan 10 '18 at 09:34
  • hm, have you tested the status first? http://doc.aldebaran.com/2-5/naoqi/motion/alnavigation-api.html#Navigation/AvoidanceNavigator/Status – Anders_K Jan 10 '18 at 10:30
  • Yes, same problem with this event. Actually none of the 'Navigation/AvoidanceNavigator' events works with my robot. – stefan.stt Jan 10 '18 at 10:43
  • 1
    Unless you can find some working code sample, I think you should create a support ticket. You could ask for some guidelines of how to use the events. I haven't used them myself so I don't know what might be wrong. – Anders_K Jan 10 '18 at 11:16
  • I am using events all the time so I think this is problem not with the way I use/define/listen events, but the events of the 'Navigation/AvoidanceNavigator'. Maybe I really should create a support ticket. – stefan.stt Jan 10 '18 at 11:29
  • 1
    Just so I don't misunderstand you; I was not accusing you of using the events wrong ;-) There could be a bug in the navigation API. – Anders_K Jan 11 '18 at 10:27