main.cc

Go to the documentation of this file.
00001 #include <iostream>
00002 #include <stdio.h>
00003 #include <scorpion.h>
00004 #include <libplayerc++/playerc++.h>
00005 
00006 int
00007 main(int argc, char *argv[])
00008 {
00009    using namespace PlayerCc;
00010    timespec move_sleep = { 5, 0 };
00011    timespec turn_sleep = { 3, 0 };
00012    timespec stop_sleep = { 10, 0 };
00013 
00014    PlayerClient    robot("localhost");
00015    Position2dProxy pp(&robot, 0);
00016    IrProxy ir(&robot, 0);
00017 
00018    double turn_rate = -0.5;
00019    double move_speed = 0.020;
00020 
00021    while (1) {
00022       // read from the proxies
00023       robot.Read();
00024 
00025       printf("SCORPION_IR_BN_N (front) shows: %f\n", ir[SCORPION_IR_BN_N]);
00026       printf("SCORPION_IR_TE_NNW (right wheel) shows: %f\n", ir[SCORPION_IR_TE_NNW]);
00027       printf("SCORPION_IR_TW_NNE (left wheel) shows: %f\n", ir[SCORPION_IR_TW_NNE]);
00028       nanosleep(&turn_sleep, NULL);
00029    }
00030 }

Generated on Sat Jan 13 03:11:09 2007 for ERSP Player driver by  doxygen 1.5.1