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

Marker Plate wrong axis? #51

Open
CesMak opened this issue May 29, 2018 · 7 comments
Open

Marker Plate wrong axis? #51

CesMak opened this issue May 29, 2018 · 7 comments

Comments

@CesMak
Copy link

CesMak commented May 29, 2018

Hey there,

I just wonder the following:

In the picture it looks like the y axis (green) is going out of the red plate but actually this should be the blue z - axis or??

marker-error

does that mean the marker axis are displayed wrong?!

This is my code:


   <arg name="start_camera_ex" default="False" />


<arg name="markerId" default="701"/>
<arg name="markerSize" default="0.10"/> <!-- in meter breite inc. schwarz des aruco markers (ausgedruckt hier angeben!) -->
<arg name="eye" default="right"/>
<arg name="marker_frame" default="plate_origin"/>
<arg name="ref_frame" default=""/> <!-- leave empty and the pose will be published wrt param parent_name -->
<arg name="corner_refinement" default="LINES" /> <!-- NONE, HARRIS, LINES, SUBPIX -->


    <!-- start xtion pro camera with topic names: /camera/ir/image, /camera/rgb/image_raw, /camera/depth/image -->
    <include if="$(arg start_camera_ex)"
         file="$(find openni2_launch)/launch/openni2.launch">
    </include>



<node pkg="aruco_ros" type="single" name="aruco_single">
    <remap from="/camera_info" to="/camera/rgb/camera_info" />
    <remap from="/image" to="/camera/rgb/image_rect_color" />
    <param name="image_is_rectified" value="True"/> <!-- set this to true?! -->
    <param name="marker_size" value="$(arg markerSize)"/>
    <param name="marker_id" value="$(arg markerId)"/>
    <param name="reference_frame" value="$(arg ref_frame)"/> <!-- frame in which the marker pose will be refered -->
    <param name="camera_frame" value="camera_link"/> <!-- this is just for the pose output - does not change anything to the pose calc itself! -->
    <param name="marker_frame" value="$(arg marker_frame)" />
    <param name="corner_refinement" value="$(arg corner_refinement)" />
</node>

Just tested the same thing again with this pack:
https://github.com/joselusl/aruco_eye

and got a whole different output picture which seems to be right:
screenshot - 05292018 - 01 38 41 pm

so I now guess that with this lib here the axes are just drawn wrong in the result pic!

Think I know my error I just should make the
to NONE not to LINES .....

Anyway does anyone has a description of the corner_refinement parameter?

@ctaipuj
Copy link

ctaipuj commented Sep 28, 2018

Hi, @CesMak ,
We found out that the orientation issue is caused due to a rotation matrix described in aruco_ros_utils.cpp see these code lines. You could modify the rotate_to_ros cv::Mat object and use it as an identity matrix to undo the rotation. (Actually not perform a rotation at all). So your TF data will be the same as the one found by ARuco.

If you change this take into account that the simple_double.cpp has to be modified too, in order to avoid the same issue (this only affects the simple_double.cpp file). So you will have to change this line to mDetector.detect(inImage, markers, camParam, marker_size,false); since the default value of setYPerpendicular is set to true in the .h file.

@nevermore0127
Copy link

I have the same question about that. So witch axis is right ? Displayed in /aruco_single/result OR displayed in rviz ?

Hi, @CesMak ,
We found out that the orientation issue is caused due to a rotation matrix described in aruco_ros_utils.cpp see these code lines. You could modify the rotate_to_ros cv::Mat object and use it as an identity matrix to undo the rotation. (Actually not perform a rotation at all). So your TF data will be the same as the one found by ARuco.

If you change this take into account that the simple_double.cpp has to be modified too, in order to avoid the same issue (this only affects the simple_double.cpp file). So you will have to change this line to mDetector.detect(inImage, markers, camParam, marker_size,false); since the default value of setYPerpendicular is set to true in the .h file.

I have the same question about that and still don't understand by your reply.
So witch axis are right ? Displayed in /aruco_single/result OR displayed in rviz ?
Is the TF data right ? Or i should do things as you say then the TF data will be right?
thank you

@v-lopez
Copy link
Contributor

v-lopez commented Oct 23, 2018

You can also test with the ARuco 3.0.4 branch: https://github.com/pal-robotics/aruco_ros/tree/aruco-3.0.4

I tried to adapt the package conventions to the library convention. The problem is that if we merged this, a lot of code that relies on the orientation would stop working as expected.

@ctaipuj
Copy link

ctaipuj commented Oct 31, 2018

@nevermore0127
Answering your questions,

which axis are right?

The Z axis (the blue one) must be "going out" of the ARuco tag.

Displayed in /aruco_single/result OR displayed in rviz ?

So following the ARuco convention, the /aruco_single/result has the correct orientation. Notice that this not affect translation at all.

Is the TF data right ?

As I said above, the orientation issue doesn't affect the pose estimation. So, yes the TF data is right the only difference is that it has an additional rotation. So in Rviz you see the y-axis pointing out of the tag.

Or i should do things as you say then the TF data will be right?

Is not necessary it is just for convention, according to your needs you may need a different orientation. Or you can publish a static transform with a new rotation. (this is is the simplest solution).

Notice that the TF data is only correct if your camera is correctly calibrated.

If I am not clear enough, please let me know.

@nevermore0127
Copy link

@nevermore0127
Answering your questions,

which axis are right?

The Z axis (the blue one) must be "going out" of the ARuco tag.

Displayed in /aruco_single/result OR displayed in rviz ?

So following the ARuco convention the /aruco_single/result has the correct orientation. Notice that this not affect translation at all.

Is the TF data right ?

As I said above, the orientation issue doesn't affect the pose estimation. So, yes the TF data is right the only difference is that it has and additional rotation. So in Rviz you see the y-axis pointing out of the tag.

Or i should do things as you say then the TF data will be right?

Is not necessary it is just for convention, according to your needs you may need a different orientation. Or you can publish a static transform with a new rotation. (this is is the simpliest solution).

Notice that the TF data is only correct if your camera is correctly calibrated.

If I am not clear enough, please let me know.

Thanks,clear about that.

@7675t
Copy link

7675t commented Apr 12, 2019

Hi, I also found it is a bit confusing the TF axis direction is different from the detection result. I made a PR for this problem.

@zhudelong
Copy link

zhudelong commented Apr 24, 2019

@nevermore0127
Answering your questions,

which axis are right?

The Z axis (the blue one) must be "going out" of the ARuco tag.

Displayed in /aruco_single/result OR displayed in rviz ?

So following the ARuco convention the /aruco_single/result has the correct orientation. Notice that this not affect translation at all.

Is the TF data right ?

As I said above, the orientation issue doesn't affect the pose estimation. So, yes the TF data is right the only difference is that it has and additional rotation. So in Rviz you see the y-axis pointing out of the tag.

@ctaipuj
To make it more clear, if we want to use tf to transform a vector from marker frame to camera frame, we have to use the frame in Rviz. For example, I specify the four corners in the marker frame, [[-0.5, 0, -0.5], [-0.5, 0, 0.5], [0.5, 0, -0.5], [0.5, 0, 0.5]], then use the tf to transform it to camera frame and get a correct result. if I use the frame indicated by the result image, it is wrong.

by the way, how can I directly get the corner position?

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

No branches or pull requests

6 participants