Method for Drive Train (coding help) (v5 using VCS)


#1

I was coding a drive train method for my robot that calculates the linear displacement of the robot with respect to the size of the wheels and the target distance I want. There is a screenshot of the code attached to this. For some reason, it won’t compile and I’m relatively new to c++ so using proper vocabulary with me won’t be very helpful. Can someone explain why this doesn’t compile and how I would call this method during autonomous?
Screen Shot 2019-01-07 at 9.27.42 AM.png


#2

I just fixed it. After I posted this I realized I defined the variables in the wrong order. Anyways, one of my questions remain, how would I call the drivetrain method? (updated code attached here). It doesn’t compile when I try doing what I believe is correct.
Screen Shot 2019-01-07 at 9.32.02 AM.png


#3

Sorry again, this is now the most up to date code. Same question though.
Screen Shot 2019-01-07 at 9.34.06 AM.png


#4

Can you send a screenshot of what the error says?


#5

I’m not sure but I think I also might have had issues doing “-right” or “-left”. Maybe don’t do that.


#6

It wasn’t that


#7

I think I fixed it, I was calling the method outside of the autonomous which confused the program to think I was defining another variable when in fact I wasn’t. When I put it in the autonomous no errors pop up.


#8

Well I’m glad you were able to figure it out.