Differential Drive Robot hardware interface
So I'm still working on this never ending project on building a small autonomous robot.
First of all, here are the specifications of my robot:
- 2 * Encoded DC Motors
- Arduino Nano for controlling the PWM of the Motor
- Arduino Nano for counting encoder pulses
So now the problem. I have a Twist message and want to get the robot to move when it's published, since that's the basic function of a robot. But i don't find any good controllers to convert this Twist message to the PWM signals.
The Motor controller subscribes to a topic for each motor. This topic is an Int16 that simply represents the PWM value for the motor. So it's not a m/s or a ticks/second value.
Now I need a controller that can convert that. Yes, I searched for controllers. I found the diff_drive_controller but that one needs a PID controller (and I don't know how to use that), and the differential_drive but that one does not work (I tried tuning it for hours, but it either overshoots by excessive amounts or slows down until it stops)
I read all the documentations, but they are written extremely bad and unspecified.
So if you could tell me how I can control this differential driven robot it would be very helpful.
Yes, PID tuning is not easy. I guess the question here is something like "How do I control my motor with a given speed?" I think this is a robot specific question and not a ROS question. My recommendation: There are PID controllers libraries for the Arduino: Execute the PID on the Arduino, it can do this faster then your main computer (Whatever you are using as ROS computer)