utahrobotics / pololu_ros

Python serial and ROS driver for Daisy Chained Pololu Simple Motor Controller
MIT License
0 stars 0 forks source link

Not Using for Linear Actuators and Other Errors #1

Open ivorbach opened 5 years ago

ivorbach commented 5 years ago

Is this specifically meant to be used only for linear actuators? I'm trying to use a Pololu 18v25 to control a brush motor. When I try to launch the launch file, I get this error:

error loading tag: file /home/ian/catkin_ws/src/pololu_ros/launch/config.yaml contains invalid YAML: while scanning a simple key in "", line 3, column 1: <<<<<<< HEAD ^ could not found expected ':' in "", line 4, column 12: extend_la: 5 ^

After commenting out the lines starting with "<<<", "===", and ">>>" and then removing the two spaces before the other lines, I was able to no longer get that error. However then when I tried to launch I got the following error:

KeyError: '~dev_num/extend_la'

Thank you, any help is appreciated!!

matwilso commented 5 years ago

Sorry about those errors, I botched the git merge and left those in. I just removed that.

So this code is pretty specific to our use case, so if you want to use this package, you will probably just want to fork or clone and make your own repo, and you will have to change a few things. The pololu_driver.py, which sends commands directly to the Simple Motor Controller over serial, should be mostly reusable, but you may need to tweak a few things. Right now it assumes that you know the device number of your device (which you can edit using the GUI, shown here), and that you have assigned it to be at port /dev/pololu<dev_num> (rather than the default of /dev/ttyACM0 or whatever).

For your own use case, you would mostly need to modify pololu_node.py and the roslaunch stuff. These are very specific to what we use this code for, so it is not resuable for you. It is a good example of how to use the Pololu class though.

For details on our setup in case it is useful: We have the devices connected to the computer by USB. We assigned them each a unique serial number (these are what are shown in the config.yaml file). We also made the ports (/dev/pololu<dev_num>) match these numbers.