Wayzata / FRC-Mecanum-Pathfinder-For-TestyBottyBot

Other
2 stars 2 forks source link

Different moviment types with mecanum wheels #3

Open RodrigoDomingues18 opened 4 months ago

RodrigoDomingues18 commented 4 months ago

Sorry for the persistance! I really want to know how you defined those arc/circular moviments and that straight line 360º moviment for your robot. What kind of values you had to setpoint in linear speed x, linear speed y and angular to have those specific moviments? It was just some WPILib function managing that or you had to define them on your own?

Again, I'm sorry for the persistance and annoyingness but it could be really helpful for me

jackarivera commented 4 months ago

https://github.com/mjansen4857/pathplanner

Path planner was used to generate all trajectories. The basic flow is as follows:

1) Generate trajectories via path planner 2) Save/deploy these trajectories to the robot 3) Use a velocity commander to set the robots velocity according to the trajectory

Path planner generates trajectories with respect the robot constraints so there’s not much to worry w/r/t constraining robot motion outside of the trajectory. As long as you have well tuned velocity control for your bot it should be pretty plug and play.

RodrigoDomingues18 commented 4 months ago

Yeah but with mecanum wheels, I can go from A to B in multiple ways: diagonal, forward, (...) the same when doing a curve/arc, I can do it with the front of the robot always facing the tangent of the moviment, or always facing center of the arc, or with a fixed absolute orientation, (...). The path planner only defines what path to take. Doesn't define how it takes it. Or it does? I mean, how did you do the moviment in the straight line 360? You only setted on the path planner the point A to B, or also the middle steps on how to turn it?

jackarivera commented 4 months ago

I really suggest you read the docs for path planner. They are going to be able to help you further than I can. Path planner specifically has a holonomic mode that does exactly what you are describing. It allows you to decouple the robot heading from the path which gives you full control over robot orientation along the trajectory. Please read their docs because all of these questions are readily available there.