From: Brandon S. <si...@sp...> - 2005-09-29 23:14:42
|
I have been trying for days to get our Segway RMP to accept position commands. Can anyone give me an example of the proper way to write a C++ Client to send commands to the segwayrmp driver? This is what I have: PlayerClient robot("localhost"); int check = 0; double turnrate = 20.0; if(robot.SetFrequency(1000)) printf("Frequency not set.\n"); if(robot.SetDataMode(PLAYER_DATAMODE_PUSH_ASYNC)) printf("Data Mode Not Set.\n"); /* Request access to the position interface. */ PositionProxy segway(&robot, 0, 'a'); /* Not sure if this has any effect, but it won't move. */ check = segway.SetStatus(PLAYER_POSITION_MOTOR_POWER_REQ, 1); if( check < 0) printf("Error Setting Motor State using SetStatus.\n"); check = segway.SetMotorState(1); if( check < 0) printf("Error Setting Motor State.\n"); check = segway.SetSpeed(0, DTOR(turn_speed)); if( check < 0) printf("Error setting segway speed!!!\n"); Thank you, Brandon |