Im working on a project and i want to use a sensor. I can plug in the sensor via usb. I do not need any driver for the sensor. My task is to have an access to the sensor data. I have followed the tutorial on this page: http://clearpathrobotics.com/assets/guides/ros/Udev%20Rules.html But i dont know if this is my soution. I dont know what to do now. How can i have access to the data in ROS? Do i have to create a publisher?
-
$\begingroup$ How can I take raw data from the sensors and publish it to a ROS topic? $\endgroup$– S. YildizJul 23, 2018 at 11:29
-
$\begingroup$ You say that you do not need a driver for this sensor? Is it a serial-based sensor? $\endgroup$– Paul BelangerJul 23, 2018 at 12:52
-
$\begingroup$ Yes it is a serial based sensor $\endgroup$– S. YildizJul 23, 2018 at 13:13
-
$\begingroup$ Please give some information about the sensor. Maybe there are already ROS packages available. $\endgroup$– Tik0Jul 24, 2018 at 2:08
2 Answers
The use of udev rules is orthogonal to the publishing of sensor data. Look at the publisher side of the Writing a Publisher and Subscriber tutorial, but instead of pushing string messages to the topic, push data from your sensor instead.
If there is not already a standard message type to encapsulate your data, you can define a custom message type.
i have found the solution. I had to do it like that: https://github.com/garyservin/serial-example/blob/master/src/serial_example_node.cpp