void PFSlam:: mapCallback(const nav_msgs::OccupancyGrid& occupancyGrid) { int i=0; potentialField::repulsivePoint tempPoint; potentialField tempField; // default values for the points created. Likely to be updated later to be more dynamic float weight=10; float maxRange=.5; // create variables to store map metadata int height,width; float res; /* * print out some data about the map when the callback is triggered */ std::cout<<"callback!"<0){ // generate a point for any point in the occupancyGrid that has nonzero probability. tempPoint.x = ix*occupancyGrid.info.resolution+occupancyGrid.info.origin.position.x; // calculate x and set to temp; tempPoint.y = iy*occupancyGrid.info.resolution+occupancyGrid.info.origin.position.y; // tempPoint.weight= weight; tempPoint.maxRange=maxRange; navField.addPoint(tempPoint); // now that the point is prepared we add it to the potentialField } i++; } } // debugging printouts //navField.printPotentialField(); //setPotentialField(tempField); publishObstacles(); publishGoals(); }