Pathweaver

Recently I have been trying to work with PathWeaver and have had limited success. I am trying to pass this path…


The robot turns to the right angle but it fails to move forward after turning.

Here is the link to my repository any help is greatly appreciated:

There are a few issues that could be going on, but I think your first step would be testing pathweaver with straight lines or very slight curves, and seeing what the robot actually does, or if you have access to the simulators use those instead so you aren’t running a potentially out-of-control robot. If the robot jitters or has problems following straight lines, then that means there’s an issue with your PID control (if you use them), or possibly the settings for pathweaver (robot dimensions or treads and stuff like that). If that doesn’t work, WPIlib has some pretty good docs about using pathweaver and troubleshooting issues.

Before running any routines, have you verified that your odometry is working? That is the first thing I would check, just run the robot forward through driving, and see if it’s consistent with what you want. If you can verify that it’s doing that properly, try a straight line instead of the routine above. If it doesn’t drive, I would check the gains

The odometry seems to work just fine when I am moving the robot in teleop. When I ask it to move in a straight line, it only moves a portion of the line. For example if the line is 10 meters it will move 2 meters.

I highly suggest that you play around with your gains (especially P) and FF or try running through sysid if you haven’t done that (or you may have done it but put in incorrect information causing your gains to be off)

1 Like

When I ask it to move in a straight line, it only moves a portion of the line. For example if the line is 10 meters it will move 2 meters.

Yea I encountered a similar problem last year. I agree that either odometry or FF is probably the culprit. Assuming your encoders are configured correctly (and therefore the odometry works), try graphing the requested velocity (the velocity that the ramsete controller is trying to set the motors to) vs the actual velocity (the velocity that is measured by the encoders). If there is a discrepancy, try and identify whether there is a pattern in the error, (ours was almost perfectly quadratic lol).

I agree. If your manual drive is working and your odometry is correct, then it is almost certainly a FF issue.

@Ribstick If you need to find what FF is, WPIlib has pretty good docs on how to calculate FF, or you can find it by seeing what the absolute minimum amount of energy is for the robot to start moving at all (aka how much you need to drive the robot such that kinetic energy > potential energy).

After further inspection, I realized that the odometry is only moving a portion of how much the robot is actually moving. For example if I move the robot 10 meters in real time, it only shows a small portion of that movement in the field2D GUI.

After further inspection, I realized that the odometry is only moving a portion of how much the robot is actually moving. For example if I move the robot 10 meters in real time, it only shows a small portion of that movement in the field2D GUI.

That’s great! That means your unit conversion is just off, it seems like the wheel diameters are pretty accurate, and I’m also assuming you are using falcons. It helps to walk through the code and see which values would cause the odometry to be incorrect.

1 Like

Hmmm… ok I see. I am currently using Talons not Falcons, but the conversions look correct. I will run through the pose calculations once more.

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