TIAN-LEIDA-JIANCE/build_fixed.sh

65 lines
1.7 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
echo "🚀 开始编译宇树雷达坡面检测系统(修复版)..."
# 检查必要的依赖
echo "📋 检查系统依赖..."
# 检查PCL
if ! pkg-config --exists pcl_common-1.12 || ! pkg-config --exists pcl_visualization-1.12; then
echo "❌ PCL库未找到请安装PCL 1.12"
echo "Ubuntu安装命令: sudo apt-get install libpcl-dev"
exit 1
fi
# 检查yaml-cpp
if ! pkg-config --exists yaml-cpp; then
echo "❌ yaml-cpp库未找到请安装yaml-cpp"
echo "Ubuntu安装命令: sudo apt-get install libyaml-cpp-dev"
exit 1
fi
# 检查Unitree SDK
if [ ! -d "unilidar_sdk-main/unilidar_sdk-main/unitree_lidar_sdk" ]; then
echo "❌ Unitree SDK未找到"
echo "请确保unilidar_sdk-main目录存在并包含SDK文件"
exit 1
fi
echo "✅ 依赖检查完成"
# 创建构建目录
mkdir -p build
cd build
# 配置CMake
echo "🔧 配置CMake..."
cmake .. -DCMAKE_BUILD_TYPE=Release
if [ $? -ne 0 ]; then
echo "❌ CMake配置失败"
exit 1
fi
# 编译
echo "🔨 开始编译..."
make -j$(nproc) yushu_leida_fixed
if [ $? -eq 0 ]; then
echo "✅ 编译成功!"
echo "📁 可执行文件位置: build/yushu_leida_fixed"
echo ""
echo "🚀 运行命令:"
echo " cd build && ./yushu_leida_fixed"
echo ""
echo "📋 功能说明:"
echo " ✓ 禁用模拟雷达驱动,仅使用真实雷达"
echo " ✓ 图形界面显示坐标轴"
echo " ✓ 当检测到遮挡物(距离<5厘米时预警"
echo " ✓ 当裂缝各项参数都达到100米时预警"
echo " ✓ 语音预警3次播报结束后继续检测"
echo " ✓ 如果问题仍存在继续播报3次"
else
echo "❌ 编译失败"
exit 1
fi