sheaffej / roboclaw_driver

A ROS node providing a driver interface to the Roboclaw motor controller.
MIT License
9 stars 15 forks source link

Does this package work with multiple roboclaws? #7

Closed jmorrow10 closed 2 years ago

jmorrow10 commented 2 years ago

I've been trying to get multiple roboclaws to run at the same time but can only get one roboclaw to work. Is there a certain parameter that I am missing or is required for multiple roboclaws to be used?

sheaffej commented 2 years ago

Hi @jmorrow10, I use two roboclaw devices in my robot, and a single roboclaw_driver node controls both. Because the robot base is small, this driver node simply makes the assumption that the same commands can be sent to both roboclaw devices. This causes some wheel slip when turning, but since my robot is small, it's not much of a problem.

To have this roboclaw_driver node drive two roboclaw devices, list both of the device paths as a comma separated list of paths in the parameter dev_names.

Here's an example from my base. https://github.com/sheaffej/b2-base/blob/master/b2_base/launch/nodes/roboclaw_nodes.launch

My base node and the roboclaw_driver node both run on the same Linux host.

Technically, I believe this should work with more than 2 roboclaw devices, however I haven't tested that. The logic just parses the dev_names parameter to split on the comma, and creates a list of devices to send the same commands to. When a command is sent to a roboclaw device, this driver simply loops through the list of roboclaw paths and send the same command to all of the devices. So once again, all roboclaw devices will be driven exactly the same.