View Single Post
  #3   Spotlight this post!  
Unread 08-27-2016, 01:47 PM
cpapplefamily cpapplefamily is offline
Registered User
FRC #3244 (Granite City Gearheads)
Team Role: Mentor
 
Join Date: May 2015
Rookie Year: 2015
Location: Minnesota
Posts: 232
cpapplefamily has a spectacular aura aboutcpapplefamily has a spectacular aura about
Re: Cancel a command

Thank you. We will give this a go.

Code:
private boolean m_CancelCommand = false;
Code:
 

protected void initialize() { 
43     	m_CancelCommand = false; 
44     	// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
45     	// Not Allow movement if Wrist Is up ! 
46     	// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
47     	if(m_setpoint>70 && Robot.wristPID.getSetpoint()>30){ 
48     		System.out.println("Scissor Cancled Wrist > 30"); 
49     		m_CancelCommand = true; 
50     	}else{ 
51     		if(m_setpoint>30 && Robot.wristPID.getSetpoint()>55){ 
52     			System.out.println("Scissor Cancled Wrist > 55"); 
53         		m_CancelCommand = true; 
54         		 
55         	}else{ 
56         		
57         Robot.scissorPID.enable(); 
58         Robot.scissorPID.setSetpoint(m_setpoint); 
59 
 
60    
61         	} 
62     	}
Code:
72     protected boolean isFinished() { 
73       
74         return Robot.scissorPID.onTarget() || m_CancelCommand ; 
75 
 
76     
77     } 
78
Reply With Quote