Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,54 @@ pip install -r requirements.txt

3. **运行主程序**:
```bash
cd main
python main.py
```

4. **运行测试程序**:
```bash
cd test
python test_driving.py
```
## 项目结构

```
├── main.py # 主程序入口
├── config.py # 配置文件
├── get_location.py # 位置坐标获取工具
├── test_braking.py # 刹车模型测试
├── test_driving.py # 驾驶模型测试
├── pedestrians_1.py # 行人生成器1
├── pedestrians_2.py # 行人生成器2
└── requirements.txt # 依赖包列表
│ README.md
│ requirements.txt
├─agents
│ │ __init__.py
│ ├─navigation
│ │ basic_agent.py
│ │ behavior_agent.py
│ │ behavior_types.py
│ │ controller.py
│ │ global_route_planner.py
│ │ local_planner.py
│ │ __init__.py
│ └─tools
│ misc.py
│ __init__.py
├─main
│ car_env.py
│ config.py
│ config_manager.py
│ get_location.py
│ main.py
│ model_manager.py
│ route_visualizer.py
│ traffic_manager.py
│ trajectory_manager.py
│ vehicle_tracker.py
├─models
│ Braking___282.00max__282.00avg__282.00min__1679121006.model
│ Driving__6030.00max_6030.00avg_6030.00min__1679109656.model
└─test
braking_dqn.py
driving_dqn.py
pedestrians_1.py
pedestrians_2.py
test_braking.py
test_driving.py
```

## 核心功能
Expand Down
279 changes: 0 additions & 279 deletions src/Autonomous_vehicle_navigation_using_deep_learning_master/main.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
except IndexError:
pass

# 获取当前文件的目录
current_dir = os.path.dirname(os.path.abspath(__file__))
# 获取父目录
parent_dir = os.path.dirname(current_dir)
# 将父目录添加到系统路径
sys.path.append(parent_dir)
from agents.navigation.global_route_planner import GlobalRoutePlanner

import carla
Expand Down Expand Up @@ -420,7 +426,7 @@ def step(self, action, current_state):
self.vehicle.apply_control(carla.VehicleControl(throttle=0, brake=1.0))
print("执行动作: 刹车")
elif action == 1:
self.vehicle.apply_control(carla.VehicleControl(throttle=0.5, steer= 0*self.STEER_AMT))
self.vehicle.apply_control(carla.VehicleControl(throttle=0.4, steer= 0*self.STEER_AMT))
print("执行动作: 直行")
elif action == 2:
self.vehicle.apply_control(carla.VehicleControl(throttle=0.1, steer=-0.3*self.STEER_AMT))
Expand Down
Loading
Loading