[WIP] ROS2 Port#101
Conversation
|
Nice. It should target the foxy branch |
henningkayser
left a comment
There was a problem hiding this comment.
I will finish reviewing the rest later today
| find_package(rviz_rendering REQUIRED) | ||
| find_package(rviz_visual_tools REQUIRED) | ||
|
|
||
| find_package(Eigen3 REQUIRED) |
There was a problem hiding this comment.
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
|
|
||
| find_package(Eigen3 REQUIRED) | ||
| find_package(OpenGL REQUIRED) | ||
| find_package(GLUT REQUIRED) |
There was a problem hiding this comment.
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
| DEPENDS | ||
| EIGEN3 | ||
| rviz_rendering | ||
| tf2_eigen |
There was a problem hiding this comment.
Eigen3 and eigen3_cmake_module should be included as well.
| 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}) |
There was a problem hiding this comment.
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_; |
There was a problem hiding this comment.
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")); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
reset() is redundant if the pointer is reassigned in the next line
|
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. |
There was a problem hiding this comment.
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 :)
|
|
||
| install( | ||
| TARGETS ${THIS_PACKAGE_LIBRARIES} | ||
| EXPORT export_${PROJECT_NAME} |
There was a problem hiding this comment.
I was recently advised by @tylerjw that this is more standard cmake than the export_ prefix
| EXPORT export_${PROJECT_NAME} | |
| EXPORT ${PROJECT_NAME}Targets |
| @@ -21,17 +19,26 @@ set(SOURCE_FILES | |||
| ) | |||
There was a problem hiding this comment.
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}) |
There was a problem hiding this comment.
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> | |||
|
|
|||
| namespace moveit_rviz_plugin | ||
| { | ||
| HandEyeCalibrationFrame::HandEyeCalibrationFrame(HandEyeCalibrationDisplay* pdisplay, rviz::DisplayContext* context, | ||
| static const rclcpp::Logger LOGGER = rclcpp::get_logger("handeye_calibration_frame"); |
There was a problem hiding this comment.
Nit: Another way to do this would be to use an anonymous namespace instead
| 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 |
There was a problem hiding this comment.
I guess this is still an open issue in ROS 2 FOXY to get the current time without a node . Maybe you can use the cpp API to get the current time
| } | ||
|
|
||
| protected: | ||
| static const rclcpp::Logger LOGGER; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
| <url type="repository">https://github.com/ros-planning/moveit_calibration</url> | ||
|
|
||
| <buildtool_depend>catkin</buildtool_depend> | ||
| <buildtool_depend>ament_cmake</buildtool_depend> |
Fix tf visual tools, add image transport dependency
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>
|
@Abishalini @AndyZe |
|
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. |
|
Same as @mcres and @hamsadatta, is there a ROS2 available and working? |
|
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 |
Taking over Andy's work #100
I had to clone
rviz_visual_tools,moveit_visual_tools,moveit_resourcesandgraph_msgsfrom source. The rest can be installed usingrosdepHow to use
moveit_calibration