Skip to content
Snippets Groups Projects
Commit 85aa8cdf authored by robo's avatar robo
Browse files

Commented out zed camera interface.

parent f17e404d
No related branches found
No related tags found
No related merge requests found
import sys
import pyzed.sl as sl
# import pyzed.sl as sl
from geometry_msgs.msg import TransformStamped, PoseStamped
import rclpy
from scipy.spatial.transform import Rotation as R
......@@ -52,37 +52,37 @@ def broadcast_tf(self, base_name, frame_name, position, quaternion):
return t
def init_zed_camera():
# Create a ZED camera object
zed = sl.Camera()
# Set configuration parameters
input_type = sl.InputType()
if len(sys.argv) >= 2 :
input_type.set_from_svo_file(sys.argv[1])
init = sl.InitParameters(input_t=input_type)
init.camera_resolution = sl.RESOLUTION.HD1080
init.depth_mode = sl.DEPTH_MODE.PERFORMANCE
init.coordinate_units = sl.UNIT.MILLIMETER
# Open the camera
err = zed.open(init)
if err != sl.ERROR_CODE.SUCCESS :
print(repr(err))
zed.close()
exit(1)
# Set runtime parameters after opening the camera
runtime = sl.RuntimeParameters()
# Prepare new image size to retrieve half-resolution images
image_size = zed.get_camera_information().camera_configuration.resolution
image_size.width = image_size.width /2
image_size.height = image_size.height /2
# Declare your sl.Mat matrices
image_zed = sl.Mat(image_size.width, image_size.height, sl.MAT_TYPE.U8_C4)
depth_image_zed = sl.Mat(image_size.width, image_size.height, sl.MAT_TYPE.U8_C4)
point_cloud = sl.Mat()
return zed, runtime, image_size, image_zed, depth_image_zed, point_cloud
\ No newline at end of file
# def init_zed_camera():
# # Create a ZED camera object
# zed = sl.Camera()
# # Set configuration parameters
# input_type = sl.InputType()
# if len(sys.argv) >= 2 :
# input_type.set_from_svo_file(sys.argv[1])
# init = sl.InitParameters(input_t=input_type)
# init.camera_resolution = sl.RESOLUTION.HD1080
# init.depth_mode = sl.DEPTH_MODE.PERFORMANCE
# init.coordinate_units = sl.UNIT.MILLIMETER
# # Open the camera
# err = zed.open(init)
# if err != sl.ERROR_CODE.SUCCESS :
# print(repr(err))
# zed.close()
# exit(1)
# # Set runtime parameters after opening the camera
# runtime = sl.RuntimeParameters()
# # Prepare new image size to retrieve half-resolution images
# image_size = zed.get_camera_information().camera_configuration.resolution
# image_size.width = image_size.width /2
# image_size.height = image_size.height /2
# # Declare your sl.Mat matrices
# image_zed = sl.Mat(image_size.width, image_size.height, sl.MAT_TYPE.U8_C4)
# depth_image_zed = sl.Mat(image_size.width, image_size.height, sl.MAT_TYPE.U8_C4)
# point_cloud = sl.Mat()
# return zed, runtime, image_size, image_zed, depth_image_zed, point_cloud
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment