Added TankDrive.h
This commit is contained in:
parent
949b53c98f
commit
8c9803a35b
@ -2319,3 +2319,38 @@ java.io.IOException: Cannot run program "arm-frc-linux-gnueabi-g++": Launching f
|
||||
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:287)
|
||||
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
|
||||
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
|
||||
|
||||
!ENTRY org.eclipse.cdt.core 4 0 2016-01-28 11:35:21.182
|
||||
!MESSAGE Error: Cannot run program "arm-frc-linux-gnueabi-g++": Launching failed
|
||||
!STACK 0
|
||||
java.io.IOException: Cannot run program "arm-frc-linux-gnueabi-g++": Launching failed
|
||||
at org.eclipse.cdt.utils.spawner.Spawner.exec(Spawner.java:349)
|
||||
at org.eclipse.cdt.utils.spawner.Spawner.<init>(Spawner.java:91)
|
||||
at org.eclipse.cdt.utils.spawner.ProcessFactory.exec(ProcessFactory.java:91)
|
||||
at org.eclipse.cdt.core.CommandLauncher.execute(CommandLauncher.java:194)
|
||||
at org.eclipse.cdt.managedbuilder.internal.buildmodel.CommandBuilder.build(CommandBuilder.java:105)
|
||||
at org.eclipse.cdt.managedbuilder.internal.buildmodel.StepBuilder.build(StepBuilder.java:94)
|
||||
at org.eclipse.cdt.managedbuilder.internal.buildmodel.DescriptionBuilder$BuildStepVisitor.visit(DescriptionBuilder.java:92)
|
||||
at org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager.doAccept(BuildDescriptionManager.java:151)
|
||||
at org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager.doAccept(BuildDescriptionManager.java:159)
|
||||
at org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager.doAccept(BuildDescriptionManager.java:133)
|
||||
at org.eclipse.cdt.managedbuilder.buildmodel.BuildDescriptionManager.accept(BuildDescriptionManager.java:127)
|
||||
at org.eclipse.cdt.managedbuilder.internal.buildmodel.DescriptionBuilder.build(DescriptionBuilder.java:160)
|
||||
at org.eclipse.cdt.managedbuilder.core.InternalBuildRunner.invokeBuild(InternalBuildRunner.java:128)
|
||||
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:753)
|
||||
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:510)
|
||||
at org.eclipse.cdt.managedbuilder.internal.core.CommonBuilder.build(CommonBuilder.java:459)
|
||||
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:734)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
|
||||
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:205)
|
||||
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:245)
|
||||
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:300)
|
||||
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
|
||||
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:303)
|
||||
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:359)
|
||||
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:382)
|
||||
at org.eclipse.core.internal.resources.Workspace.buildInternal(Workspace.java:486)
|
||||
at org.eclipse.core.internal.resources.Workspace.build(Workspace.java:405)
|
||||
at org.eclipse.ui.actions.BuildAction$1.runInWorkspace(BuildAction.java:287)
|
||||
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
|
||||
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
|
||||
|
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
#
|
||||
#Thu Jan 28 11:32:02 EST 2016
|
||||
#Thu Jan 28 11:35:21 EST 2016
|
||||
Debug/FRCUserProgram=1
|
||||
Debug/src/Robot.o=1
|
||||
src/TankDrive.h=1
|
||||
|
@ -1,4 +1,4 @@
|
||||
11:32:02 **** Incremental Build of configuration Debug for project DriveBase ****
|
||||
11:35:21 **** Incremental Build of configuration Debug for project DriveBase ****
|
||||
Info: Internal Builder is used for build
|
||||
arm-frc-linux-gnueabi-g++ -std=c++1y "-IC:\\Users\\Jason/wpilib/cpp/current/include" "-ID:\\Dropbox\\Public\\FRC\\2016\\FRC2016\\DriveBase\\src" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Robot.o" "..\\src\\Robot.cpp"
|
||||
Cannot run program "arm-frc-linux-gnueabi-g++": Launching failed
|
||||
@ -7,5 +7,5 @@ Error: Program "arm-frc-linux-gnueabi-g++" not found in PATH
|
||||
PATH=[\usr\local\bin;C:/Program Files (x86)/Java/jre1.8.0_66/bin/client;C:/Program Files (x86)/Java/jre1.8.0_66/bin;C:/Program Files (x86)/Java/jre1.8.0_66/lib/i386;C:\Python27\;C:\Python34\;C:\Python34\Scripts;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Windows Live\Shared;C:\WINDOWS\system32]
|
||||
|
||||
|
||||
11:32:02 Build Finished (took 36ms)
|
||||
11:35:21 Build Finished (took 38ms)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
11:32:02 **** Incremental Build of configuration Debug for project DriveBase ****
|
||||
11:35:21 **** Incremental Build of configuration Debug for project DriveBase ****
|
||||
Info: Internal Builder is used for build
|
||||
arm-frc-linux-gnueabi-g++ -std=c++1y "-IC:\\Users\\Jason/wpilib/cpp/current/include" "-ID:\\Dropbox\\Public\\FRC\\2016\\FRC2016\\DriveBase\\src" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Robot.o" "..\\src\\Robot.cpp"
|
||||
Cannot run program "arm-frc-linux-gnueabi-g++": Launching failed
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@ -8,16 +8,60 @@
|
||||
#ifndef SRC_TANKDRIVE_H_
|
||||
#define SRC_TANKDRIVE_H_
|
||||
|
||||
#ifndef DEADZONE_RADIUS
|
||||
#define DEADZONE_RADIUS 0.05
|
||||
#endif // DEADZONE_RADIUS
|
||||
|
||||
#include "WPILib.h"
|
||||
|
||||
class TankDrive {
|
||||
|
||||
public:
|
||||
TankDrive(CANTalon *left, CANTalon *right) { Left = left; Right = right; }
|
||||
TankDrive(CANTalon *left[], CANTalon *right[])
|
||||
{
|
||||
Left = new CANTalon[] {left[0], left[1]};
|
||||
Right = new CANTalon[] {right[0], right[1]};
|
||||
}
|
||||
virtual ~TankDrive() { delete Left[0]; delete Left[1]; delete Right[0]; delete Right[1]; }
|
||||
|
||||
void Drive(Joystick *js)
|
||||
{
|
||||
float x = js->GetX(),
|
||||
y = js->GetY(),
|
||||
th = js->GetThrottle();
|
||||
|
||||
// set deadzone
|
||||
if(x > -DEADZONE_RADIUS && x < DEADZONE_RADIUS)
|
||||
{
|
||||
x = 0f;
|
||||
}
|
||||
if(y > -DEADZONE_RADIUS && y < DEADZONE_RADIUS)
|
||||
{
|
||||
y = 0f;
|
||||
}
|
||||
|
||||
float left=0f, right=0f;
|
||||
|
||||
if(x == 0)
|
||||
{
|
||||
left = th * y;
|
||||
right = left;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Left[0]->Set(left);
|
||||
Left[1]->Set(left);
|
||||
Right[0]->Set(right);
|
||||
Right[1]->Set(right);
|
||||
}
|
||||
|
||||
private:
|
||||
CANTalon *Left;
|
||||
CANTalon *Right;
|
||||
|
||||
CANTalon* Left[];
|
||||
CANTalon* Right[];
|
||||
};
|
||||
|
||||
#endif /* SRC_TANKDRIVE_H_ */
|
||||
|
Reference in New Issue
Block a user