Go to Post We are customers to FIRST. In that comes expectations. I don't want to hear another, "You should be grateful for everything FIRST does" nonsense when FIRST royally screws up. - MikeDubreuil [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 25-01-2013, 22:04
MoMo MoMo is offline
Registered User
FRC #1721
 
Join Date: Jan 2013
Location: Concord, NH
Posts: 18
MoMo will become famous soon enoughMoMo will become famous soon enough
C++ error first defined here and line Breakpoint

We tried to make a simple drive train code for mecanums, and after we got what we think is a good end result we still end up with a first defined here and a line breakpoint error. we are kinda new to programming this year and would like any help we can get. here is the command part where the error is showing up...

#include "DriveMotorCommand.h"
#include "stdio.h"
#include "math.h"



DriveMotorCommand:riveMotorCommand() {
// Use requires() here to declare subsystem dependencies
Requires(motorControlSubsystem);
}

// Called just before this Command runs the first time
void DriveMotorCommand::Initialize() {


}

// Called repeatedly when this Command is scheduled to run
void RobotDrive::MecanumDrive_Polar(float magnitude, float direction, float rotation)


{

static bool reported = false;
if (!reported)
{

}

// Normalized for full power along the Cartesian axes.
magnitude = Limit(magnitude) * sqrt(2.0);
// The rollers are at 45 degree angles.
double dirInRad = (direction + 45.0) * 3.14159 / 180.0;
double cosD = cos(dirInRad);
double sinD = sin(dirInRad);

double wheelSpeeds[kMaxNumberOfMotors];
wheelSpeeds[kFrontLeftMotor] = sinD * magnitude + rotation;
wheelSpeeds[kFrontRightMotor] = cosD * magnitude - rotation;
wheelSpeeds[kRearLeftMotor] = cosD * magnitude + rotation;
wheelSpeeds[kRearRightMotor] = sinD * magnitude - rotation;

Normalize(wheelSpeeds);

UINT8 syncGroup = 0x80;

m_frontLeftMotor->Set(wheelSpeeds[kFrontLeftMotor] * m_invertedMotors[kFrontLeftMotor] * m_maxOutput, syncGroup);
m_frontRightMotor->Set(wheelSpeeds[kFrontRightMotor] * m_invertedMotors[kFrontRightMotor] * m_maxOutput, syncGroup);
m_rearLeftMotor->Set(wheelSpeeds[kRearLeftMotor] * m_invertedMotors[kRearLeftMotor] * m_maxOutput, syncGroup);
m_rearRightMotor->Set(wheelSpeeds[kRearRightMotor] * m_invertedMotors[kRearRightMotor] * m_maxOutput, syncGroup);

CANJaguar::UpdateSyncGroup(syncGroup);

m_safetyHelper->Feed();

}

// Make this return true when this Command no longer needs to run execute()
bool DriveMotorCommand::IsFinished() {
return false;
}

// Called once after isFinished returns true
void DriveMotorCommand::End() {
motorControlSubsystem->Drive(0);

}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void DriveMotorCommand::Interrupted() {
}
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 14:44.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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