In Ubuntu 18.04 and ROS melodic, the following compilation error will occur (ubuntu 16.04 & ROS kinetic works fine however):
error: expected constructor, destructor, or type conversion before ‘(’ token
PLUGINLIB_DECLARE_CLASS(router, RouterNode, RouterNode, nodelet::Nodelet);
The solution is to change the line from:
PLUGINLIB_DECLARE_CLASS(router, RouterNode, RouterNode, nodelet::Nodelet);
to:
PLUGINLIB_EXPORT_CLASS(RouterNode, nodelet::Nodelet);
Note that this issue is caused by different versions of pluginlib and this similar issue will happen 3 times (CascadeControllerNode, MissionTemplateNode, RouterNode). Just using similar fixes will be fine.
In Ubuntu 18.04 and ROS melodic, the following compilation error will occur (ubuntu 16.04 & ROS kinetic works fine however): error: expected constructor, destructor, or type conversion before ‘(’ token PLUGINLIB_DECLARE_CLASS(router, RouterNode, RouterNode, nodelet::Nodelet);
The solution is to change the line from: PLUGINLIB_DECLARE_CLASS(router, RouterNode, RouterNode, nodelet::Nodelet); to: PLUGINLIB_EXPORT_CLASS(RouterNode, nodelet::Nodelet);
Note that this issue is caused by different versions of pluginlib and this similar issue will happen 3 times (CascadeControllerNode, MissionTemplateNode, RouterNode). Just using similar fixes will be fine.
One can find the references from 1, 2, 3.