YAGSL Pathplanner Issue

Hi, this is our first time using Pathplanner ( swerve is configured with YAGSL). We had created a basic path moving straight forward. But when it does move this is what happens
Below shown is the path we used

This is the code link - GitHub - Viraj-M/swerve-code-6024 at test (latest code in the test branch)

WhatsApp Video 2024-02-28 at 16.04.04.mp4 - Google Drive (Video of whats going on)

1 Like

So after more testing
We have a few more observations

  1. When the swerve is kept on a trolley. The wheels appear to move perfectly straight and even the path planner recognises the path being completed accurately.However when we kept the swerve on the floor its slowly starts spiralling out of control (edited)

Image
Pathplanner Issues - Google Drive (video)

  1. The robot always moves backwards whereas the path planner believes it to move forward however in turning the robot and path planner move CW.

Note:- PID is not tuned and could be causing issues.

Are your wheels moving in the correct direction? Have you tested direct angle control?

i dont understand what you mean by wheels in the same direction, however during teleop the code works perfectly with angular velocity control (not direct angle control haven’t tested too)

In auton the angular turning of the robot is as commanded (CW = CW) but translation seems to reversed

I said “correct” direction not “same”. The difference is very important here. This sounds like when your wheels are running with positive dutycycle they cause the robot to turn CW, which is an easy fix.

it seems to spiral out of the control which could be beause it is trying to correct angular error and the correction is in the direction of the error, so this could be the problem.

You have to test the 8 steps. You could do this by running with pathplanner but that is more tedious. I recommend using this drive function to test the eight steps.

https://yagsl.gitbook.io/yagsl/configuring-yagsl/the-eight-steps

Alright, thanks, we’ll try : )

Also, ou CANcoders keep changing their offsets a lot, everytime we change the offset it works for a bit then gets slightly misaligned.

This sounds like the glue/loctite holding your magnets in place is slipping, please check and redo them according to the module assembly documentation. This will cause an issue during any match you play and maybe even your autonomous.

We tested it today. It works, turns out the drive motors were inverted. : )

Also @nstrike, how do we flip the gyro for the opposite alliance? Since for blue Alliance, the robot moves correctly. But when we set it as ed alliance, the robot follows the path correctly but after reaching the end it makes a 180-degree turn.

Use theblatest pathplanner and be sure to have your paths set the initial pose.

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