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

Why there is no #define before PLUGINLIB_EXPORT_CLASS macro?

asked 2020-08-28 21:38:48 -0500

RicoJ gravatar image

updated 2020-08-29 01:00:33 -0500

gvdhoorn gravatar image

When we want to make a plugin, we need to register the plugin

PLUGINLIB_EXPORT_CLASS(carrot_planner::CarrotPlanner, nav_core::BaseGlobalPlanner)

My understanding is that this is the redefinition of the pluginlib_export_class macro. However, from what I have seen so far, we need #define for this. How come there is no #define?

Thanks, Rico

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-29 01:01:54 -0500

gvdhoorn gravatar image

updated 2020-08-29 03:27:26 -0500

My understanding is that this is the redefinition of the pluginlib_export_class macro.

Not quite: it's an invocation of the macro.

However, from what I have seen so far, we need #define for this. How come there is no #define?

Because you're not defining a macro, but invoking it.

edit flag offensive delete link more

Comments

Good point, but note that there is no semicolon ; after the macro. My understanding is that when we invoke a macro, there is always a ;. Here is an example for a macro with no semicolon

This is interesting

RicoJ gravatar image RicoJ  ( 2020-08-30 12:57:02 -0500 )edit

This seems like a different (but related) question.

Please post follow-up questions as new questions, instead of as comments under answers to your original question.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-31 01:13:51 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-08-28 21:38:48 -0500

Seen: 78 times

Last updated: Aug 29 '20