Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   GetRawAxis() crashes robot code (http://www.chiefdelphi.com/forums/showthread.php?t=144236)

XaoS 02-20-2016 03:13 PM

GetRawAxis() crashes robot code
 
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:
Code:

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 02-20-2016 03:16 PM

Re: GetRawAxis() crashes robot code
 
Are you putting a valid number in the GetRawAxis()? Eg. GetRawAxis(1)

cantdecide 02-20-2016 06:14 PM

Re: GetRawAxis() crashes robot code
 
Try creating a Joystick outside OI and in Robot, then try calling those functions. Does the problem still persist?


All times are GMT -5. The time now is 09:20 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi