4/11/2024 0 Comments Ros occupancy grid data type"/media/chen/chen/Robot/projects_ros_test/test/map.pgm", Ros::ServiceServer serv=nh.advertiseService("/static_map",ServiceCallBack) "/media/chen/chen/Robot/projects_ros_test/test/src/mrobot_navigation/maps/cloister_gmapping1.yaml" "/media/chen/chen/Robot/projects_ros_test/test/src/mrobot_navigation/maps/cloister_gmapping.pgm", Nav_msgs::OccupancyGrid BuildMap(const string& imgPath,const string& metaPath) īool ServiceCallBack(nav_msgs::GetMap::Request &req,nav_msgs::GetMap::Response &res) It can help understand the data type of OccupancyGrid 2. There is already a map_server, what's the use of this program? 1. The published service is / static of GetMap type_ map. Read below yaml and pgm map file, build OccupancyGrid message and publish it as / map topic. Read map files and publish themes and services Map (nav_msgs/OccupancyGrid) gets a map by specifying a topic After generation, AAA is obtained Yaml and AAA PGM two files home/xxx/map / is the map directory path, and zhizhaokongjian is the map name. Use the - f option to specify the storage directory and name of the map. rosrun map_server map_saver -f /home/xxx/map/AAA Map_ The saver obtains the map data and writes it to map by default PGM and map yaml. ~frame_id (string, default: "map") sets the coordinate system frame id of the map 2. Static_map (nav_msgs/GetMap) obtains the map through this service Map_metadata (nav_msgs/MapMetaData) gets the metadata of the map This node provides map data through ROS server.ġ.1 usage rosrun map_server map_server mymap.yaml You can provide a two-dimensional map 1.map_server node Nav_msgs/OccupancyGrid map # acquired map Origin the origin of the map, that is, the coordinates of pixels (0,0) in the world coordinate system nav_msgs/GetMap 0 means completely free, 100 means completely occupied, and the special value - 1 is completely unknown. At this time, the occupancy is expressed as an integer in the range of. When ROS messages communicate, the data type is nav_msgs::OccupancyGrid. This formula indicates that the darker the pixel, the higher the occupancy probability, and the whiter the pixel, the lower the occupancy probability. The image unit occupancy probability is calculated as follows: OCC = (255 color_avg) / 255.0 (color_avg is the average value of all channels). If it is a color image, the average value of all channels is calculated. White pixels represent freedom, black pixel cells represent occupancy, and cells between two colors represent unknown. Image describes the occupancy status of each unit in the color of the corresponding pixel on the map. Why the White / black free / occupied semantics should be reversed (Interpretation of thresholds is unaffected) Occupied_thresh: if the pixel occupancy rate is greater than this threshold, it is considered to be fully occupied.įree_thresh: if the pixel occupancy is smaller than the threshold, it is considered completely free. Many parts of the system now ignore the yaw value. Yaw rotates counterclockwise (yaw=0 means no rotation). Origin: the two-dimensional pose of the lower left pixel in the figure, such as (x, y, yaw). Resolution: map resolution, in meters/pixel. Image: Specifies the path of the image file containing occupancy data It can be an absolute path or an object path relative to the YAML file. Map metadata XXX The format of yaml is as follows: image: testmap.pgm ROS navigates through the OccupancyGrid, which consists of a yaml format metadata file, and picture format map data file.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |