int main(void) { InitializeScreen(); /* Redirect all of std::cout to a curses complaint window */ toolbox::ncurses_stream redirector_cout(std::cout); #ifdef RT_PRIORITY SetProcessPriority(RT_PRIORITY); #endif /* Please check RoboticArtm_Config.h for number of joints*/ RoboArm = new RoboticArm(); /* Register a signal handler to exit gracefully */ signal(SIGINT, _cleanup); RoboArm->Init(); logger << "I: Press the arrow keys to control the robotic arm!" << std::endl << std::endl; for(;;) { /* Used for single line message */ char buffer[80]; /* First obtain the actual coordinates of the robot, to move it at will */ RoboArm->GetPosition(coordinates); /* Arrows will increase position by 1% increments in a x,y plane, uses curses library */ WaitKeyPress(coordinates); /* Command the robot to a new position once that coordinates was updated */ RoboArm->SetPosition(coordinates); sprintf(buffer, " x= %+3.4f | y= %+3.4f | z= %+3.4f", coordinates.x, coordinates.y, coordinates.z); logger << "I: Computed - " << buffer << std::endl; /* Updated coordinates and print it out */ RoboArm->GetPosition(coordinates); sprintf(buffer, " x= %+3.4f | y= %+3.4f | z= %+3.4f", coordinates.x, coordinates.y, coordinates.z); logger << "I: Measured - " << buffer << std::endl; } return EXIT_SUCCESS; }
int main() { //WaitKeyPress(3); RM_ThirdReader<RM_TR_ProcessingStagingThread> xReader( g_iProcessIndex, READER_MAX_RANDOM_SEGMENTS, READER_NUM_POOLTHREADS, READER_NUM_BUFFERED_SEGMENTS); xReader.Initialise(); xReader.ReadData(); xReader.Shutdown(); printf("WriterTransform done. Waiting key press... \n"); WaitKeyPress(3); return S_OK; }