Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arm Teleop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CREATE Lab
Robot hand
ADAPT Hand
ros_ws
Arm Teleop
Commits
85aa8cdf
Commit
85aa8cdf
authored
8 months ago
by
robo
Browse files
Options
Downloads
Patches
Plain Diff
Commented out zed camera interface.
parent
f17e404d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
arm_teleop/teleop_helper_functions.py
+35
-35
35 additions, 35 deletions
arm_teleop/teleop_helper_functions.py
with
35 additions
and
35 deletions
arm_teleop/teleop_helper_functions.py
+
35
−
35
View file @
85aa8cdf
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment