Thread: Vision
View Single Post
  #5   Spotlight this post!  
Unread 23-01-2017, 18:30
SamCarlberg's Avatar
SamCarlberg SamCarlberg is offline
GRIP, WPILib. 2084 alum
FRC #2084
Team Role: Mentor
 
Join Date: Nov 2015
Rookie Year: 2009
Location: MA
Posts: 161
SamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to beholdSamCarlberg is a splendid one to behold
Re: Vision

execute() won't work. You're overwriting the vision centerX instead of copying it. You should make the centerX variable in VisionSubsystem be private to avoid problems like this.

Code:
synchronized (Robot.visionSubsystem.imgLock) {
  Robot.visionSubsystem.centerX = this.centerX;
}
should be

Code:
synchronized (Robot.visionSubsystem.imgLock) {
  this.centerX = Robot.visionSubsystem.centerX();
}
isFinished should also return true when the robot's driven to wherever it should be. As is, the command will never finish and the robot will never stop.
__________________
WPILib
GRIP, RobotBuilder
Reply With Quote