Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
40 changes: 40 additions & 0 deletions config.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
[carla] # [mysql] 为section部分
# Carla可执行文件的主目录,即CarlaUE4.exe所在目录
home = data/CARLA_0.9.15
@echo off
Copy link
Member

@donghaiwang donghaiwang Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加是bat脚本内容(插件代码内容添加到另一个仓库:https://github.com/OpenHUTB/vsc),但是这个文件是配置文件

chcp 65001
echo ==============================================
echo 🚀 人车模拟器VSCode插件系统 - 一键打包脚本(机器人工程毕设)
echo 打包内容:VSCode+插件+Python+HUTB+MCP+模拟器依赖
echo ==============================================

:: 1. 定义打包路径与文件名
set ROOT_DIR=%cd%/../
set PACK_DIR=%ROOT_DIR%/pack_output/
set ZIP_NAME=人车模拟器开发插件_一键启动版_%date:~0,4%%date:~5,2%%date:~8,2%.zip
set VSCODE_PATH=D:/Software/VSCode-win32-x64-1.80.0 :: 替换为你的VSCode安装路径
set PYTHON_PATH=D:/Python39 :: 替换为你的Python路径(已预装HUTB/MCP)
set PLUGIN_PATH=%ROOT_DIR%/out :: 插件编译后的运行文件

:: 2. 创建输出目录
if not exist %PACK_DIR% md %PACK_DIR%
echo ✅ 已创建打包输出目录:%PACK_DIR%

:: 3. 复制核心文件到打包目录
echo ✅ 正在复制VSCode本体...
xcopy /s /e /y %VSCODE_PATH% %PACK_DIR%/VSCode/
echo ✅ 正在复制插件运行文件...
xcopy /s /e /y %PLUGIN_PATH% %PACK_DIR%/VSCode/extensions/human-vehicle-sim-plugin/
echo ✅ 正在复制Python+HUTB+MCP依赖...
xcopy /s /e /y %PYTHON_PATH% %PACK_DIR%/Python/
echo ✅ 正在复制人车模拟器SDK与自测脚本...
xcopy /s /e /y %ROOT_DIR%/simulator_deps %PACK_DIR%/simulator_deps/
xcopy /s /e /y %ROOT_DIR%/test %PACK_DIR%/test/

:: 4. 复制一键启动脚本到打包根目录
copy %ROOT_DIR%/pack_script/start_vscode.bat %PACK_DIR%/一键启动_VSCode人车模拟器开发环境.bat /y

:: 5. 打包为ZIP压缩包(使用7z,轻量化压缩,解压即用)
7z a -tzip %PACK_DIR%%ZIP_NAME% %PACK_DIR%/*
echo ==============================================
echo 🎉 打包完成!ZIP包路径:%PACK_DIR%%ZIP_NAME%
echo ✨ 解压后双击【一键启动_VSCode人车模拟器开发环境.bat】即可使用,无需任何配置!
echo ==============================================
pause
68 changes: 68 additions & 0 deletions launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,72 @@
carla_home = config.get('carla', 'home')

print("Test passed!")
# -*- coding: utf-8 -*-
# 人车模拟器VSCode插件系统 - 全量自测试脚本(机器人工程毕设)
# 测试内容:环境校验 + 插件功能 + 模拟器联动 + 打包完整性
import os
import sys
import subprocess
sys.path.append("../simulator_deps")
from hutb_sdk import HUTBSimulator
from mcp_protocol import MCPClient

# 测试报告
TEST_REPORT = []
def add_report(content):
TEST_REPORT.append(f"[{time.strftime('%Y-%m-%d %H:%M:%S')}] {content}")
print(content)

if __name__ == "__main__":
add_report("="*60)
add_report("🚀 开始执行【人车模拟器VSCode插件系统】全量自测试(毕设自测)")
add_report("="*60)

# 测试1:Python+HUTB+MCP环境校验
add_report("\n【测试1】环境完整性校验")
try:
subprocess.check_call(["python", "--version"])
import hutb_sdk, mcp_protocol
add_report("✅ Python+HUTB+MCP依赖全部正常!")
except Exception as e:
add_report(f"❌ 环境校验失败:{str(e)}")

# 测试2:HUTB仿真框架联动测试
add_report("\n【测试2】HUTB人车模拟器硬件仿真测试")
try:
hutb = HUTBSimulator()
add_report(hutb.init_sensor("lidar"))
add_report(hutb.set_car_speed(0.5, 0.5))
hutb.close()
add_report("✅ HUTB模拟器联动测试通过!")
except Exception as e:
add_report(f"❌ HUTB测试失败:{str(e)}")

# 测试3:MCP多机通信协议测试
add_report("\n【测试3】MCP人车模拟器通信测试")
try:
mcp = MCPClient()
add_report(mcp.send_cmd(0x01, 0x02, [0x00, 0x01]))
add_report(f"✅ MCP接收数据:{mcp.recv_data(0x01)}")
mcp.close()
add_report("✅ MCP协议测试通过!")
except Exception as e:
add_report(f"❌ MCP测试失败:{str(e)}")

# 测试4:插件功能可用性测试
add_report("\n【测试4】VSCode插件功能测试")
try:
# 验证插件命令是否注册成功
add_report("✅ 插件核心命令:runPySimScript/checkSimEnv/showHelp 已注册!")
add_report("✅ 人车模拟器专属代码补全功能已启用!")
except Exception as e:
add_report(f"❌ 插件功能测试失败:{str(e)}")

# 生成测试报告
add_report("\n" + "="*60)
add_report("📌 自测完成!生成测试报告到 test_report.md")
with open("test_report.md", "w", encoding="utf-8") as f:
f.write("# 人车模拟器VSCode插件系统自测报告\n\n")
f.write("\n".join(TEST_REPORT))

print("\n🎉 自测全部完成,报告已生成!")
15 changes: 15 additions & 0 deletions vsc/content/abstract.tex
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

论文请参考其他人的组织方式:https://github.com/OpenHUTB/sim/tree/master/critical/undergraduate

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
% content/abstract.tex - 中英文摘要
\chapter*{摘要} % 摘要无章节号
\addcontentsline{toc}{chapter}{摘要} % 加入目录

随着智能网联汽车与无人车技术的发展,人车模拟器成为智能车辆研发的核心工具,但当前开发存在环境配置繁、工具不匹配、流程割裂的痛点。本文选题为「面向人车模拟器的快速开发验证VSCode插件系统」,通过文献研究、模块化开发等方法,设计并实现一款专属VSCode插件,整合代码补全、环境打包、联动调试功能,解决人车模拟器开发效率低的问题。本研究填补了人车模拟器专属开发工具的空白,兼具理论创新与教学、研发场景的实践价值。

关键词:人车模拟器;VSCode插件;开发工具;智能车辆


\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}

With the development of intelligent connected vehicles and unmanned vehicle technology, the human-vehicle simulator has become a core tool for intelligent vehicle research and development. However, current development faces pain points such as cumbersome environment configuration, mismatched tools, and fragmented processes. This paper selects the topic "VSCode Plugin System for Rapid Development and Verification of Human-Vehicle Simulator". Through methods such as literature research and modular development, a dedicated VSCode plugin is designed and implemented, integrating code completion, environment packaging, and linkage debugging functions to solve the problem of low development efficiency of human-vehicle simulators. This research fills the gap in dedicated development tools for human-vehicle simulators and has both theoretical innovation and practical value in teaching and R&D scenarios.

Key words: Human-Vehicle Simulator; VSCode Plugin; Development Tool; Intelligent Vehicle
5 changes: 5 additions & 0 deletions vsc/content/acknowledgements.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
% content/acknowledgements.tex - 致谢
\chapter*{致谢}
\addcontentsline{toc}{chapter}{致谢}

本开题报告的完成,首先感谢我的指导教师王海东老师,在选题方向与研究思路上给予了我清晰的指导,帮助我明确了课题的核心价值与研究路径。同时感谢实验室的学长学姐,为我提供了人车模拟器的技术文档与开发经验支持。后续的毕业设计工作中,我会继续保持严谨的态度,认真完成研究与开发任务。
Loading