2D Motion Profiling Pros Vex

Hello I am back with more questions. I was wondering how you use the point system in 2D motion profiling. This is my original code that moves the robot forward, and it works.↓


I was wondering how I would make the robot do another action. Such as turning and then moving froward again. I do understand that 2D motion profiling has issued with turning the robot, because it cant use negative values. Which is why i am wondering also what the point of the" 0_deg" is for.
Would I do this to add more commands?↓

Or would I do something like this? ↓

I have an H-Drive.
Questions I am trying to ask: What is the “_deg” option do. How do you add more commands? How does the robot use the y coordinate with the autonomous.? If possible providing sample code of a robot using 2D motion profiling and moving multiple times(going forward, turning, andor using lift)
would be very useful.

Thank You for your Help.

The degree specifies the robot’s heading at that point with respect to the starting heading. In other words, if you have two points (0, 0, 0) and (10, 2, 45), the robot will move to the second point and end up facing 45 degrees away from the original (left or right I’m not sure).

A benefit of motion profiling is that you can use it to achieve smooth turns while moving. Issuing a turn command after moving straight can be achieved with the moveDistance and turnAngle methods, for which you don’t need a motion profile for.

1 Like