Would “stop driving” block (running continuously inside a loop) effectively disable any drivetrain-related commands coming from a controller when using a standard drivetrain device? We’re trying to prevent an operator from driving the bot when certain conditions are met.
I haven’t used that block very much, and not inside of a loop but I believe so.
forever
if my var = 0,
stop driving
else
(blank)
that should work i think
That’s exactly our intent, I’m wondering if “stop driving” would tell the brain to ignore any drive-related commands coming from the controller?..
There’s this block:
but we want to disable just the two joysticks that are tied to the drivetrain device.
You need to use the block to achieve what you are trying to do otherwise you’ll get some strange behaviours.
Just seen your edit. You’ll need to write some slightly more clever code to do what it is you are trying to do. Can you give a more detailed outline of the objective?
Sure. In the Devices, we have a drivetrain, a controller, and some other sensors and motors. We have a powered arm to pick up objects from the ground, and when it’s in its fully collapsed position, it’s pressed against the ground and tends to get bent when the robot is driven. We want to force the operator to raise the arm off the ground before they can drive the robot, so we’re looking for a way to disable just the two joysticks until the arm is off the ground (as reported by a sensor).
I know we could do that with a custom drivetrain but we want to avoid going that route due to the amount of code changes that would incur.
Realistically, you need to have a custom drivetrain to achieve this because you can’t get the control over the Drivetrain blocks that you need for this task.