Giter Site home page Giter Site logo

Comments (10)

awesomebytes avatar awesomebytes commented on September 25, 2024

You just need to make your own launchfile like: https://github.com/pal-robotics/aruco_ros/blob/kinetic-devel/aruco_ros/launch/single.launch

With your data (markerid you printed, real life size of it, camera info topic, image topic). Note that to have accurate results your camera should be calibrated intrinsically (so what's published in the camera_info topic should be correct, or you provide the rectified topic already, like in the example launchfile). You can ignore the stereo parameters as you may see in the launchfile they are there for convenience for the stereo case.

from aruco_ros.

GianlucaCerilli avatar GianlucaCerilli commented on September 25, 2024

HI @awesomebytes ,

Thank you for your explanation. So, in my case should I have something like this?

<arg name="markerId"        default="70"/>
<arg name="markerSize"      default="0.034"/>    <!-- in m -->
<!-- <arg name="eye"             default="left"/> -->
<arg name="marker_frame"    default="aruco_marker_frame"/>
<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 -->

<node pkg="aruco_ros" type="single" name="aruco_single">
    <remap from="/camera_info" to="/pylon_camera_node/camera_info" />
    <remap from="/image" to="/pylon_camera_node/image_raw" />
    <param name="image_is_rectified" value="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="stereo_gazebo_$(arg eye)_camera_optical_frame"/>
    <param name="marker_frame"       value="$(arg marker_frame)" />
    <param name="corner_refinement"  value="$(arg corner_refinement)" />
</node>

But I am not sure on what to insert in marker_frame, ref_frame and camera_frame fields in my case since I am not in the simulator and I still have to extrinsically calibrate the camera.
By the way, when I connect the camera I have these topics:

/pylon_camera_node/camera_info
/pylon_camera_node/grab_images_raw/cancel
/pylon_camera_node/grab_images_raw/feedback
/pylon_camera_node/grab_images_raw/goal
/pylon_camera_node/grab_images_raw/result
/pylon_camera_node/grab_images_raw/status
/pylon_camera_node/image_raw
/pylon_camera_node/image_raw/compressed
/pylon_camera_node/image_raw/compressed/parameter_descriptions
/pylon_camera_node/image_raw/compressed/parameter_updates
/pylon_camera_node/image_raw/compressedDepth
/pylon_camera_node/image_raw/compressedDepth/parameter_descriptions
/pylon_camera_node/image_raw/compressedDepth/parameter_updates
/pylon_camera_node/image_raw/theora
/pylon_camera_node/image_raw/theora/parameter_descriptions
/pylon_camera_node/image_raw/theora/parameter_updates

Thank you very much again!

from aruco_ros.

awesomebytes avatar awesomebytes commented on September 25, 2024

Hey @GianlucaCerilli . That looks like a correct launchfile to me. You did set image_is_rectified to True and I don't really believe that is true because you'd have a topic called image_rect or similar. If you set it to False the node itself will use the calibration published in /pylon_camera_node/camera_info to rectify the image for you internally. Which, you really wanna calibrate your camera intrinsically, following the ros monocular camera calibration tutorial. Otherwise your 3D poses detected will be off by some amount (depending on your camera) so your extrinsic calibration will be even more off.

camera_frame is the frame of your camera, as the name suggests, for doing the internal frame transformations. That's the one you have in your URDF where the camera is positioned. For example if your robot has arm_link_7 -> end_effector_frame -> pylon_camera_frame as where the camera is, you want to set it to pylon_camera_frame.

marker_frame is the name of the frame that will be published in TF where the detection of the aruco marker happens. Useful for doing transformations in the relative pose to the marker. aruco_marker_frame is a good default.

ref_frame is frame in which the marker pose will be referred, so if for your use-case it's more useful to have the marker Pose topic published in, say, base_link, just set that there.

from aruco_ros.

GianlucaCerilli avatar GianlucaCerilli commented on September 25, 2024

Hi @GianlucaCerilli ,

Thank you for your explanation. Now all the extrinsic calibration works.
But in the end, the final camera pose that I get from the extrinsic calibration (aruco + visp) seems to be incorrect on the Z axis and I think the problem it is related to the result that I get from aruco. Indeed, when I run aruco, the estimate that I get on the Z direction is not really accurate (some centimeters of error). It seems to compute the distance from the marker to the lens of the camera instead of computing it from the marker to the sensor of the camera. So, there are some centimeters of errors in that direction.

How can I do the get a more accurate result in this sense?

Thank you very much

from aruco_ros.

awesomebytes avatar awesomebytes commented on September 25, 2024

Well you should add as camera_frame the frame of your camera, I mean, the optical frame, which is probably the sensor of your camera, just behind the lens. If you think that is the error.

In many cameras there is the camera_link > camera_optical_frame. Maybe you need to add that to your model to fix the issue? (If the error you are seeing is constant, of course).

from aruco_ros.

GianlucaCerilli avatar GianlucaCerilli commented on September 25, 2024

Hi @awesomebytes ,

Thank you for your reply. Where can I check if there is camera_optical_frame for my camera or if I am using the correct one?

From rostopic echo I see only these topics:

/pylon_camera_node/camera_info
/pylon_camera_node/grab_images_raw/cancel
/pylon_camera_node/grab_images_raw/feedback
/pylon_camera_node/grab_images_raw/goal
/pylon_camera_node/grab_images_raw/result
/pylon_camera_node/grab_images_raw/status
/pylon_camera_node/grab_images_rect/cancel
/pylon_camera_node/grab_images_rect/feedback
/pylon_camera_node/grab_images_rect/goal
/pylon_camera_node/grab_images_rect/result
/pylon_camera_node/grab_images_rect/status
/pylon_camera_node/image_raw
/pylon_camera_node/image_raw/compressed
/pylon_camera_node/image_raw/compressedDepth
/pylon_camera_node/image_raw/compressedDepth/parameter_descriptions
/pylon_camera_node/image_raw/compressedDepth/parameter_updates
/pylon_camera_node/image_raw/compressed/parameter_descriptions
/pylon_camera_node/image_raw/compressed/parameter_updates
/pylon_camera_node/image_raw/theora
/pylon_camera_node/image_raw/theora/parameter_descriptions
/pylon_camera_node/image_raw/theora/parameter_updates
/pylon_camera_node/image_rect

from aruco_ros.

GianlucaCerilli avatar GianlucaCerilli commented on September 25, 2024

I have also noticed that the frame of aruco marker is not really correct:

image

Even if it looks wrong only in Rviz, since I get:

camera->marker translation:
x: -0.0326698213869
y: -0.0221858542217
z: 0.474173845014
rotation:
x: 0.28700230383
y: -0.628464615532
z: 0.636957014297
w: -0.341976119867

from aruco_ros.

LiGengLei avatar LiGengLei commented on September 25, 2024

Hello, @GianlucaCerilli
When I use the aruco to estimate the position of something, I have the same question: the distance of z axis has too many error(about 1.5 times the true distance). How do you solve this question?Thank you.

from aruco_ros.

LiGengLei avatar LiGengLei commented on September 25, 2024

Update:
The program itself is error-free, the problem is that I set the resolution of the camera incorrectly.

from aruco_ros.

sngweicong avatar sngweicong commented on September 25, 2024

Hi, @LiGengLei,

I am facing the exact same problem, where the distance of z is just wrong. May I know where do you set the resolution of the camera?

from aruco_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.