sua file cmake

This commit is contained in:
2025-11-06 17:46:05 +07:00
parent 05616f8fca
commit b6dd2d4336
82 changed files with 5501 additions and 0 deletions

32
nav_msgs/test/main.cpp Normal file
View File

@@ -0,0 +1,32 @@
// #include "geometry_msgs/BatteryState.h"
// #include "sensor_msgs/JoyFeedbackArray.h"
#include "nav_msgs/OccupancyGrid.h"
#include <iostream>
int main()
{
nav_msgs::OccupancyGrid grid;
grid.info.resolution = 0.05f;
grid.info.width = 2;
grid.info.height = 2;
grid.data.resize(grid.info.width * grid.info.height, -1);
grid.data[0] = 0; // Free cell
grid.data[1] = 100; // Occupied cell
grid.data[2] = 10; // Occupied cell
grid.data[3] = 0; // Free cell
std::cout << "Occupancy Grid Data:" << std::endl;
for (size_t i = 0; i < grid.info.height; ++i)
{
for (size_t j = 0; j < grid.info.width; ++j)
{
std::cout << static_cast<int>(grid.data[i * grid.info.width + j]) << " ";
}
std::cout << std::endl;
}
return 0;
}