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

  1. 2 weeks ago

    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?

  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.

  3. Sorry again, this is now the most up to date code. Same question though.

  4. JuiceBox

    Jan 7 Ohio 6741E

    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. @rakibsta I’m not sure but I think I also might have had issues doing “-right” or “-left”. Maybe don’t do that.

    It wasn't that

  7. @JuiceBox Can you send a screenshot of what the error says?

    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. last week

    JuiceBox

    Jan 7 Ohio 6741E

    @mvas8037 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.

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

 

or Sign Up to reply!