ros-drivers / transport_drivers

A set of ROS2 drivers for transport-layer protocols.
Apache License 2.0
92 stars 56 forks source link

serial_driver only supports one type of message #11

Closed JWhitleyWork closed 3 years ago

JWhitleyWork commented 4 years ago

Similar to #3 but for serial_driver. See https://github.com/ros-drivers/transport_drivers/blob/7660c2a02700ffafe8fc0839d45ff688c1a31db4/serial_driver/include/serial_driver/serial_driver_node.hpp#L64.

For some sensors, it'd be useful to be able to generate messages of different types

JWhitleyWork commented 4 years ago

Previous discussion: https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto/issues/132

flynneva commented 3 years ago

wouldnt it make sense for this package to purely handle grabbing data from the serial port and then publishing it to a ROS2 topic (uint8_t array or something) and then anyone could write a package that subscribes to that topic and does whatever they want with it?

what I mean by this question is isnt this the intended use of this serial_driver package?

JWhitleyWork commented 3 years ago

@flynneva While this is the way that the ROS1 implementation operated, the advantage here is that you don't have to deal with the additional overhead and delay of publishing each serial message. This allows you to simply inherit from this class and get all of the I/O functionality that you're looking for built into your node in a cross-platform manner.

flynneva commented 3 years ago

@JWhitleyWork so sort of like a psuedo pure cpp library for interfacing with serial devices....just specific for ROS2?

JWhitleyWork commented 3 years ago

Sort of, yes. I'm assuming by "psuedo-pure-cpp" you mean "using Boost."

flynneva commented 3 years ago

are there any examples of people using this library yet? ive been going off of what is in the test dir but would be cool to see it in action in the real world too.

JWhitleyWork commented 3 years ago

Autoware.Auto currently uses the released version. You can see an example in https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto/-/blob/master/src/drivers/xsens_nodes/include/xsens_nodes/xsens_common_node.hpp and a UDP example in https://gitlab.com/autowarefoundation/autoware.auto/AutowareAuto/-/blob/master/src/drivers/velodyne_nodes/include/velodyne_nodes/velodyne_cloud_node.hpp.

flynneva commented 3 years ago

so i guess my question is what is left to do if people can already use the library as desired?

if you want a generic serial package that works for all serial devices you'll have to just create a node using the library that publishes the data to a topic with a uint8_t array type or something....that would probably be the easiest way to do it. is that what people are asking for? that still only supports one type of message I guess....

flynneva commented 3 years ago

@JWhitleyWork for the udp_driver we got lucky that I had already released the udp_msgs package. should I get to work to develop a serial_msgs package as well?

flynneva commented 3 years ago

I created a repo really quickly for serial_msgs but I am probably missing something. feel free to check it out.

I can make a release pretty quickly once given the "green light".

JWhitleyWork commented 3 years ago

This is no longer the case since the major code reorg for 1.0. Closing.