![]() |
Switching between Kinect drive / Joystick drive / Autonomous drive
Currently I have a command for each of them (TeleopCommand, KinectCommand, AutonomousCommand) but I'm not sure how to tell it to use Kinect as opposed to Autonomous (ie. switching between the 2), or end either of them when Teleop starts.
What would be the best way to accomplish this? A switch on the SmartDashboard? |
Re: Switching between Kinect drive / Joystick drive / Autonomous drive
Code:
public class Robot extends IterativeRobot { |
Re: Switching between Kinect drive / Joystick drive / Autonomous drive
Thanks, I'll try it out when I get a chance.
Here's my "switch" code, though I'm not sure whether it's going to work. Code:
Command autonomousCommand, teleopCommand;From OI.java: Code:
InternalButton kinectButton = new InternalButton();(EDIT) I've been looking at an alternate way of doing it via the "sendableChooser" method of SmartDashboard. Code:
NetworkTable.initialize(); |
Re: Switching between Kinect drive / Joystick drive / Autonomous drive
The SendableChooser idea is a good one, I think. I'd also recommend moving the selection to autonomousInit(), so that you can choose the autonomous mode before each run. In robotInit(), it gets decided when the robot turns on, and never again.
|
| All times are GMT -5. The time now is 09:14. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi