![]() |
[FTC]: [FTC]: Autonomous-run motor with encoders does not stop
We are trying write an autonomous program to drive the robot a specified distance. we have connected encoders to our 4 drive motors and here is the code we have so far :
Code:
public class CCAutonomous extends LinearOpMode {thanks Charging Champions Team 8660 |
Re: [FTC]: [FTC]: Autonomous-run motor with encoders does not stop
Hey, i would use the following code:
PHP Code:
|
Re: [FTC]: [FTC]: Autonomous-run motor with encoders does not stop
We got around the original issue by setting the motor power to 0 after the Targetposition is reached. We also had an another issue with the condition performing the "and" condition on all 4 motors to check if the target position is reached. Two of the motors where always at zero position so we modified the condition to just check of the front set of wheels (which were the ones with the encoders returning the right values)
|
| All times are GMT -5. The time now is 17:10. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi