void init( const std::string& hostname ) { // Initialize the actors if (JPG_IMAGE_OUTPUT == imageOutputFormat) { camera.setJPGDecodingEnabled(false); } // Connect std::cout << "Connecting..."; com.setAddress( hostname.c_str() ); com.connectToServer( true ); if( false == com.isConnected() ) { std::cout << std::endl << "Could not connect to " << com.address() << std::endl; #ifdef WIN32 std::cout << "Press any key to exit..." << std::endl; rec::robotino::api2::waitForKey(); #endif rec::robotino::api2::shutdown(); exit( 1 ); } else { std::cout << "success" << std::endl; } }
void init( const std::string& hostname) { // Initialize the actors motor1.setMotorNumber( 0 ); motor2.setMotorNumber( 1 ); motor3.setMotorNumber( 2 ); // Connect std::cout << "Connecting to "<< hostname << " ... " << std::endl; com.setAddress( hostname.c_str() ); com.connect(); odometry.set(0, 0, 0); std::cout << std::endl << "Connected" << std::endl; }