ArduPilot飞控之ubuntu22.04-Gazebo模拟

ArduPilot飞控之ubuntu22.04-Gazebo模拟

  • 1. 源由
  • 2. Gazebo安装
    • 2.1 ubuntu22.04系统更新
    • 2.2 安装Gazebo Garden
    • 2.3 安装ArduPilot Gazebo插件
      • 2.3.1 基础库安装
      • 2.3.2 源代码编译
      • 2.3.3 配置插件
    • 2.4 测试Gazebo Garden
  • 3. ArduPilot SITL + Gazebo模拟
    • 3.1 Gazebo Garden模拟环境
    • 3.2 ArduPilot SITL仿真环境
    • 3.3 ArduPilot SITL + Gazebo 测试视频
  • 4. 参考资料
  • 5. 补充资料
    • 5.1 官网视频
    • 5.2 关于HITL

1. 源由

Gazebo是一款知名且备受业界推崇的模拟器,已被广泛用于地面、海洋和太空机器人的许多模拟挑战,包括DARPA机器人竞赛。

这里简单介绍如何使用最新一代Gazebo作为ArduPilot Rover、Coper和Plane的外部模拟器。为后续模拟器调试奠定基础。

2. Gazebo安装

2.1 ubuntu22.04系统更新

$ sudo apt-get update
$ sudo apt-get install lsb-release wget gnupg

2.2 安装Gazebo Garden

$ sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
$ sudo apt-get update
$ sudo apt-get install gz-garden

2.3 安装ArduPilot Gazebo插件

2.3.1 基础库安装

$ sudo apt install libgz-sim7-dev rapidjson-dev

2.3.2 源代码编译

$ git clone git@github.com:ArduPilot/ardupilot_gazebo.git
$ cd ardupilot_gazebo
$ mkdir build && cd build
$ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
$ make -j4

2.3.3 配置插件

可选择手工或者脚本配置方法

$ export GZ_SIM_SYSTEM_PLUGIN_PATH=<ardupilot_gazebo path>/build:$GZ_SIM_SYSTEM_PLUGIN_PATH
$ export GZ_SIM_RESOURCE_PATH=<ardupilot_gazebo path>/models:$HOME/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH
or
$ echo 'export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}' >> ~/.bashrc
$ echo 'export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot_gazebo/models:$HOME/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}' >> ~/.bashrc

这里笔者采用脚本配置方法:

$ pwd
/home/daniel/Work/ardupilot_gazebo

$ echo 'export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/daniel/Work/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}' >> ~/.bashrc
$ echo 'export GZ_SIM_RESOURCE_PATH=/home/daniel/Work/ardupilot_gazebo/models:/home/daniel/Work/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}' >> ~/.bashrc

$ . ~/.profile

2.4 测试Gazebo Garden

$ gz sim -v4 -r shapes.sdf
[Msg] Gazebo Sim GUI    v7.4.0
[Dbg] [gz.cc:162] Subscribing to [/gazebo/starting_world].
[Dbg] [gz.cc:164] Waiting for a world to be set from the GUI...
[Dbg] [Gui.cc:260] Waiting for subscribers to [/gazebo/starting_world]...
[Msg] Received world [shapes.sdf] from the GUI.
[Dbg] [gz.cc:168] Unsubscribing from [/gazebo/starting_world].
[Msg] Gazebo Sim Server v7.4.0
[Msg] Loading SDF world file[/usr/share/gz/gz-sim7/worlds/shapes.sdf].
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
[Msg] Serving entity system service on [/entity/system/add]
[Msg] Loaded level [3]
[Msg] No systems loaded from SDF, loading defaults
[Dbg] [ServerConfig.cc:1042] Loaded (3) plugins from file [/home/daniel/.gz/sim/7/server.config]
[Dbg] [Physics.cc:869] Loaded [gz::physics::dartsim::Plugin] from library [/usr/lib/x86_64-linux-gnu/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::Physics] for entity [1]
[Msg] Create service on [/world/shapes/create]
[Msg] Remove service on [/world/shapes/remove]
[Msg] Pose service on [/world/shapes/set_pose]
[Msg] Pose service on [/world/shapes/set_pose_vector]
[Msg] Light configuration service on [/world/shapes/light_config]
[Msg] Physics service on [/world/shapes/set_physics]
[Msg] SphericalCoordinates service on [/world/shapes/set_spherical_coordinates]
[Msg] Enable collision service on [/world/shapes/enable_collision]
[Msg] Disable collision service on [/world/shapes/disable_collision]
[Msg] Material service on [/world/shapes/visual_config]
[Msg] Material service on [/world/shapes/wheel_slip]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::UserCommands] for entity [1]
[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::SceneBroadcaster] for entity [1]
[Msg] Serving world controls on [/world/shapes/control], [/world/shapes/control/state] and [/world/shapes/playback/control]
[Msg] Serving GUI information on [/world/shapes/gui/info]
[Msg] World [shapes] initialized with [default_physics] physics profile.
[Msg] Serving world SDF generation service on [/world/shapes/generate_world_sdf]
[Msg] Serving world names on [/gazebo/worlds]
[Msg] Resource path add service on [/gazebo/resource_paths/add].
[Msg] Resource path get service on [/gazebo/resource_paths/get].
[Msg] Resource path resolve service on [/gazebo/resource_paths/resolve].
[Msg] Resource paths published on [/gazebo/resource_paths].
[Msg] Server control service on [/server_control].
[Msg] Found no publishers on /stats, adding root stats topic
[Msg] Found no publishers on /clock, adding root clock topic
[Dbg] [SimulationRunner.cc:513] Creating PostUpdate worker threads: 2
[Dbg] [SimulationRunner.cc:524] Creating postupdate worker thread (0)
[Dbg] [Application.cc:96] Initializing application.
[Dbg] [Application.cc:122] Qt using OpenGL graphics interface
[Msg] Serving scene information on [/world/shapes/scene/info]
[Msg] Serving graph information on [/world/shapes/scene/graph]
[Msg] Serving full state on [/world/shapes/state]
[Msg] Serving full state (async) on [/world/shapes/state_async]
[Msg] Publishing scene information on [/world/shapes/scene/info]
[Msg] Publishing entity deletions on [/world/shapes/scene/deletion]
[Msg] Publishing state changes on [/world/shapes/state]
[Msg] Publishing pose messages on [/world/shapes/pose/info]
[Msg] Publishing dynamic pose messages on [/world/shapes/dynamic_pose/info]
[GUI] [Dbg] [Application.cc:596] Create main window
[GUI] [Wrn] [Application.cc:845] [QT] qrc:/qml/StyleDialog.qml:112:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] qrc:/qml/StyleDialog.qml:105:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] qrc:/qml/StyleDialog.qml:98:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] qrc:qml/Main.qml:102:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] qrc:/qml/PluginMenu.qml:27:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Dbg] [PathManager.cc:67] Requesting resource paths through [/gazebo/resource_paths/get]
[GUI] [Wrn] [Application.cc:845] [QT] file::/Gazebo/GazeboDrawer.qml:241:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Dbg] [PathManager.cc:56] Received resource paths.
[GUI] [Wrn] [Application.cc:845] [QT] file::/Gazebo/GazeboDrawer.qml:147:3: QML Dialog: Binding loop detected for property "implicitHeight"
[GUI] [Wrn] [Application.cc:845] [QT] file::/Gazebo/GazeboDrawer.qml:147:3: QML Dialog: Binding loop detected for property "implicitHeight"
[GUI] [Dbg] [Gui.cc:340] GUI requesting list of world names. The server may be busy downloading resources. Please be patient.
[GUI] [Dbg] [Gui.cc:398] Requesting GUI from [/world/shapes/gui/info]...
[GUI] [Dbg] [GuiRunner.cc:149] Requesting initial state from [/world/shapes/state]...
[GUI] [Msg] Loading config [/home/daniel/.gz/sim/7/gui.config]
[GUI] [Dbg] [Application.cc:453] Loading plugin [MinimalScene]
[Dbg] [EntityComponentManager.cc:1619] Updated state thread iterators: 2 threads processing around 15 entities each.
[Wrn] [Component.hh:144] Trying to serialize component with data type [N3sdf3v135WorldE], which doesn't have `operator<<`. Component will not be serialized.
[Wrn] [Model.hh:69] Skipping serialization / deserialization for models with //pose/@relative_to attribute.
[GUI] [Dbg] [MinimalScene.cc:657] Creating gz-rendering interface for OpenGL
[GUI] [Dbg] [MinimalScene.cc:657] Creating gz-rendering interface for OpenGL
[GUI] [Dbg] [MinimalScene.cc:813] Creating render thread interface for OpenGL
[GUI] [Msg] Added plugin [3D View] to main window
[GUI] [Msg] Loaded plugin [MinimalScene] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [EntityContextMenuPlugin]
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:57:5: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Msg] Added plugin [Entity Context Menu] to main window
[GUI] [Msg] Loaded plugin [EntityContextMenuPlugin] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libEntityContextMenuPlugin.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [GzSceneManager]
[GUI] [Msg] Added plugin [Scene Manager] to main window
[GUI] [Msg] Loaded plugin [GzSceneManager] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libGzSceneManager.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [InteractiveViewControl]
[GUI] [Msg] Camera view controller topic advertised on [/gui/camera/view_control]
[GUI] [Msg] Camera reference visual topic advertised on [/gui/camera/view_control/reference_visual]
[GUI] [Msg] Camera view control sensitivity advertised on [/gui/camera/view_control/sensitivity]
[GUI] [Msg] Added plugin [Interactive view control] to main window
[GUI] [Msg] Loaded plugin [InteractiveViewControl] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libInteractiveViewControl.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [CameraTracking]
[GUI] [Msg] Added plugin [Camera tracking] to main window
[GUI] [Msg] Loaded plugin [CameraTracking] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libCameraTracking.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [MarkerManager]
[GUI] [Msg] Listening to stats on [/world/shapes/stats]
[GUI] [Msg] Added plugin [Marker Manager] to main window
[GUI] [Msg] Loaded plugin [MarkerManager] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMarkerManager.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [SelectEntities]
[GUI] [Msg] Added plugin [Select entities] to main window
[GUI] [Msg] Loaded plugin [SelectEntities] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libSelectEntities.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [Spawn]
[GUI] [Wrn] [Application.cc:845] [QT] file::/Spawn/Spawn.qml:32:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Msg] Added plugin [Spawn] to main window
[GUI] [Msg] Loaded plugin [Spawn] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libSpawn.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [VisualizationCapabilities]
[GUI] [Msg] View as transparent service on [/gui/view/transparent]
[GUI] [Msg] View as wireframes service on [/gui/view/wireframes]
[GUI] [Msg] View center of mass service on [/gui/view/com]
[GUI] [Msg] View inertia service on [/gui/view/inertia]
[GUI] [Msg] View collisions service on [/gui/view/collisions]
[GUI] [Msg] View joints service on [/gui/view/joints]
[GUI] [Msg] View frames service on [/gui/view/frames]
[GUI] [Msg] Added plugin [Visualization capabilities] to main window
[GUI] [Msg] Loaded plugin [VisualizationCapabilities] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libVisualizationCapabilities.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [WorldControl]
[GUI] [Wrn] [Application.cc:845] [QT] file::/WorldControl/WorldControl.qml:30:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Msg] Using world control service [/world/shapes/control]
[GUI] [Msg] Listening to stats on [/world/shapes/stats]
[GUI] [Dbg] [WorldControl.cc:250] Using an event to share WorldControl msgs with the server
[GUI] [Msg] Added plugin [World control] to main window
[GUI] [Msg] Loaded plugin [WorldControl] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libWorldControl.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [WorldStats]
[GUI] [Msg] Listening to stats on [/world/shapes/stats]
[GUI] [Msg] Added plugin [World stats] to main window
[GUI] [Msg] Loaded plugin [WorldStats] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libWorldStats.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [Shapes]
[GUI] [Msg] Added plugin [Shapes] to main window
[GUI] [Msg] Loaded plugin [Shapes] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libShapes.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [Lights]
[GUI] [Msg] Added plugin [Lights] to main window
[GUI] [Msg] Loaded plugin [Lights] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libLights.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [TransformControl]
[GUI] [Wrn] [Application.cc:845] [QT] file::/TransformControl/TransformControl.qml:104:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] file::/TransformControl/TransformControl.qml:99:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] file::/TransformControl/TransformControl.qml:94:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Wrn] [Application.cc:845] [QT] file::/TransformControl/TransformControl.qml:89:3: QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
[GUI] [Msg] Added plugin [Transform control] to main window
[GUI] [Msg] Loaded plugin [TransformControl] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libTransformControl.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [Screenshot]
[GUI] [Msg] Screenshot service on [/gui/screenshot]
[GUI] [Msg] Added plugin [Screenshot] to main window
[GUI] [Msg] Loaded plugin [Screenshot] from path [/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libScreenshot.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [CopyPaste]
[GUI] [Msg] Added plugin [Copy/Paste] to main window
[GUI] [Msg] Loaded plugin [CopyPaste] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libCopyPaste.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [ComponentInspector]
[GUI] [Msg] Added plugin [Component inspector] to main window
[GUI] [Msg] Loaded plugin [ComponentInspector] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libComponentInspector.so]
[GUI] [Dbg] [Application.cc:453] Loading plugin [EntityTree]
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityTree/EntityTree.qml:148:7: QML ToolButton: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Msg] Added plugin [Entity tree] to main window
[GUI] [Msg] Loaded plugin [EntityTree] from path [/usr/lib/x86_64-linux-gnu/gz-sim-7/plugins/gui/libEntityTree.so]
[GUI] [Dbg] [Application.cc:323] Loading window config
[GUI] [Msg] Using server control service [/server_control]
[GUI] [Dbg] [Application.cc:610] Applying config
[GUI] [Wrn] [Component.hh:189] Trying to deserialize component with data type [N3sdf3v135WorldE], which doesn't have `operator>>`. Component will not be deserialized.
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Model.hh:98] Unable to deserialize sdf::Model
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityTree/EntityTree.qml:148:7: QML ToolButton: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/WorldStats/WorldStats.qml:53:3: QML RowLayout: Binding loop detected for property "x"
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:52:3: QML RenderWindowOverlay: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Wrn] [Application.cc:845] [QT] file::/EntityContextMenuPlugin/EntityContextMenuPlugin.qml:67:3: QML EntityContextMenu: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.
[GUI] [Dbg] [MinimalScene.cc:657] Creating gz-rendering interface for OpenGL
[GUI] [Dbg] [MinimalScene.cc:813] Creating render thread interface for OpenGL
[GUI] [Wrn] [Application.cc:845] [QT] file::/Gazebo/GazeboDrawer.qml:147:3: QML Dialog: Binding loop detected for property "implicitHeight"
[GUI] [Msg] Loading plugin [gz-rendering-ogre2]
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1113]  Unable to create the rendering window: OGRE EXCEPTION(3:RenderingAPIException): OpenGL 3.3 is not supported. Please update your graphics card drivers. in GL3PlusRenderSystem::initialiseContext at ./RenderSystems/GL3Plus/src/OgreGL3PlusRenderSystem.cpp (line 3434)
[GUI] [Err] [Ogre2RenderEngine.cc:1121] Unable to create the rendering window after [11] attempts.
[GUI] [Err] [Ogre2RenderEngine.cc:1032] Failed to create dummy render window.
Stack trace (most recent call last):
#31   Object "/lib/x86_64-linux-gnu/libgz-sim7-gui.so.7", at 0x7f0fa26790a8, in gz::sim::v7::gui::runGui(int&, char**, char const*, char const*, int, char const*)
#30   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa14c0cf3, in QCoreApplication::exec()
#29   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa14b875a, in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)
#28   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa15130b7, in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)
#27   Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f0fa03193e2, in g_main_context_iteration
#26   Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f0fa03706c7, in 
#25   Object "/lib/x86_64-linux-gnu/libglib-2.0.so.0", at 0x7f0fa031bd3a, in g_main_context_dispatch
#24   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa1513a66, in 
#23   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa14bcf26, in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*)
#22   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa14b9e39, in QCoreApplication::notifyInternal2(QObject*, QEvent*)
#21   Object "/lib/x86_64-linux-gnu/libQt5Widgets.so.5", at 0x7f0fa0b6c712, in QApplicationPrivate::notify_helper(QObject*, QEvent*)
#20   Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f0fa14e741d, in QObject::event(QEvent*)
#19   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f0f5c736513, in gz::gui::plugins::RenderWindowItem::Ready()
#18   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f0f5c736120, in gz::gui::plugins::RenderThread::Initialize[abi:cxx11]()
#17   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f0f5c742c7d, in gz::gui::plugins::RenderThreadRhiOpenGL::Initialize[abi:cxx11]()
#16   Object "/usr/lib/x86_64-linux-gnu/gz-gui-7/plugins/libMinimalScene.so", at 0x7f0f5c73a414, in gz::gui::plugins::GzRenderer::Initialize[abi:cxx11]()
#15   Object "/lib/x86_64-linux-gnu/libgz-rendering7.so.7", at 0x7f0f5c5984bb, in gz::rendering::v7::RenderEngineManager::Engine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#14   Object "/lib/x86_64-linux-gnu/libgz-rendering7.so.7", at 0x7f0f5c59829e, in gz::rendering::v7::RenderEngineManagerPrivate::Engine(EngineInfo, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#13   Object "/lib/x86_64-linux-gnu/libgz-rendering7.so.7", at 0x7f0f5c5a2b21, in gz::rendering::v7::BaseRenderEngine::Init()
#12   Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f0f35fcaac2, in gz::rendering::v7::Ogre2RenderEngine::InitImpl()
#11   Object "/usr/lib/x86_64-linux-gnu/gz-rendering-7/engine-plugins/libgz-rendering-ogre2.so", at 0x7f0f35fd06f7, in gz::rendering::v7::Ogre2RenderEngine::InitAttempt()
#10   Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35aeb228, in Ogre::ResourceGroupManager::initialiseAllResourceGroups(bool)
#9    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35aeac9e, in Ogre::ResourceGroupManager::parseResourceGroupScripts(Ogre::ResourceGroupManager::ResourceGroup*)
#8    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b2abac, in Ogre::ScriptCompilerManager::parseScript(Ogre::SharedPtr<Ogre::DataStream>&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#7    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b225b2, in Ogre::ScriptCompiler::compile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#6    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b222b2, in Ogre::ScriptCompiler::compile(Ogre::SharedPtr<std::__cxx11::list<Ogre::SharedPtr<Ogre::ConcreteNode>, Ogre::STLAllocator<Ogre::SharedPtr<Ogre::ConcreteNode>, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#5    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b33bdf, in Ogre::MaterialTranslator::translate(Ogre::ScriptCompiler*, Ogre::SharedPtr<Ogre::AbstractNode> const&)
#4    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b349a7, in Ogre::TechniqueTranslator::translate(Ogre::ScriptCompiler*, Ogre::SharedPtr<Ogre::AbstractNode> const&)
#3    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b3a2ce, in Ogre::PassTranslator::translate(Ogre::ScriptCompiler*, Ogre::SharedPtr<Ogre::AbstractNode> const&)
#2    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35b9e9d9, in Ogre::Technique::createPass()
#1    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f35aa6cd0, in Ogre::Pass::Pass(Ogre::Technique*, unsigned short)
#0    Object "/usr/lib/x86_64-linux-gnu/OGRE-2.3/libOgreNextMain.so.2.3.1", at 0x7f0f359d9e3d, in Ogre::Hlms::createDatablock(Ogre::IdString, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Ogre::HlmsMacroblock const&, Ogre::HlmsBlendblock const&, std::vector<std::pair<Ogre::IdString, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Ogre::STLAllocator<std::pair<Ogre::IdString, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, Ogre::CategorisedAllocPolicy<(Ogre::MemoryCategory)0> > > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
Segmentation fault (Address not mapped to object [0x220])
[Dbg] [SignalHandler.cc:141] Received signal[2].
[Dbg] [ServerPrivate.cc:115] Server received signal[2]
[Dbg] [gz.cc:411] Shutting down gz-sim-server
[Dbg] [SimulationRunner.cc:540] Exiting postupdate worker thread (0)

笔记本硬件环境遇到问题:不支持OpenGL3.3

$ sudo apt-get install mesa-utils
[sudo] password for daniel: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  tightvncpasswd usb-modeswitch usb-modeswitch-data
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  mesa-utils-bin
The following NEW packages will be installed:
  mesa-utils mesa-utils-bin
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,118 kB of archives.
After this operation, 2,455 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://cn.archive.ubuntu.com/ubuntu jammy/universe amd64 mesa-utils-bin amd64 8.4.0-1ubuntu1 [53.8 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu jammy/universe amd64 mesa-utils amd64 8.4.0-1ubuntu1 [1,065 kB]
Fetched 1,118 kB in 5s (242 kB/s)       
Selecting previously unselected package mesa-utils-bin:amd64.
(Reading database ... 310676 files and directories currently installed.)
Preparing to unpack .../mesa-utils-bin_8.4.0-1ubuntu1_amd64.deb ...
Unpacking mesa-utils-bin:amd64 (8.4.0-1ubuntu1) ...
Selecting previously unselected package mesa-utils.
Preparing to unpack .../mesa-utils_8.4.0-1ubuntu1_amd64.deb ...
Unpacking mesa-utils (8.4.0-1ubuntu1) ...
Setting up mesa-utils-bin:amd64 (8.4.0-1ubuntu1) ...
Setting up mesa-utils (8.4.0-1ubuntu1) ...
Processing triggers for man-db (2.10.2-1) ...

$ glxinfo | grep "OpenGL version"
OpenGL version string: 3.0 Mesa 22.2.5

更换Gazebo启动命令,性能可能会不太好!

$ gz sim -v4 -r shapes.sdf --render-engine ogre

在这里插入图片描述

3. ArduPilot SITL + Gazebo模拟

笔记本环境

daniel@daniel-ThinkPad-SL410:~$ uname -r
5.19.0-35-generic
daniel@daniel-ThinkPad-SL410:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

ArduPilot版本

$ git log -n 1
commit c33653cd4ebec780d6961c0bcbd42a38c787fb28 (HEAD -> Copter-4.3, origin/Copter-4.3)
Author: bugobliterator <siddharthbharatpurohit@gmail.com>
Date:   Sat Mar 18 09:04:26 2023 +1100

    bootloaders: add CubeOrangePlus-bdshot bootloader

Gazebo版本

$ gz sim --version
Gazebo Sim, version 7.4.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

ArduPilot Gazebo plugin版本

$ git log -n 1
commit 0753b067a5a20219930818de34395577b930c129 (HEAD -> main, origin/main, origin/HEAD)
Author: Rhys Mainwaring <rhys.mainwaring@me.com>
Date:   Mon Mar 20 15:51:29 2023 +0000

    Update README (#50)

    Update example models section with links to recent additions to SITL_Models/Gazebo.

    Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>

3.1 Gazebo Garden模拟环境

$ gz sim -v4 -r iris_runway.sdf --render-engine ogre

在这里插入图片描述

3.2 ArduPilot SITL仿真环境

$ sim_vehicle.py -v ArduCopter -f gazebo-iris --model JSON --map --console

注:SITL安装,详见:ArduPilot飞控之ubuntu22.04-SITL安装
在这里插入图片描述

3.3 ArduPilot SITL + Gazebo 测试视频

ArduPilot SITL + Gazebo Demo Try

MAVProxy输入命令如下:

mode guided
arm throttle
takeoff 5
position 0 0 3
position 100 100 0
position 100 -200 0
rtl

4. 参考资料

【1】Using SITL with Gazebo
【2】Gazebo Garden/7th major release of Gazebo
【3】ArduPilot Gazebo Plugin
【4】ArduPilot飞控之ubuntu22.04-SITL安装
【5】MAVProxy

5. 补充资料

5.1 官网视频

Gazebo Ship Landing Demo

5.2 关于HITL

当前ArdupilotCopter尚没有HITL模拟的方法,后面将跳过Copter HITL部分。

有兴趣的朋友可以适时去跟进了解下hitl-simulators。

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/3581.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

大数据周会-本周学习内容总结07

目录 01【hadoop】 1.1【编写集群分发脚本xsync】 1.2【集群部署规划】 1.3【Hadoop集群启停脚本】 02【HDFS】 2.1【HDFS的API操作】 03【MapReduce】 3.1【P077- WordCount案例】 3.2【P097-自定义分区案例】 历史总结 01【hadoop】 1.1【编写集群分发脚本xsync】…

【Spring从成神到升仙系列 四】从源码分析 Spring 事务的来龙去脉

&#x1f44f;作者简介&#xff1a;大家好&#xff0c;我是爱敲代码的小黄&#xff0c;独角兽企业的Java开发工程师&#xff0c;CSDN博客专家&#xff0c;阿里云专家博主&#x1f4d5;系列专栏&#xff1a;Java设计模式、数据结构和算法、Kafka从入门到成神、Kafka从成神到升仙…

YOLOv7训练自己的数据集(手把手教你)

YOLOv7训练自己的数据集整个过程主要包括&#xff1a;环境安装----制作数据集----模型训练----模型测试----模型推理 一&#xff1a;环境安装 conda create -n yolov7 python3.8 conda activate yolov7 #cuda cudnn torch等版本就不细说了&#xff0c;根据自己的显卡配置自行…

水果新鲜程度检测系统(UI界面+YOLOv5+训练数据集)

摘要&#xff1a;水果新鲜程度检测软件用于检测水果新鲜程度&#xff0c;利用深度学习技术识别腐败或损坏的水果&#xff0c;以辅助挑拣出新鲜水果&#xff0c;支持实时在线检测。本文详细介绍水果新鲜程度检测系统&#xff0c;在介绍算法原理的同时&#xff0c;给出Python的实…

给准备面试网络工程师岗位的应届生一些建议

你听完这个故事&#xff0c;应该会有所收获。最近有一个23届毕业的大学生和我聊天&#xff0c;他现在网络工程专业大四&#xff0c;因为今年6、7月份的时候毕业&#xff0c;所以现在面临找工作的问题。不管是现在找一份实习工作&#xff0c;还是毕业后找一份正式工作&#xff0…

100天精通Python丨基础知识篇 —— 03、Python基础知识扫盲(第一个Python程序,13个小知识点)

文章目录&#x1f41c; 1、Python 初体验Pycharm 第一个程序交互式编程第一个程序&#x1f41e; 2、Python 引号&#x1f414; 3、Python 注释&#x1f985; 4、Python 保留字符&#x1f42f; 5、Python 行和缩进&#x1f428; 6、Python 空行&#x1f439; 7、Python 输出&…

Linux基础知识点总结

♥️作者&#xff1a;小刘在C站 ♥️个人主页&#xff1a;小刘主页 ♥️每天分享云计算网络运维课堂笔记&#xff0c;努力不一定有收获&#xff0c;但一定会有收获加油&#xff01;一起努力&#xff0c;共赴美好人生&#xff01; ♥️夕阳下&#xff0c;是最美的绽放&#xff0…

史上最详细的改良顺序表讲解,看完不会你打我

目录 0.什么是顺序表 1.顺序表里结构体的定义 2.顺序表的初始化 3.顺序表的输入 4.增加顺序表的长度 5.1顺序表的元素查找&#xff08;按位查找&#xff09; 5.2顺序表的元素查找&#xff08;按值查找&#xff09;在顺序表进行按值查找&#xff0c;大概只能通过遍历的方…

HFish蜜罐的介绍和简单测试(三)

在学习蜜罐时&#xff0c;HFish是个不错的选择。首先是免费使用&#xff0c;其次易于安装管理&#xff0c;然后文档支持比较丰富&#xff0c;最后还有更多扩展功能。第三篇的话作为本系列的最终篇章进行总结&#xff0c;具体是看到哪里写到哪里。 0、HFish平台管理 0.1、报告…

基于SpringBoot实现冬奥会运动会科普平台【源码+论文】

基于SpringBoot实现冬奥会科普平台演示开发语言&#xff1a;Java 框架&#xff1a;springboot JDK版本&#xff1a;JDK1.8 服务器&#xff1a;tomcat7 数据库&#xff1a;mysql 5.7 数据库工具&#xff1a;Navicat11 开发软件&#xff1a;eclipse/myeclipse/idea Maven包&#…

一文吃透SpringBoot整合mybatis-plus(保姆式教程)

✅作者简介&#xff1a;2022年博客新星 第八。热爱国学的Java后端开发者&#xff0c;修心和技术同步精进。 &#x1f34e;个人主页&#xff1a;Java Fans的博客 &#x1f34a;个人信条&#xff1a;不迁怒&#xff0c;不贰过。小知识&#xff0c;大智慧。 &#x1f49e;当前专栏…

23.3.26总结

康托展开 是一个全排列与自然数的映射关系&#xff0c;康托展开的实质是计算当前序列在所有从小到大的全排列中的顺序&#xff0c;跟其逆序数有关。 例如&#xff1a;对于 1,2,3,4,5 来说&#xff0c;它的康托展开值为 0*4&#xff01;0*3&#xff01;0*2&#xff01;0*1&…

Android 之 打开相机 打开相册

Android 之 打开系统摄像头拍照 打开系统相册&#xff0c;并展示1&#xff0c;清单文件 AndroidManifest.xml<uses-permission android:name"android.permission.INTERNET" /><!--文件读取权限--><uses-permission android:name"android.permiss…

网络编程2(套接字编程)

套接字编程UDP协议通信&#xff1a;TCP通信&#xff1a;套接字编程&#xff1a;如何编写一个网络通信程序 1.网络通信的数据中都会包含一个完整的五元组&#xff1a; sip&#xff0c;sport&#xff0c;dip&#xff0c;dport&#xff0c;protocol&#xff08;源IP&#xff0c;源…

【linux】多线程控制详述

文章目录一、进程控制1.1 POSIX线程库1.2 创建线程pthread_create1.2.1 创建一批线程1.3 终止线程pthread_exit1.4 线程等待pthread_jion1.4.1 线程的返回值&#xff08;退出码&#xff09;1.5 取消线程pthread_cancel1.6 C多线程1.7 分离线程pthread_detach二、线程ID值三、线…

C/C++内存管理

内存管理在C中无处不在&#xff0c;内存泄漏几乎在每个C程序中都会发生。因此&#xff0c;要学好C&#xff0c;内存管理这一关势在必得&#xff01; 目录 1.C/C内存分布 2.C语言中动态内存管理方式 3.C内存管理方式 3.1.new和delete操作内置类型 3.2.new和delete操作自定义类型…

SQL注入之HTTP请求头注入

Ps&#xff1a; 先做实验&#xff0c;在有操作的基础上理解原理会更清晰更深入。 一、实验 sqli-lab 1. User-Agent注入 特点&#xff1a;登陆后返回用户的 User-Agent --> 服务器端可能记录用户User-Agent 输入不合法数据报错 payload: and updatexml(1,concat("~&…

异或相关算法

文章目录1. 异或的性质2. 题目一3. 题目二4. 题目三5. 题目四1. 异或的性质 我们知道&#xff0c;异或的定义是&#xff1a;相同为0&#xff0c;相异为1。所以也被称为无进位相加&#xff0c;根据这定义&#xff0c;我们可以得出三个性质&#xff1a; 1. N ^ N0。2. N ^ 0N。3…

13-C++面向对象(纯虚函数(抽象类)、多继承、多继承-虚函数、菱形继承、虚继承、静态成员)

虚析构函数 存在父类指针指向子类对象的情况&#xff0c;应该将析构函数声明为虚函数&#xff08;虚析构函数&#xff09; 纯虚函数 纯虚函数&#xff1a;没有函数体且初始化为0的虚函数&#xff0c;用来定义接口规范 抽象类&#xff1a; 含有纯虚函数的类&#xff0c;不可以实…

Prometheus监控实战系列十七:探针监控

目前对于应用程序的监控主要有两种方式&#xff0c;一种被称为白盒监控&#xff0c;它通过获取目标的内部信息指标&#xff0c;来监控目标的状态情况&#xff0c;我们前面介绍的主机监控、容器监控都属于此类监控。另一种则是“黑盒监控”&#xff0c;它指在程序外部通过探针的…