当前位置: 首页 > news >正文

OpenHarmony无人机MAVSDK开源库适配方案分享

MAVSDK 是 PX4 开源团队贡献的基于 MavLink 通信协议的用于无人机应用开发的 SDK,支持多种语言如 C/C++、python、Java 等。通常用于无人机间、地面站与通信设备的消息传输。

MAVLink 是一种非常轻量级的消息传递协议,用于与无人机(以及机载无人机组件之间)进行通信。MAVLink 遵循现代混合发布-订阅和点对点设计模式,数据流作为主题发送/发布,而任务协议或参数协议等配置子协议是点对点的重传。其中 MAVLink 1 每个数据包只有 8 个字节的开销,包括开始标志和数据包丢弃检测。MAVLink 2 只有 14 字节的开销。由于 MAVLink 不需要任何额外的成帧,因此非常适合通信带宽非常有限的应用程序。

当我们想要在 OpenHarmony 上做无人机相关工作时,在通信方面需要面临 MAVLink 的移植适配工作。因此接下来我们将分享如何将 MAVSDK 移植至 OpenHarmony 系统当中。


MAVSDK Github 开源地址:GitHub - mavlink/MAVSDK: API and library for MAVLink compatible systems written in C++17

接下来讲解如何把 MAVSDK 开源库添加至 OpenHarmony 工程中进行编译。(此方法与其他开源库移植方法基本一致)

本次移植通过新建子系统 mavsdk,在子系统下添加名为 mavsdk 的组件,并在该组件下添加名为 MAVSDK 的模块,OpenHarmony 系统层级顺序如下:子系统-> 组件-> 模块,下文中将都以此为顺序进行叙述。

表 1:添加到工程后的目录结构

路径描述
ohos/build/subsystem_config.json子系统配置
ohos/productdefine/common/products/ohos-arm64.json板级相关
ohos/third_party/MAVSDK/bundle.json在子系统中添加组件配置
ohos/third_party/MAVSDK/BUILD.gn三方库模块化,将其加入组件中的 gn 文件

subsystem_config.json

首先在 ohos/build/subsystem 中添加 subsystem 节点。

"mavsdk": {   "path": "third_party/MAVSDK", "name": "mavsdk"}

ohos-arm64.json 文件

在 ohos/productdefine/common/products/ohos-arm64.json 文件中添加板级相关的信息。

"mavsdk:MAVSDK":{} 

如下图所示:

Bundle.json 文件

在 ohos/third 目录下添加 bundle.json 文件,以便系统可以添加名为 MAVSDK 的组件。

对于此文件要点如注释所见(编译时去除注释以保证配置文件整洁性)

{"name": "@ohos/MAVSDK","description": "","version": "","license": "","publishAs": "","segment": {"destPath": "third_party/MAVSDK"},"dirs": {},"scripts": {},"readmePath": {},"component": {"name": "MAVSDK","subsystem": "mavsdk","syscap": [],"features": [],"adapted_system_type": [],"rom": "","ram": "","deps": {"components": [ "jsoncpp","zlib"//此处添加了要用的三方库,后续的build.gn中还会有所体现。],"third_party": ["jsoncpp","zlib"]},"build": {"sub_component": [  "//third_party/mavsdk:MAVSDK","//third_party/mavsdk:mavsdk_test"],//此处添加了接下来要编译的组件,一个是代码主仓组件,一个是代码的测试文件组件"inner_kits": [],"test": ["//third_party/mavsdk:mavsdk_test"]}}}

BUILD.gn 文件

在完成上述步骤后,下面需要在 ohos/third 目录添加 BUILD.gn,根据不同的系统生成静态或者动态库,注意点如下:

文件作用
build.make生成目标的源文件
depend.make需要依赖的其他 C 源文件
flags.makecflags 相关的一些标志
link.txt链接库相关信息

① 注意移植时的 cflags、cflags 应从原始的编译文件(例如 cmake 过程中 build 的生成文件:在 cmake 生成 makefile 的过程中分析 build.make、depend.make、flags.make、link.txt 等得出三方库对应的依赖关系)中获取相关的标志位

② 注意移植的源文件及头文件地址可以使用当前 build.gn 所在路径下相对位置,例如/src 与 build.gn 在同一路径下则路径可以直接应用 src/....

③ 注意 deps 若引用的是组件内的其他模块,例如其他 build.gn 文件中的组件或当前 build.gn 中位于此 deps 前的其他组件可以使用 ”:module 进行模块依赖,若是引用组件外的其他组件则需要使用 ”bundle

import("//build/ohos.gni")  
import("//build/test.gni")config("mavsdk_cflag_config") {#编译时的标志位cflags = [  "-fexceptions","-Wextra","-Wshadow","-Wno-strict-aliasing","-Wformat=2","-Wextra","-Wno-unused-lambda-capture","-Wno-pragmas","-Wno-unknown-warning-option","-Wduplicated-cond","-Wnull-dereference","-Wduplicated-branches","-Wlogical-op", "-Wno-old-style-cast","-pthread",]cflags_cc = [ "-frtti" ] #fix:[OHOS ERROR] ../../prebuilts/clang/ohos/linux-x86_64/llvm/bin/../include/libcxx-ohos/include/c++/v1/memory:3566:16: error: use of dynamic_cast requires -frttildflags = [ "-fPIC","-g","-shared","-Wl","-soname" ]
}ohos_source_set("libmavsdk_source") {configs = [":mavsdk_cflag_config"]deps = [ "//third_party/curl:curl"  ] #需要包含的源文件sources = ["src/mavsdk/core/call_every_handler.cpp" ,"src/mavsdk/core/connection.cpp" ,"src/mavsdk/core/connection_result.cpp" ,"src/mavsdk/core/curl_wrapper.cpp" ,"src/mavsdk/core/crc32.cpp" ,"src/mavsdk/core/system.cpp" ,"src/mavsdk/core/system_impl.cpp" ,"src/mavsdk/core/fs.cpp" ,"src/mavsdk/core/mavsdk.cpp" ,"src/mavsdk/core/mavsdk_impl.cpp" ,"src/mavsdk/core/http_loader.cpp" ,"src/mavsdk/core/mavlink_channels.cpp" ,"src/mavsdk/core/mavlink_command_receiver.cpp" ,"src/mavsdk/core/mavlink_command_sender.cpp" ,"src/mavsdk/core/mavlink_ftp.cpp" ,"src/mavsdk/core/mavlink_mission_transfer.cpp" ,"src/mavsdk/core/mavlink_parameters.cpp" ,"src/mavsdk/core/mavlink_receiver.cpp" ,"src/mavsdk/core/mavlink_request_message_handler.cpp" ,"src/mavsdk/core/mavlink_statustext_handler.cpp" ,"src/mavsdk/core/mavlink_message_handler.cpp" ,"src/mavsdk/core/ping.cpp" ,"src/mavsdk/core/plugin_impl_base.cpp" ,"src/mavsdk/core/serial_connection.cpp" ,"src/mavsdk/core/tcp_connection.cpp" ,"src/mavsdk/core/timeout_handler.cpp" ,"src/mavsdk/core/udp_connection.cpp" ,"src/mavsdk/core/log.cpp" ,"src/mavsdk/core/cli_arg.cpp" ,"src/mavsdk/core/geometry.cpp" ,"src/mavsdk/core/request_message.cpp" ,"src/mavsdk/core/mavsdk_time.cpp" ,"src/mavsdk/core/timesync.cpp" ,"src/mavsdk/plugins/action/action.cpp" ,"src/mavsdk/plugins/action/action_impl.cpp" ,"src/mavsdk/plugins/action_server/action_server.cpp" ,"src/mavsdk/plugins/action_server/action_server_impl.cpp" ,"src/mavsdk/plugins/calibration/calibration.cpp" ,"src/mavsdk/plugins/calibration/calibration_impl.cpp" ,"src/mavsdk/plugins/calibration/calibration_statustext_parser.cpp" ,"src/mavsdk/plugins/camera/camera.cpp" ,"src/mavsdk/plugins/camera/camera_impl.cpp" ,"src/mavsdk/plugins/camera/camera_definition.cpp" ,"src/mavsdk/plugins/camera/camera_definition_files/generated/camera_definition_files.cpp" ,"src/mavsdk/plugins/component_information/component_information.cpp" ,"src/mavsdk/plugins/component_information/component_information_impl.cpp" ,"src/mavsdk/plugins/component_information_server/component_information_server.cpp" ,"src/mavsdk/plugins/component_information_server/component_information_server_impl.cpp" ,"src/mavsdk/plugins/failure/failure.cpp" ,"src/mavsdk/plugins/failure/failure_impl.cpp" ,"src/mavsdk/plugins/follow_me/follow_me.cpp" ,"src/mavsdk/plugins/follow_me/follow_me_impl.cpp" ,"src/mavsdk/plugins/ftp/ftp.cpp" ,"src/mavsdk/plugins/ftp/ftp_impl.cpp" ,"src/mavsdk/plugins/geofence/geofence.cpp" ,"src/mavsdk/plugins/geofence/geofence_impl.cpp" ,"src/mavsdk/plugins/gimbal/gimbal.cpp" ,"src/mavsdk/plugins/gimbal/gimbal_impl.cpp" ,"src/mavsdk/plugins/gimbal/gimbal_protocol_v1.cpp" ,"src/mavsdk/plugins/gimbal/gimbal_protocol_v2.cpp" ,"src/mavsdk/plugins/info/info.cpp" ,"src/mavsdk/plugins/info/info_impl.cpp" ,"src/mavsdk/plugins/log_files/log_files.cpp" ,"src/mavsdk/plugins/log_files/log_files_impl.cpp" ,"src/mavsdk/plugins/manual_control/manual_control.cpp" ,"src/mavsdk/plugins/manual_control/manual_control_impl.cpp" ,"src/mavsdk/plugins/mavlink_passthrough/mavlink_passthrough.cpp" ,"src/mavsdk/plugins/mavlink_passthrough/mavlink_passthrough_impl.cpp" ,"src/mavsdk/plugins/mission/mission.cpp" ,"src/mavsdk/plugins/mission/mission_impl.cpp" ,"src/mavsdk/plugins/mission_raw/mission_raw.cpp" ,"src/mavsdk/plugins/mission_raw/mission_raw_impl.cpp" ,"src/mavsdk/plugins/mission_raw/mission_import.cpp" ,"src/mavsdk/plugins/mission_raw_server/mission_raw_server.cpp" ,"src/mavsdk/plugins/mission_raw_server/mission_raw_server_impl.cpp" ,"src/mavsdk/plugins/mocap/mocap.cpp" ,"src/mavsdk/plugins/mocap/mocap_impl.cpp" ,"src/mavsdk/plugins/offboard/offboard.cpp" ,"src/mavsdk/plugins/offboard/offboard_impl.cpp" ,"src/mavsdk/plugins/param/param.cpp" ,"src/mavsdk/plugins/param/param_impl.cpp" ,"src/mavsdk/plugins/param_server/param_server.cpp" ,"src/mavsdk/plugins/param_server/param_server_impl.cpp" ,"src/mavsdk/plugins/server_utility/server_utility.cpp" ,"src/mavsdk/plugins/server_utility/server_utility_impl.cpp" ,"src/mavsdk/plugins/shell/shell.cpp" ,"src/mavsdk/plugins/shell/shell_impl.cpp" ,"src/mavsdk/plugins/telemetry/telemetry.cpp" ,"src/mavsdk/plugins/telemetry/telemetry_impl.cpp" ,"src/mavsdk/plugins/telemetry/math_conversions.cpp" ,"src/mavsdk/plugins/telemetry_server/telemetry_server.cpp" ,"src/mavsdk/plugins/telemetry_server/telemetry_server_impl.cpp" ,"src/mavsdk/plugins/tracking_server/tracking_server.cpp" ,"src/mavsdk/plugins/tracking_server/tracking_server_impl.cpp" ,"src/mavsdk/plugins/transponder/transponder.cpp" ,"src/mavsdk/plugins/transponder/transponder_impl.cpp" ,"src/mavsdk/plugins/rtk/rtk.cpp" ,"src/mavsdk/plugins/rtk/rtk_impl.cpp" ,"src/mavsdk/plugins/tune/tune.cpp" ,"src/mavsdk/plugins/tune/tune_impl.cpp"]#需要包含的头文件include_dirs = ["src/mavsdk/core","src/mavsdk/core/include/mavsdk","src/mavsdk/plugins/action/include","src/mavsdk/plugins/action_server/include","src/mavsdk/plugins/calibration/include","src/mavsdk/plugins/camera/include","src/mavsdk/plugins/camera/camera_definition_files/generated","src/mavsdk/plugins/component_information/include","src/mavsdk/plugins/component_information_server/include","src/mavsdk/plugins/failure/include","src/mavsdk/plugins/follow_me/include","src/mavsdk/plugins/ftp/include","src/mavsdk/plugins/geofence/include","src/mavsdk/plugins/gimbal/include","src/mavsdk/plugins/info/include","src/mavsdk/plugins/log_files/include","src/mavsdk/plugins/manual_control/include","src/mavsdk/plugins/mavlink_passthrough/include","src/mavsdk/plugins/mission/include","src/mavsdk/plugins/mission_raw/include","src/mavsdk/plugins/mission_raw_server/include","src/mavsdk/plugins/mocap/include","src/mavsdk/plugins/offboard/include","src/mavsdk/plugins/param/include","src/mavsdk/plugins/param_server/include","src/mavsdk/plugins/rtk/include","src/mavsdk/plugins/server_utility/include","src/mavsdk/plugins/shell/include","src/mavsdk/plugins/telemetry/include","src/mavsdk/plugins/telemetry_server/include","src/mavsdk/plugins/tracking_server/include","src/mavsdk/plugins/transponder/include","src/mavsdk/plugins/tune/include","src/mavsdk/plugins/action","src/mavsdk/plugins/action_server","src/mavsdk/plugins/calibration","src/mavsdk/plugins/camera","src/mavsdk/plugins/component_information","src/mavsdk/plugins/component_information_server","src/mavsdk/plugins/failure","src/mavsdk/plugins/follow_me","src/mavsdk/plugins/ftp","src/mavsdk/plugins/geofence","src/mavsdk/plugins/gimbal","src/mavsdk/plugins/info","src/mavsdk/plugins/log_files","src/mavsdk/plugins/manual_control","src/mavsdk/plugins/mavlink_passthrough","src/mavsdk/plugins/mission","src/mavsdk/plugins/mission_raw","src/mavsdk/plugins/mission_raw_server","src/mavsdk/plugins/mocap","src/mavsdk/plugins/offboard","src/mavsdk/plugins/param","src/mavsdk/plugins/param_server","src/mavsdk/plugins/rtk","src/mavsdk/plugins/server_utility","src/mavsdk/plugins/shell","src/mavsdk/plugins/telemetry","src/mavsdk/plugins/telemetry_server","src/mavsdk/plugins/tracking_server","src/mavsdk/plugins/transponder","src/mavsdk/plugins/tune","src/third_party/mavlink","src/third_party/mavlink/mavlink/src/mavlink/include/mavlink/v2.0","src/third_party/mavlink/mavlink/src/mavlink/include/mavlink/v2.0/common","//third_party/jsoncpp/include","//third_party/curl/include","//third_party/tinyxml2","//third_party/zlib",]
}ohos_shared_library("MAVSDK") {deps = [    ":libmavsdk_source","//third_party/curl:curl_shared","//third_party/openssl:libssl_shared","//third_party/openssl:libcrypto_shared","//third_party/jsoncpp:jsoncpp","//third_party/tinyxml2:tinyxml2"]         #依赖的三方库part_name = "MAVSDK"subsystem_name = "mavsdk"output_name = "libmavsdk"}ohos_executable("takeoff_and_land") {use_exceptions = trueoutput_name = "takeoff_and_land" # 可选,模块输出名include_dirs = ["src/third_party/mavlink/mavlink/src/mavlink/include","src/mavsdk/core/include/mavsdk","src/mavsdk/plugins/action/include","src/mavsdk/plugins/telemetry/include"]sources = ["examples/takeoff_and_land/takeoff_and_land.cpp","examples/takeoff_and_land/autopilot_interface.cpp",]deps = ["//third_party/MAVSDK:MAVSDK"]part_name = "MAVSDK"subsystem_name = "MAVSDK"}
#演示编译部分
ohos_executable("offboard") {  use_exceptions = trueoutput_name = "offboard" # 可选,模块输出名include_dirs = ["src/third_party/mavlink/mavlink/src/mavlink/include","src/mavsdk/core/include/mavsdk","src/mavsdk/plugins/offboard/include","src/mavsdk/plugins/action/include","src/mavsdk/plugins/telemetry/include"]sources = ["examples/offboard/offboard.cpp",]deps= ["//third_party/MAVSDK:MAVSDK"]part_name = "MAVSDK"subsystem_name = "MAVSDK"}#编译测试文件
ohos_unittest("mavsdk_test") {module_out_path = "MAVSDK/mavsdk_test" testonly = trueuse_exceptions = trueinclude_dirs = [ "src/mavsdk/core/include/mavsdk","src/mavsdk/plugins/action/include","src/mavsdk/plugins/action_server/include","src/mavsdk/plugins/calibration/include","src/mavsdk/plugins/camera/include","src/mavsdk/plugins/camera/camera_definition_files/generated","src/mavsdk/plugins/component_information/include","src/mavsdk/plugins/component_information_server/include","src/mavsdk/plugins/failure/include","src/mavsdk/plugins/follow_me/include","src/mavsdk/plugins/ftp/include","src/mavsdk/plugins/geofence/include","src/mavsdk/plugins/gimbal/include","src/mavsdk/plugins/info/include","src/mavsdk/plugins/log_files/include","src/mavsdk/plugins/manual_control/include","src/mavsdk/plugins/mavlink_passthrough/include","src/mavsdk/plugins/mission/include","src/mavsdk/plugins/mission_raw/include","src/mavsdk/plugins/mission_raw_server/include","src/mavsdk/plugins/mocap/include","src/mavsdk/plugins/offboard/include","src/mavsdk/plugins/param/include","src/mavsdk/plugins/param_server/include","src/mavsdk/plugins/rtk/include","src/mavsdk/plugins/server_utility/include","src/mavsdk/plugins/shell/include","src/mavsdk/plugins/telemetry/include","src/mavsdk/plugins/telemetry_server/include","src/mavsdk/plugins/tracking_server/include","src/mavsdk/plugins/transponder/include","src/mavsdk/plugins/tune/include","src/mavsdk/core","src/mavsdk/plugins/action","src/mavsdk/plugins/action_server","src/mavsdk/plugins/calibration","src/mavsdk/plugins/camera","src/mavsdk/plugins/component_information","src/mavsdk/plugins/component_information_server","src/mavsdk/plugins/failure","src/mavsdk/plugins/follow_me","src/mavsdk/plugins/ftp","src/mavsdk/plugins/geofence","src/mavsdk/plugins/gimbal","src/mavsdk/plugins/info","src/mavsdk/plugins/log_files","src/mavsdk/plugins/manual_control","src/mavsdk/plugins/mavlink_passthrough","src/mavsdk/plugins/mission","src/mavsdk/plugins/mission_raw","src/mavsdk/plugins/mission_raw_server","src/mavsdk/plugins/mocap","src/mavsdk/plugins/offboard","src/mavsdk/plugins/param","src/mavsdk/plugins/param_server","src/mavsdk/plugins/rtk","src/mavsdk/plugins/server_utility","src/mavsdk/plugins/shell","src/mavsdk/plugins/telemetry","src/mavsdk/plugins/telemetry_server","src/mavsdk/plugins/tracking_server","src/mavsdk/plugins/transponder","src/mavsdk/plugins/tune","src/third_party/mavlink","src/third_party/curl/curl/src/curl/include","src/third_party/install/include","src/third_party/mavlink/mavlink/src/mavlink/include/mavlink/v2.0","src/third_party/mavlink/mavlink/src/mavlink/include/mavlink/v2.0/common",]sources = ["src/mavsdk/core/mavsdk_time_test.cpp" ,"src/mavsdk/core/mavsdk_math_test.cpp" ,"src/mavsdk/core/mavlink_channels_test.cpp" ,"src/mavsdk/core/unittests_main.cpp" ,"src/mavsdk/core/timeout_handler_test.cpp" ,"src/mavsdk/core/call_every_handler_test.cpp" ,"src/mavsdk/core/curl_test.cpp" ,"src/mavsdk/core/cli_arg_test.cpp" ,"src/mavsdk/core/locked_queue_test.cpp" ,"src/mavsdk/core/safe_queue_test.cpp" ,"src/mavsdk/core/mavsdk_test.cpp" ,"src/mavsdk/core/mavlink_mission_transfer_test.cpp" ,"src/mavsdk/core/mavlink_statustext_handler_test.cpp" ,"src/mavsdk/core/geometry_test.cpp" ,"src/mavsdk/core/ringbuffer_test.cpp" ,"src/mavsdk/plugins/calibration/calibration_statustext_parser_test.cpp" ,"src/mavsdk/plugins/camera/camera_definition_test.cpp" ,"src/mavsdk/plugins/mission_raw/mission_import_test.cpp" ,"src/mavsdk/plugins/telemetry/math_conversions_test.cpp"]deps = ["//third_party/MAVSDK:MAVSDK","//third_party/googletest:gmock_main","//third_party/googletest:gtest_main"]part_name = "MAVSDK"
}

通过以上操作以后,就可以在 OpenHarmony 编译源码了:

./build.sh --product-name rpi4 --build-target=MAVSDK --ccache

编译完成以后可以在 out/rpi4/mavsdk/MAVSDK 目录下看到编译生成的 libmavsdk.z.so 文件。

同时,还可以在 ohos/out/rpi4/tests/unittest/MAVSDK/mavsdk_test/mavsdk_test 目录下看到我们编译的测试文件,如下所示:

接下来把编译完成的 so 及测试文件到 RPI4 开发板中,运行测试文件验证整个库的移植情况。

最后

有很多小伙伴不知道学习哪些鸿蒙开发技术?不知道需要重点掌握哪些鸿蒙应用开发知识点?而且学习时频繁踩坑,最终浪费大量时间。所以有一份实用的鸿蒙(HarmonyOS NEXT)资料用来跟着学习是非常有必要的。 

这份鸿蒙(HarmonyOS NEXT)资料包含了鸿蒙开发必掌握的核心知识要点,内容包含了ArkTS、ArkUI开发组件、Stage模型、多端部署、分布式应用开发、音频、视频、WebGL、OpenHarmony多媒体技术、Napi组件、OpenHarmony内核、Harmony南向开发、鸿蒙项目实战等等)鸿蒙(HarmonyOS NEXT)技术知识点。

希望这一份鸿蒙学习资料能够给大家带来帮助,有需要的小伙伴自行领取,限时开源,先到先得~无套路领取!!

获取这份完整版高清学习路线,请点击→纯血版全套鸿蒙HarmonyOS学习资料

鸿蒙(HarmonyOS NEXT)最新学习路线

  •  HarmonOS基础技能

  • HarmonOS就业必备技能 
  •  HarmonOS多媒体技术

  • 鸿蒙NaPi组件进阶

  • HarmonOS高级技能

  • 初识HarmonOS内核 
  • 实战就业级设备开发

有了路线图,怎么能没有学习资料呢,小编也准备了一份联合鸿蒙官方发布笔记整理收纳的一套系统性的鸿蒙(OpenHarmony )学习手册(共计1236页)鸿蒙(OpenHarmony )开发入门教学视频,内容包含:ArkTS、ArkUI、Web开发、应用模型、资源分类…等知识点。

获取以上完整版高清学习路线,请点击→纯血版全套鸿蒙HarmonyOS学习资料

《鸿蒙 (OpenHarmony)开发入门教学视频》

《鸿蒙生态应用开发V2.0白皮书》

图片

《鸿蒙 (OpenHarmony)开发基础到实战手册》

OpenHarmony北向、南向开发环境搭建

图片

 《鸿蒙开发基础》

  • ArkTS语言
  • 安装DevEco Studio
  • 运用你的第一个ArkTS应用
  • ArkUI声明式UI开发
  • .……

图片

 《鸿蒙开发进阶》

  • Stage模型入门
  • 网络管理
  • 数据管理
  • 电话服务
  • 分布式应用开发
  • 通知与窗口管理
  • 多媒体技术
  • 安全技能
  • 任务管理
  • WebGL
  • 国际化开发
  • 应用测试
  • DFX面向未来设计
  • 鸿蒙系统移植和裁剪定制
  • ……

图片

《鸿蒙进阶实战》

  • ArkTS实践
  • UIAbility应用
  • 网络案例
  • ……

图片

 获取以上完整鸿蒙HarmonyOS学习资料,请点击→纯血版全套鸿蒙HarmonyOS学习资料

总结

总的来说,华为鸿蒙不再兼容安卓,对中年程序员来说是一个挑战,也是一个机会。只有积极应对变化,不断学习和提升自己,他们才能在这个变革的时代中立于不败之地。 

相关文章:

OpenHarmony无人机MAVSDK开源库适配方案分享

MAVSDK 是 PX4 开源团队贡献的基于 MavLink 通信协议的用于无人机应用开发的 SDK,支持多种语言如 C/C、python、Java 等。通常用于无人机间、地面站与通信设备的消息传输。 MAVLink 是一种非常轻量级的消息传递协议,用于与无人机(以及机载无…...

模型训练----parser.add_argument添加配置参数

现在需要配置参数来达到修改训练的方式,我现在需要新建一个参数来开关wandb的使用。 首先就是在def parse_option():函数里添加上你要使用的变量名 parser.add_argument("--open_wandb",type bool,defaultFalse,helpopen wandb) 到config文件里增加你的…...

数字未来:探索 Web3 的革命性潜力

在当今数字化的时代,Web3作为互联网的新兴范式正逐渐崭露头角,引发了广泛的关注和探讨。本文将深入探索数字未来中Web3所蕴含的革命性潜力,探讨其对社会、经济和技术的深远影响。 1. Web3:数字世界的下一个阶段 Web3是一个正在崛…...

群晖NAS使用Docker部署大语言模型Llama 2结合内网穿透实现公网访问本地GPT聊天服务

文章目录 1. 拉取相关的Docker镜像2. 运行Ollama 镜像3. 运行Chatbot Ollama镜像4. 本地访问5. 群晖安装Cpolar6. 配置公网地址7. 公网访问8. 固定公网地址 随着ChatGPT 和open Sora 的热度剧增,大语言模型时代,开启了AI新篇章,大语言模型的应用非常广泛,包括聊天机…...

[选型必备基础信息] 存储器

存储芯片根据断电后是否保留存储的信息可分为易失性存储芯片(RAM)和非易失性存储芯片(ROM)。 简单说,存储类IC分为 ROM和RAM ROM:EEPROM / Flash / eMMC RAM:SRAM/SDRAM/DDR2/DDR3/DDR4/DDR5…...

C++——C++11线程库

目录 一,线程库简介 二,线程库简单使用 2.1 传函数指针 ​编辑 2.2 传lamdba表达式 2.3 简单综合运用 2.4 线程函数参数 三,线程安全问题 3.1 为什么会有这个问题? 3.2 锁 3.2.1 互斥锁 3.2.2 递归锁 3.3 原子操作 3…...

机器学习 | 线性判别分析(Linear Discriminant Analysis)

1 机器学习中的建模 1.1 描述性建模 以方便的形式给出数据的主要特征,实质上是对数据的概括,以便在大量的或有噪声的数据中仍能观察到重要特征。重在认识数据的主要概貌,理解数据的重要特征。 Task:聚类分析,数据降…...

TypeScript-数组、函数类型

1.数组类型 1.1类型 方括号 let arry:number[][5,2,0,1,3,1,4] 1.2 数组泛型 let arry2:Array<number>[5,2,0,1,3,1,4] 1.3接口类型 interface makeArryRule{[index:number]:number }let arry3:makeArryRule[5,2,0,1,3,1,4] 1.4伪数组 说明&#xff1a; argument…...

Python深度学习034:cuda的环境如何配置

文章目录 1.安装nvidia cuda驱动CMD中看一下cuda版本:下载并安装cuda驱动2.创建虚拟环境并安装pytorch的torch_cuda3.测试附录1.安装nvidia cuda驱动 CMD中看一下cuda版本: 注意: 红框的cuda版本,是你的显卡能装的最高的cuda版本,所以可以选择低于它的版本。比如我的是11…...

【论文笔记】Text2QR

论文&#xff1a;Text2QR: Harmonizing Aesthetic Customization and Scanning Robustness for Text-Guided QR Code Generation Abstract 二维码通常包含很多信息但看起来并不美观。stable diffusion的出现让平衡扫描鲁棒性和美观变为可能。 为了保证美观二维码的稳定生成&a…...

【ReadPapers】A Survey of Large Language Models

LLM-Survey的llm能力和评估部分内容学习笔记——思维导图 思维导图 参考资料 A Survey of Large Language Models论文的github仓库...

站群CMS系统

站群CMS系统是一种用于批量建立和管理网站的内容管理系统&#xff0c;它能够帮助用户快速创建大量的网站&#xff0c;并实现对这些网站的集中管理。以下是三个在使用广泛的站群CMS系统&#xff0c;它们各具特色&#xff0c;可以满足不同用户的需求。 1. Z-BlogPHP Z-BlogPHP是…...

landsat8数据产品说明

1、下载数据用户手册 手册下载网址&#xff0c;搜索landsat science关键词&#xff0c;并点击到官网下载。 2、用户手册目录 3、landsat8数据产品说明 具体说明在手册的第四章&#xff0c;4.1.4数据产品章节&#xff0c;具体描述如下&#xff1a; 英文意思&#xff1a; L8 的…...

Golang 内存管理和垃圾回收底层原理(二)

一、这篇文章我们来聊聊Golang内存管理和垃圾回收&#xff0c;主要注重基本底层原理讲解&#xff0c;进一步实战待后续文章 垃圾回收&#xff0c;无论是Java 还是 Golang&#xff0c;基本的逻辑都是基于 标记-清理 的&#xff0c; 标记是指标记可能需要回收的对象&#xff0c…...

OpenHarmony:全流程讲解如何编写ADC平台驱动以及应用程序

ADC&#xff08;Analog to Digital Converter&#xff09;&#xff0c;即模拟-数字转换器&#xff0c;可将模拟信号转换成对应的数字信号&#xff0c;便于存储与计算等操作。除电源线和地线之外&#xff0c;ADC只需要1根线与被测量的设备进行连接。 一、案例简介 该程序是基于…...

计算机学生求职简历的一些想法

面试真的是一件非常难的事情&#xff0c;因为在短短的半小时到一个小时&#xff0c;来判断一个同学行不行&#xff0c;其实是很不全面的。作为一个求职的同学应该怎么办呢&#xff1f;求职的同学可以提前做一些准备&#xff0c;其中比较重要的要数简历的编写。 简历的作用 简…...

网工内推 | 售前专场,需熟悉云计算技术,上市公司,提成高

01 神州数码 招聘岗位&#xff1a;售前工程师 职责描述&#xff1a; 1.负责所在区域华为IT产品线&#xff08;服务器、存储、云、虚拟化&#xff09;的售前技术支持工作&#xff0c;包括客户交流、方案编写、配置报价、投标支持、测试等&#xff1b; 2.与厂商相关人员建立和保…...

excel匹配替换脱敏身份证等数据

假如excel sheet1中有脱敏的身份证号码和姓名&#xff0c;如&#xff1a; sheet2中有未脱敏的数据数据 做法如下&#xff1a; 1、在sheet2的C列用公式 LEFT(A2,6)&REPT("*",8)&RIGHT(A2,4) 做出脱敏数据&#xff0c;用来与sheet1的脱敏数据匹配 2、在sheet…...

[技术笔记] Flash选型之基础知识芯片分类

1、按照接口分类 分为 Serial串口Flash 和 Parallel并口Flash&#xff1b; 市场大量使用Serial Flash&#xff1b;价格便宜&#xff1b;已满足系统对数据读写速度的要求&#xff1b; Serial Flash已经可以代表 NOR Flash&#xff1b; 小知识&#xff1a; 1&#xff09;在…...

Jenkins常用插件安装及全局配置

Jenkins常用插件安装及全局配置 前言 ​ Jenkins是一个流行的持续集成工具&#xff0c;通过安装适用的插件&#xff0c;可以扩展Jenkins的功能&#xff0c;并与其他工具和系统集成。本文将介绍一些常用的Jenkins插件以及安装和配置的步骤。通过安装和配置这些常用插件&#xf…...

C++初学者:如何优雅地写程序

我喜欢C语言的功能强大&#xff0c;简洁&#xff0c;我也喜欢C#的语法简单&#xff0c;清晰&#xff0c;写起来又方便好用。 一、为什么不用C语言写程序。 C语言用来做题目&#xff0c;考试研究是很方便的&#xff0c;但是用来写程序做软件&#xff0c;你就会发现&#xff0c…...

图论- 最小生成树

一、最小生成树-prim算法 1.1 最小生成树概念 一幅图可以有很多不同的生成树&#xff0c;比如下面这幅图&#xff0c;红色的边就组成了两棵不同的生成树&#xff1a; 对于加权图&#xff0c;每条边都有权重&#xff08;用最小生成树算法的现实场景中&#xff0c;图的边权重…...

LeetCode刷题记(一):1~30题

1. 两数之和 给定一个整数数组 nums 和一个整数目标值 target&#xff0c;请你在该数组中找出 和为目标值 target 的那 两个 整数&#xff0c;并返回它们的数组下标。 你可以假设每种输入只会对应一个答案。但是&#xff0c;数组中同一个元素在答案里不能重复出现。 你可以…...

芒果YOLOv5改进89:卷积SPConv篇,即插即用,去除特征图中的冗余,FLOPs 和参数急剧下降,提升小目标检测

芒果专栏 基于 SPConv 的改进结构,改进源码教程 | 详情如下🥇 👉1. SPConv 结构、👉2. CfSPConv 结构 💡本博客 改进源代码改进 适用于 YOLOv5 按步骤操作运行改进后的代码即可 即插即用 结构。博客 包括改进所需的 核心结构代码 文件 YOLOv5改进专栏完整目录链接:…...

Linux:详解TCP报头类型

文章目录 温习序号的意义序号和确认序号报文的类型 TCP报头类型详解ACK: 确认号是否有效SYN: 请求建立连接; 我们把携带SYN标识的称为同步报文段FIN: 通知对方, 本端要关闭了PSH: 提示接收端应用程序立刻从TCP缓冲区把数据读走RST: 对方要求重新建立连接; 我们把携带RST标识的称…...

【Leetcode】top 100 二分查找

35 搜索插入位置 给定一个排序数组和一个目标值&#xff0c;在数组中找到目标值&#xff0c;并返回其索引。如果目标值不存在于数组中&#xff0c;返回它将会被按顺序插入的位置。请必须使用时间复杂度为 O(log n) 的算法。 基础写法&#xff01;&#xff01;&#xff01;牢记…...

Redis高级面试题-2024

说说你对Redis的理解 Redis是一个基于Key-Value存储结构的开源内存数据库&#xff0c;也是一种NoSQL数据库。 它支持多种数据类型&#xff0c;包括String、Map、Set、ZSet和List&#xff0c;以满足不同应用场景的需求。 Redis以内存存储和优化的数据结构为基础&#xff0c;提…...

HarmonyOS 应用开发之FA模型与Stage模型应用组件

应用配置文件概述&#xff08;FA模型&#xff09; 每个应用项目必须在项目的代码目录下加入配置文件&#xff0c;这些配置文件会向编译工具、操作系统和应用市场提供描述应用的基本信息。 应用配置文件需申明以下内容&#xff1a; 应用的软件Bundle名称&#xff0c;应用的开发…...

6个黑科技网站,永久免费

1、http://mfsc123.com https://www.mfsc123.com 一个非常赞的免费商用素材导航网站。 收集了各种免费、免版权的图片、插画、视频、视频模板、音乐、音效、字体、图标网站。 再也不用担心版权问题&#xff0c;都能免费商用&#xff0c;自媒体作者必备。 而且还在每个网站…...

Linux 内核优化简笔 - 高并发的系统

简介 Linux 服务器在高并发场景下&#xff0c;默认的内核参数无法利用现有硬件&#xff0c;造成软件崩溃、卡顿、性能瓶颈。 当然&#xff0c;修改参数只是让Linux更好软件的去利用已有的硬件资源&#xff0c;如果硬件资源不够也无法解决问题的。而且当硬件资源不足的时候&am…...

如何做网站咨询/免费b站推广网站短视频

目录&#xff1a;python学习目录 开发环境&#xff1a;vs 2019os.access(para1, para2) 用来判断para1路径有什么权限 para1&#xff1a;文件路径 para2&#xff1a;有以下四个值 os.F_OK&#xff1a;测试para1路径是否存在 os.R_OK&#xff1a;测试para1路径是否允许读 os.W_O…...

找个建设网站的网管/全网搜索关键词查询

OpenStack 企业私有云的若干需求&#xff08;3&#xff09;&#xff1a;多租户和租户间隔离(multi-tenancy and isolation) 本系列会介绍OpenStack 企业私有云的几个需求&#xff1a; 自动扩展&#xff08;Auto-scaling&#xff09;支持多租户和租户隔离 &#xff08;multi-t…...

天元建设集团有限公司重庆分公司/东莞seo黑帽培训

前言 随着业务和大数据技术的发展&#xff0c;越来越多的公司需要在后端架设Hbase数据库&#xff0c;而原有的业务则需要从各种RDBMS数据库中迁移到Hbase当中。Appach的sqoop&#xff08;发音&#xff1a;[skup]&#xff09;就是基于这样的需求而诞生的&#xff0c;本文详细记…...

疫情防控政策/苏州seo排名优化课程

一.模块的搜索路径 模块的加载路径&#xff1a;内存》内置模块》sys.path(系统内置的环境变量,一系列自定义的模块) import sys print(sys.path) #查询系统的环境变量,以列表的形式进行存储 # 默认第一个元素就是当前被执行的文件目录# 我们可以自定义的去加入系统的配置 sys.p…...

wordpress主题king/html制作网站

综上&#xff0c;当监测的fd数量较小&#xff0c;且各个fd都很活跃的情况下&#xff0c;建议使用select和poll&#xff1b;当监听的fd数量较多&#xff0c;且单位时间仅部分fd活跃的情况下&#xff0c;使用epoll会明显提升性能。 select系统调用 select函数 1&#xff09;nfds…...

旅游论坛网站建设/南京今天重大新闻事件

开源「高逼格」简历例句&#xff0c;看你有没有中招&#xff1f; 星期天下午&#xff0c;在浏览 GitHub 的时候&#xff0c;发现一个非常有意思的开源项目&#xff0c;是由 ResumeJob 整理贡献的&#xff0c;那就是一份程序员简历上常常使用的介绍和描述技能的例句。感觉写的很…...