How do I get action name in cpp?

asked 2020-03-27 12:34:20 -0500

jiseongyoo gravatar image

Hi all,

I am practicing action_server and client with eloquent, and trying to get action name. But rclcpp_action::create_server<actionT> seems not to have get_action_name() function. In case of service and pubsub, there are get_service_name() and get_topic_name() to get service and topic name.

Is there a function like that for action?? When I tried get_action_name(), it shows below error.

error: ‘using element_type = class rclcpp_action::Server<interfaces::action::Example> {aka class rclcpp_action::Server<interfaces::action::Example>}’ has no member named ‘get_action_name’


edit retag flag offensive close merge delete


What is the "interfaces::action::Example"? That doesnt look like an .action file name, unless your package is called "interfaces" and your file is called "Example"

stevemacenski gravatar image stevemacenski  ( 2020-03-27 21:43:16 -0500 )edit

That's my customed action interface and from .action file.

jiseongyoo gravatar image jiseongyoo  ( 2020-03-28 00:25:44 -0500 )edit

Can you post your entire code snippet?

stevemacenski gravatar image stevemacenski  ( 2020-03-28 01:02:30 -0500 )edit