February 2018
Beginner
580 pages
13h 20m
English
Here is the explanation of the code:
#include <pluginlib/class_list_macros.h> #include <nodelet/nodelet.h> #include <ros/ros.h> #include <std_msgs/String.h> #include <stdio.h>
These are the header files of this code. We should include class_list_macro.h and nodelet.h to access the pluginlib APIs and nodelets APIs:
namespace nodelet_hello_world
{
class Hello : public nodelet::Nodelet
{
Here, we create a nodelet class called Hello, which inherits a standard nodelet base class. All nodelet classes should inherit from the nodelet base class and be dynamically loadable using pluginlib. Here, the Hello class is going to be used for dynamic loading:
virtual void onInit() { ros::NodeHandle& private_nh = ...