为了方便大家快速访问和下载 APM/https://gitee.com/px4pilot,https://gitee.com/ardupilot,https://gitee.com/mavlink,https://gitee.com/dronecan,http://gitee.com/px4pilot )是对 配置环境
运行以下 python 脚本自动配置 git,当 git 请求 px4 相关链接 https://github.com/**/**.git 时自动替换为 https://gitee.com/px4pilot/**.git 地址,其它 github.com 的链接不会替换:
import subprocess import os result = subprocess.Popen( 'git submodule --quiet foreach --recursive "git remote get-url origin"', shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, ) for line in result.stdout.readlines(): url = line.decode().strip() rep = os.path.basename(url) cmd = 'git config --global url."https://gitee.com/px4pilot/%s".insteadOf %s' % (rep, url) print(cmd) os.system(cmd)
当然您也可以在终端输入以下指令,直接配置 git:
git config --global url."https://gitee.com/px4pilot/PX4-FlightGear-Bridge.git".insteadOf https://github.com/PX4/PX4-FlightGear-Bridge.git git config --global url."https://gitee.com/px4pilot/PX4-SITL_gazebo-classic.git".insteadOf https://github.com/PX4/PX4-SITL_gazebo-classic.git git config --global url."https://gitee.com/px4pilot/PX4-gazebo-models.git".insteadOf https://github.com/PX4/PX4-gazebo-models.git git config --global url."https://gitee.com/px4pilot/jMAVSim.git".insteadOf https://github.com/PX4/jMAVSim.git git config --global url."https://gitee.com/px4pilot/jMAVlib.git".insteadOf https://github.com/PX4/jMAVlib.git git config --global url."https://gitee.com/px4pilot/px4-jsbsim-bridge.git".insteadOf https://github.com/PX4/px4-jsbsim-bridge.git git config --global url."https://gitee.com/px4pilot/ATI-Resolution.git".insteadOf https://github.com/FGMEMBERS/ATI-Resolution.git git config --global url."https://gitee.com/px4pilot/FlightGear-Rascal.git".insteadOf https://github.com/Auterion/FlightGear-Rascal.git git config --global url."https://gitee.com/px4pilot/libfc-sensor-api.git".insteadOf https://gitlab.com/voxl-public/voxl-sdk/core-libs/libfc-sensor-api.git git config --global url."https://gitee.com/px4pilot/NuttX-apps.git".insteadOf https://github.com/PX4/NuttX-apps.git git config --global url."https://gitee.com/px4pilot/public_regulated_data_types.git".insteadOf https://github.com/PX4/public_regulated_data_types.git git config --global url."https://gitee.com/px4pilot/libcanard.git".insteadOf https://github.com/opencyphal/libcanard.git git config --global url."https://gitee.com/px4pilot/public_regulated_data_types.git".insteadOf https://github.com/opencyphal/public_regulated_data_types.git git config --global url."https://gitee.com/px4pilot/libuavcan.git".insteadOf https://github.com/dronecan/libuavcan.git git config --global url."https://gitee.com/px4pilot/DSDL".insteadOf https://github.com/dronecan/DSDL git config --global url."https://gitee.com/px4pilot/pydronecan".insteadOf https://github.com/dronecan/pydronecan git config --global url."https://gitee.com/px4pilot/cyclonedds".insteadOf https://github.com/px4/cyclonedds git config --global url."https://gitee.com/px4pilot/rosidl".insteadOf https://github.com/px4/rosidl git config --global url."https://gitee.com/px4pilot/libtomcrypt.git".insteadOf https://github.com/PX4/libtomcrypt.git git config --global url."https://gitee.com/px4pilot/libtommath.git".insteadOf https://github.com/PX4/libtommath.git git config --global url."https://gitee.com/px4pilot/Monocypher.git".insteadOf https://github.com/PX4/Monocypher.git git config --global url."https://gitee.com/px4pilot/libevents.git".insteadOf https://github.com/mavlink/libevents.git git config --global url."https://gitee.com/px4pilot/json.git".insteadOf https://github.com/nlohmann/json.git git config --global url."https://gitee.com/px4pilot/heatshrink.git".insteadOf https://github.com/PX4/heatshrink.git git config --global url."https://gitee.com/px4pilot/mavlink.git".insteadOf https://github.com/mavlink/mavlink.git git config --global url."https://gitee.com/px4pilot/Micro-XRCE-DDS-Client.git".insteadOf https://github.com/PX4/Micro-XRCE-DDS-Client.git git config --global url."https://gitee.com/px4pilot/zenoh-pico".insteadOf https://github.com/px4/zenoh-pico
使用以下命令 取消 对 git config --global --unset url."https://gitee.com/px4pilot/.insteadof"
然后就可以从 gitee.com 上 clone 或者 pull 相关代码:
# 使用github.com或者gitee.com都可以,如果github.com会自动替换为gitee.com git clone https://github.com/px4/px4-autopilot.git --recursive
关于 px4 的开发和学习,欢迎关注由 https://gitee.com/nextpilot/px4-dev-bucket
如果对 将 px4 移植到 rt-thread 国产操作系统 感兴趣的小伙伴,欢迎访问:https://gitee.com/nextpilot/nextpilot-flight-control