# Trajectory units returning much less than given

https://imgur.com/a/qBlVWwt

As you guys can see, it’s end values are proportionally less. approximately 1/4. What could be the reason to it, any ideas? Thx in advance

Are you saying that when you run the trajectory you see the results are 1/4 of what you expect, or that you inspected the resulting trajectory and the final state in the trajectory is 1/4 what you expected?

Probably easier if you can post your code along with your problem for people to see.

Trajectory trajectory = TrajectoryGenerator.generateTrajectory(
new Pose2d(0, 0, new Rotation2d(0)),
List.of(
new Translation2d(2, 0),
new Translation2d(4, 0),
new Translation2d(6, 0)
),
new Pose2d(8, 0, Rotation2d.fromDegrees(0)),
trajectoryConfig);

As you can see, the robot should ideally move 8 meters(?) but it ends up at approx. 2 meters according to encoder data. Am I confusing the units or missing any kind of conversion factor?

To clarify, when you say “According to encoder data” does that also include an empirical measurement of the robot movement (like you used a measuring tape) or is it just encoder feedback that you’re observing?

There are obviously some conversion factors here that are off, either in your subsystem configuration, your encoder->distance measurement, or how you are observing.

Do your drive motors actually go to the speed you set them to? My team had this issue and it was due to improperly tuned swerve PID

.

Encoder logs. They are correct tho, I measured multiple times. 3-4 times difference between inputs and logs is just absurd and I am running out of ideas sadly

You probably should post your code for more help.

What do you mean the difference between the inputs and the logs?

Encoders measure shaft rotations. Put the robot on blocks, and turn the wheels by hand one full rotation of the wheel. While you are doing that, plot the encoder value for your motor. You should see a distance traveled equal to one wheel rotation.

That is step 1 to troubleshoot the problem. If that is not accurate, you can’t go further until you see that exactly correct.