Program Listing for File OccupancyGridVisualization.hpp

Return to documentation for file (include/grid_map_visualization/visualizations/OccupancyGridVisualization.hpp)

/*
 * PointCloudOccupancyGrid.hpp
 *
 *  Created on: Nov 3, 2014
 *      Author: Péter Fankhauser
 *   Institute: ETH Zurich, ANYbotics
 */

#ifndef GRID_MAP_VISUALIZATION__VISUALIZATIONS__OCCUPANCYGRIDVISUALIZATION_HPP_
#define GRID_MAP_VISUALIZATION__VISUALIZATIONS__OCCUPANCYGRIDVISUALIZATION_HPP_

#include <grid_map_core/GridMap.hpp>
#include <nav_msgs/msg/occupancy_grid.hpp>

#include <string>

#include "grid_map_visualization/visualizations/VisualizationBase.hpp"

namespace grid_map_visualization
{

class OccupancyGridVisualization : public VisualizationBase
{
public:
  explicit OccupancyGridVisualization(const std::string & name, rclcpp::Node::SharedPtr nodePtr);

  virtual ~OccupancyGridVisualization();

  bool readParameters() override;

  bool initialize() override;

  bool visualize(const grid_map::GridMap & map) override;

private:
  std::string layer_;

  // (used to normalize the cell data in [min, max]).
  float dataMin_, dataMax_;

  rclcpp::Publisher<nav_msgs::msg::OccupancyGrid>::SharedPtr publisher_;
};

}  // namespace grid_map_visualization
#endif  // GRID_MAP_VISUALIZATION__VISUALIZATIONS__OCCUPANCYGRIDVISUALIZATION_HPP_