Trying use command-based -- Type wrong

I’m trying to use command-based to program our codes. We only use robot.file before, so we meet some problems and don’t know how to slove even if we look at wpilib. Could anyone can help us?

The method arcadeDrive(double, double) is undefined for the type DriveTrainJava(67108964)

Your Drivetrain class (in Drivetrain.Java) doesn’t define an arcadeDrive method. You need to write one, probably just a one-line method that passes the arguments to m_drive.arcadeDrive().

I build a drive command in DriveTrain of subsystems, and there is no error message. Could you help me to check it?

Implementation looks fine. My only comment would be on the names of the parameters: the m_ prefix is used to indicate that a variable is a member variable of a class, so it shouldn’t be used on function parameters.

Thank you!
And, I don’t understand deeply of programing actually. I wonder which “m_” do mean in subsystems, command or robotContainer?

m_ is used in class member variables to indicate that they’re, well, member variables. Usually this is only used for private member variables, as public member variables usually use straight naming or title case.

1 Like

Most of my codes are set private, so is it mean that there shouldn’t be any “m_”, right?
I mean - in my situation.

If your member variables are private you want to prefix them with m_.

Meanwhile, variables within methods and functions should have no prefixes as Peter Johnson said.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.