Hiep sua ten file
This commit is contained in:
35
robot_map_msgs/include/robot_map_msgs/OccupancyGridUpdate.h
Normal file
35
robot_map_msgs/include/robot_map_msgs/OccupancyGridUpdate.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef OCCUPANCY_GRID_UPDATE_H
|
||||
#define OCCUPANCY_GRID_UPDATE_H
|
||||
|
||||
#include <vector>
|
||||
#include "robot_std_msgs/Header.h"
|
||||
namespace robot_map_msgs
|
||||
{
|
||||
struct OccupancyGridUpdate
|
||||
{
|
||||
robot_std_msgs::Header header; // Thời gian và frame của bản đồ cập nhật
|
||||
int32_t x; // Tọa độ x của góc trên bên trái của vùng cập nhật trong bản đồ
|
||||
int32_t y; // Tọa độ y của góc trên bên trái của vùng cập nhật trong bản đồ
|
||||
uint32_t width; // Chiều rộng của vùng cập nhật
|
||||
uint32_t height; // Chiều cao của vùng cập nhật
|
||||
std::vector<int8_t> data; // Dữ liệu cập nhật của vùng (giá trị từ -1 đến 100, trong đó -1 là không biết, 0 là không có chướng ngại vật, và 100 là chướng ngại vật chắc chắn
|
||||
OccupancyGridUpdate() = default;
|
||||
};
|
||||
|
||||
inline bool operator==(const robot_map_msgs::OccupancyGridUpdate & lhs, const robot_map_msgs::OccupancyGridUpdate & rhs)
|
||||
{
|
||||
return lhs.header == rhs.header &&
|
||||
lhs.x == rhs.x &&
|
||||
lhs.y == rhs.y &&
|
||||
lhs.width == rhs.width &&
|
||||
lhs.height == rhs.height &&
|
||||
lhs.data == rhs.data;
|
||||
}
|
||||
|
||||
|
||||
inline bool operator!=(const robot_map_msgs::OccupancyGridUpdate & lhs, const robot_map_msgs::OccupancyGridUpdate & rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
} // namespace robot_map_msgs
|
||||
#endif
|
||||
Reference in New Issue
Block a user