ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

ros node, ros driver and ros wrapper

asked 2015-01-29 00:10:44 -0600

dmngu9 gravatar image

Hi guys,

Im new to ros and am confused about what is the difference between ros node and ros driver? Because i saw some posts about ros wrapper for device with linux driver to make ros node.

Please explain . thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
5

answered 2015-01-29 03:11:37 -0600

updated 2015-01-29 03:13:53 -0600

  • A ROS node is any program that uses ROS to publish/subscribe to topics, calls or provides services etc. ROS nodes #include some ROS headers (C++) or import ROS modules (Python) and call functions defined there, like ros::init() / rospy.init_node(), publish() and so on. Some ROS nodes are "ROS drivers", others do path planning/sensor data processing/whatever.
  • A ROS driver is a ROS node that makes a piece of hardware accessible from ROS. For example, it talks to a laser scanner and publishes the output of the device as ROS messages.
  • Sometimes, the actual Linux hardware driver is part of the ROS driver node; however, it's better to separate the hardware driver and the ROS communication part. In that case, the Linux driver is usually provided as a ROS-agnostic library, and the ROS driver simply performs API calls to that library and converts the results to ROS messages. In that case, it is called a ROS wrapper.

As an example, the sicktoolbox is a standalone Linux device driver library for SICK laser scanners. If you search the source code, you won't find any mention of ROS in the actual source files. The sicktoolbox_wrapper is a ROS package that contains several ROS nodes, for example sicklms. If you look at the source code (sicklms.cpp), you can see that it's a ROS node that uses the sicktoolbox API (by calling GetSickScan()) and publishes the result as a ROS message, so it's a ROS wrapper:

#include "ros/ros.h"
[...]
ros::init(argc, argv, "sicklms");
[...]
sick_lms.GetSickScan(range_values, intensity_values, n_range_values, n_intensity_values);
[...]
pub->publish(scan_msg);
edit flag offensive delete link more

Comments

Thanks for the reply. Just another quick question, what is the meaning of n.param("my_param",i,40)? It does not explain clearly on the wiki.

dmngu9 gravatar image dmngu9  ( 2015-01-29 23:30:09 -0600 )edit

It looks for "my_param" on the parameter server and stores the value in i. If the param is not present, it stores 40 in i. (That's why the wiki says 40 is the default value; I think it's explained clearly there.)

Martin Günther gravatar image Martin Günther  ( 2015-01-30 02:48:58 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2015-01-29 00:10:44 -0600

Seen: 3,492 times

Last updated: Jan 29 '15