Skip to content

Commit

Permalink
fix(coverage_progress): minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rokusottervanger committed Feb 8, 2023
1 parent 29deeb1 commit a55cfe6
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions nodes/coverage_progress
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ class CoverageProgressNode(object):
self.tf_buffer = tf2_ros.Buffer()
self.listener = tf2_ros.TransformListener(self.tf_buffer)

x = None # type: float
y = None # type: float
self._coverage_area = None # type: Tuple[float, float]

self.coverage_resolution = None # type: float # How big is a cell [m]
Expand Down Expand Up @@ -111,6 +109,7 @@ class CoverageProgressNode(object):
# Initialize message
self.grid.header = Header()
self.grid.header.frame_id = self.map_frame
self.grid.header.stamp = coverage_tf.header.stamp

# Loop over amount of cells covered in x (j) and y (i) direction
for i in range(2 * self.coverage_radius_cells):
Expand All @@ -128,9 +127,6 @@ class CoverageProgressNode(object):

if cell_in_coverage_circle and cell_in_grid:
self.grid.data[array_index] = max(0, self.grid.data[array_index] - self.coverage_effectivity)
else:
rospy.logdebug("x_point %i y_point %i, x_meas %f, y_meas %f", x_point, y_point, coveragepos[X],
coveragepos[Y])

coverage_progress = float(sum([self.grid.data < self.DIRTY])) / (self.grid.info.width * self.grid.info.height)

Expand Down

0 comments on commit a55cfe6

Please sign in to comment.