Driving on a heading instead of setting a heading

We have a robot coded in BLOCKS to turn to a heading with the inertial sensor and then drive forward, but the robot sometimes takes off at a slight angle after the heading is set. Is there a way to instead of setting a heading and driving forward, to make the robot correct the heading as it drives to prevent the drift?

Yes, it can be done. However, you probably can’t easily do it in blocks. After all, you need to be constantly changing your motor velocities as it gets off of course.

1 Like

See this video - it covers how to do this in IQ but the logic for V5 (if that’s the platform you’re working with) will be very similar:

4 Likes

Is it not the exact same?