ROS occupancy grid मैप फ़ॉर्मैट
ROS occupancy grid मैप फ़ाइलों का एक जोड़ा है — आमतौर पर map.pgm और map.yaml — जो robot के environment का 2D top-down view describe करता है। यह ROS navigation stacks (nav1 map_server, nav2 map_server) द्वारा उपभोग किया जाने वाला canonical मैप फ़ॉर्मैट है और gmapping, Cartographer, और slam_toolbox जैसे SLAM packages द्वारा produce किया जाता है।
दो फ़ाइलों में क्या होता है
Section titled “दो फ़ाइलों में क्या होता है”.pgm फ़ाइल एक grayscale Portable Gray Map image है। Pixel values occupancy encode करती हैं:
- Dark pixels — occupied (obstacles, walls)।
- Light pixels — free space।
- एक specific gray (अक्सर 205) — unknown।
.yaml फ़ाइल यह describe करती है कि image को metric coordinates में कैसे interpret करें:
image: map.pgmresolution: 0.05 # metres per pixelorigin: [-12.2, -28.5, 0.0] # bottom-left corner in (x, y, yaw)negate: 0occupied_thresh: 0.65free_thresh: 0.196resolution और origin मिलकर किसी भी downstream tool को pixel coordinates को world coordinates में और वापस बदलने देते हैं।
व्यवहार में यह फ़ॉर्मैट कहाँ से आता है
Section titled “व्यवहार में यह फ़ॉर्मैट कहाँ से आता है”सबसे सामान्य pipelines:
- Robot को manually drive करें और odometry + 2D lidar को gmapping या slam_toolbox को feed करें; resulting मैप save करें।
- Cartographer को bag file पर offline चलाएं और occupancy grid export करें।
- दूसरे format से convert करें —
.bt, OctoMap projection, या custom format।
Output फिर map_server द्वारा localisation (AMCL) और planning (nav2) के लिए load किया जाता है।
drawtonomy कहाँ fit होता है
Section titled “drawtonomy कहाँ fit होता है”drawtonomy .pgm + .yaml pairs import करता है और ब्राउज़र में occupancy grid annotate करने देता है:
- मैप को
resolutionऔरoriginmetadata का उपयोग करके सही metric scale पर canvas पर दिखाया जाता है। - आप मैप के ऊपर lanes, intersections, vehicles, pedestrians, और traffic signs draw कर सकते हैं।
- Annotations अलग drawtonomy shapes के रूप में store होते हैं — original
.pgmmodify नहीं होती। - Paper figures (उस पर planned routes drawn के साथ SLAM मैप), teaching (annotate करें कि planner क्या देखता है), और quick ground-truth labelling के लिए उपयोगी।
यह intentionally एक one-way import है: drawtonomy nav2 के map editing tools का replacement नहीं है। यह एक convenient option है जब आप SLAM map का visually clean, publishable annotation चाहते हैं।
संबंधित पठन
Section titled “संबंधित पठन”- Use case: ROS occupancy grid maps annotate करना — typical workflows।