Skip to content

[WIP] ROS2 Port#101

Closed
Abishalini wants to merge 25 commits into
moveit:foxyfrom
Abishalini:ros2_port
Closed

[WIP] ROS2 Port#101
Abishalini wants to merge 25 commits into
moveit:foxyfrom
Abishalini:ros2_port

Conversation

@Abishalini

@Abishalini Abishalini commented Aug 4, 2021

Copy link
Copy Markdown

Taking over Andy's work #100
I had to clone rviz_visual_tools, moveit_visual_tools, moveit_resources and graph_msgs from source. The rest can be installed using rosdep

How to use moveit_calibration

@AndyZe

AndyZe commented Aug 4, 2021

Copy link
Copy Markdown
Member

Nice. It should target the foxy branch

@Abishalini Abishalini changed the base branch from master to foxy August 4, 2021 19:58
@Abishalini Abishalini changed the title ROS2 Port [WIP] ROS2 Port Aug 4, 2021

@henningkayser henningkayser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will finish reviewing the rest later today

Comment thread moveit_calibration_gui/CMakeLists.txt Outdated
Comment thread moveit_calibration_gui/CMakeLists.txt Outdated
find_package(rviz_rendering REQUIRED)
find_package(rviz_visual_tools REQUIRED)

find_package(Eigen3 REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure if this is still required (I think it is), but we used to depend on eigen3_cmake_module for Eigen3 to work. See https://github.com/ros2/eigen3_cmake_module

Comment thread moveit_calibration_gui/CMakeLists.txt Outdated

find_package(Eigen3 REQUIRED)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we directly depending on GLUT or is this only added because of moveit_ros_perception not exporting it correctly? If so, please add a comment + issue link

Comment thread moveit_calibration_gui/CMakeLists.txt Outdated
Comment thread moveit_calibration_gui/CMakeLists.txt Outdated
DEPENDS
EIGEN3
rviz_rendering
tf2_eigen

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eigen3 and eigen3_cmake_module should be included as well.

Comment thread moveit_calibration_gui/CMakeLists.txt Outdated
set_target_properties(${MOVEIT_LIB_NAME}_core PROPERTIES VERSION "${${PROJECT_NAME}_VERSION}")
target_link_libraries(${MOVEIT_LIB_NAME}_core
${catkin_LIBRARIES} ${OpenCV_LIBS} ${rviz_DEFAULT_PLUGIN_LIBRARIES} ${OGRE_LIBRARIES} ${QT_LIBRARIES} ${Boost_LIBRARIES})
${OpenCV_LIBS} ${rviz_DEFAULT_PLUGIN_LIBRARIES} ${OGRE_LIBRARIES} ${QT_LIBRARIES} ${Boost_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is rviz_DEFAULT_PLUGIN_LIBRARIES still a thing in ROS 2?
Also, all targets providing _LIBRARIES and _INCLUDE_DIRS can just be passed to ament_target_dependencies() which also supports the SYSTEM keyword. For readability, I would opt for using it, possibly even in combination with a SYSTEM_DEPENDS variable or similar.


private:
rviz::DisplayContext* context_;
rviz_common::DisplayContext* context_;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a high priority until things are working, but I would strongly advocate replacing all unnecessary raw pointers with smart pointers if possible

{
robot_model_loader_.reset(new robot_model_loader::RobotModelLoader("robot_description"));
frame_manager_.reset(new rviz::FrameManager());
robot_model_loader_.reset(new robot_model_loader::RobotModelLoader(node_, "robot_description"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo, it's a general best practice to replace the new operator with std::make_shared() or std::make_unique()

camerainfo_sub_.shutdown();
camerainfo_sub_ = nh_.subscribe(topic_name.toStdString(), 1, &TargetTabWidget::cameraInfoCallback, this);
// camerainfo_sub_.shutdown();
camerainfo_sub_.reset();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reset() is redundant if the pointer is reassigned in the next line

@tylerjw

tylerjw commented Aug 9, 2021

Copy link
Copy Markdown
Member

Please don't port without tests

@AndyZe

AndyZe commented Aug 10, 2021

Copy link
Copy Markdown
Member

Please don't port without tests

Disagree. Some port is better than no port at all. The first PR probably won't be perfect. I mean, it's 650 lines already.

We will test this eventually because it's needed on a project.

@sjahr sjahr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work! I had issues with building this PR (Code did not compile). Maybe I did something wrong when I've tried to install this. Could you add some instructions in the PR description (or even the README)? Nonetheless, I've added a couple of comments with suggestions that I've received recently :)

Comment thread moveit_calibration_gui/CMakeLists.txt Outdated

install(
TARGETS ${THIS_PACKAGE_LIBRARIES}
EXPORT export_${PROJECT_NAME}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was recently advised by @tylerjw that this is more standard cmake than the export_ prefix

Suggested change
EXPORT export_${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets

@@ -21,17 +19,26 @@ set(SOURCE_FILES
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can remove the comment above that is related to catkin_lint

)

set(MOVEIT_LIB_NAME moveit_handeye_calibration_rviz_plugin)
add_library(${MOVEIT_LIB_NAME}_core ${SOURCE_FILES} ${HEADERS})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Do you know why this is built with headers and source files instead of using only the source files and including + exporting the headers?

@@ -48,21 +48,25 @@
#include <QRadioButton>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a description?

namespace moveit_rviz_plugin
{
HandEyeCalibrationFrame::HandEyeCalibrationFrame(HandEyeCalibrationDisplay* pdisplay, rviz::DisplayContext* context,
static const rclcpp::Logger LOGGER = rclcpp::get_logger("handeye_calibration_frame");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Another way to do this would be to use an anonymous namespace instead

Suggested change
static const rclcpp::Logger LOGGER = rclcpp::get_logger("handeye_calibration_frame");
namespace {
const rclcpp::Logger LOGGER = rclcpp::get_logger("handeye_calibration_frame");
}

You can find the related discussion here

geometry_msgs::TransformStamped transform_stamped;
transform_stamped.header.stamp = ros::Time::now();
geometry_msgs::msg::TransformStamped transform_stamped;
transform_stamped.header.stamp = rclcpp::Clock(RCL_ROS_TIME).now(); //Not sure if this is the right approach

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

protected:
static const rclcpp::Logger LOGGER;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be a member of this class? I think it would be better to just have one per source file like in the rest of this PR

namespace moveit_handeye_calibration
{
const std::string LOGNAME = "handeye_aruco_target";
static const rclcpp::Logger LOGGER = rclcpp::get_logger(LOGNAME);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could merge line 41 and 42 as LOGNAME is only used here

{
const std::string LOGNAME = "handeye_charuco_target";
const std::string LOGNAME = "moveit_calibration.plugins.handeye_charuco_target";
static const rclcpp::Logger LOGGER = rclcpp::get_logger(LOGNAME);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

<url type="repository">https://github.com/ros-planning/moveit_calibration</url>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add moveit_common as build_depend

@henningkayser henningkayser mentioned this pull request Nov 2, 2021
@henningkayser henningkayser linked an issue Nov 2, 2021 that may be closed by this pull request
Vatan Aksoy Tezer and others added 3 commits December 1, 2021 23:26
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
Signed-off-by: Andrej Orsula <orsula.andrej@gmail.com>
@hamsadatta

Copy link
Copy Markdown

@Abishalini @AndyZe
Hello, any updates on this? I am interested in using this package in one of our projects.

@mcres

mcres commented Aug 9, 2024

Copy link
Copy Markdown

Same as @hamsadatta here, it would be great if this was available in ROS2. We'd like to use this in one of our projects as well.

@rhaschke rhaschke deleted the branch moveit:foxy August 29, 2024 20:31
@rhaschke rhaschke closed this Aug 29, 2024
@CarlottaPizzolato

Copy link
Copy Markdown

Same as @mcres and @hamsadatta, is there a ROS2 available and working?

@AndrejOrsula

Copy link
Copy Markdown

Hello everyone,

I still see people commenting on related issues and PRs under this project, so I'm adding a small reference here to make the search easier for others...

The following PR migrates this project to ROS 2 humble. However, it has been abandoned for years. If anyone wishes to continue this endeavor, feel free to use the PR as a starting point in whatever way you see fit. Thank you! ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port to ROS 2

10 participants