Advertisement
aninath93

Nav2

Aug 6th, 2024
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.54 KB | None | 0 0
  1.                         while True:
  2.                             navigator.clearAllCostmaps()
  3.                             time.sleep(10)
  4.                             costmap = OccupancyGrid()
  5.                             #footprint_checker = FootprintCollisionChecker(PyCostmap2D(costmap))
  6.                             #print(localization_check.global_info)
  7.                             costmap.info.resolution = localization_check.global_info.info.resolution
  8.                             costmap.info.width = localization_check.global_info.info.width
  9.                             costmap.info.height = localization_check.global_info.info.height
  10.                             costmap.info.origin.position.x = localization_check.global_info.info.origin.position.x
  11.                             costmap.info.origin.position.y = localization_check.global_info.info.origin.position.y
  12.                             costmap.data = localization_check.global_info.data
  13.                             costmap_ = PyCostmap2D(costmap)
  14.                             footprint_checker = FootprintCollisionChecker()
  15.                             footprint_checker.setCostmap(costmap_)
  16.                             footprint_ = Polygon()
  17.                             point = Point32()
  18.                             point.x = 0.0
  19.                             point.y = 0.70
  20.                             point.z = 0.0
  21.                             footprint_.points.append(point)
  22.                             cost = footprint_checker.footprintCost(footprint_)
  23.                             print(cost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement