-
Notifications
You must be signed in to change notification settings - Fork 79
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
[WIP] ROS2 Port #101
[WIP] ROS2 Port #101
Conversation
Nice. It should target the foxy branch |
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 will finish reviewing the rest later today
find_package(rviz_common REQUIRED) | ||
find_package(rviz_default_plugins REQUIRED) | ||
find_package(rviz_rendering REQUIRED) | ||
find_package(rviz_visual_tools REQUIRED) | ||
|
||
find_package(Eigen3 REQUIRED) |
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.
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.
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
DEPENDS | ||
EIGEN3 | ||
rviz_rendering | ||
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.
Eigen3
and eigen3_cmake_module
should be included as well.
add_library(${MOVEIT_LIB_NAME}_core ${SOURCE_FILES} ${HEADERS}) | ||
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.
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.
...ation_rviz_plugin/include/moveit/handeye_calibration_rviz_plugin/handeye_calibration_frame.h
Show resolved
Hide resolved
@@ -83,7 +83,7 @@ class HandEyeCalibrationFrame : public QWidget | |||
ControlTabWidget* tab_control_; | |||
|
|||
private: | |||
rviz::DisplayContext* context_; | |||
rviz_common::DisplayContext* context_; |
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.
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.
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()
...libration_rviz_plugin/include/moveit/handeye_calibration_rviz_plugin/handeye_target_widget.h
Outdated
Show resolved
Hide resolved
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.
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
moveit_calibration_plugins/handeye_calibration_target/src/handeye_target_charuco.cpp
Outdated
Show resolved
Hide resolved
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.
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 :)
|
||
install( | ||
TARGETS ${THIS_PACKAGE_LIBRARIES} | ||
EXPORT export_${PROJECT_NAME} |
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 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.
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
@@ -21,17 +19,26 @@ set(SOURCE_FILES | |||
) | |||
|
|||
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.
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> | |||
|
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.
Can you add a description?
#include <cmath> | ||
|
||
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.
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -412,6 +420,7 @@ class HandEyeTargetBase | |||
} | |||
|
|||
protected: | |||
static const rclcpp::Logger LOGGER; |
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.
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
@@ -39,6 +39,9 @@ | |||
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.
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
@@ -38,7 +38,10 @@ | |||
|
|||
namespace moveit_handeye_calibration | |||
{ | |||
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); |
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.
Same as above
<license>BSD</license> | ||
|
||
<url type="website">http://moveit.ros.org</url> | ||
<url type="bugtracker">https://github.com/ros-planning/moveit_calibration/issues</url> | ||
<url type="repository">https://github.com/ros-planning/moveit_calibration</url> | ||
|
||
<buildtool_depend>catkin</buildtool_depend> | ||
<buildtool_depend>ament_cmake</buildtool_depend> |
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.
Add moveit_common as build_depend
Fix tf visual tools, add image transport dependency
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
Signed-off-by: Andrej Orsula <[email protected]>
@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. |
Taking over Andy's work #100
I had to clone
rviz_visual_tools
,moveit_visual_tools
,moveit_resources
andgraph_msgs
from source. The rest can be installed usingrosdep
How to use
moveit_calibration