sheaffej / roboclaw_driver

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

Readme not updated? how to use it? #4

Closed alduxvm closed 4 years ago

alduxvm commented 4 years ago

Hi!

Thanks for this great work! I have a couple of questions about how to use it, I think the readme is not updated to reflect the methodology...

I also have a 4wd robot and I'm using 2 roboclaws, for a robot as follows:

[ a ]-------[ b ]

[ c ]-------[ d ]

Do you wire a roboclaw to drive a + b or a + c?

And in the new launch file, to serial ports need to be configured, but I do not seem to find how to do it... can you provide an example?

sheaffej commented 4 years ago

Hi @alduxvm, thanks for reaching out. Sorry for the delay as I messed up my GH notifications when I changed jobs. Hopefully you are well past this phase in your project by now, but I wanted to respond anyways since you took the time to reach out.

I ended up using 2 separate roboclaws, each driving 2 wheels. So I have a front roboclaw, and a rear roboclaw. I considered wiring a single roboclaw to drive the left wheels the same, and the right wheels the same. And I saw several people who did this on other projects, however I was concerned with the current required to drive 4 wheels from one Roboclaw 2x7A (the model I have). Also the roboclaw would only be able to read encoder ticks from two wheels, such as only the front two wheels or the rear two wheels. I like the fact that the roboclaw's PID controller will maintain the wheel's speed using the encoder ticks, and I didn't think that would work well if it was trying to drive 4 wheels w/ only 2 encoders.

However, I did make the assumption that each roboclaw would do the same thing. That is, my 4-wheel robot is behaving like a 2-wheel differential robot, that simply yaws around the origin (well in theory at least, since the front and rear wheels grip different so it actually yaws around a point about 2cm in front of the origin). To do this, I have both roboclaw_driver nodes (one for each roboclaw unit) listening to the same SpeedCommand topic. My base publishes the SpeedCommand to a single topic and both roboclaws execute the same SpeedCommand. For stats, I just read the stats from the front roboclaw, however I do have both roboclaws publishing stats to their own topic. BTW I didn't modify my base to fuse the stats together for odometry, and so it just reads stats from the front. That could be project for later, but it's working well for now since I just need odometry to be slowly changing as AMCL in my nav stack will compensate for odom drift from the map.

I'm documenting my project here if you'd like to read more. https://sheaffej.github.io/b2/4wd-base/rethinking-the-design

I don't get to work on it often, so there are long pauses in my updates unfortunately.