View my account

intel realsense object center pixel to coordinate coverstion

Comments

7 comments

  • MartyX Grover

    Hi Chetankumar Ekzenrobotics  The first observation I would make is that you seem to be performing depth-color alignment first and applying post-processing filters secondly.  It is recommended that alignment is performed after post-processing is applied. 

     

    Also, if your goal is to only obtain the 3D coordinate of the center pixel then you could do so using an instruction called rs2_project_color_pixel_to_depth_pixel.  This will convert a single pixel in the color frame to a depth pixel and can be used as an alternative to performing alignment of the entire image. Using this method can provide faster processing than whole-image alignment.

     

    It should also be noted that when using depth_get_distance(x,y) or a similar format of the get_distance instruction, it has been known for the coordinates to be relatively correct at the center of the image but drift when moving towards the edges of the image.

    https://github.com/IntelRealSense/librealsense/issues/7925#issuecomment-751335949

     

    Your post-processing filters are applied in the order that is recommended by the post-processing documentation, so that aspect of the script looks correct.

    https://dev.intelrealsense.com/docs/post-processing-filters#section-using-filters-in-application-code

    0
    Comment actions Permalink
  • Chetankumar Ekzenrobotics

    Hi MartyG

    Thanks for your support, i could able to achieve this.

    further to project i am integrating camera with the UR5 robot. I have done camera calibration using the following repo https://github.com/portgasray/ur5_realsense_calibration

    And done following tf. the robot is not moving to object location properly. Point1 are the de-projected points from the camera

    Please help me where i am going wrong

    def callback(point1):
    	print("camera_coordinate",point1)
    	result_1 = []
    	trans = 0
    	rot = 0
    	listener = tf.TransformListener()
    	while not rospy.is_shutdown():
    		try:
    			(trans,rot) = listener.lookupTransform('/tool0', '/camera_link', rospy.Time(0)) 
    			break
    		except :
    			continue
    
    	matrix2=np.dot(translation_matrix(trans), quaternion_matrix(rot))
    	point1[0][0] = -point1[0][0]
    	point1[1][0] = -point1[1][0]
    	point1[2][0] = point1[2][0]
    	
            result_1 = np.matmul(np.array(matrix2),point1)
    	result_1[0][0]=-result_1[0][0]
    	result_1[1][0]=-result_1[1][0]
            print("object coordinates",result_1)
            move_to_pos_1(result_1)
    	return result_1

    0
    Comment actions Permalink
  • MartyX Grover

    Is the robot able to move at all, or is it moving to the wrong position?

    Also, are you using ROS Kinetic like the UR5 guide requests?  And which versions of the librealsense SDK and the RealSense ROS wrapper are you using please?

    0
    Comment actions Permalink
  • Chetankumar Ekzenrobotics

    -The robot is moving, but not to the exact position

    - I am using ROS melodic for UR

    - Realsense ROS is from (https://github.com/IntelRealSense/realsense-ros) this, presently i am using python package for the object detection

    0
    Comment actions Permalink
  • MartyX Grover

    The librealsense and ROS version numbers are listed in the ROS launch log in the section of the log shown in the example below.

     

     

    It is important for the ROS wrapper version to be matched as closely as possible with the specific librealsense version listed in a particular wrapper version's release notes.  Having said that, your RealSense ROS project does seem to be functioning well enough for the robot to be able to move.

     

    Would you describe your robot's movement as drifting off-course from the intended route as though it has become lost?

    0
    Comment actions Permalink
  • Chetankumar Ekzenrobotics

    The robot is moving to object position roughly, If we add error factor for that position. When moving to other object position the position error is large.

    Following is the setup

     

    0
    Comment actions Permalink
  • MartyX Grover

    Okay, thank you very much.  So it is not a case of a wheeled mobile robot becoming 'lost' on a route, but instead a robot arm interacting with the position of an object (hand-eye calibration with the previously mentioned ur5_realsense_calibration package).   

    The GitHub of the package indicates that it makes use of ArUco image tags.  If you are using ArUco and the camera's IR emitter is enabled and projecting a semi-random dot pattern onto the scene, this may make image tags more difficult for the camera to read if the dot pattern is overlaid on the tags.  

    RealSense 400 Series cameras can alternatively use the ambient light in a scene to analyze surfaces for depth detail instead of analyzing the projected dots cast on a surface.  Would it be possible to turn off the camera's IR emitter and see whether your results improve, please?

    The IR emitter can be disabled with Python scripting or from within the RealSense ROS wrapper.

    ROS

    https://github.com/IntelRealSense/realsense-ros/issues/1379#issuecomment-691453842

    PYTHON

    https://github.com/IntelRealSense/librealsense/issues/8978#issuecomment-833612704

    0
    Comment actions Permalink

Please sign in to leave a comment.