dheera / ros-pwm-pca9685

ROS package for PCA9685 16-channel PWM driver, used in motor and LED applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to properly pass parameters?

kevkid opened this issue · comments

I have been trying to pass parameters to the node and cant seem to figure out what is going on. Here is what I tried:
rosrun pwm_pca9685 pca9685_node timeout:=[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100] but it still runs for 5 seconds. I have also tried rosrun pwm_pca9685 pca9685_node _timeout:=[100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100] and the same thing. Any advice?

commented

I suggest you change the PCA9685_activity.cpp file directly. Once changed don't forget to catkin make the directory. This seems to work for me.

I'm not seeing any topics published when I run this node.
I'm running rosrun pwm_pca9685 pca9685_node _device:=/dev/i2c-1 _frequency:=50 and the node starts, but no additional topics show up when I run rostopic list or try to run a rostopic pub .
Is this meant to be a single-shot interface where you provide the values to the motors when you start it up and that's that or is it meant to be used as more of a library function in other ROS code ?
I've built this off the latest code on the master branch.
Thanks!

commented

I Publish to the node from my motor driver code in python. This motor driver code receives the cmd_vel Twist command and publishes the motor drive commands.

self.pub_drive = rospy.Publisher('command', Int32MultiArray, queue_size=1) #command is PCA9685 driver identifier

self.drive=Int32MultiArray(data=[-1,-1,left_motor[0],left_motor[1],left_motor[2],right_motor[1],right_motor[2],right_motor[0],-1,
-1,-1,-1,-1,-1,-1,-1])
self.pub_drive.publish(self.drive)