-
Notifications
You must be signed in to change notification settings - Fork 193
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
Port tf2_kdl #90
Port tf2_kdl #90
Conversation
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.
This would be great to have. Before merging this I'd like to see the unit tests ported too. They use a launch file in ROS1 but in ROS2 there's no master so that's not necessary for unit tests so everything can just be a unit test. The launch file only launches a single executable at a time anyway.
This port is still incomplete. Here are some issues that remain:
|
|
||
catkin_python_setup() |
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.
python libs need to be exported with
ament_python_install_package(${PROJECT_NAME}
PACKAGE_DIR src/${PROJECT_NAME})
tf2_kdl/CMakeLists.txt
Outdated
endif() | ||
|
||
endif() | ||
# if(BUILD_TESTING) |
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.
Don't just comment out tests. This port still needs work which gets hidden because the tests are disabled.
@vmayoral I'm moved this back to "in progress", let me know if/when it's ready for another round of review. |
Sure @jacobperron, will do. |
@ahcorde cherry-picked your commits here. Please review. |
@jacobperron, after @ahcorde's review, it should be ready to go from our side. |
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.
There are a few things to fixup here, but nothing major.
tf2_kdl/test/test_tf2_kdl.cpp
Outdated
// auto node = rclcpp::Node::make_shared("test"); | ||
rclcpp::init(argc, argv); | ||
rclcpp::Clock::SharedPtr clock = std::make_shared<rclcpp::Clock>(RCL_SYSTEM_TIME); | ||
tf_buffer = new tf2_ros::Buffer(clock); |
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.
I think this would be better as a std::unique_ptr
. Then we would make sure not to leak memory below.
tf2_kdl/test/test_tf2_kdl.cpp
Outdated
#include "tf2_ros/buffer.h" | ||
|
||
#include <tf2/convert.h> | ||
|
||
tf2_ros::Buffer* tf_buffer; |
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.
See comment below about making this a std::unique_ptr
.
tf2_kdl/include/tf2_kdl/tf2_kdl.h
Outdated
* \return The TimePoint conversion. | ||
*/ | ||
inline | ||
tf2::TimePoint timePointFromTime(const builtin_interfaces::msg::Time& t) |
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.
We already have versions of this and timeFromTimePoint
in https://github.com/ros2/geometry2/blob/ros2/tf2_ros/include/tf2_ros/buffer_interface.h#L46 ; is there any reason we can't use those?
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.
Done, But I was wondering if this methods should go into tf2/time.h
. inside tf2_ros/buffer_interface.h
it's not very intuitive
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.
Done, But I was wondering if this methods should go into
tf2/time.h
. insidetf2_ros/buffer_interface.h
it's not very intuitive
The reason for that is that tf2
itself is meant to be ROS-agnostic; you'll notice that there are no includes of ROS header files anywhere directly in tf2. The interface between tf2 and ROS comes via the tf2_ros package.
That being said, I agree that it is not very intuitive that the time functions are in tf2_ros/buffer_interface.h
. I'd be in favor of making a new file tf2_ros/time.h
where these methods would go, but I'll suggest we do that in a separate PR.
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.
Sure! I like tf2_ros/time.h
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.
One more minor change, then this is good to go from me. I'll run CI on it in the meantime.
tf2_kdl/test/test_tf2_kdl.cpp
Outdated
t.header.frame_id = "A"; | ||
t.child_frame_id = "B"; | ||
tf_buffer->setTransform(t, "test"); | ||
|
||
int retval = RUN_ALL_TESTS(); | ||
delete tf_buffer; | ||
tf_buffer.reset(); |
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.
With the change to a unique_ptr
, this shouldn't be necessary; it will be destroyed as it goes out of scope. So you can just remove this.
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.
This is still unresolved in the latest patches.
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.
Done
@clalancette could you please consider #93 as well (required for moveit2 as well) |
It looks like Windows is upset for two different reasons:
The M_PI thing we've dealt with before, but I can't exactly remember how; @tfoote , do you remember? The loss of precision thing is actually true, so we either need to explicitly cast it or do something smarter there. |
Actually, before I run CI again, there hasn't been any change for the Windows loss of precision, so @ahcorde will need to do something about that before moving forward. |
can you try the CI with this last commit?
I was assigning a double. Probably the sizeof(double) and the sizeof(int32) (or sizeof(uint32)) is different and that's why it's failing. |
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.
One last nitpick, then I'm happy to approve.
Signed-off-by: Chris Lalancette <[email protected]>
Signed-off-by: Chris Lalancette <[email protected]>
Sorry for being quiet here. After a bit of discussion with @tfoote , I think we've determined that for now it will be fine to just not build and install the python stuff, and leave that as a TODO for later. So we can forget about #99 in terms of this PR; I'll open an issue on this repository to finish that porting. Towards getting things finished, I've taken the liberty of rebasing this PR and doing some cleanup in the CMakeLists.txt and package.xml to get things moving again. Take a look at what I've done in ec63e8b, and let me know what you think. I'm also going to run CI on this shortly. |
And issue for python port opened in #110 |
All right, CI is all green and things seem happy. I'm going to give this 24 hours for any further objections, then I'll merge it. |
@clalancette Thanks for reviewing it 👍 |
This pull request has been mentioned on ROS Discourse. There might be relevant details there: https://discourse.ros.org/t/the-moveit-2-journey-part-1-porting-and-understanding-moveit-core/8718/1 |
No description provided.