What is function of action_name_ string in action server(ROSBasicsIn5DaysCPP)

The image below is taken from the answer for Action server pt2 in ROS Basics in 5 Days CPP course.

My question is: what is the use of “action_name_”? It is first declared as an std::string class within protected, and then passed as an argument in the constructor within public. What is going on, and how is this “action_name_” string taking the argument “name” in the constructor? Is this c++ syntax?

Sorry for the barrage of questions, i’m quite confused as the ROS wiki seems to show the same syntax(using “action_name_” as well), but doesn’t explain in depth what’s going on, as shown:

Would be great if someone can clear this doubt. Thanks!


To my understanding, action_name_ is simply used as an alternative to the variable name that is passed to the class constructor in order to later display the information with ROS_INFO and be more specific than just using name.

If you look forward to where action_name_ is being used, it is only inside ROS_INFO, which is used as a printf function that shows information in the terminal output.