Update of /cvsroot/playerstage/code/player/examples/libplayerc++
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19101/examples/libplayerc++
Modified Files:
laserobstacleavoid.cc
Log Message:
implemented min-left and min-right functionality in libplayerc and libplayerc++
Index: laserobstacleavoid.cc
===================================================================
RCS file:
/cvsroot/playerstage/code/player/examples/libplayerc++/laserobstacleavoid.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** laserobstacleavoid.cc 24 Oct 2007 22:32:03 -0000 1.6
--- laserobstacleavoid.cc 5 Dec 2007 21:43:50 -0000 1.7
***************
*** 37,58 ****
double newspeed = 0;
double newturnrate = 0;
- double minR = 1e9;
- double minL = 1e9;
// this blocks until new data comes; 10Hz by default
robot.Read();
// laser avoid (stolen from esben's java example)
- uint32_t count = lp.GetCount();
- for (uint32_t j=0; j < count/2; ++j)
- {
- if (minR > lp[j])
- minR = lp[j];
- }
- for (uint32_t j = count/2; j < count; ++j)
- {
- if (minL > lp[j])
- minL = lp[j];
- }
std::cout << "minR: " << minR
<< "minL: " << minL
--- 37,48 ----
double newspeed = 0;
double newturnrate = 0;
// this blocks until new data comes; 10Hz by default
robot.Read();
+ double minR = lp.GetMinRight();
+ double minL = lp.GetMinLeft();
+
// laser avoid (stolen from esben's java example)
std::cout << "minR: " << minR
<< "minL: " << minL
-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit