Expose typesupport_helpers API needed for the Rosbag2#2858
Expose typesupport_helpers API needed for the Rosbag2#2858MichaelOrlov merged 2 commits intorollingfrom
typesupport_helpers API needed for the Rosbag2#2858Conversation
typesupport_helpers API needed for the Rosbag2typesupport_helpers API needed for the Rosbag2
typesupport_helpers API needed for the Rosbag2typesupport_helpers API needed for the Rosbag2
|
Rpr CI build failed with error message: 18:04:22 --- stderr: rclcpp_lifecycle
18:04:22 /tmp/ws/src/rclcpp/rclcpp_lifecycle/src/lifecycle_node_interface_impl.cpp: In member function ‘rcl_ret_t rclcpp_lifecycle::LifecycleNode::LifecycleNodeInterfaceImpl::change_state(uint8_t, rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn&)’:
18:04:22 /tmp/ws/src/rclcpp/rclcpp_lifecycle/src/lifecycle_node_interface_impl.cpp:412:39: error: ‘rcl_lifecycle_get_transition_label_by_id’ was not declared in this scope; did you mean ‘rcl_lifecycle_get_transition_by_id’?
18:04:22 412 | const char * transition_label = rcl_lifecycle_get_transition_label_by_id(
18:04:22 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18:04:22 | rcl_lifecycle_get_transition_by_id
18:04:22 gmake[2]: *** [CMakeFiles/rclcpp_lifecycle.dir/build.make:90: CMakeFiles/rclcpp_lifecycle.dir/src/lifecycle_node_interface_impl.cpp.o] Error 1
18:04:22 gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/rclcpp_lifecycle.dir/all] Error 2
18:04:22 gmake: *** [Makefile:146: all] Error 2But it seems unrelated to the changes from this PR. |
|
@ros-pull-request-builder retest this please |
0ce6124 to
752eeab
Compare
| /// Load the type support library for the given type. | ||
| /** | ||
| * \param[in] type The topic type, e.g. "std_msgs/msg/String" | ||
| * \param[in] typesupport_identifier Type support identifier, typically "rosidl_typesupport_cpp" | ||
| * \return A shared library | ||
| */ |
There was a problem hiding this comment.
I think exposing these makes sense, but I'd prefer keeping this documentation style, since all of rclcpp uses /// for the one-line function summary and/** ... */ for the rest.
There was a problem hiding this comment.
I want to keep changed C++ style for the Doxygen comments.
If someone was wrong doing in the style of the Doxygen comments, it doesn't necessarily mean that everybody should repeat and follow this bad style.
First of all C style doxygen comments should be used only for C files and C++ header files which could participate in the compilation with C compiler when present and used C compatible API. This is true for the RCL, RCLUTILS and sometimes for the RMW header files when they need to be used from the RCL packages.
There are no benefits to using C style in C++ code.
This is the same as asking someone to use malloc instead of new with unique_ptr or shared_ptr in C++ files just because in other files, historically, from the ancient ages was used malloc.
Moreover, in case of the RCLCPP package the current style for the Doxygen comments this is not even a pure C style. This is total mess!
In Doxygen ///: Used for a one-line comment or to document a single line of code. This is typically used for short summaries or descriptions that fit on one line.
/// This function adds two numbers.
int add(int a, int b);By the way, C compiler will not understand comments with ///.
In Doxygen the /** ... */: Used for multi-line comments. This is typically for more detailed documentation, including function descriptions, parameters, return values, and any additional information you want to include. It's common to start with /** and end with */.
/**
* Adds two integers.
* This function takes two integers as arguments and returns their sum.
*
* @param a The first integer.
* @param b The second integer.
* @return The sum of a and b.
*/
int add(int a, int b);We have used both of them for no reason. Moreover, to strictly follow Doxygen syntax, the brief multiline description, details, or notes should be prefixed with the appropriate Doxygen tags like \brief, \notes, \details, \warning, etc.
In the current "RCLCP Doxygen" style, nobody follows this convention, and our documentation is often messy. It is not bad, but it could be more structured and concise with the appropriate tags.
From my personal experience, I found that using /// style in the C++ files is more concise and structured, and as on the opposite side, using /** ... */ very often clutters the code and comments with dummy empty lines with /**, */ and make content less readable for user. On average, I need more time to read and understand Doxygen comments written with the cluttered /** ... */ rather than with the short and concise /// style. That is almost the same as comparing YAML and XML formats for human reading and comprehension.
There was a problem hiding this comment.
By the way, the claim that all files in the RCLCPP package are written in this file is not true, I found at least one header file https://github.com/ros2/rclcpp/blob/rolling/rclcpp/include/rclcpp/parameter_map.hpp with the /// Doxygen style.
There was a problem hiding this comment.
If you want to change the comment style in this case, just open a separate PR and this can be discussed there. This PR seems to be about exposing functions, not about changing documentation style.
There was a problem hiding this comment.
I've spent my time over the weekend making the Doxygen documentation in the typesupport_helpers.hpp look the best way and comply with the best Doxygen practice and now you are asking me to revert it back to the more or less "uglish" stage and create a separate PR just for Doxygen changes.
That is ridiculous!
I can revert it to make it look like an "original" from the ancient ages. However, I will not create a separate PR just for the Doxygen changes and try to convince someone to accept them. I have more important things to do on my plate.
BTW, such a restrictive approach will not make the ROS 2 core code better.
There was a problem hiding this comment.
There was a problem hiding this comment.
Hm, this is not helpful. I would suggest to move this to the PMC and agree on one standard.
I don't want to end up in a situation were developer A changes the doc style to one style in every file he touches, and developer B changes is back to a different style. This is just counter productive.
There was a problem hiding this comment.
I just have two separate points:
- As mentioned above, we don't have a clear single choice for documentation style, which is mostly fine, because it's "just" documentation. I also don't think we should spend a ton of time on it (I also have more important things to do), and I don't think we should start pushing all decisions to the PMC meetings. However, if we want to keep things less restrictive, I think what's left is the "consistency principle," i.e., keep the documentation style/whatever consistent.
rclcppis mostly using this style, so I don't see a strong reason to change it. - We shouldn't bundle unrelated changes in the same PR. Keeping things separate makes reviews and backports much easier, as Tomoya said. If you think this style is better technically for Doxygen, then that's good to know, but let's consider and discuss that change in its own PR.
If other maintainers want to take this PR as-is, then go for it.
There was a problem hiding this comment.
I would vote for the consistency on a per-file basis rather than on a per-package basis.
This way, we can gradually improve the quality of the Doxygen comments.
As I mentioned above, we already have at least one file https://github.com/ros2/rclcpp/blob/rolling/rclcpp/include/rclcpp/parameter_map.hpp with the /// Doxygen style.
There was a problem hiding this comment.
We shouldn't bundle unrelated changes in the same PR. Keeping things separate makes reviews and backports much easier, as Tomoya said. If you think this style is better technically for Doxygen, then that's good to know, but let's consider and discuss that change in its own PR.
basically i will stand with this, this is practically useful and good maintainability for downstream branches. but with this one, maybe there would not be any conflicts for downstream branches. so i think that would be okay.
fujitatomoya
left a comment
There was a problem hiding this comment.
lgtm.
i am not even sure why those APIs are not exposed before. i think it would be better to expose them, so that other application and libraries can depend on it.
| /// Load the type support library for the given type. | ||
| /** | ||
| * \param[in] type The topic type, e.g. "std_msgs/msg/String" | ||
| * \param[in] typesupport_identifier Type support identifier, typically "rosidl_typesupport_cpp" | ||
| * \return A shared library | ||
| */ |
There was a problem hiding this comment.
usually breaking down the PR into specific changes would be easier to backport for the downstream branches for the maintainability, but i do not mind that for this PR. it changes this file anyway. and the doc fix is minor so if we want to, we can pick this change to downstream branches. or maybe we do not need the backport... this kind of refactoring is not mandatory, we can just wait it out.
|
Pulls: #2858 |
|
Pulls: #2858 |
|
|
@claraberendsen Is it normal that the Windows build has so many unrelated test failures? |
|
Windows CI failure is unrelated again.
|
|
The same error on CI
Re-running Windows CI with the excluded |
|
|
Pulls: #2858 |
- Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
Signed-off-by: Michael Orlov <michael.orlov@apex.ai>
752eeab to
a7cb588
Compare
|
Re-run Ci after rebase to the latest Rolling |
|
CI is green! Merging then. |
|
https://github.com/Mergifyio backport kilted jazzy |
✅ Backports have been createdDetails
|
* Expose extract_type_identifier and get_typesupport_library_path API - Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Use C++ style in doxygen documentation Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 448287b)
* Expose extract_type_identifier and get_typesupport_library_path API - Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Use C++ style in doxygen documentation Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 448287b) # Conflicts: # rclcpp/include/rclcpp/typesupport_helpers.hpp
…port #2858) (#2902) * Expose `typesupport_helpers` API needed for the Rosbag2 (#2858) * Expose extract_type_identifier and get_typesupport_library_path API - Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Use C++ style in doxygen documentation Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 448287b) # Conflicts: # rclcpp/include/rclcpp/typesupport_helpers.hpp * Address merge conflicts Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com>
* Expose extract_type_identifier and get_typesupport_library_path API - Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 * Use C++ style in doxygen documentation --------- (cherry picked from commit 448287b) Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com>
…port ros2#2858) (ros2#2902) * Expose `typesupport_helpers` API needed for the Rosbag2 (ros2#2858) * Expose extract_type_identifier and get_typesupport_library_path API - Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Use C++ style in doxygen documentation Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 448287b) # Conflicts: # rclcpp/include/rclcpp/typesupport_helpers.hpp * Address merge conflicts Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com>
* QoSInitialization::from_rmw does not validate invalid history policy values, leading to silent failures (ros2#2841) (ros2#2845) (cherry picked from commit 73e9bfb) Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> * get_all_data_impl() does not handle null pointers properly, causing segmentation fault (backport ros2#2840) (ros2#2851) Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> * Added missing chrono includes (ros2#2854) (ros2#2856) (cherry picked from commit 373a63c) Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> * Fix for memory leaks in rclcpp::SerializedMessage (ros2#2861) (ros2#2864) (cherry picked from commit 8d44b95) Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com> Co-authored-by: kylemarcey <marcey.kyle@gmail.com> * Replace std::default_random_engine with std::mt19937 (humble) (ros2#2847) (ros2#2867) (cherry picked from commit a0e2240) Signed-off-by: keeponoiro <keeeeeeep@gmail.com> Co-authored-by: keeponoiro <keeeeeeep@gmail.com> * Changelog Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> * 28.1.10 * fix test_publisher_with_system_default_qos. (ros2#2881) (ros2#2883) (cherry picked from commit e6577c6) Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * Shutdown deadlock fix jazzy (ros2#2887) * fix: Don't deadlock if removing shutdown callbacks in a shutdown callback Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> * refactor: Made fix API compatible Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> --------- Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com> * Event exec timer fix for ros2#2889 (ros2#2890) Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Signed-off-by: Janosch Machowinski <jmachowinski@users.noreply.github.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> * Add overload of `append_parameter_override` (ros2#2891) (ros2#2895) (cherry picked from commit fa0cf2d) Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com> Co-authored-by: Patrick Roncagliolo <ronca.pat@gmail.com> * Fujitatomoya/test append parameter override (ros2#2896) (ros2#2900) (cherry picked from commit 84c6fb1) Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> * [jazzy] Expose `typesupport_helpers` API needed for the Rosbag2 (backport ros2#2858) (ros2#2902) * Expose `typesupport_helpers` API needed for the Rosbag2 (ros2#2858) * Expose extract_type_identifier and get_typesupport_library_path API - Rationale: We need to use this API in the Rosbag2 - Reference PR ros2/rosbag2#2017 in the Rosbag2 Signed-off-by: Michael Orlov <michael.orlov@apex.ai> * Use C++ style in doxygen documentation Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> (cherry picked from commit 448287b) # Conflicts: # rclcpp/include/rclcpp/typesupport_helpers.hpp * Address merge conflicts Signed-off-by: Michael Orlov <michael.orlov@apex.ai> --------- Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Co-authored-by: Michael Orlov <morlovmr@gmail.com> * Add qos parameter for wait_for_message function (ros2#2903) (ros2#2906) (cherry picked from commit 2fcef70) Signed-off-by: Sriharsha Ghanta <ghanta1996@gmail.com> Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Co-authored-by: Sriharsha Ghanta <ghanta_sriharsha@mymail.sutd.edu.sg> Co-authored-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> * Fix `start_type_description_service` param handling (ros2#2897) (ros2#2909) * Fix `start_type_description_service` param handling * Add test * Demonstrate different exceptions depending on node options * Same exact exception and `what()` message in both cases * Uncrustify --------- (cherry picked from commit 4fb558a) Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com> Co-authored-by: Patrick Roncagliolo <ronca.pat@gmail.com> --------- Signed-off-by: Alejandro Hernandez Cordero <ahcorde@gmail.com> Signed-off-by: Michael Orlov <morlovmr@gmail.com> Signed-off-by: Michael Orlov <michael.orlov@apex.ai> Signed-off-by: keeponoiro <keeeeeeep@gmail.com> Signed-off-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com> Signed-off-by: Janosch Machowinski <jmachowinski@users.noreply.github.com> Signed-off-by: Patrick Roncagliolo <ronca.pat@gmail.com> Signed-off-by: Sriharsha Ghanta <ghanta1996@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com> Co-authored-by: Michael Orlov <morlovmr@gmail.com> Co-authored-by: kylemarcey <marcey.kyle@gmail.com> Co-authored-by: keeponoiro <keeeeeeep@gmail.com> Co-authored-by: Tomoya Fujita <Tomoya.Fujita@sony.com> Co-authored-by: Janosch Machowinski <jmachowinski@users.noreply.github.com> Co-authored-by: Janosch Machowinski <J.Machowinski@cellumation.com> Co-authored-by: Patrick Roncagliolo <ronca.pat@gmail.com> Co-authored-by: Sriharsha Ghanta <ghanta_sriharsha@mymail.sutd.edu.sg>
Description
extract_type_identifier(const std::string & full_type)andget_typesupport_library_path( const std::string & package_name, const std::string & typesupport_identifier)API to be publicly available for usage from other packages.Rationale:
extract_type_identifier(const std::string & full_type)andget_typesupport_library_path( const std::string & package_name, const std::string & typesupport_identifier)API from the RCLCPP package in order to get rid of the code duplication and possible implementation divergences in the future for the same utility functions.Please refer to the relevant Rosbag2 PR Use rclcpp type support helpers in rosbag2_cpp rosbag2#2017
Fixes # (issue) N/A
Is this user-facing behavior change?
No.
Did you use Generative AI?
Yes. Github Copilot, GPT-4.1, to help write Doxygen comments for the API.
Additional Information