Can anybody tell me why I’m unable to drive? It used to be able to, but it has suddenly stopped working.
I have checked through all of the code, and nothing is moving it other than the driving script.
Can anybody tell me why I’m unable to drive? It used to be able to, but it has suddenly stopped working.
I have checked through all of the code, and nothing is moving it other than the driving script.
I dont recommend the equal 95 or 96 part as it is probably the cause of the drive not working. What most teams use is to set the speed of the drive to the joystick values. This works well and allows you to drive the bot at different speeds.
With the controls you’re using, you’ll probably want a linear speed drivecode like this
simpledrivecode.v5blocks (6.8 KB)
Looking back on the code, however, presents a possible issue with the original. The value of 95 is only met briefly during the movement of the joystick, because the max value is 100, meaning the when the custom block is triggered, the drive will not drive unless the left joystick is perfectly at 95. If the custom block were inside an infinite loop, it might trigger, but the drive would also likely stop immediately because the joystick would be easy to move off of the 95 unintentionally and trigger the set velocity to 0%.
If you change the logic to be >95 or <-95 it will “work”. But it basically is either full forward or full reverse speed… which is really terrible.
Can’t dream of a setup where this would be better than proportional control, but if you change the logic operators, it should work.