Unit 5.4 Clarification

Hello, I have some questions to be clarified when following the Unit 5.4 Create an Action Interface.

We were prompted to create the Action directory in the custom_interface created couple units ago, however, I find that the name of the directory needs to be lower case action and the .action file needs to be capitalized Move.action (Also, why is it specifically looking for Move.action and not Custom_name.action?)

In addition, inside the CMakeLists.txt
we need to remain unchanged for project(custom_interfaces) instead of changing it to project(t3_action_msg)

and in package.xml
remain <name>custom_interfaces</name> instead of <name>t3_action_msg</name>

If I change anything, the colon build will break…
image

I just wanted to ensure I’m not breaking any rules or missing any consistency with naming.

Lastly, there’s a warning which I’m not sure what it means when building:

user:~/ros2_ws$ colcon build --packages-select custom_interfaces
[0.638s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
        'custom_interfaces' is in: /home/user/ros2_ws/install/custom_interfaces
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so
may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API and ABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
        --allow-overriding custom_interfaces

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> custom_interfaces
Finished <<< custom_interfaces [4.21s]

Summary: 1 package finished [4.66s]

Ok, I think I figured out the first part of my question:
the capitalized and lower cases were specified by in the CMake:
image

Hi @Genozen ,

Yes, the folder containing action interfaces must be named action and not Action. That might be a typo error in the course notes.
The action interface definition file must be named in CamelCase. This is the convention ROS1 and ROS2 follows. If you use underscores in your interface file name, that may not get detected.
So, your action interface definition file name would be MyCustomActionInterface.action.
It CANNOT be named as mycustomactioninterface.action or my_custom_action_interface.action or myCustomActionInterface.action.

This, I believe is a copy-paste error. It should read project(custom_interfaces).

Yes, here also, <name>custom_interfaces</name> is the correct line.

Yes, this is true. You need to follow the conventions and procedure correctly.

This warning is just telling you that the package has been previously built with specific configuration and the current build will replace and/or overwrite previously built version.
To solve this, delete the build, install and log folders and do the build command again (from ~/ros2_ws directory)
colcon build --packages-select custom_interfaces

Hope I cleared all your doubts.

Let me know if this solved your problem.

Regards,
Girish

1 Like

Great, hopefully they could add the correction on the next update :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.