xwj199815 / frc1388-2013

Automatically exported from code.google.com/p/frc1388-2013
0 stars 0 forks source link

Cause the robot to drive forward in TeleopInit() #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
See Issue #34.

If the robot drives toward the feeder station, and is waiting at the center 
line, it would be desirable to have the robot start driving forward as soon as 
Teleop begins.  This would give a jump-start on the robot's forward movement, 
so that the robot could start moving forward before the driver has a chance to 
step forward and take control.

This could be implemented using a Command which simply tells the robot to drive 
forward at full speed.  The IsFinished() code for this command could monitor 
the driver joysticks and exit the command when it sees any activity on the 
driver joysticks.  As an added measure of safety, the command could also use 
SetTimeout() to ensure that it returns control to the drive train's default 
command after a couple seconds (when the driver should be in control).

Note that this code should only be operated if the autonomous code has 
positioned the robot so that it's facing the feeder station.  In that sense, 
this command is essentially an extension of that autonomous code, and should be 
coordinated thusly.

It's also been suggested that all of the autonomous driving code plus this 
command be under control of the driver, pre-match, perhaps via a setting on the 
SmartDashboard.

Original issue reported on code.google.com by jtec...@gmail.com on 29 Mar 2013 at 4:41

GoogleCodeExporter commented 8 years ago
I do not know if the SmartDashboard can communicate with the robot to feed it 
data, so if we want to have control of this before TeleOp, We mightneed to put 
a switch or some other input on the robot to have control.

-David

Original comment by jonie4 on 29 Mar 2013 at 11:00

GoogleCodeExporter commented 8 years ago
I don’t have experience with sending data from SmartDashboard to the robot, 
but I believe there are several ways you can do it, according to the 
documentation.

- For most SmartDashboard “Put*” functions, there’s a corresponding 
“Get” function.  For instance, PutNumber(key, value) and GetNumber(key).

- SmartDashboard supports a data type called SendableChooser, which allows you 
to have radio buttons on the SmartDashboard that can be read by the robot.

- You can save preferences on the cRIO using the Preferences class.  
SmartDashboard has a built-in widget to display and modify the robot 
preferences.  (I wish I’d know about this sooner!!!)

Most of this is discussed in the WPILib Cookbook, and of course documented in 
the WPILib C++ reference.

Original comment by jtec...@gmail.com on 29 Mar 2013 at 11:33

GoogleCodeExporter commented 8 years ago
^  See WPILib Cookbook pages 65-67.

Original comment by jtec...@gmail.com on 29 Mar 2013 at 11:36

GoogleCodeExporter commented 8 years ago
The driver control / SmartDashboard issue is really a separate issue, and has 
been moved to Issue #38.

This issue should henceforth only refer to driving the robot forward the 
instant TeleOp begins - but of course can use the mechanism referenced in Issue 
#38.

Original comment by jtec...@gmail.com on 31 Mar 2013 at 2:06