Git Product home page Git Product logo

Comments (8)

linknum23 avatar linknum23 commented on July 21, 2024 1

This value is actually configurable in the underlying librealsense driver. The default for the R200 camera, which is not changed in this ros driver, is 1mm resolution. So a value of 1000 corresponds to 1 meter. Here is where to find this information: https://github.com/IntelRealSense/librealsense/blob/master/doc/projection.md.
FYI: In ROS the depth is expected to be in one of 2 formats: 32-bit float in meters or 16-bit unsigned integers in millimeter resolution. This ros realsense driver currently publishes depth in 16-bit 1 millimeter resolution.

from realsense-ros.

jlysnantel avatar jlysnantel commented on July 21, 2024

Is there a topic that return the depth_scale for the current camera ? I am using the D435

from realsense-ros.

doronhi avatar doronhi commented on July 21, 2024

The D435 publishes depth in "16-bit unsigned integers in millimeter resolution."

from realsense-ros.

jlysnantel avatar jlysnantel commented on July 21, 2024

Even in the the topic /camera/aligned_depth_to_color/image_raw? When I echo the topic, I receive values between 0 and 255.

Are you saying 16-bit unsigned integers in millimeter resolution. in quote because it is documented somewhere? I am having a hard time finding documentation about the intel-ros realsense package. Can you send me the link of the place where you saw that ?

My problem is that I am trying to have the depth of a pixel from topic published by the realsense node when I launch it with
roslaunch realsense2_camera rs_camera.launch filters:=pointcloud align_depth:=true

But every topic give me a array data of value between 0 and 255. I am subscribed to
/camera/color/image_raw
/camera/aligned_depth_to_color/image_raw"
/camera/depth/color/points

What am I doing wrong ?

from realsense-ros.

iscsrl avatar iscsrl commented on July 21, 2024

As @jlysnantel I've the same need to get the depth of a single pixel. Is there any way I can do it through any Ros topic?

from realsense-ros.

doronhi avatar doronhi commented on July 21, 2024

@jlysnantel , sorry for failing to return to you.
I believe you already figured thing out by now or moved on but still..
Check out the function "imageDepthCallback" in the file: "realsense/realsense2_camera/scripts/show_center_depth.py"
There is an example, in python, for subscribing and printing the depth value.
If you add, in line 16: print cv_image.dtype you'll see that the image type is uint16. So the values you get in the range of 0-255 just mean that you need to cast the buffer differently.

The format is defined in REP-118, under the "OpenNI Raw Representation" section.

from realsense-ros.

iscsrl avatar iscsrl commented on July 21, 2024

@doronhi I was already using this solution but I'm not able to make the following line work with python3:

cv_image = self.bridge.imgmsg_to_cv2(data, data.encoding)

It only works correctly on python, but running it with python3 (python 3.6 version) I get the following error:

[ERROR] [1594211659.759482]: bad callback: <function convert_depth_image at 0x7f6079571e18>
Traceback (most recent call last):
    ...
from cv_bridge.boost.cv_bridge_boost import getCvType
ImportError: dynamic module does not define module export function (PyInit_cv_bridge_boost)

It looks like it cannot import from cv_bridge.boost.cv_bridge_boost import getCvType.
Any tips to solve this?

from realsense-ros.

Shrutii07 avatar Shrutii07 commented on July 21, 2024

This value is actually configurable in the underlying librealsense driver. The default for the R200 camera, which is not changed in this ros driver, is 1mm resolution. So a value of 1000 corresponds to 1 meter. Here is where to find this information: https://github.com/IntelRealSense/librealsense/blob/master/doc/projection.md.
FYI: In ROS the depth is expected to be in one of 2 formats: 32-bit float in meters or 16-bit unsigned integers in millimeter resolution. This ros realsense driver currently publishes depth in 16-bit 1 millimeter resolution.

The link is not working. Could you please direct me the correct link?
Even I am looking to extract single depth value in mm for a depth img from R200 camera using ros.

from realsense-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.