-
Notifications
You must be signed in to change notification settings - Fork 142
feat: implement ament_auto_generate_code
#600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Kotaro Yoshimoto <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
this dramatically reduces boilerplate for ROS interface packages and makes code generation and target linkage easier and less error-prone.
@HansRobo are you still working on this? i see this is tagged with draft.
|
The underlying macro which backs this functionality is In general, there is no awareness of ROS-specific mechanisms like rosidl in |
|
I fixed a bug and finished the build check on my repository. HansRobo/ros2_sandbox#4 |
|
@cottsay Thank you for your feedback. |
|
@cottsay thanks for the comment. i agree with you that it should stay in rosidl repository. |
This pull request adds an implementation for
ament_auto_generate_code, which until now had an empty implementation.This will automatically generate code for interfaces which are located below.
msg/*.msgsrv/*srvaction/*actionWith this, many interface packages can have a simple CMake file like this:
Link generated interfaces to targets in same package with
TARGETSoptionAs described here, to use an interface in source code of the same package, explicit linking of the interface is required, which requires additional CMake instructions. With
ament_auto_generate_code, linking is performed automatically by simply specifying the array of targets you want to link in theTARGETSoption.Proper propagation of dependency updates
The
ament_cmake_autofunctions create a file list using globs, so even if build files or messages are added or removed, the CMake file does not need to be updated, and it was not possible to detect this and perform a rebuild.However, this implementation uses the
CONFIGURE_DEPENDSoption added in CMake 3.12 to detect changes in the file list and automatically perform a rebuild.