ros_pca9685
is a package for talking to the PCA9685 I2C PWM driver by NXP
Package tested with [Adafruit 16-Channel 12-bit PWM/Servo Driver] (http://adafruit.com/products/815)
How to configure Raspberry PI described [here] (https://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi/overview)
mkdir -p ~/pca_ws/src
cd ~/pca_ws
catkin_init_workspace
cd ~/pca_ws/src
git clone https://github.com/dennn66/ros_pca9685
cd ~/pca_ws/src/ros_pca9685/ros_pca9685/src/lib/
git clone https://github.com/TeraHz/I2C
git clone https://github.com/TeraHz/PCA9685
cd ~/pca_ws
catkin_make_isolated
rosrun ros_pca9685 controller_sub
rostopic pub /pca9685/servostate_to_controller pca9685_msgs/ServoState '{port_num: 1, servo_rot: 0.5, servo_type: 2}' --once
rostopic pub /pca9685/pwmstate_to_controller pca9685_msgs/PwmState '{port_num: 1, on_value: 0, off_value: 400}' --once
Stop all servos:
rostopic pub /pca9685/servostate_to_controller pca9685_msgs/ServoState '{port_num: 0, servo_rot: 0.0, servo_type: 0}' --once
Stop servo:
rostopic pub /pca9685/servostate_to_controller pca9685_msgs/ServoState '{port_num: 1, servo_rot: 0.0, servo_type: 0}' --once
or
rostopic pub /pca9685/pwmstate_to_controller pca9685_msgs/PwmState '{port_num: 1, on_value: 0, off_value: 0}' --once