Hi all,
We are trying to get our drive running...I know it is a little late. We keep getting the following error on the driverstation.
ERROR: Allocating module that is out of range or not found: Digital Module 2 ...in InitPWM() in C:/WindRiver/workspace/WPILib/PWM.cpp at line 36
We checked the code over and over, and all electrical connections. We opened up the imaging utility and the module status does say ok and the module is green. The digital module is plugged into module 2 on the 4 slot crio. The code uploads fine, and the status light is blinking normally until we run the code. Then the 5V indicator on the digital sidecar and the status light both go out when we enable the robot.
Our robot code is written in C++ using the Command Based model. We've debugged and checked that the default DriveCommand is executing and calling the correct tank drive method with values from the joysticks. Here's the initialization code for the DriveTrain please let us know if you spot anything that could be wrong. It was generated with RobotBuilder.
Code:
void RobotMap::init() {
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
driveSubsystemSpeedController1 = new Victor(2, 1);
lw->AddActuator("DriveSubsystem", "Speed Controller 1", (Victor*) driveSubsystemSpeedController1);
driveSubsystemSpeedController2 = new Victor(2, 2);
lw->AddActuator("DriveSubsystem", "Speed Controller 2", (Victor*) driveSubsystemSpeedController2);
driveSubsystemSpeedController3 = new Victor(2, 3);
lw->AddActuator("DriveSubsystem", "Speed Controller 3", (Victor*) driveSubsystemSpeedController3);
driveSubsystemSpeedController4 = new Victor(2, 4);
lw->AddActuator("DriveSubsystem", "Speed Controller 4", (Victor*) driveSubsystemSpeedController4);
driveSubsystemRobotDriveMecanum = new RobotDrive(driveSubsystemSpeedController1, driveSubsystemSpeedController2,
driveSubsystemSpeedController3, driveSubsystemSpeedController4);
// RobotBuilder generated driveSubsystemRobotDriveMecanum->SetSafetyEnabled(true);
driveSubsystemRobotDriveMecanum->SetSafetyEnabled(false);
driveSubsystemRobotDriveMecanum->SetExpiration(0.1);
driveSubsystemRobotDriveMecanum->SetSensitivity(0.5);
driveSubsystemRobotDriveMecanum->SetMaxOutput(1.0);
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
}
Here's the code in the Drive Subsystem that calls tank drive:
Code:
void DriveSubsystem::TankDrive(float left, float right)
{
printf("DriveSubSystem::TankDrive->left = %f, right = %f\n", left, right);
robotDriveMecanum->TankDrive(left, right);
}
Thanks,
Team 3950