|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
||||
|
||||
|
Re: Java wait Function
The MotorSafetyHelper is disabled by default for the Victor, Jaguar, and Talon classes. It is enabled by default for RobotDrive with a 100 ms timeout.
From RobotDrive.java: Code:
...
public static final double kDefaultExpirationTime = 0.1;
...
private void setupMotorSafety() {
m_safetyHelper = new MotorSafetyHelper(this);
m_safetyHelper.setExpiration(kDefaultExpirationTime);
m_safetyHelper.setSafetyEnabled(true);
}
|
|
#17
|
|||
|
|||
|
Re: Java wait Function
That matches what I'd hoped for. Great.
Greg McKaskle |
|
#18
|
|||
|
|||
|
Re: Java wait Function
Quote:
This causes the calling thread to sleep, and thus will cause your robot to hang unless called from a separate thread. Use time stamps as mentioned. System.getCurrentTimeMillis, or the FPGA timer, or anything else in a loop, or spawn a separate thread and call thread.sleep() in the new thread. But do not call Thread.sleep or Timer.Delay in the same thread as your TeleOp/Auto periodic functions. Hope this helps, Kevin |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|