optimal & fix file cmake

This commit is contained in:
2026-08-03 22:40:26 +07:00
parent 33ee9b7f31
commit 2223453639
120 changed files with 12204 additions and 1886 deletions

View File

@@ -0,0 +1,55 @@
/*********************************************************************
*
* Software License Agreement (BSD License)
*
* Nguồn mission từ một goal đơn lẻ (schema "geometry.pose_stamped").
*
* Author: DuongTD
*********************************************************************/
#ifndef MISSION_ADAPTERS_PLUGINS_GOAL_SOURCE_ADAPTER_H_
#define MISSION_ADAPTERS_PLUGINS_GOAL_SOURCE_ADAPTER_H_
#include <memory>
#include <string>
#include <vector>
#include <robot/node_handle.h>
#include <mission_adapters/adapter.h>
namespace mission_plugins
{
/**
* @class GoalSourceAdapter
* @brief Goal đơn lẻ từ host -> đúng một mission.
*
* Không có state giữa các lần gọi, nhưng vẫn không dùng biến static: một tiến trình có thể chạy
* nhiều instance (nhiều robot mô phỏng) và state static sẽ nối chúng lại với nhau.
*/
class GoalSourceAdapter : public mission_adapters::MissionSourceAdapter
{
public:
/// @brief Factory được PluginRegistry nạp qua boost::dll::import_alias.
static mission_adapters::MissionSourceAdapter::Ptr create();
bool configure(const std::string& name, robot::NodeHandle& nh) override;
std::string schema() const override;
bool validate(const mission_adapters::MissionRequest& request,
std::string& reason) const override;
mission_adapters::ConversionResult
convert(const mission_adapters::MissionRequest& request) override;
private:
/// Dưới ngưỡng này thì quaternion coi như không mang hướng nào. [không đơn vị]
static constexpr double kMinQuaternionNorm = 1e-6;
std::string name_;
};
} // namespace mission_plugins
#endif // MISSION_ADAPTERS_PLUGINS_GOAL_SOURCE_ADAPTER_H_