No. Your main class (Brain) is extending OpMode class which means it inherited everything the OpMode class has
http://ftckey.com/apis/ftc/com/qualc...de/OpMode.html. One of the fields that OpMode class has is a variable:
Code:
HardwareMap hardwareMap
So the hardwareMap is already created for you. If you want the RobotDrive class has access to it, you need to pass the hardwareMap to it through its constructor, like this:
Code:
public class Brain
{
...
private RobotDrive rd = new RobotDrive(hardwareMap);
}
public class RobotDrive
{
private HardwareMap rd_hardwareMap;
public RobotDrive(HardwareMap hardwareMap)
{
rd_hardwareMap = hardwareMap;
}
}