Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
larm-astro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Inès EL HADRI
larm-astro
Commits
160556fa
Commit
160556fa
authored
Jan 17, 2024
by
Inès EL HADRI
💤
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get depth as Float32MultiArray
parent
9e82dc26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
cam_vision
grp_astro/src/cam_vision
+3
-2
No files found.
grp_astro/src/cam_vision
View file @
160556fa
...
...
@@ -2,7 +2,7 @@
import
rclpy
from
rclpy.node
import
Node
from
sensor_msgs.msg
import
Image
from
std_msgs.msg
import
String
from
std_msgs.msg
import
String
,
Float32MultiArray
import
numpy
as
np
import
sys
,
cv2
,
pathlib
,
statistics
from
cv_bridge
import
CvBridge
...
...
@@ -22,7 +22,7 @@ class CameraVision(Node):
# Initialize subscribers
self
.
create_subscription
(
Image
,
'cam_rgb'
,
self
.
rgb_callback
,
10
)
self
.
create_subscription
(
Image
,
'cam_depth_dist'
,
self
.
depth_callback
,
10
)
self
.
create_subscription
(
Float32MultiArray
,
'cam_depth_dist'
,
self
.
depth_callback
,
10
)
# Initialize subcriber variables
self
.
_rgb_img
=
None
...
...
@@ -42,6 +42,7 @@ class CameraVision(Node):
# Callbacks
def
rgb_callback
(
self
,
img
):
print
(
'coucou'
)
self
.
_rgb_img
=
self
.
_bridge
.
imgmsg_to_cv2
(
img
,
desired_encoding
=
'passthrough'
)
def
depth_callback
(
self
,
img
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment