Vex::drivetrain Constructor error

The following line of code:

vex::drivetrain        dt(motor_left, motor_right, 319.1764, 292.1, vex::distanceUnits::mm);

generates the “no matching constructor” error specfically because of the part that says “dt”. Any information will help.

you have to do vex::drivetrain dt = vex::drivetrain(motor_left, motor_right, 319.1764, 292.1, vex::distanceUnits::mm);. Otherwise, it seems fine

1 Like

I tried this but the same error seems the occur except now the “vex” part after the = is highlighted.

you are missing one parameter before the units.

4 Likes

Sorry to ask, but I am new to C++, how would I fix that?

This is the constructor,

drivetrain( vex::motor &l, vex::motor &r, double wheelTravel=320, double trackWidth=320, double wheelBase=130, distanceUnits unit=distanceUnits::mm, double externalGearRatio = 1.0 );

either leave out the units so wheelBase uses the default value, or add the wheelBase parameter.

5 Likes