you may want to check the example codes in your /player/example  directory. There are some kind of laser proxy usages that you may check.

Best,

Eyup


2008/2/18, TheChosenOne <thula@mohan-12.de>:

Hi,

I wrote a very simple laser obstacle avoidence. The robot is driving
forward, if there is a obstacle, he turns 90 deg.

The code looks like this:

#include <libplayerc++/playerc++.h>
#include <iostream>

int
main(int argc, char *argv[])
{
    using namespace PlayerCc;

    PlayerClient robot("localhost");
    Position2dProxy pp(&robot, 0);
    LaserProxy lp(&robot, 0);

for(;;) {

pp.SetMotorEnable (true);
  robot.Read();


   while(lp[270] > 0.40) {
        robot.Read();
        pp.SetSpeed(0.200, 0);
        usleep(3);
}
       robot.Read();
       pp.SetSpeed(0,dtor(90));
       usleep(3);
}
}

I now just use lp[180] (the front range) but how can I use a bundle of laser
ranges? Is there a command in player?

Regards.

-TM-
--
View this message in context: http://www.nabble.com/laser-obstacle-avoidence-tp15547064p15547064.html
Sent from the playerstage-users mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Playerstage-users mailing list
Playerstage-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/playerstage-users