From 63fa17284752a2df2b2039305769f311ae15bebc Mon Sep 17 00:00:00 2001 From: li-shihao-code <2469171725@qq.com> Date: Thu, 26 Feb 2026 14:29:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=8C=E5=96=84=E4=BA=86=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=A0=87=E5=AE=9A=E8=BD=A6=E9=97=B4=E7=9A=84=E7=8E=AF?= =?UTF-8?q?=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../build.sh | 0 .../src/calibration_sim/CMakeLists.txt | 91 ---------------- .../launch/calibration_system.launch.py | 73 ------------- .../src/calibration_sim/package.xml | 26 ----- .../src/calibration_sim/urdf/agv.xacro | 72 ------------- .../urdf/calibration_board.xacro | 32 ------ .../urdf/workshop_sensors.xacro | 87 --------------- .../worlds/calibration_room.world | 101 ------------------ 8 files changed, 482 deletions(-) rename {calibration_gazebo => agv_calib_brain}/build.sh (100%) delete mode 100644 calibration_gazebo/src/calibration_sim/CMakeLists.txt delete mode 100644 calibration_gazebo/src/calibration_sim/launch/calibration_system.launch.py delete mode 100644 calibration_gazebo/src/calibration_sim/package.xml delete mode 100644 calibration_gazebo/src/calibration_sim/urdf/agv.xacro delete mode 100644 calibration_gazebo/src/calibration_sim/urdf/calibration_board.xacro delete mode 100644 calibration_gazebo/src/calibration_sim/urdf/workshop_sensors.xacro delete mode 100644 calibration_gazebo/src/calibration_sim/worlds/calibration_room.world diff --git a/calibration_gazebo/build.sh b/agv_calib_brain/build.sh similarity index 100% rename from calibration_gazebo/build.sh rename to agv_calib_brain/build.sh diff --git a/calibration_gazebo/src/calibration_sim/CMakeLists.txt b/calibration_gazebo/src/calibration_sim/CMakeLists.txt deleted file mode 100644 index 6f37ca2..0000000 --- a/calibration_gazebo/src/calibration_sim/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(calibration_sim) - -# 1. 基础编译设置 -if(NOT CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 17) -endif() - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# 2. 寻找依赖库 -find_package(ament_cmake REQUIRED) -find_package(rclcpp REQUIRED) -find_package(std_msgs REQUIRED) -find_package(sensor_msgs REQUIRED) # 用于 PointCloud2 -find_package(geometry_msgs REQUIRED) # 用于坐标变换 -find_package(tf2_ros REQUIRED) # 坐标变换工具 -find_package(tf2_geometry_msgs REQUIRED) -find_package(pcl_conversions REQUIRED)# ROS <-> PCL 转换桥梁 - -# 寻找系统级安装的 PCL 库 (非 ROS 包) -find_package(PCL REQUIRED COMPONENTS common io visualization filters registration segmentation) - -# 3. 定义可执行文件 (你的核心 C++ 节点) -# 假设你将来会写一个 lidar_fusion_node.cpp -#add_executable(lidar_fusion_node src/lidar_fusion_node.cpp) - -# 4. 配置头文件路径 -#target_include_directories(lidar_fusion_node PUBLIC -# $ - # $ - # ${PCL_INCLUDE_DIRS} # 必须包含 PCL 的头文件 -#) - -# 5. 链接库文件 -# 链接 ROS 相关的依赖 -#ament_target_dependencies(lidar_fusion_node - # rclcpp - # std_msgs - #sensor_msgs - #geometry_msgs - # tf2_ros - # tf2_geometry_msgs - # pcl_conversions -#) - -# 链接 PCL 相关的依赖 (PCL 不是 ament 包,需要单独链接) -#target_link_libraries(lidar_fusion_node - # ${PCL_LIBRARIES} -#) - -# 6. 安装规则 (至关重要!) - -# 安装可执行文件 (C++ 节点) -#install(TARGETS - # lidar_fusion_node -# DESTINATION lib/${PROJECT_NAME} -#) - -# 安装脚本文件 (如果你有 Python 节点) -# install(PROGRAMS -# scripts/my_python_script.py -# DESTINATION lib/${PROJECT_NAME} -# ) - -# 安装资源目录 (Launch, URDF, RViz, Worlds) -# 如果没有这步,你的 ros2 launch 命令会找不到文件 -install(DIRECTORY - launch - urdf - rviz - worlds - config - DESTINATION share/${PROJECT_NAME} -) - -# 7. 导出依赖与生成包 -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips the linter which checks for eccentric indentation - # comment the line when it conforms to defaults - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/calibration_gazebo/src/calibration_sim/launch/calibration_system.launch.py b/calibration_gazebo/src/calibration_sim/launch/calibration_system.launch.py deleted file mode 100644 index 9f17a6c..0000000 --- a/calibration_gazebo/src/calibration_sim/launch/calibration_system.launch.py +++ /dev/null @@ -1,73 +0,0 @@ -import os -from ament_index_python.packages import get_package_share_directory -from launch import LaunchDescription -from launch.actions import IncludeLaunchDescription, ExecuteProcess -from launch.launch_description_sources import PythonLaunchDescriptionSource -from launch_ros.actions import Node -import xacro - -def generate_launch_description(): - pkg_name = 'calibration_sim' - - # 1. 解析 URDF - infra_xacro = os.path.join(get_package_share_directory(pkg_name), 'urdf', 'workshop_sensors.xacro') - infra_doc = xacro.process_file(infra_xacro) - infra_xml = infra_doc.toxml() - - agv_xacro = os.path.join(get_package_share_directory(pkg_name), 'urdf', 'agv.xacro') - agv_doc = xacro.process_file(agv_xacro) - agv_xml = agv_doc.toxml() - - world_path = os.path.join( - get_package_share_directory('calibration_sim'), - 'worlds', - 'calibration_room.world' - ) - - # 2. 启动 Gazebo - gazebo = IncludeLaunchDescription( - PythonLaunchDescriptionSource([os.path.join( - get_package_share_directory('gazebo_ros'), 'launch', 'gazebo.launch.py')]), - launch_arguments={'world': world_path}.items(), # 【关键】指定 world 参数 - ) - - # 3. 生成基础设施 (4个雷达) - spawn_infra = Node( - package='gazebo_ros', executable='spawn_entity.py', - arguments=['-topic', 'robot_description_infra', '-entity', 'workshop_sensors'], - output='screen' - ) - - # 发布基础设施的 State Publisher (为了TF树) - infra_state_publisher = Node( - package='robot_state_publisher', - executable='robot_state_publisher', - name='infra_state_publisher', - parameters=[{'robot_description': infra_xml}], - remappings=[('robot_description', 'robot_description_infra')] - ) - - # 4. 生成 AGV - spawn_agv = Node( - package='gazebo_ros', executable='spawn_entity.py', - arguments=['-topic', 'robot_description_agv', '-entity', 'my_agv', '-z', '0.1'], - output='screen' - ) - - # 发布 AGV 的 State Publisher - agv_state_publisher = Node( - package='robot_state_publisher', - executable='robot_state_publisher', - name='agv_state_publisher', - parameters=[{'robot_description': agv_xml}], - remappings=[('robot_description', 'robot_description_agv')] - ) - - return LaunchDescription([ - gazebo, - infra_state_publisher, - spawn_infra, - agv_state_publisher, - spawn_agv, - # 这里还可以加上 RViz 的节点 - ]) diff --git a/calibration_gazebo/src/calibration_sim/package.xml b/calibration_gazebo/src/calibration_sim/package.xml deleted file mode 100644 index 4b96452..0000000 --- a/calibration_gazebo/src/calibration_sim/package.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - calibration_sim - 0.0.0 - Simulated environment for workshop calibration project - User - TODO: License declaration - - ament_cmake - - rclcpp - std_msgs - sensor_msgs - geometry_msgs - tf2_ros - tf2_geometry_msgs - pcl_conversions - - gazebo_ros ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/calibration_gazebo/src/calibration_sim/urdf/agv.xacro b/calibration_gazebo/src/calibration_sim/urdf/agv.xacro deleted file mode 100644 index 1d1032e..0000000 --- a/calibration_gazebo/src/calibration_sim/urdf/agv.xacro +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / - - left_wheel_joint - right_wheel_joint - 0.4 - 0.2 - true - true - odom - base_footprint - - - - diff --git a/calibration_gazebo/src/calibration_sim/urdf/calibration_board.xacro b/calibration_gazebo/src/calibration_sim/urdf/calibration_board.xacro deleted file mode 100644 index f3f337c..0000000 --- a/calibration_gazebo/src/calibration_sim/urdf/calibration_board.xacro +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - Gazebo/Checkerboard - - - - true - - - diff --git a/calibration_gazebo/src/calibration_sim/urdf/workshop_sensors.xacro b/calibration_gazebo/src/calibration_sim/urdf/workshop_sensors.xacro deleted file mode 100644 index b5f887a..0000000 --- a/calibration_gazebo/src/calibration_sim/urdf/workshop_sensors.xacro +++ /dev/null @@ -1,87 +0,0 @@ - - - - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gazebo/FlatBlack - - - 0 0 0 0 0 0 - false - 10 - - - 600 - 1 - -0.7854 - 0.7854 - - - - 128 - 1 - -0.2181 - 0.2251 - - - - - 0.5 210.0 - - - - gaussian - 0.0 - 0.03 - - - - - - /infrastructure - ~/out:=${name}/points - - sensor_msgs/PointCloud2 - ${name}_link - - - - - - - - - - - diff --git a/calibration_gazebo/src/calibration_sim/worlds/calibration_room.world b/calibration_gazebo/src/calibration_sim/worlds/calibration_room.world deleted file mode 100644 index 15ce2aa..0000000 --- a/calibration_gazebo/src/calibration_sim/worlds/calibration_room.world +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - 0.6 0.6 0.6 1.0 - 0.7 0.7 0.7 1.0 - true - - - model://ground_plane - - - true - 0 0 0 0 0 0 - 0 5 1.25 0 0 010.2 0.2 2.510.2 0.2 2.5 - 0 -5 1.25 0 0 010.2 0.2 2.510.2 0.2 2.5 - 5 0 1.25 0 0 00.2 10.0 2.50.2 10.0 2.5 - -5 0 1.25 0 0 00.2 10.0 2.50.2 10.0 2.5 - - - model://checkerboard_planeboard_n1-3.75 4.89 1.25 1.57 0 00.3125 0.3125 1 - model://checkerboard_planeboard_n2-1.25 4.89 1.25 1.57 0 00.3125 0.3125 1 - model://checkerboard_planeboard_n3 1.25 4.89 1.25 1.57 0 00.3125 0.3125 1 - model://checkerboard_planeboard_n4 3.75 4.89 1.25 1.57 0 00.3125 0.3125 1 - - model://checkerboard_planeboard_s1-3.75 -4.89 1.25 1.57 0 3.141590.3125 0.3125 1 - model://checkerboard_planeboard_s2-1.25 -4.89 1.25 1.57 0 3.141590.3125 0.3125 1 - model://checkerboard_planeboard_s3 1.25 -4.89 1.25 1.57 0 3.141590.3125 0.3125 1 - model://checkerboard_planeboard_s4 3.75 -4.89 1.25 1.57 0 3.141590.3125 0.3125 1 - - model://checkerboard_planeboard_e14.89 -3.75 1.25 1.57 0 -1.570.3125 0.3125 1 - model://checkerboard_planeboard_e24.89 -1.25 1.25 1.57 0 -1.570.3125 0.3125 1 - model://checkerboard_planeboard_e34.89 1.25 1.25 1.57 0 -1.570.3125 0.3125 1 - model://checkerboard_planeboard_e44.89 3.75 1.25 1.57 0 -1.570.3125 0.3125 1 - - model://checkerboard_planeboard_w1-4.89 -3.75 1.25 1.57 0 1.570.3125 0.3125 1 - model://checkerboard_planeboard_w2-4.89 -1.25 1.25 1.57 0 1.570.3125 0.3125 1 - model://checkerboard_planeboard_w3-4.89 1.25 1.25 1.57 0 1.570.3125 0.3125 1 - model://checkerboard_planeboard_w4-4.89 3.75 1.25 1.57 0 1.570.3125 0.3125 1 - - - - true - 0 0 2.5 0 0 0 - - 0-4.5 -4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-1.5 -4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 1.5 -4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 4.5 -4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-4.5 -1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-1.5 -1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 1.5 -1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 4.5 -1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-4.5 1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-1.5 1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 1.5 1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 4.5 1.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-4.5 4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0-1.5 4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 1.5 4.5 0 0 0 00.10.050.5 0.5 0.5 1 - 0 4.5 4.5 0 0 0 00.10.050.5 0.5 0.5 1 - - - - -4.5 -4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -1.5 -4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 1.5 -4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 4.5 -4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -4.5 -1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -1.5 -1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 1.5 -1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 4.5 -1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -4.5 1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -1.5 1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 1.5 1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 4.5 1.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -4.5 4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - -1.5 4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 1.5 4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - 4.5 4.5 2.45 0 0 00.3 0.3 0.3 10.1 0.1 0.1 160.20.050.10 - - - model://checkerboard_planefloor_n1-3.75 3.75 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_n2-1.25 3.75 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_n3 1.25 3.75 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_n4 3.75 3.75 0.01 0 0 00.3125 0.3125 1 - - model://checkerboard_planefloor_s1-3.75 -3.75 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_s2-1.25 -3.75 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_s3 1.25 -3.75 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_s4 3.75 -3.75 0.01 0 0 00.3125 0.3125 1 - - model://checkerboard_planefloor_e13.75 -1.25 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_e23.75 1.25 0.01 0 0 00.3125 0.3125 1 - - model://checkerboard_planefloor_w1-3.75 -1.25 0.01 0 0 00.3125 0.3125 1 - model://checkerboard_planefloor_w2-3.75 1.25 0.01 0 0 00.3125 0.3125 1 - - -