Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e4b4846
性能优化
haruDT Dec 18, 2025
2a08aa6
性能优化
haruDT Dec 18, 2025
34f8b40
删除仓库根目录下的site文件夹
haruDT Dec 19, 2025
bd5eba8
新增requirements.txt文件
haruDT Dec 19, 2025
c82b068
修改README文件,新增requirements文件
haruDT Dec 19, 2025
3b507d4
修改README文件,新增requirements文件
haruDT Dec 19, 2025
6bb9e4d
Merge branch 'main' into main
haruDT Dec 19, 2025
e117740
模块重组
haruDT Dec 19, 2025
b1f4240
Merge branch 'main' of https://github.com/haruDT/nn模块重组
haruDT Dec 19, 2025
f7a8321
目标ID颜色编码
haruDT Dec 19, 2025
1d74b0a
新增实时统计面板
haruDT Dec 19, 2025
f6b0785
修复问号问题
haruDT Dec 20, 2025
80f38cf
新增实时统计面板
haruDT Dec 20, 2025
99cbf97
Merge branch 'main' into main
haruDT Dec 20, 2025
e80d7a1
新增实时统计面板
haruDT Dec 21, 2025
dae1d5a
Merge branch 'main' into main
haruDT Dec 21, 2025
7e07ea8
新增实时统计面板
haruDT Dec 21, 2025
40958b0
完成远程main分支的合并,解决代码冲突
haruDT Dec 21, 2025
20b3e8f
恢复误修改的文件
haruDT Dec 21, 2025
bb08dbe
修改相对路径
haruDT Dec 21, 2025
d935aa2
修改绝对路径
haruDT Dec 21, 2025
026b433
随机地点生成主车
haruDT Dec 21, 2025
490eb1e
随机地点生成自车
haruDT Dec 22, 2025
e2659d2
新增卫星视角跟随主车
haruDT Dec 22, 2025
18ac7ff
Merge branch 'main' into main
haruDT Dec 22, 2025
1fd8e11
使用配置文件切换视角
haruDT Dec 22, 2025
321ceb9
Merge branch 'main' into main
haruDT Dec 22, 2025
1da7a1c
优化检测范围
haruDT Dec 23, 2025
fb43939
优化检测范围
haruDT Dec 23, 2025
572858f
Merge branch 'main' into main
haruDT Dec 23, 2025
4e4dbb4
多余部分优化
haruDT Dec 24, 2025
15b527f
多余部分优化
haruDT Dec 24, 2025
f1b6c7c
修复问题
haruDT Dec 24, 2025
7ec6d5e
Merge branch 'main' into main
haruDT Dec 24, 2025
d4461de
自适应帧率
haruDT Dec 24, 2025
d74c81d
Merge branch 'main' of https://github.com/haruDT/nn
haruDT Dec 24, 2025
fd9dd9c
热重载功能
haruDT Dec 25, 2025
b630789
Merge branch 'main' into main
haruDT Dec 25, 2025
55389c0
新增识别交通标识
haruDT Dec 26, 2025
0951f33
Merge branch 'main' into main
haruDT Dec 26, 2025
1963bf5
CARLA ROS封装作业
haruDT Dec 28, 2025
e004418
Merge branch 'main' of https://github.com/haruDT/nn
haruDT Dec 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/tracking_car/carla_tracking_ros/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# ROS编译文件
build/
devel/
install/

# Python缓存
__pycache__/
*.py[cod]
*$py.class
*.so
.Python

# 日志和临时文件
*.log
*.pid
*.sqlite
*.sqlite3

# 编辑器文件
.vscode/
.idea/
*.swp
*.swo
*~

# 系统文件
.DS_Store
Thumbs.db

# 备份文件
*.bak
*.backup
*.tmp

# 大文件
*.bag
*.mp4
*.avi
28 changes: 28 additions & 0 deletions src/tracking_car/carla_tracking_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.0.2)
project(carla_tracking_ros)

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
cv_bridge
image_transport
)

catkin_python_setup()

catkin_package(
CATKIN_DEPENDS roscpp rospy std_msgs cv_bridge image_transport
)

install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
)

install(DIRECTORY config/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
)

install(FILES requirements.txt
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
90 changes: 90 additions & 0 deletions src/tracking_car/carla_tracking_ros/config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# ======================== CARLA连接配置 ========================
host: "localhost"
port: 2000
timeout: 20.0

# ======================== 传感器配置 ========================
img_width: 1280
img_height: 960
fov: 110
sensor_tick: 0.05
use_lidar: true

# ======================== LiDAR配置 ========================
lidar_channels: 32
lidar_range: 100.0
lidar_points_per_second: 500000

# ======================== 检测模型配置 ========================
yolo_model: "yolov8n.pt"
conf_thres: 0.1
iou_thres: 0.3
device: "cpu"
yolo_imgsz_max: 640

# ======================== 跟踪算法配置 ========================
max_age: 5
min_hits: 3
kf_dt: 0.05
max_speed: 50.0

# ======================== 可视化配置 ========================
window_width: 1280
window_height: 720
display_fps: 30

# ======================== 轨迹历史配置 ========================
track_history_len: 20

# ======================== 行为分析配置 ========================
stop_speed_thresh: 0.8
stop_frames_thresh: 5
overtake_speed_ratio: 1.5
overtake_dist_thresh: 60.0
lane_change_thresh: 0.4
brake_accel_thresh: 2.0
turn_angle_thresh: 15.0
danger_dist_thresh: 15.0
predict_frames: 10

# ======================== 天气与NPC配置 ========================
default_weather: "clear"
num_npcs: 20

# ======================== 视角控制配置 ========================
view:
default_mode: "satellite"
satellite_height: 50.0
behind_distance: 10.0
first_person_height: 1.6

# ======================== 热重载配置 ========================
hot_reload:
enabled: true # 是否启用热重载
check_interval: 100 # 每多少帧检查一次配置文件
safe_keys_only: true # 是否只更新安全参数(避免重启连接)

# 可热重载的安全参数列表(这些参数可以安全更新而不需要重启)
hot_reload_safe_keys:
- "conf_thres" # 检测置信度阈值
- "iou_thres" # IOU阈值
- "display_fps" # 显示帧率
- "max_age" # 跟踪最大丢失帧数
- "min_hits" # 跟踪最小匹配次数
- "adaptive_fps" # 是否启用自适应帧率
- "min_fps" # 最小FPS
- "max_fps" # 最大FPS
- "fov" # 相机视野
- "yolo_imgsz_max" # YOLO输入尺寸
- "stop_speed_thresh" # 停车速度阈值
- "danger_dist_thresh" # 危险距离阈值
- "weather" # 天气设置

# ======================== 交通标志检测配置 ========================
enable_sign_detection: false # 是否启用交通标志检测

traffic_sign:
enabled: true # 检测器是否启用
show_signs: true # 是否显示检测框
enable_actions: false # 是否触发动作(警告等)
conf_threshold: 0.5 # 置信度阈值
34 changes: 34 additions & 0 deletions src/tracking_car/carla_tracking_ros/launch/main.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0"?>
<launch>
<!--
CARLA多目标跟踪系统ROS封装
运行命令: roslaunch carla_tracking_ros main.launch
-->

<!-- 参数配置 -->
<arg name="mode" default="simulation" />
<arg name="gui" default="true" />
<arg name="config_file" default="$(find carla_tracking_ros)/config.yaml" />

<!-- 主节点 -->
<node name="carla_tracking_node"
pkg="carla_tracking_ros"
type="main.py"
output="screen">

<!-- 配置文件 -->
<param name="config_path" value="$(arg config_file)" />

<!-- 运行模式 -->
<param name="mode" value="$(arg mode)" />

</node>

<!-- 图像查看器(可选) -->
<node name="image_view"
pkg="image_view"
type="image_view"
args="image:=/carla/camera"
if="$(arg gui)" />

</launch>
31 changes: 31 additions & 0 deletions src/tracking_car/carla_tracking_ros/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0"?>
<package format="2">
<name>carla_tracking_ros</name>
<version>1.0.0</version>
<description>CARLA Multi-Object Tracking System - ROS Integration</description>

<maintainer email="tjl@todo.todo">tjl</maintainer>
<license>MIT</license>

<url type="website">https://github.com/yourusername/carla_tracking_ros</url>
<author email="tjl@todo.todo">tjl</author>

<buildtool_depend>catkin</buildtool_depend>

<depend>roscpp</depend>
<depend>rospy</depend>
<depend>std_msgs</depend>
<depend>cv_bridge</depend>
<depend>image_transport</depend>

<!-- 消息和服务依赖 -->
<depend>message_generation</depend>
<depend>message_runtime</depend>

<!-- 测试依赖 -->
<test_depend>rosunit</test_depend>

<export>
<rosdoc config="rosdoc.yaml" />
</export>
</package>
17 changes: 17 additions & 0 deletions src/tracking_car/carla_tracking_ros/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 核心依赖
# 可选依赖

carla>=0.9.14
loguru>=0.7.0
matplotlib>=3.7.0
numba>=0.57.0
numpy>=1.24.0
open3d>=0.17.0
opencv-python>=4.8.0
pandas>=2.0.0
psutil>=5.9.0
pyyaml>=6.0.0
scikit-learn>=1.2.0
scipy>=1.10.0
torch>=2.0.0
ultralytics>=8.0.0
Empty file.
Loading
Loading