Quote:
Originally Posted by Fedoros
From what I've gathered, there are many, many different problems which could give this error.
|
In my experience, the NullPointerException is almost always caused by invoking an object's methods before initializing the object via the hardware map. The object might be a motor, servo, sensor, etc. -- anything that gets initialized via hardwareMap.get().
I think that's your problem here, too. The code that's not in a method (lines 49-131) is running as soon at the op mode is instantiated, which is BEFORE the opmode's "init" method is invoked. Since the "init" method initializes the robot via the hardware map, any command such as "robot.driveRight.setPower(right);" will throw a NPE.