Drivetrain Function Using Inertial

I am currently trying to implement an inertial sensor into autonomous functions but am not sure whether this will work.
Function

This function will only be used to move the drive forward.

Im quite confused. Whats the end goal here? Why do you need the inertial sensor in this function? Were you trying to make some sort of drive correction function? (if so use the search bar) Also no need to calibrate the inertial sensor every time in fact you should probably not do that.

I am just playing around with inertial in this function because I want to use it for turning in the future.

I see no point in using the inertial like this. This provides no use for driving straight and is really only a nuisance because this wont do anything if you robot is facing a direction that has a lesser degree than whatever you call. General rule of thumb is until you are ready to combine turning and driving straight into one function keep those things separate and in their own functions.

3 Likes

I am planning to have them separate. I created this thread because I want to know if the syntax is correct because I don’t have much experience with the inertial sensor.

Technically speaking yes the syntax is correct. Although, practically speaking this is not a very viable function. As with anything else you can find the documentation for the inertial sensor here.

5 Likes

Also: https://kb.vex.com/hc/en-us/articles/360037382272-Inertial-Sensor-Sensors-for-VEX-V5

1 Like