portgasray / ur5_vision_pick

A Project that leading the Robot Arm to pick up the Coca Cola bins, with regards to the Intel Opensource Software and Self-Designed motor to trigger the Open/Close
4 stars 0 forks source link

Realsense Camera directly get depth and dx , dy information #2

Open portgasray opened 5 years ago

portgasray commented 5 years ago

https://github.com/facebookresearch/pyrobot/blob/92132a29246a7bbecb1f6b2d0170e1507704b1ea/examples/grasping/locobot.py#L102

portgasray commented 5 years ago
portgasray commented 5 years ago

get depth from realsense camera IntelRealSense/librealsense#3460 (comment)

portgasray commented 5 years ago

Threoy

From pixel to world https://stackoverflow.com/questions/13419605/how-to-map-x-y-pixel-to-world-cordinates

From world to pixel https://blog.csdn.net/lyl771857509/article/details/79633412

portgasray commented 5 years ago

intrinsic camera Parameters from rs-enumerate-devices -c

while color image is Width * Height = 640 * 480

PPX: 314.059814453125 PPY: 248.703369140625 Fx: 613.410034179688 Fy: 613.709289550781

intrinsic matrix (mm):

   613.41003     0.00000   314.05981
   0.00000   613.70928   248.70336
   0.00000     0.00000     1.00000
portgasray commented 5 years ago

Transforming pixel from a depth image to world coordinates

Intrinsics & Extrinsics demo

https://github.com/IntelRealSense/librealsense/issues/1904#issuecomment-398434434

portgasray commented 5 years ago

ros-realsense

How to get RGBD Depth Image Stream in ROS-realsense https://github.com/IntelRealSense/realsense-ros/issues/861

what's the difference brtween depth raw and aligned depth? #573

portgasray commented 5 years ago

Aligned Frame

Align Depth to Color get depth distance #4021

How to convert a pixel to x, y in meters? https://github.com/IntelRealSense/librealsense/issues/2481#issuecomment-428651169

portgasray commented 5 years ago

Deprojection

realsense deproject pixel to point

dx_dy

How to convert a pixel to x, y in meters? #2481

EmilyJrxx commented 5 years ago

use message_filters.ApproximateTimeSynchronizer() to synchronize the messages from different topics (in our case , depth_msg and color_msg)

how to use approximate TimeSynchronizer in Python

EmilyJrxx commented 5 years ago

Subscribe to camera_info to get intrinsics along with other properties of the camera. ( and Dont forget to Synchronize)

use image_geometry.projectPixelTo3dRay((u,v)) API to perform deprojection in realsense-ros env.

rs::deproject_pixel_to_meters : from the source code we know that dealing with different distortions (which is included in camra's info) is part of the deprojection despite the direct calculation of x, y.

image_geometry.projectPixelTo3dRay((u, v)) : source code

EmilyJrxx commented 5 years ago

The key point of getting depth at the exact (x, y) is to align the depth_frame to the color_frame, which can be done by adding align_depth:=true when launching rs_camera.launch and subscribing to camera/aligned_depth_to_color/image_raw instead of camera/depth/image_rect_raw