You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
3.0 KiB
84 lines
3.0 KiB
#ifndef BUSBAR_PLANNER_API_H
|
|
#define BUSBAR_PLANNER_API_H
|
|
|
|
#include <cstdint>
|
|
|
|
#ifdef _WIN32
|
|
#if defined(BUSBAR_PLANNER_EXPORTS) || defined(VOXEL_DISTANCE_EXPORTS)
|
|
// 编译动态库时导出
|
|
#define BUSBAR_API __declspec(dllexport)
|
|
#elif defined(BUSBAR_ROUTER_STATIC)
|
|
// 编译或使用静态库时,不需要导入导出声明
|
|
#define BUSBAR_API
|
|
#else
|
|
// 使用动态库时导入
|
|
#define BUSBAR_API __declspec(dllimport)
|
|
#endif
|
|
#else
|
|
#define BUSBAR_API
|
|
#endif
|
|
|
|
extern "C" {
|
|
/**
|
|
* 巴片路径规划接口
|
|
*
|
|
* voxel_types: uint16_t数组,表示每个体素的类型(预处理表)
|
|
* - Bit 11-15 (5 bits): 障碍计数(包含绝缘件在内). >0 视为实体障碍(最高优先级)
|
|
* - Bit 6-10 (5 bits): 非障碍计数(带电件/金属件等). 仅用于分类/统计,不用于最短距离阻挡
|
|
* - Bit 0-5 (6 bits): 间隙计数. 高5位为0时,可作为“间隙碰撞”标记
|
|
* - 全0: 可通行
|
|
*
|
|
* mandatory_region: 必经区域(AABB包围盒),路径必须经过此区域
|
|
* - mandatory_min_x/y/z: 区域最小坐标
|
|
* - mandatory_max_x/y/z: 区域最大坐标
|
|
* - mandatory_enabled: 是否启用必经区域约束
|
|
*/
|
|
BUSBAR_API bool planBusbarPath(
|
|
// 输入参数 - 起点位置、法向和切向
|
|
int start_x, int start_y, int start_z,
|
|
float start_nx, float start_ny, float start_nz,
|
|
float start_tx, float start_ty, float start_tz, // 起点切向,(0,0,0)表示不指定
|
|
// 终点位置、法向和切向
|
|
int end_x, int end_y, int end_z,
|
|
float end_nx, float end_ny, float end_nz,
|
|
float end_tx, float end_ty, float end_tz, // 终点切向,(0,0,0)表示不指定
|
|
// 必经区域(AABB包围盒)
|
|
int mandatory_min_x, int mandatory_min_y, int mandatory_min_z,
|
|
int mandatory_max_x, int mandatory_max_y, int mandatory_max_z,
|
|
bool mandatory_enabled, // 是否启用必经区域
|
|
// 地图尺寸和体素数据
|
|
int xsize, int ysize, int zsize,
|
|
const uint16_t* voxel_types, // 体素类型数组(预处理表)
|
|
const bool* available_types,
|
|
float busbar_width,
|
|
float busbar_thickness,
|
|
float min_begin_length,
|
|
float clearance,
|
|
float flat_bend_f,
|
|
float vertical_bend_v,
|
|
float twist_t,
|
|
float bend_b,
|
|
float heuristic_weight,
|
|
const char* log_file_path,
|
|
float max_time_s,
|
|
// 输出参数
|
|
float* total_cost,
|
|
int* segment_count,
|
|
int* segment_types,
|
|
int* start_pos_x,
|
|
int* start_pos_y,
|
|
int* start_pos_z,
|
|
float* start_normal_x,
|
|
float* start_normal_y,
|
|
float* start_normal_z,
|
|
int* end_pos_x,
|
|
int* end_pos_y,
|
|
int* end_pos_z,
|
|
float* end_normal_x,
|
|
float* end_normal_y,
|
|
float* end_normal_z,
|
|
float* bend_angles
|
|
);
|
|
}
|
|
|
|
#endif // BUSBAR_PLANNER_API_H
|