# dynamic_ws
**Repository Path**: nameiscs/dynamic_ws
## Basic Information
- **Project Name**: dynamic_ws
- **Description**: 静态、动态环境下进行轨迹规划
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2025-03-23
- **Last Updated**: 2025-05-26
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 本仓库为静态、动态环境下进轨迹规划
> 参考github: https://github.com/Zhefan-Xu/CERLAB-UAV-Autonomy.git
## 1、install
### 1.1 px4ctrl
```
mkdir drone_ws/src
cd src
git clone https://gitee.com/nameiscs/px4ctrl.git -b realworld
cd ..
catkin_make
```
### 1.2 autonomous_flight
```
mkdir dynamic_ws/src
cd src
git clone https://gitee.com/nameiscs/autonomous_flight.git
```
### 1.3 global_planner
```
git clone https://gitee.com/nameiscs/global_planner.git
```
### 1.4 map_manager
```
git clone https://gitee.com/nameiscs/map_manager.git
```
### 1.5 onboard_detector
```
git clone https://gitee.com/nameiscs/onboard_detector.git
```
### 1.6 remote_control
```
git clone https://gitee.com/nameiscs/remote_control.git
```
### 1.7 time_optimizer
```
git clone https://gitee.com/nameiscs/time_optimizer.git
```
### 1.8 tracking_controller
```
git clone https://gitee.com/nameiscs/tracking_controller.git
```
### 1.9 trajectory_planner
```
git clone https://gitee.com/nameiscs/trajectory_planner.git
```
### 1.10 uav_simulator
```
git clone https://gitee.com/nameiscs/uav_simulator.git
```
### 1.11 odom_vis
```
git clone https://gitee.com/nameiscs/odom_vis.git
```
## 2、build
### 2.0 catkin_make
> 出现error 显示protobuf版本不匹配问题
**注:如果跑实机则不需要uav_simulator模块,可以将其放置在~/dynamic_ws/目录下**
解决办法:安装protobuf3.6.1版本[教程](https://blog.csdn.net/u014454538/article/details/89005934)
> 查看protobuf版本
```
protoc --version
```
```
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz
tar zvxf protobuf-all-3.6.1.tar.gz
cd protobuf-3.6.1
./configure --prefix=/usr/local/
sudo make
sudo make check
sudo make install
```
### 2.1
```
source ~/dynamic_ws/src/uav_simulator/gazeboSetup.bash
source ~/dynamic_ws/devel/setup.sh
source ~/drone_ws/devel/setup.sh
```
> 可以将其放置在.bashrc文件内
>
### 2.2(已处理好)
将~/dynamic_ws/src/uav_simulator/worlds/corridor路径下的corridor_dynamic_9.world 和 corridor_static.world复制到~/drone_ws/src/simulator/worlds目录下
```
cp ~/dynamic_ws/src/uav_simulator/worlds/corridor/corridor_dynamic_9.world ~/drone_ws/src/simulator/worlds/dynamic.world
```
```
cp ~/dynamic_ws/src/uav_simulator/worlds/corridor/corridor_static.world ~/drone_ws/src/simulator/worlds/static.world
```
### 2.3(已处理好)
```
cd ~/drone_ws/src/simulator/launch/
cp drone_sim_1uav.launch drone_sim_dynamic.launch
```
> 将drone_sim_dynamic.launch文件中的world更改为dynamic.world
```
更改为
```
drone_sim_static.launch文件同理。
## 3、使用
> 启动仿真环境,以及底层控制(具体使用可以查看https://gitee.com/nameiscs/px4ctrl.git)
### 3.1 动态环境
```
roslaunch simulator drone_sim_dynamic.launch
roslaunch px4ctrl run_ctrl_sim.launch
roslaunch px4ctrl terminal_ctrl.launch
```
```
roslaunch remote_control dynamic_navigation_rviz.launch
roslaunch autonomous_flight dynamic_navigation.launch
```

### 3.2 静态环境
```
roslaunch simulator drone_sim_static.launch
roslaunch px4ctrl run_ctrl_sim.launch
roslaunch px4ctrl terminal_ctrl.launch
```
```
roslaunch remote_control navigation_rviz.launch
roslaunch autonomous_flight navigation.launch
```

### 3.3 真机实验
```
roslaunch px4ctrl run_ctrl_exp.launch (注意更改odom和source以及ctrl_param_fpv.yaml文件中的no_RC参数)
roslaunch px4ctrl terminal_ctrl.launch
```
```
roslaunch remote_control navigation_rviz.launch
roslaunch autonomous_flight navigation.launch(注意更改mapping_param.yaml文件中深度相机话题以及相机内参,odom话题不需要更改)
```