Mecanum Code #7
| public class DriveCode { | ||
| public static FloatInput leftJoystickChannel; | ||
| public static FloatInput rightJoystickChannel; | ||
| public static BooleanInput octocanumShifting; | ||
| + private static FloatOutput rightFrontMotor = Igneous.makeTalonMotor(1, Igneous.MOTOR_FORWARD, .1f); | ||
| + private static FloatOutput leftFrontMotor = Igneous.makeTalonMotor(2, Igneous.MOTOR_FORWARD, .1f); | ||
| + private static FloatOutput rightBackMotor = Igneous.makeTalonMotor(3, Igneous.MOTOR_FORWARD, .1f); | ||
| + private static FloatOutput leftBackMotor = Igneous.makeTalonMotor(4, Igneous.MOTOR_FORWARD, .1f); |
|
celskeggs
Two comments - remember that you can combine the motors on the same side with |
|
I added mecanum code that we can hopefully test on the practice robot soon. It seems to work fine in the emulator. |
|
Looks good - can you reformat this with Eclipse's formatter? Once you've done that and tested it on the robot, I'll merge this pull request. |
| + } | ||
| + if (normalize < Math.abs(speed)) { | ||
| + float multiplier = Math.abs(speed) / normalize; | ||
| + leftFront *= multiplier; | ||
| + rightFront *= multiplier; | ||
| + leftBack *= multiplier; | ||
| + rightBack *= multiplier; | ||
| + } | ||
| + rightFrontMotor.set(rightFront); | ||
| + leftFrontMotor.set(leftFront); | ||
| + rightBackMotor.set(rightBack); | ||
| + leftBackMotor.set(leftBack); | ||
| + } | ||
| + }; | ||
| + | ||
| + private static EventOutput tankDrive = new EventOutput() { |
|
celskeggs
Recall that a tank drive implementation is provided by
AidanSmith
I don't know how to get DriverImpls.createSyncTankDriver to work with filterEvent, because DriverImpls sends it immediately when it is called (it doesn't return an eventOutput).
celskeggs
Two possible ways: call |
| public static void setup() { | ||
| - | ||
| + Igneous.duringTele.send(mecanum); | ||
| + BooleanMixing.whenBooleanBecomes(octocanumShifting, true).send(new EventOutput(){ | ||
| + public void event(){ | ||
| + Igneous.duringTele.unsend(mecanum); | ||
| + Igneous.duringTele.send(tankDrive); | ||
| + } | ||
| + }); | ||
| + BooleanMixing.whenBooleanBecomes(octocanumShifting, false).send(new EventOutput(){ | ||
| + public void event(){ | ||
| + Igneous.duringTele.unsend(tankDrive); | ||
| + Igneous.duringTele.send(mecanum); |
|
celskeggs
Interesting choice of way to switch. This should work, though I would recommend using |
|
The code now works on the practice robot, so it should be ready to be merged. The filterEvent has not been tested on the robot, but it works on the emulator so I see no reason why it wouldn't work on the robot. |
|
I have at least one merge conflict. (On QuasarHelios.java) Do you have any advice for how to get rid of it? |
|
You'll need to pull from the repository. It'll complain and put the repo into merge conflict mode. Then go to each of the files with an issue - each will contain marked sections of the different versions. Merge them into what makes sense, and Also, FYI, we had to change two of the drive motor port numbers for the real robots. |
|
No. You went and committed some Mac OS X specific files. You should delete those from the repository. |
|
I'm not sure why it generated that last commit, but, anyway, it looks good now. I changed the tank drive to DriverImpls. |
|
Clamp is using talon 2 right now for speed control. Should I switch clamp's speed control to talon 11 (the next available one)? I don't see it on the port numbers document you shared with us. |
|
The clamp winch runs over CAN. For now, talon 11 works fine. Can you cut that last line up or shorten it? It seems a bit long. |
|
Changed both. I also made the controls to more like how I envision them actually looking for competition. The old way was good for testing weird angles, but I think the new way is more intuitive for now. |
I think I was able to figure this out by myself. This is just a test to make sure I can make a pull request correctly.