Using ROS with the TB6612 motor driver

asked 2021-02-10 20:45:39 -0500

RobotHunter gravatar image

updated 2021-02-11 10:39:26 -0500

The robot car I built with the Raspberry Pi 4 uses a PCA9685 servo board which I can control with a package from Bradan Lane Studios that can be found here. However, in order to control the two DC motors which controls forward and backward movement, it uses a TB6612 motor driver which is also connected to the PCA9685. Do I need a separate ROS package to control the DC motors?

I've attached a diagram of the wiring below. The servos that control moving the front-mounted camera vertically and horizontally, and the steering servo, are connected directly to the PCA9685, and I can control those directly by publishing to the ROS topic "servo_absolute". Each servo connects to a numbered pin on the PCA9685; by publishing the number of the pin, plus a numerical value, you can control the orientation of the servos. However, this didn't work with the pins that are connected to the TB6612. Does anyone know how I can access the TB6612 and the two DC motors?

https://www.flickr.com/photos/1921266...

edit retag flag offensive close merge delete