Log in

View Full Version : GetRawAxis() crashes robot code


XaoS
20-02-2016, 15:13
As part of the tests for our robots, we encountered a problem with the OI.

Every time we tried to get a value of axis of a joystick, using GetRawAxis(), GetAxis() or GetY(), our robot code just crashed (robot disabled and robot has no code for a second).

part of our OI.cpp file:

OI::OI()
{
this->st = new Joystick(0);
}
// mainStick functions
float OI::GetMainLeftY(){
return this->st->GetY();
}


What could be the problem?
Is there any solution?

Thanks,
#4590.

Joekachu
20-02-2016, 15:16
Are you putting a valid number in the GetRawAxis()? Eg. GetRawAxis(1)

cantdecide
20-02-2016, 18:14
Try creating a Joystick outside OI and in Robot, then try calling those functions. Does the problem still persist?