0
$\begingroup$

Rosanswers logo

Hi,

I have a device which is communicating using the TCP/IP protocol and I already have a QT application to control it via a PC. I am now looking to create a ROS driver to control the device.

I was wondering if there is an easy way to create a TCP socket using ROS to send custom TCP frames to a device. From what I have read, the TCPROS package is used to communicate between ROS nodes, not between a node and a device.

One option I am looking for is to use my application code (c++) which is built around the QT4 libs (QTcpSocket, QByteArray, etc.). I would then need to integrate this into ROS to make the node publish the device status and subscribe to receive commands for the device.

Is using the QT libs the easiest way to do this or is there a better, more standard way to build ROS drivers for TCP devices?

Thanks,

Nicolas


Originally posted by nlauzier on ROS Answers with karma: 37 on 2012-06-04

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

As @dornhege said, there is no standard way.

There are definite advantages to starting with a working non-ROS driver. Adding the necessary ROS initialization and message creation is generally straightforward.

However, if this driver is intended for widespread use, I would worry about the weight of the Qt dependencies. We generally like to minimize driver dependencies, so they can run on "headless" controllers with limited resources. That goal is not always achieved, but we do try.

I have written a couple of drivers for devices with UDP or TCP interfaces. For them, wrapping the raw C interfaces in an ad-Hoc C++ class worked fine. There are probably good light-weight C++ socket classes available, but I am not familiar with any.


Originally posted by joq with karma: 25443 on 2012-06-04

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

AFAIK, there is no standard way. Using the Qt libraries seems a good choice, especially since you already have the majority done. Build the ROS node for the device should prove easy then.


Originally posted by dornhege with karma: 31395 on 2012-06-04

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.