Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiago camera render range #44

Open
onuroydu opened this issue Sep 15, 2024 · 0 comments
Open

tiago camera render range #44

onuroydu opened this issue Sep 15, 2024 · 0 comments

Comments

@onuroydu
Copy link

onuroydu commented Sep 15, 2024

Hello,

I am trying to use tiago camera for feature extraction/matching. To test the image received from tiago camera, I write the following scripts. It may be a dirty code, I just wanted to see the result quickly.

```

import rclpy
from rclpy.node import Node

from geometry_msgs.msg import Point
from std_msgs.msg import Int16

from sensor_msgs.msg import Image, CameraInfo

import cv2
import numpy as np

class SaveImg(Node):

    def __init__(self):
        super().__init__('save_img')

        self.subscription_1 = self.create_subscription(Image,'/head_front_camera/rgb/image_raw',self.save_img,10)
        self.subscription_2 = self.create_subscription(CameraInfo,'/head_front_camera/rgb/camera_info',self.print_camera_info,10)

    def save_img(self, msg):
        img = np.asarray(msg.data).reshape(msg.height,msg.width,3)
        self.get_logger().info(str(img.shape))
        res = cv2.imwrite("1.jpg", img)
        self.get_logger().info('image saved ?: "%s"' % res)

    def print_camera_info(self, msg):
        self.get_logger().info('K matrix: "%s"' % msg.k)
        self.get_logger().info('D matrix: "%s"' % msg.d)
        self.get_logger().info('height: "%s"' % msg.height)
        self.get_logger().info('width: "%s"' % msg.width)
        self.get_logger().info('distortion_model: "%s"' % msg.distortion_model)

def main(args=None):
    rclpy.init(args=args)

    node = SaveImg()

    rclpy.spin(node)

    # Destroy the node explicitly
    # (optional - otherwise it will be done automatically
    # when the garbage collector destroys the node object)
    node.destroy_node()
    rclpy.shutdown()


if __name__ == '__main__':
    main()


```

However, seems like render range of the camera is very short.

1

Screenshot from 2024-09-15 15-08-34

Is there any way to fix it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant