Stryke Force java library

I noticed how robot length and robot width are both 1.0. There is no indication of units or ratios. How are these numbers determined? Is it in inches? Is it a ratio?


You should be able to enter values in whatever unit you want. The length and width are used to calculate the vectors at each wheel for a robot steering command. They are divided so the units cancel each other out. See lines 46-48 here:

For example if your wheelbase is a 23" square, 1 and 1 works just fine because 1/(1+1) is equivalent to 23/(23+23). It’s more important when you have a rectangular wheelbase as the vector at each wheel for a robot steering command won’t be at 45 degrees.

So if my swerve frame is say 26" by 28" I could just replace Length with 26 and width with 28? That simple?

That should be it!

Make sure you don’t get trackwidth and wheelbase confused.

Indeed. Said another way - ensure the length/width represent the distance between the wheel/ground contact points, not the frame perimeter dimensions.

1 Like

It’s the length and width. Can be simplified to a ratio.

1 Like