Ask Your Question

Anonymous's profile - activity

2021-05-26 15:44:50 -0500 marked best answer How can i bridge and display images from realsense d435 camera?

I am a beginner in ros. I am looking to get image frames from an Intel Realsense D435 camera, bridge and show the image (with opencv) . At the same time, I look to print/ log out the information from the camera. After running code, the program continuously runs (due to rospy.spin() function) but does not print out anything.

Where could I be going wrong with the code? Could someone please explain a bit on how to use the ros messages in a python code. I am writing a subscriber node.'

class Depth_Retriever():
    def __init__(self):

        self.bridge = CvBridge()

        self.sub = rospy.Subscriber('/camera/depth/image_rect_raw',Image,callback)

    def callback(self,ros_pics):
        try: 
            my_image = self.bridge.imgmsg_to_cv2(ros_pics, encoding = "passthrough")

        except CvBridgeError as e:
            print("CvBridge could not convert images from realsense to opencv")
        height,width, channels = my_image.shape
        my_height = my_image.shape[0]
        print(my_height)

        self.vert_len = ros_pics.height # retrieve height information from Image msg
        print(self.vert_len)


def main():
    rospy.init_node("Depth",anonymous = True)

    rospy.spin()


if __name__ == '__main__':

    main()

Thank you for help in advance.

2021-05-12 04:37:11 -0500 received badge  Famous Question (source)
2021-02-02 06:47:51 -0500 received badge  Famous Question (source)
2021-02-02 06:47:51 -0500 received badge  Notable Question (source)
2020-12-30 13:44:39 -0500 received badge  Famous Question (source)
2020-12-30 13:44:39 -0500 received badge  Notable Question (source)
2020-11-27 23:47:50 -0500 received badge  Famous Question (source)
2020-11-27 23:47:50 -0500 received badge  Notable Question (source)
2020-08-25 20:49:53 -0500 received badge  Famous Question (source)
2020-07-31 15:24:02 -0500 received badge  Famous Question (source)
2020-07-24 16:47:23 -0500 commented question Depth Image is very dark.

I found that my image output for my depth info after bridging was "uint16". I am not sure if this needs to be converted

2020-07-15 06:06:08 -0500 received badge  Popular Question (source)
2020-07-14 17:58:50 -0500 asked a question Depth Image is very dark.

Depth Image is very dark. Hello, I am working on a project where I would like to use the depth map for object tracking

2020-06-24 14:04:10 -0500 received badge  Popular Question (source)
2020-06-22 15:48:31 -0500 commented question How do you calculate depth using point cloud information?

Sorry for the confusion. The issue is that I am not entirely sure of how to use "sensor_msg/Image" to retrieve informati

2020-06-22 15:47:31 -0500 commented question How do you calculate depth using point cloud information?

Sorry for the confusion. The issue is that I am not entirely sure of how to use "sensor_msg/Image" to retrieve informati

2020-06-18 10:20:20 -0500 asked a question How do you calculate depth using point cloud information?

How do you calculate depth using point cloud information? Hello, I am working with an Intel Realsense D435 camera to c

2020-06-18 08:07:07 -0500 commented answer How can i bridge and display images from realsense d435 camera?

After running the rqt_image_view I realized I was subscribing to the wrong topic. The data encoding was "passthrough". I

2020-06-17 12:54:43 -0500 received badge  Notable Question (source)
2020-06-16 15:27:27 -0500 commented answer How can i bridge and display images from realsense d435 camera?

Thank you so much for the response. I was able to get the code to work. However, when I use cv2.imshow() to display the

2020-06-12 02:06:04 -0500 received badge  Popular Question (source)
2020-06-11 12:51:23 -0500 asked a question How can i bridge and display images from realsense d435 camera?

How can i bridge and display images from realsense d435 camera? I am a beginner in ros. I am looking to get image frames

2020-04-19 01:53:18 -0500 received badge  Famous Question (source)
2020-03-26 20:52:33 -0500 edited question Error report "tfConfig".

Error report "tfConfig". Hello, I am trying to run catkin_make in my catkin_ws an error gets reported and the build fai

2020-03-26 20:51:55 -0500 commented answer Error report "tfConfig".

Thank you once again

2020-03-24 20:04:48 -0500 received badge  Popular Question (source)
2020-03-24 12:33:47 -0500 asked a question Error report "tfConfig".

Error report "tfConfig". Hello, I am trying to run catkin_make in my catkin_ws an error gets reported and the build fai

2020-01-19 17:19:39 -0500 received badge  Notable Question (source)
2020-01-19 17:19:39 -0500 received badge  Popular Question (source)
2019-11-29 04:57:41 -0500 received badge  Notable Question (source)
2019-10-11 00:09:41 -0500 received badge  Enthusiast
2019-10-07 01:38:46 -0500 received badge  Notable Question (source)
2019-10-07 01:38:46 -0500 received badge  Popular Question (source)
2019-10-05 13:28:14 -0500 asked a question How can you track an object using ROS for drone?

How can you track an object using ROS for drone? I would like to track an object in the camera frame of drone to control

2019-09-20 16:10:04 -0500 asked a question How do I get drone to respond to different commands other than takeoff and land?

How do I get drone to respond to different commands other than takeoff and land? I am trying to write a code that allows

2019-09-20 16:02:28 -0500 asked a question Drone does not respond to commands other than takeoff and land?

Drone does not respond to commands other than takeoff and land? I am writing a simple code for my parrot ardrone to take

2019-08-18 11:34:33 -0500 received badge  Popular Question (source)
2019-08-15 18:02:39 -0500 asked a question Cannot find python node

Cannot find python node Hello, I am new to ros and gazebo. I am running a simple "takeoff" python code to program a par

2019-08-15 18:02:39 -0500 asked a question Cannot find my python node.

Cannot find my python node. Hello, I am new to ros and gazebo. I am running a simple "takeoff" python code to program a

2019-08-15 18:02:39 -0500 asked a question Can't see my python node in rosnode list?

Can't see my python node in rosnode list? I am trying to simulate a simple code in Gazebo to takeoff, but there is no re