Skip to content

Commit

Permalink
Fix orientation changes in aruco 3.0.0
Browse files Browse the repository at this point in the history
Victor Lopez committed Feb 7, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 3bdcbf6 commit 0d3f673
Showing 3 changed files with 4 additions and 19 deletions.
17 changes: 1 addition & 16 deletions aruco_ros/src/aruco_ros_utils.cpp
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ aruco::CameraParameters aruco_ros::rosCameraInfo2ArucoCamParams(const sensor_msg
{
cv::Mat cameraMatrix(3, 3, CV_64FC1);
cv::Mat distorsionCoeff(4, 1, CV_64FC1);
cv::Size size(cam_info.height, cam_info.width);
cv::Size size(cam_info.width, cam_info.height);

if ( useRectifiedParameters )
{
@@ -52,21 +52,6 @@ tf::Transform aruco_ros::arucoMarker2Tf(const aruco::Marker &marker)
cv::Mat tran64;
marker.Tvec.convertTo(tran64, CV_64FC1);

cv::Mat rotate_to_ros(3, 3, CV_64FC1);
// -1 0 0
// 0 0 1
// 0 1 0
rotate_to_ros.at<double>(0,0) = -1.0;
rotate_to_ros.at<double>(0,1) = 0.0;
rotate_to_ros.at<double>(0,2) = 0.0;
rotate_to_ros.at<double>(1,0) = 0.0;
rotate_to_ros.at<double>(1,1) = 0.0;
rotate_to_ros.at<double>(1,2) = 1.0;
rotate_to_ros.at<double>(2,0) = 0.0;
rotate_to_ros.at<double>(2,1) = 1.0;
rotate_to_ros.at<double>(2,2) = 0.0;
rot = rot*rotate_to_ros.t();

tf::Matrix3x3 tf_rot(rot.at<double>(0,0), rot.at<double>(0,1), rot.at<double>(0,2),
rot.at<double>(1,0), rot.at<double>(1,1), rot.at<double>(1,2),
rot.at<double>(2,0), rot.at<double>(2,1), rot.at<double>(2,2));
2 changes: 1 addition & 1 deletion aruco_ros/src/simple_double.cpp
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ void image_callback(const sensor_msgs::ImageConstPtr& msg)
//detection results will go into "markers"
markers.clear();
//Ok, let's detect
mDetector.detect(inImage, markers, camParam, marker_size);
mDetector.detect(inImage, markers, camParam, marker_size, false);
//for each marker, draw info and its boundaries in the image
for(unsigned int i=0; i<markers.size(); ++i)
{
4 changes: 2 additions & 2 deletions aruco_ros/src/simple_single.cpp
Original file line number Diff line number Diff line change
@@ -276,8 +276,8 @@ class ArucoSimple
visMarker.action = visualization_msgs::Marker::ADD;
visMarker.pose = poseMsg.pose;
visMarker.scale.x = marker_size;
visMarker.scale.y = 0.001;
visMarker.scale.z = marker_size;
visMarker.scale.y = marker_size;
visMarker.scale.z = 0.001;
visMarker.color.r = 1.0;
visMarker.color.g = 0;
visMarker.color.b = 0;

0 comments on commit 0d3f673

Please sign in to comment.