예제 #1
0
//--------------------------------------------------------------------------
// SignalHandler - Try to free up things like servos if we abort.
//--------------------------------------------------------------------------
void SignalHandler(int sig){
    printf("Caught signal %d\n", sig);

    // Stop motors if they are active
    if (g_fArmActive)
		PutArmToSleep();
    command.end();	// tell the commander to release stuff...

   exit(1); 

}
예제 #2
0
//--------------------------------------------------------------------------
// SignalHandler - Try to free up things like servos if we abort.
//--------------------------------------------------------------------------
void SignalHandler(int sig){
    printf("Caught signal %d\n", sig);

    // Stop motors if they are active
    if (g_fRoverActive) {
        g_MotorsDriver.RDrive(0);
        g_MotorsDriver.LDrive(0);
    }

#ifdef BBB_SERVO_SUPPORT
    printf("Free Servos\n");
    for (int i=0; i < sizeof(g_aServos)/sizeof(g_aServos[0]); i++) {
        g_aServos[i]->Disable();
    }
#endif
    command.end();	// tell the commander to release stuff...

   exit(1);

}