nobleo / tracking_pid

PID controller following a moving carrot
Apache License 2.0
237 stars 49 forks source link

How to use the package on ackermann chassis? #23

Closed is-whale closed 11 months ago

is-whale commented 11 months ago

Hello, I want to know how to use the package on the Ackermann chassis, and add some param about setting something like Wheelbase, steering angle, max speed.

Timple commented 11 months ago

This package has as output a geometry_msgs/Twist message on the cmd_vel topic.

It is up to the consumer of that topic to split it into an angle for the steering wheel.

Good news though: a minimal radius output can be configured. Such that only valid velocities are output even in the case of an Ackermann chassis.

is-whale commented 11 months ago

Thank you very much for your help! I have implemented twist2vehice in another package, but I am not quite sure where the minimum radius should be configured. Is it a parameter of the tracking PID? Or should I add some restrictions when converting Twist 2Vehice?

Timple commented 11 months ago

My appologies, I was confusing it with path_tracking_pid That one does have a parameter called min_turning_radius: https://github.com/nobleo/path_tracking_pid/blob/main/cfg/Pid.cfg#L19C10-L19C28

It can be used in a similar matter, so perhaps more suitable to your usecase.

is-whale commented 11 months ago

Min_ Turning_ Is the role of radius like this: when it is set to a larger value, it means that it is not an omnidirectional wheel that can rotate in place now? By setting it to an appropriate value match the Ackerman chassis structure? Another thing I don't understand is, Gen. add ("min_turning radius", double_t, 0, "Minimum turning radius", 0.0, 0.0, 100) Why are there three parameters in the end here

Timple commented 11 months ago

Yes, you are correct in your assumption.

It's a parameter that can be changed on the fly: https://wiki.ros.org/dynamic_reconfigure/Tutorials/HowToWriteYourFirstCfgFile

is-whale commented 11 months ago

I feel that I understand. Thank you very much for your patience. I hope you have a happy life!