update file cmakelists

This commit is contained in:
2025-11-06 17:47:27 +07:00
parent b6dd2d4336
commit bb0bfa6f80
67 changed files with 1971 additions and 44 deletions

View File

@@ -2,42 +2,42 @@
#include "sensor_msgs/JoyFeedbackArray.h"
#include "sensor_msgs/PointCloud2.h"
#include <iostream>
#include <yaml-cpp/yaml.h>
// #include <yaml-cpp/yaml.h>
bool getParams()
{
try {
YAML::Node config = YAML::LoadFile("../cfg/config.yaml");
// bool getParams()
// {
// try {
// YAML::Node config = YAML::LoadFile("../cfg/config.yaml");
double cost_scaling_factor = config["inflation_layer"]["cost_scaling_factor"].as<double>();
double inflation_radius = config["inflation_layer"]["inflation_radius"].as<double>();
// double cost_scaling_factor = config["inflation_layer"]["cost_scaling_factor"].as<double>();
// double inflation_radius = config["inflation_layer"]["inflation_radius"].as<double>();
bool enabled = config["inflation_layer"]["enabled"].as<bool>();
bool inflate_unknown = config["inflation_layer"]["inflate_unknown"].as<bool>();
// bool enabled = config["inflation_layer"]["enabled"].as<bool>();
// bool inflate_unknown = config["inflation_layer"]["inflate_unknown"].as<bool>();
double distance = config["obstacle_layer"]["distance"].as<double>();
// double distance = config["obstacle_layer"]["distance"].as<double>();
std::cout << "Inflation Layer Parameters:" << std::endl;
std::cout << " Cost Scaling Factor: " << cost_scaling_factor << std::endl;
std::cout << " Inflation Radius: " << inflation_radius << std::endl;
std::cout << " Enabled: " << (enabled ? "true" : "false") << std::endl;
std::cout << " Inflate Unknown: " << (inflate_unknown ? "true" : "false") << std::endl;
std::cout << "Obstacle Layer Parameters:" << std::endl;
std::cout << " Distance: " << distance << std::endl;
// std::cout << "Inflation Layer Parameters:" << std::endl;
// std::cout << " Cost Scaling Factor: " << cost_scaling_factor << std::endl;
// std::cout << " Inflation Radius: " << inflation_radius << std::endl;
// std::cout << " Enabled: " << (enabled ? "true" : "false") << std::endl;
// std::cout << " Inflate Unknown: " << (inflate_unknown ? "true" : "false") << std::endl;
// std::cout << "Obstacle Layer Parameters:" << std::endl;
// std::cout << " Distance: " << distance << std::endl;
}
catch (const YAML::BadFile& e) {
std::cerr << "Cannot open YAML file: " << e.what() << std::endl;
return false;
}
// }
// catch (const YAML::BadFile& e) {
// std::cerr << "Cannot open YAML file: " << e.what() << std::endl;
// return false;
// }
return true;
// return true;
}
// }
int main()
{
getParams();
// getParams();
sensor_msgs::BatteryState battery;
// battery.header = std_msgs::Header::now("battery_frame");