Robotics StackExchange | Archived questions

How to wrap a hardware-driver in ROS

Dear All,

I need to write a ROS wrapper for a driver in ROS. Is there any clear procedure for writhing a ROS wrapper?

What if I consider the driver as ROS library? is it OK? How could I do that?

I could not find any clear tutorial for doing that. Dose anybody know how to do it?

Thanks for any suggestion and help.

Asked by A.M Dynamics on 2016-07-24 22:19:19 UTC

Comments

Answers

I have done this a few times now. It really depends how you can interface with the existing hardware drivers.

If you have a C++ library that can be used to access the hardware then you can create a C++ ROS node that has access to this library so that you can unify the ROS system and the hardware. You'll need to setup the CMakeLists.txt file so that the built can find the header files and the shared object for the library to be able to compile this.

When you have the skeleton of this node building successfully then it's just a case of connecting and disconnecting to the hardware on startup/shutdown and using the appropriate message topics or service servers.

If you can give us some more details of the type of hardware you are attaching to I could give you some more specific details.

Asked by PeteBlackerThe3rd on 2018-07-18 06:47:13 UTC

Comments

@PeteBlackerThe3rd Thanks for your response.I have to build a mobile robot compatible with ROS. I'll control the robot using a Linux -cased laptop. Therefore, basically, I install the driver and ROS wrapper on Laptop. I also use an embedded system as interface between laptop and motors(EtherCat Com)

Asked by A.M Dynamics on 2018-07-18 08:51:15 UTC

To clarify the hardware in this case is the mobile robot? So you'll need to drive the robot using twist messages on a topic such as /cmd_vel. Possibly monitor battery state, current draws and other such things.

Asked by PeteBlackerThe3rd on 2018-07-18 10:47:40 UTC