Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to properly pass parameters? #6

Open
kevkid opened this issue Dec 9, 2020 · 3 comments
Open

How to properly pass parameters? #6

kevkid opened this issue Dec 9, 2020 · 3 comments

Comments

@kevkid
Copy link

kevkid commented Dec 9, 2020

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?

@odart
Copy link
Contributor

odart commented Mar 19, 2021

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.

@jetdillo
Copy link

jetdillo commented May 29, 2022

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!

@odart
Copy link
Contributor

odart commented May 31, 2022

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants