Page 1 of 1

Using roboclaw with ros_control, and programming interface

Posted: Sat Feb 09, 2019 1:08 pm
by wireline
Hi

I am hoping someone can give me a steer in the right direction as I am floundering with my autonomous mobile robot project!

I have built a two wheel diff drive robot, with a kinect and a lidar, which I intend to use for mapping and later, SLAM. I am at the stage where I can use ros teleop to move the robot around, however up to this point I have only built robots in ROS' virtual tools. Making an actual robot is a new venture!

I see that the roboclaw_ros node does indeed publish the odom topic and subscribes to /cmd_vel. Now as I understand it, I need to use ros_control to allow ROS to interface with the roboclaw so that it can use the diff_drive_controller to operate the wheels. Part of this involves writing a hardware interface class that tells ros_control how to speak to your hardware. Unfortunately the ros documentation on all of this is somewhat vague and I have not been able to make progress in understanding.

Is there an interface class already coded up for the roboclaw? If not can you advise on where to start? Secondly, how does the roboclaw_ros package relate to all of this?

Thanks for reading

Re: Using roboclaw with ros_control, and programming interface

Posted: Thu Feb 14, 2019 6:21 pm
by ChrisA
They provide exactly what is needed

https://github.com/sonyccd/roboclaw_ros
  • clone the above
    Change the "com port" to match the one for your system
    build with catkin_make.
    There is even a launch file that will start it.
I've been driving a diff drive robot around for a few hours today then ran into some other problem where the roboclaw stops working until power cycled.

The above ROS node works well enough. There is one bug I noticed. If two errors are reported at ones it only prints the first one. For example error "3" means two bits are set, 1 and 2. Both should be logged.

I was going to fix it then this more serious problem came up.

But it drives well. Runs on my Raspberry Pi with Ubuntu 16.04 and Kinetic. Not sure about 18.04 and Python 3. but works on Pi3, Ubuntu 16 and Kinetic after making on line change to point to correct common port which on my system is "/dev/roboclaw"

Re: Using roboclaw with ros_control, and programming interface

Posted: Fri Feb 15, 2019 10:06 am
by Basicmicro Support
For those interested oyu can follow ChrisA's other problem in this thread: http://forums.basicmicro.com/viewtopic.php?f=2&t=819