Change resulting tvec, rvec units from pixel to meters in aruco estimatePoseSingleMarkers

Hi all,

I’m using aruco marker’s estimatePoseSingleMarker to get the pose of a single marker. I’m able to detect the marker and get the tvec and rvec. However the tvec and rvec I get are in pixel units since my camera matrix and distortion coefficients are in pixel units too. I was wondering if there’s a way to convert the resulting tvec and rvec from estimatePoseSingleMarkers in meter so that I can use that pose with ROS2 Nav2? Thanks in advance

they aren’t in pixels, they are in physical units of length.

that is because the function takes the marker length as an argument, and you should supply that as a (unitless) value expressing the physical length of the marker.

Thanks for your response.

does that mean the resulting tvec and rvec will be unitless?

If that’s the case, how do I use that in ROS2 nav2? Essentially, I’m trying to use the tvec and rvec as a goal pose where a robot can navigate to that pose on its map.

why do you interpret that as “unitless”? I didn’t say “unitless”, I said they have units. I hope you figure out why you misunderstood. I can’t help you if my words don’t reach you.

I misinterpret it as unitless because you mentioned supplying the marker length as a unitless argument and I ignored the part you said “expressing the physical length of the marker”. If I understand correctly the tvec and rvec will be in the same unit as the marker length, right?

ok granted, I didn’t anticipate that.

what I meant was: you can’t pass quantities with units in code. in code, everything is just a number.

yes, same unit as the marker length.

That makes more sense. Thanks a lot.