Commit 8b7e5c2c authored by Inès EL HADRI's avatar Inès EL HADRI 💤

Move depth radius check variable to ROS param

parent 52c0831f
......@@ -40,6 +40,14 @@ class CameraVision(CameraDriver):
print("Set HSV params to default values :\n - low : {self._low}\n - high {self._high}")
# Node parameters
self.declare_parameters(
namespace='',
parameters=[
('DEPTH_CHECK_RADIUS', 10)
])
# Node variables
self._kernel = np.ones((5, 5), np.uint8)
self._color_info = (0, 0, 255)
......@@ -165,7 +173,7 @@ class CameraVision(CameraDriver):
def pixelToRelativePos(self, x, y):
# Calculation of the depth value
color_intrin = self._color_frame.profile.as_video_stream_profile().intrinsics
D_RADIUS = 10
D_RADIUS = self.paramInt('DEPTH_CHECK_RADIUS')
front_dist = []
lateral_dist = []
......@@ -185,6 +193,9 @@ class CameraVision(CameraDriver):
return xDist, yDist
def paramInt(self, name):
return self.get_parameter(name).get_parameter_value().integer_value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment