Skip to content

No error prompt for namespace typo in plugin declaration #5745

Open
ros2/rclcpp
#2878
@Jessen-Li

Description

@Jessen-Li

In "Writing an action server and client(C++)" of ROS2 humble document,in CMakeList.txt, if I happen to have a typo in the PLUGIN name of

rclcpp_components_register_node(action_server PLUGIN "action_tutorials_cpp::FibonacciActionServer" EXECUTABLE fibonacci_action_server)

rendering it

rclcpp_components_register_node(action_server PLUGIN "action_tutorials_cpp:FibonacciActionServer" EXECUTABLE fibonacci_action_server)

Have you noticed the difference? I mistakenly use:rather than::in representing namespace. However, it prompts no error either in colcon build or ros2 run. Nonetheless, when running ros2 node list, nothing comes out. Such a typo took me great efforts to pinpoint, and openAI couldn't help me troubleshoot it. Though it may be impractical for ament_cmake to detect the typo, the class loader definitely fails silently to find the class, which could be improved to report error, and terminate the program when it deems necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions