HKUST-Aerial-Robotics/Teach-Repeat-Replan

A minor fix in pluginlib for those using Ubuntu 18.04 and ROS melodic

syangav opened this issue · 3 comments

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.

Thank you very much for correction. I will post it to readme.md, hoping to help more people that use Ubuntu 18.04 and ROS melodic.

太感谢了!!!!!!!!

Having the same problem in ROS Noetic and Ubuntu 20.04