Quote:
Originally Posted by otherguy
In the Elevator subsystem:
How are the upperLimit() and lowerLimit() switches wired up?
If they are just limit switches that pull the channel low when the switch is closed (ground on the NC pin, signal on the C pin), then I would expect your GetLowerLimit() and GetUpperLimit() to return true when the switches are not pressed, and false when they are pressed. This is because there are pull-ups on the discrete input channels.
This would cause your MoveElevatorXXX commands to immediately end.
If you haven't already tested in your subsystem do what you think they should... $@#$@#$@# some print statements that call elevator.GetLowerLimit() and elevator.GetUpperLimit() from within Robot.TeleopPeriodic(). Without running any commands, press your switches and verify that the functions are retuning True/False when you think they should.
If that's not the problem, can you provide a real log of the output that you're seeing in the console when you run. I suspect that what was provided earlier wasn't real output from the robot. There's a lot more print statements in your code that I would expect to see that aren't in the log you provided. Having a real copy of the log will help us see how the commands are executing and potentially help narrow down where to look.
|
Nah, I know they're wired properly, as I said the code works amazingly well, and I've tested both emergency situation and it works exactly as expected. We specifically wired it this way so if an issue arises, such as a wire coming loose, it'll act like it's hit(?) so it will stop the elevator. At least that's what the electrical guys told me. All I know is that logic is correct for our electrical set-up. The only issue that this code is giving us is that it will run two commands concurrently.
I'll get a proper log later, but yeah that was pretty much it :/ the only thing I changed was adding a printf to the isFinished command. When the new button was pressed it ran the:
old command interrupt
new command init
new command execute
new command isFinished
old command execute
old command isfinished
new command execute
new command isFinished
old command execute
old command isfinished
and et cetera.