Example #1
0
void GameManager::setPlayerRunning(bool running)
{
	if (running == false) {
		resetSpeeds();
	}
	else if (running == true) {
		playerSpeed = 300.0f;
	}
}
Example #2
0
int HBridgeDriver::commandEmergencyStop(void) {
	for(int j=0; j < 10; j++) {
		int pindex = motorDrive[j][0];
		ppwms[pindex]->init(ppwms[pindex]->pin);
		ppwms[pindex]->setPWMPrescale(motorDrive[j][2]);
		ppwms[pindex]->setPWMResolution(motorDrive[j][3]);
		ppwms[pindex]->pwmOff();
	}
	fault_flag = 16;
	resetSpeeds();
	resetEncoders();
	return 1;
}
Example #3
0
void Robot::resetRobot()
{
    resetSpeeds();
    dBodySetLinearVel(chassis->body,0,0,0);
    dBodySetAngularVel(chassis->body,0,0,0);
    dBodySetLinearVel(dummy->body,0,0,0);
    dBodySetAngularVel(dummy->body,0,0,0);
    dBodySetLinearVel(kicker->box->body,0,0,0);
    dBodySetAngularVel(kicker->box->body,0,0,0);
    for (int i=0;i<4;i++)
    {
        dBodySetLinearVel(wheels[i]->cyl->body,0,0,0);
        dBodySetAngularVel(wheels[i]->cyl->body,0,0,0);
    }
    float x,y;
    getXY(x,y);
    setXY(x,y);
    if (m_dir==-1) setDir(180);
    else setDir(0);
}