kindr_ros
kindr_ros copied to clipboard
[ROS2] Port kindr_ros and kindr_msgs
Summary of non-ROS2 specific changes. These could potentially be cherry picked into the ROS1 branch to avoid future merge conflicts:
- Using tf2 instead of tf (f022c41ba831a5d8db15041fe09f85f96dbf8440)
- Linted all files in kindr_msgs and kindr_ros with cppcheck, cpplint, lint_cmake, xmllint, and uncrustify (af5667c08e3b9fb484385dec702bd95356eacbb2, 51b18eccbed6ce7f77df2acc4248a459d2943a43)
- Removed what looks to be unnecessary variables that triggered unused-but-set-variable warnings (250f0e03d57ca640850ba54c0171875e164605ca)
ROS2 specific changes:
- Updated the package.xml format
- Replaced catkin with ament_cmake
- Changed geometry_msgs include paths, and namespace to the new ROS2 convention.
All 18 gtests run and pass for me. I've targeted ROS2 Galactic, but I see not reason why it shouldn't work with ROS2 Foxy.
The rviz plugins haven't been ported yet.
Partly resolves #22
@SivertHavso We internally discussed the matter of formatting of code: As we are using this style for most of our closed source and open source code, we decided that it would make sense to use it also on the ROS2 branches.
Would you mind adopting it after merging this PR?
@remod Sure, in the process of doing it now. On my ROS2 working branch I've got it set to run clang-format, cppcheck, gtest, lint_cmake, and xmllint automatically (through the corresponding ament_cmake packages) as part of testing now, and have disabled the cpplint and uncrustify linters because they expect a different style. I'm getting a lot of failures from clang_format with your style though.
For example clang-format wants:
template <typename PrimType_>
inline static void convertFromRosGeometryMsg(const geometry_msgs::msg::Point& geometryPointMsg, kindr::Position<PrimType_, 3>& position) {
position.x() = static_cast<PrimType_>(geometryPointMsg.x);
position.y() = static_cast<PrimType_>(geometryPointMsg.y);
position.z() = static_cast<PrimType_>(geometryPointMsg.z);
}
instead of the current: https://github.com/ANYbotics/kindr_ros/blob/f0bd43cc1497674c52c43ab78e2f52d1002185de/kindr_ros/include/kindr_ros/RosGeometryMsgPhysicalQuantities.hpp#L84-L92
I get the same results running ament_clang_format or clang-format directly for both the master branch and my ROS2 working branch, "12 files with 218 code style divergences".
I'm quite sure it's loading your custom configuration because settings such as PointerAlignment: Left
to PointerAlignment: Right
increases the amount of failures.
Can you confirm whether the master branch is formatted correctly according to your style please?
Can you confirm whether the master branch is formatted correctly according to your style please?
No you are right, this package is not formatted according to our guidelines yet. I'll do that today!