6 #ifndef mitre_fast_layered_map_sensor_map 7 #define mitre_fast_layered_map_sensor_map 16 #include <nav_msgs/Odometry.h> 17 #include <sensor_msgs/PointCloud2.h> 27 #include <grid_map_msgs/GridMap.h> 30 #include <pcl-1.7/pcl/point_cloud.h> 31 #include <pcl-1.7/pcl/point_types.h> 86 conf1.
len(0) == conf2.
len(0) &&
123 void odomCb(
const nav_msgs::Odometry::ConstPtr);
124 int moveMap(
double,
double);
126 void groundPointCb(
const sensor_msgs::PointCloud2 &);
127 int updateGroundPts(
const PointCloud &);
129 void nonGroundPointCb(
const sensor_msgs::PointCloud2 &);
130 int updateNongroundPts(
const PointCloud &);
131 bool pointHeightFilter(
const pcl::PointXYZ,
double _vehicleHeight = 0);
132 bool pointBoundingBoxFilter(
const pcl::PointXYZ);
134 int integrateStaticMap();
135 void markerCb(
const visualization_msgs::Marker &);
137 void staticMapCb(
const nav_msgs::OccupancyGrid &);
139 int getOccupancyGrid(nav_msgs::OccupancyGrid &);
142 int tfTransformCloud(
const sensor_msgs::PointCloud2 &, sensor_msgs::PointCloud2 &, std::string);
151 bool initialized_{
false};
168 uint64_t readingsReceived_{0};
170 bool cornersCalculated_{
false};
172 bool recStaticMap_{
false};
189 bool CheckFrame(
SensorMap &, std::string);
190 bool CheckPosition(
SensorMap &,
double x,
double y);
192 bool TestMapCells(
SensorMap &, std::string, Eigen::MatrixXi);
193 bool TestMapCells(
SensorMap& , std::string, Eigen::MatrixXf);
ros::Subscriber markerSub_
Subscriber for marker topic to add points to map.
ros::Subscriber groundPointsSub_
Receives point cloud of ground points.
grid_map::GridMap staticMap_
Storage for static map. For optimization we only want to receive it once.
std::string obstacleFilterNs
Filter chain for filtering sensor data into obstacles.
std::string staticMapSubTopic
Sub topic for static maps that should be integrated with our dynamic map.
double permanentFilterProb
Probability required to declare a cell as a permanent obstacle.
ros::Publisher gridMapPub_
Publisher for the whole grid map using grid map msgs.
std::string nonGroundPointSubTopic
Ros topic with nonground (obstacle) points.
bool enablePermanentObstacles
Whether to try and save permanent obstacles.
std::string mapFrameId
TF frame that the map should use.
std::string gridmapOutputTopic
Topic to output the full grid map on.
grid_map::Length len
Size of the map, assumed to be square.
ros::Time odomLastUpdate_
Keeps track of last time we updated position of map.
TFSIMD_FORCE_INLINE const tfScalar & y() const
bool enablePointHeightFilter
Whether to filter points by height.
std::string odomSubTopic
Ros topic holding odometry information.
grid_map::GridMap gridMap_
Mapping data storage container.
double footPrintLen
Length of robot.
double resolution
Cell size of map.
std::string occupancyOutputTopic
Topic the occupancy map should be output on.
TFSIMD_FORCE_INLINE const tfScalar & x() const
bool operator==(const MapConfiguration &conf1, const MapConfiguration &conf2)
bool enableBoundingBoxFilter
Whether to filter lidar points if they are inside the hitbox of the vehicle.
std::string historyLayerPrefix
Prefix to use for history layers.
double footPrintWidth
Width of robot.
int numHistoryLayers
Number of layers to hold for history.
ros::NodeHandle nh_
Passed in node handle for namespace.
filters::FilterChain< grid_map::GridMap > mapOperationsFilterChain_
after updating points
double maxPointHeight
If height filter is enabled, filter points more than this height above vehicle.
ros::Time groundLastUpdate_
Keeps track of the last time we updated ground points.
filters::FilterChain< grid_map::GridMap > obstacleFilterChain_
Filters to modify obstacle state of map.
tf2_ros::TransformListener tfListener_
Used in tfBuffer_.
ros::Time nongroundLastUpdate_
Keeps track of the last time we updated non ground points.
std::vector< geometry_msgs::Pose > corners_
Holds corner of vehicle which will create polygon bounding box.
ros::Subscriber nonGroundPointsSub_
Receives point cloud of nonground points.
std::string vehicleFrameId
Frame id of the robot.
std::string groundPointSubTopic
Ros topic with ground points.
ros::Subscriber odomSub_
Subscribes to odom topic to position map within frame.
std::string mapOperationsFilterNs
Filter chain for map operations after obstacles have been determined.
std::string markerSubTopic
Ros topic to recieve obstacles from other sources.
ros::Subscriber staticMapSub_
Will subscripe to the static map topic. ASSUMPTION: Only one static map.
tf2_ros::Buffer tfBuffer_
Holds transformations from tf tree.
ros::Publisher occPub_
Publisher of occupancy grid.
std::string mapName
Name that will refer to this instance of map.
pcl::PointCloud< pcl::PointXYZ > PointCloud