Lemlib code not working

Whenever the code runs, it just has spasms at the starting position while the pneumatic and intake functions work correctly. I have tried a plethora of diffrent solutions, and none have worked. It could also just be me being incompetent when it comes to programming in PROS.

void autonomous(){
	chassis.setBrakeMode(pros::E_MOTOR_BRAKE_HOLD);
	chassis.setPose(49, -15, 180);

	chassis.moveToPose(-49, -47, 180, 5000);
	chassis.waitUntilDone();


	PnLoader.set_value(true);


	chassis.moveToPose(-60, -47, 270, 5000);
	chassis.waitUntilDone();
	chassis.cancelAllMotions();

	IntakeFunc(Intake::Suck, Output::Pass);
	pros::delay(4000);
	IntakeFunc(Intake::Brake, Output::Pass);	
}


Did you tune everything and configure stuff properly? Tell us what you have tried.

Have you attempted implementing your own solution vs using a library you do not understand?

G4 is clear that robot design should represent skill level of the team.

I think you should focus on coding solutions you understand. It is not fun to the feeling you describe:

Often, solutions your team comes up with that is consistent is better than leveraging coding solutions others have developed.

First of all, i think you should not be using the hold brake mode. Generally, most teams use COAST. Besides that, I think you need to tune your PIDs.

Hold is standard in auto, and then typically you switch to brake or coast (depends on driver preference) for driver.

damn i did not know that. we always used coast for drivetrain, and only switched to brake for a singl moment at the end of motions.

How do I tune a PID?

I should of given up on it a long time ago. It’s too late now, we have dozens of pages in our notebook talking about how PROS and Lemlib would make our lived better when it comes to auton and state being in 8 days makes the time frame for making a new sytem a time crunch.

I highly recommend reading the LemLib documentation. Tuning the PID is crucial for LemLib’s movements to work.
https://lemlib.readthedocs.io/en/stable/tutorials/4_pid_tuning.html

I recommend you go through all the tutorials, since it seems you don’t fully understand LemLib.

However, it is important to note that using a template without understanding it is a huge problem. Not only is it a rule violation (as mentioned earlier), but it also will limit your ability to program good autons, as you will struggle to figure out how to get the basics to work.

As someone who has taught others programming, I have seen how using a template with a lack of understanding can cause the creation of bad autons, and huge delays when programming!

Good luck with your competition!