-
Notifications
You must be signed in to change notification settings - Fork 948
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
replaced eigen_conversions with tf2_eigen in moveit_core #2472
Conversation
Thanks for helping in improving MoveIt and open source robotics! |
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.
Thanks for this initial work. Could you, please, continue replacing eigen_conversions
in all remaining packages as well (not only moveit_core)? I just pushed another commit removing eigen_conversions
from various cmake
files and package.xml
(but did not yet adapted the actual conversion routines).
Note, that there are also many eigen_conversions
in moveit_planners/pilz_industrial_motion_planner*
.
Codecov Report
@@ Coverage Diff @@
## master #2472 +/- ##
==========================================
- Coverage 60.30% 60.26% -0.03%
==========================================
Files 351 351
Lines 26471 26475 +4
==========================================
- Hits 15960 15953 -7
- Misses 10511 10522 +11
Continue to review full report at Codecov.
|
Just for the record, this belongs to a first-timer-only issue I opened (#2437). Basically, all methods in the So far, I found these methods in these files:
I just used |
No problem, @gleichdick. Are there any functionality tests or we just consider passed build as proof of well done migration? Also, is it convention to commit changes to the pull request multiple times (as one would on a normal coding project) or should it be done only once, when the whole issue is solved? |
Thanks, for handling the remaining conversions as well. It's no problem, to push as many commits as you like to a PR branch. |
I have replaced As result, my build fails with:
Do you know what could be the cause of missed definition? As far as I can see, I have included all the relevant files as in moveit_planners/pilz_industrial_motion_planner_testutils/include/pilz_industrial_motion_planner_testutils/cartesianconfiguration.h, where tf2::convert raises no issue? |
Could you try to replace the const geometry_msgs::Pose pose_msg = tf2::toMsg(trajectory.Pos(*time_iter));
tf2::fromMsg(pose_msg, pose_sample); In this case, PPS. One small nitpick: In the header |
@gleichdick thank you for your help. If I am not wrong, all tf:: occurrences are now replaced as well as eigen_conversions dependancies. |
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.
Thanks for this work. Let's see whether CI will be satisfied now.
moveit_planners/ompl/CMakeLists.txt
Outdated
tf2 | ||
tf2_eigen |
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.
Are you sure tf2_eigen is required for building? This PR, only comprises changes to the testing code of OMPL.
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 tf2_ros is also not necessary
@@ -8,7 +8,6 @@ add_definitions(-Wextra) | |||
add_definitions(-Wno-unused-parameter) | |||
|
|||
find_package(catkin REQUIRED COMPONENTS | |||
eigen_conversions | |||
kdl_conversions |
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.
What about kdl_conversions
? Is this still needed, now that you use eigen_kdl
?
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.
Good work, you're almost done!
@@ -1387,7 +1386,7 @@ void IKFastKinematicsPlugin::transformToChainFrame(const geometry_msgs::Pose& ik | |||
if (base_transform_required_) | |||
ik_eigen_pose = chain_base_to_group_base_ * ik_eigen_pose; | |||
|
|||
tf::transformEigenToKDL(ik_eigen_pose, ik_pose_chain); | |||
tf2::convert(ik_eigen_pose, ik_pose_chain); |
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.
Please use the explicit conversion (toMsg()
/ fromMsg()
) for the same reason as before
moveit_planners/ompl/CMakeLists.txt
Outdated
tf2 | ||
tf2_eigen |
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 tf2_ros is also not necessary
This should fix the linking error in the CI: --- a/moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_circ.cpp
+++ b/moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_circ.cpp
@@ -42,12 +42,12 @@
#include <kdl/trajectory_segment.hpp>
#include <kdl/utilities/error.h>
#include <kdl/utilities/utility.h>
-#include <kdl_conversions/kdl_msg.h>
#include <moveit/robot_state/conversions.h>
#include <ros/ros.h>
#include <tf2/convert.h>
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
+#include <tf2_kdl/tf2_kdl.h>
namespace pilz_industrial_motion_planner
{
@@ -222,9 +222,8 @@ std::unique_ptr<KDL::Path> TrajectoryGeneratorCIRC::setPathCIRC(const MotionPlan
pose_msg = tf2::toMsg(info.goal_pose);
tf2::fromMsg(pose_msg, goal_pose);
- KDL::Vector path_point;
- const geometry_msgs::Point point_msg = tf2::toMsg(info.circ_path_point.second);
- tf2::fromMsg(point_msg, path_point);
+ const auto& eigen_path_point = info.circ_path_point.second;
+ const KDL::Vector path_point{ eigen_path_point.x(), eigen_path_point.y(), eigen_path_point.z() };
// pass the ratio of translational by rotational velocity as equivalent radius
// to get a trajectory with rotational speed, if no (or very little)
diff --git a/moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_lin.cpp b/moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_lin.cpp
index 67e5e939d..cd86b7b1c 100644
--- a/moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_lin.cpp
+++ b/moveit_planners/pilz_industrial_motion_planner/src/trajectory_generator_lin.cpp
@@ -45,6 +45,7 @@
#include <kdl/trajectory_segment.hpp>
#include <kdl/utilities/error.h>
+#include <tf2_kdl/tf2_kdl.h>
#include <tf2/convert.h>
#include <tf2_eigen/tf2_eigen.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h> Unfortunately, one conversion function with |
Is there any way to know whether CI will pass without pushing the code and waiting? Last few commits pass without warnings/errors locally but do not satisfy the CI check. |
You can run the CI scripts locally as described here. |
moveit_kinematics/ikfast_kinematics_plugin/templates/ikfast61_moveit_plugin_template.cpp
Outdated
Show resolved
Hide resolved
It looks like the previous check passed, although, if I am correct, it did not at the time I have committed it. Is this PR now solved? |
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.
Forgot to review them until now, fixed.
* Use tf2::toMsg / tf2::fromMsg where possible * Use tf2::convert when converting between two non-message types exception: conversion to/from KDL types: Due to a bad implementation of tf2_kdl (not using templates), tf2::convert cannot be used.
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.
Thanks for your effort. I added another commit to even more unify usage of conversion functions:
- Use
tf2::toMsg
/tf2::fromMsg
where possible - Use
tf2::convert
when converting between two non-message types
exception: conversion to/from KDL types: Due to a bad implementation oftf2_kdl
(not using templates),tf2::convert
cannot be used.
Ready to merge if CI is happy.
Congrats on getting your first MoveIt pull request merged and improving open source robotics! |
Description
Followed the tutorial and replaced eigen_conversions with tf2_eigen
Checklist