![]() |
Toggle Switch on Robot and Line Trackers
Hello,
I'm trying to program autonomous but having a little trouble. 1) Since, autonomous can't be influenced by the driver station at all, I would like to have a toggle switch mounted on the robot instead of having to redeploy code before each round that controls the position of the arm depending on whether we get placed in the middle or outside of the scoring grid. Would this be a digital input output on the sidecar? 2) For line trackers, would this be the digital input outputs labeled IR1, IR2, and IR3 on the default code. How would apply this to a basic flat sequence structure where the motor basically, in one frame, goes forward for about 8 seconds (8000 milliseconds) at half speed? Would this wire into the direction input at all of the holonomic drive I am using? |
Re: Toggle Switch on Robot and Line Trackers
Your (1) isn't quite entirely true.
The robot transitions between a number of states during a competition match: Autonomous Disabled (waiting on the field for match to start) Autonomous Enabled (Autonomous) Teleop Disabled (brief period between auto and teleop enabled) Teleop Enabled (main match time) Teleop Disabled (end of match) During Autonomous Enabled, the robot will not get any information from the driver station. However, in Autonomous Disabled and Teleop Disabled, the robot can in fact read data from the driver station - it just can't move any mechanisms in response. So, using this, you can have the robot read values from the driver station during disabled, and save those values to be used during Autonomous Enabled. |
Re: Toggle Switch on Robot and Line Trackers
As to question 1, you can use the Driver Station inputs to convey information to the autonomous. If you look at the provided code example for line following, the code looks at the DS inputs to determine if following the left lane, right lane, or straigt lane is desired. The default code looks at the first two inputs to determine. I expanded the concept by using the next two inputs (DI 3, 4) to tell the autonoumous code are we going to the low, middle, or high peg. With 8 digital inputs, that is a possible 256 possible scenarios you can program. I think that should handle what you need.
As to question 2, the digital inputs labeled IR 1, 2, 3 are the status to the photo switches provided in the KOP. They register true or false depending on the presence of reflective tape or not. The default code assume a true if over tape and false if over just the carpet. You could attempt to do autonomous without the photo switches doing a timed straight move, but will problematic without the feedback of the switches. |
| All times are GMT -5. The time now is 09:29. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi