ros2djs
ros2djs copied to clipboard
map edit and save
I want to edit and save the map through the draw.html sample. How can you implement it?
Thank You..
One way of implementing it is to record the
- polygon points (these would naturally be saved as points with respect to the map frame)
- pass these points over to ROS using some sort of service call such as:
request = new ROSLIB.ServiceRequest({
polygon_points: JSON.stringify(points)
above_occupied_thresh: true
});
edit_map.callService(request, function (result) {
if (result.result) {
console.log("Service successfully called")
}
});
- On the ROS side receive the service topic, and set all pixels within these points to be occupied if above_occupied_thresh is true and set the points to be unoccupied if above_occupied_thresh is set to false