方法一:
1.使用以下命令克隆 PX4 Autopilot 源码到本地:
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
这将下载最新版本的PX4源码,包括所有子模块。
2.进入下载的源码目录:
cd PX4-Autopilot
3.下载特定版本的PX4源码,可以切换到对应的标签(tag)。例如,如果你想下载1.9.2版本的PX4源码,可以执行以下命令:
git checkout v1.9.2
4.确保所有子模块也被更新:
git submodule update --init --recursive
5.获取当前分支的描述信息查看是否切换为需要的版本
git describe --always
方法二:
也可以使用一条指令选择下载的版本
git clone -b v1.9.2 https://github.com/PX4/PX4-Autopilot.git --recursive