Skip to content
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

Added the marker detection to the image, pose and position #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NehilDanis
Copy link
Contributor

Hey Marco,
while I was using the repo, I needed to visualize the pose, position or the marker and also I visualized it on the image published. I thought it would be nice to add this into the code, this way people can directly subscribe to the topics from rviz. What do you think?

Copy link
Owner

@marcoesposito1988 marcoesposito1988 left a comment

Choose a reason for hiding this comment

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

Hi Nehil,

thanks for the PR! The pose topic and drawing the corners can be nice features indeed.

@@ -48,6 +51,9 @@ void CharucoBoardDetector::onImageImpl(const sensor_msgs::ImageConstPtr &img) {
boardDetected = cv::aruco::estimatePoseCharucoBoard(
charucoCorners, charucoIds, board, cameraParameters->cameraMatrix,
cameraParameters->distorsionCoeff, rvec, tvec);

cv::aruco::drawDetectedCornersCharuco(image->image, charucoCorners, charucoIds, cv::Scalar(255, 0, 0));

Choose a reason for hiding this comment

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

Can you move this next to the drawAxis, within the if?

@@ -6,6 +6,7 @@
#include <ros/ros.h>
#include <sensor_msgs/CameraInfo.h>
#include <sensor_msgs/Image.h>
#include <visualization_msgs/Marker.h>

Choose a reason for hiding this comment

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

Suggested change
#include <visualization_msgs/Marker.h>

This looks unnecessary

@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(easy_aruco)

find_package(catkin REQUIRED COMPONENTS sensor_msgs cv_bridge tf2_ros tf2_geometry_msgs)
find_package(catkin REQUIRED COMPONENTS sensor_msgs cv_bridge tf2_ros tf2_geometry_msgs visualization_msgs)

Choose a reason for hiding this comment

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

Suggested change
find_package(catkin REQUIRED COMPONENTS sensor_msgs cv_bridge tf2_ros tf2_geometry_msgs visualization_msgs)
find_package(catkin REQUIRED COMPONENTS sensor_msgs cv_bridge tf2_ros tf2_geometry_msgs)

This looks unnecessary

@@ -15,6 +15,7 @@
<depend>sensor_msgs</depend>
<depend>tf2_ros</depend>
<depend>tf2_geometry_msgs</depend>
<depend>visualization_msgs</depend>

Choose a reason for hiding this comment

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

Suggested change
<depend>visualization_msgs</depend>

This looks unnecessary

@@ -68,6 +74,21 @@ void CharucoBoardDetector::onImageImpl(const sensor_msgs::ImageConstPtr &img) {
cameraToBoardStamped.transform = tf2::toMsg(cameraToBoard);

broadcaster->sendTransform(cameraToBoardStamped);

geometry_msgs::Vector3Stamped positionMsg;

Choose a reason for hiding this comment

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

What is the use case for the position publisher? I think the user can listen to the pose and just take the translation part

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.

2 participants