无人机避障——4D毫米波雷达Octomap从点云建立三维栅格地图

news2024/11/28 16:53:02

Octomap安装

sudo apt-get install ros-melodic-octomap-ros
sudo apt-get install ros-melodic-octomap-msgs
sudo apt-get install ros-melodic-octomap-server
sudo apt-get install ros-melodic-octomap-rviz-plugins
# map_server安装
sudo apt-get install ros-melodic-map-server

  启动rviz

roscore
rosrun rviz rviz

点击add,可以看到多了Octomap_rviz_plugins模组:

OccupancyGrid是显示三维概率地图,也就是octomap地图。OccupancyMap是显示二维占据栅格地图

从PCD创建PointCloud2点云话题并发布出去:

参考资料:

测试的test数据采用以下第一条博客的pcd测试数据

Octomap 在ROS环境下实时显示_octomap在ros环境下实时显示-飞天熊猫-CSDN博客

学习笔记:使用Octomap将点云地图pcd转换为三维栅格地图,并在rviz中可视化_octomap功能包-CSDN博客

创建点云发布话题的工作空间:

mkdir -p ~/publish_pointcloudtest/src        #使用系统命令创建工作空间目录
cd ~/publish_pointcloudtest/src
catkin_init_workspace           # ROS的工作空间初始化命令

在工作空间下放入以下两个文件:

octomap_mapping

octomap_server

资源下载:

https://github.com/OctoMap/octomap_mapping

src下创建cpp文件pointcloud_publisher.cpp

#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <sstream>
#include <vector>
 
#include <ros/ros.h>  
#include <pcl/point_cloud.h>  
#include <pcl_conversions/pcl_conversions.h>  
#include <sensor_msgs/PointCloud2.h>  
#include <pcl/io/pcd_io.h>
 
#include <octomap_msgs/OctomapWithPose.h>
#include <octomap_msgs/Octomap.h>
#include <geometry_msgs/Pose.h>
 
#include <octomap/octomap.h>
#include <octomap_msgs/Octomap.h>
#include <octomap_msgs/conversions.h>
 
#include <geometry_msgs/TransformStamped.h>
 
#define TESTCLOUDPOINTS 1  // 设置为 1 以测试点云发布,设置为 0 不测试
#define TESTOCTOTREE 0     // 设置为 1 以测试OctoMap发布,设置为 0 不测试
 
int main (int argc, char **argv)  
{  
    std::string topic, path, frame_id;
    int hz = 5;  // 发布频率,单位 Hz
 
    ros::init(argc, argv, "publish_pointcloud");  // 初始化ROS节点
    ros::NodeHandle nh;  // 创建节点句柄
 
    // 从参数服务器获取参数
    nh.param<std::string>("path", path, "/home/nvidia/publish_pointcloudtest/data/test.pcd");
    nh.param<std::string>("frame_id", frame_id, "map");
    nh.param<std::string>("topic", topic, "pointcloud_topic");
    nh.param<int>("hz", hz, 5);
 
    // 加载点云数据到pcl::PointCloud对象中
    pcl::PointCloud<pcl::PointXYZ> pcl_cloud; 
    pcl::io::loadPCDFile(path, pcl_cloud);  // 从文件加载点云数据
 
#if TESTCLOUDPOINTS  // 如果 TESTCLOUDPOINTS 定义为 1,则执行这部分代码
    ros::Publisher pcl_pub = nh.advertise<sensor_msgs::PointCloud2>(topic, 10);  // 创建Publisher对象,将点云数据发布到指定话题
 
    // 转换PCL点云到ROS下的 PointCloud2 类型
    sensor_msgs::PointCloud2 output;  
    pcl::toROSMsg(pcl_cloud, output);
 
    output.header.stamp = ros::Time::now();  // 设置时间戳
    output.header.frame_id = frame_id;  // 设置坐标系框架
 
    // 打印参数信息
    std::cout << "path = " << path << std::endl;
    std::cout << "frame_id = " << frame_id << std::endl;
    std::cout << "topic = " << topic << std::endl;
    std::cout << "hz = " << hz << std::endl;
 
    ros::Rate loop_rate(hz);  // 设置发布频率  
    while (ros::ok())  
    {  
        pcl_pub.publish(output);  // 发布 PointCloud2 数据
        ros::spinOnce();  // 处理所有回调函数
        loop_rate.sleep();  // 按照指定频率睡眠
    }
#endif
 
#if TESTOCTOTREE  // 如果 TESTOCTOTREE 定义为 1,则执行这部分代码
    ros::Publisher octomap_pub = nh.advertise<octomap_msgs::Octomap>(topic, 1);  // 创建Publisher对象,将OctoMap数据发布到指定话题
 
    // 创建 octomap 对象,并设置其分辨率
    octomap::OcTree tree(0.1);  // 你可以根据需要调整分辨率
 
    // 将点云数据插入到 octomap 中
    for (const auto& point : pcl_cloud.points) {
        tree.updateNode(point.x, point.y, point.z, true);
    }
 
    // 发布OctoMap消息
    octomap_msgs::Octomap octomap_msg;
    octomap_msgs::fullMapToMsg(tree, octomap_msg);  // 转换为 OctoMap 消息
 
    // 设置 OctoMap 消息的头信息
    octomap_msg.header.stamp = ros::Time::now();
    octomap_msg.header.frame_id = frame_id;
 
    // 打印参数信息
    std::cout << "path = " << path << std::endl;
    std::cout << "frame_id = " << frame_id << std::endl;
    std::cout << "topic = " << topic << std::endl;
    std::cout << "hz = " << hz << std::endl;
 
    ros::Rate loop_rate(hz);  // 设置发布频率  
    while (ros::ok())  
    {  
        octomap_pub.publish(octomap_msg);  // 发布 OctoMap 数据
        ros::spinOnce();  // 处理所有回调函数
        loop_rate.sleep();  // 按照指定频率睡眠
    }
#endif
 
    return 0;  // 主函数返回值
}

代码中需要进行修改为自己的点云,后续相应都需要修改为自己的路径(自行修改)

nh.param<std::string>("path", path, "/home/nvidia/publish_pointcloudtest/data/test.pcd");

CMakeLists.txt

cmake_minimum_required(VERSION 3.0.2)
project(publish_pointcloud)
 
## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)
 
## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
 
set(octomap_ros_DIR "/opt/ros/melodic/share/octomap_ros/cmake")
 
find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  sensor_msgs
  octomap_msgs
  geometry_msgs
  octomap_ros
)
find_package(PCL REQUIRED)
find_package(octomap REQUIRED)
 
## System dependencies are found with CMake's conventions
# find_package(Boost REQUIRED COMPONENTS system)
 
 
## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()
 
################################################
## Declare ROS messages, services and actions ##
################################################
 
## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a exec_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
 
## Generate messages in the 'msg' folder
# add_message_files(
#   FILES
#   Message1.msg
#   Message2.msg
# )
 
## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )
 
## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )
 
## Generate added messages and services with any dependencies listed here
# generate_messages(
#   DEPENDENCIES
#   std_msgs
# )
 
################################################
## Declare ROS dynamic reconfigure parameters ##
################################################
 
## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
##   * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
##   * add "dynamic_reconfigure" to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * uncomment the "generate_dynamic_reconfigure_options" section below
##     and list every .cfg file to be processed
 
## Generate dynamic reconfigure parameters in the 'cfg' folder
# generate_dynamic_reconfigure_options(
#   cfg/DynReconf1.cfg
#   cfg/DynReconf2.cfg
# )
 
###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES my_pkg
#  CATKIN_DEPENDS roscpp std_msgs
#  DEPENDS system_lib
)
 
###########
## Build ##
###########
 
## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include
  ${catkin_INCLUDE_DIRS}
  ${PCL_INCLUDE_DIRS}
  ${OCTOMAP_INCLUDE_DIRS}
)
 
## Declare a C++ library
# add_library(${PROJECT_NAME}
#   src/${PROJECT_NAME}/my_pkg.cpp
# )
 
## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
 
## Declare a C++ executable
## With catkin_make all packages are built within a single CMake context
## The recommended prefix ensures that target names across packages don't collide
add_executable(publish_pointcloud src/pointcloud_publisher.cpp)
 
## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the
## target back to the shorter version for ease of user use
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
 
## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
 
## Specify libraries to link a library or executable target against
target_link_libraries(publish_pointcloud
  ${catkin_LIBRARIES}
  ${PCL_LIBRARIES}
  ${OCTOMAP_LIBRARIES}
)
 
#############
## Install ##
#############
 
# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
 
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# catkin_install_python(PROGRAMS
#   scripts/my_python_script
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
 
## Mark executables for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html
# install(TARGETS ${PROJECT_NAME}_node
#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )
 
## Mark libraries for installation
## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html
# install(TARGETS ${PROJECT_NAME}
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
# )
 
## Mark cpp header files for installation
# install(DIRECTORY include/${PROJECT_NAME}/
#   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
#   FILES_MATCHING PATTERN "*.h"
#   PATTERN ".svn" EXCLUDE
# )
 
## Mark other files for installation (e.g. launch and bag files, etc.)
# install(FILES
#   # myfile1
#   # myfile2
#   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# )
 
#############
## Testing ##
#############
 
## Add gtest based cpp test target and link libraries
# catkin_add_gtest(${PROJECT_NAME}-test test/test_my_pkg.cpp)
# if(TARGET ${PROJECT_NAME}-test)
#   target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
# endif()
 
## Add folders to be run by python nosetests
# catkin_add_nosetests(test)

package.xml

<?xml version="1.0"?>
<package format="2">
  <name>publish_pointcloud</name>
  <version>0.0.0</version>
  <description>The publish_pointcloud package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email="nvidia@todo.todo">nvidia</maintainer>


  <!-- One license tag required, multiple allowed, one license per tag -->
  <!-- Commonly used license strings: -->
  <!--   BSD, MIT, Boost Software License, GPLv2, GPLv3, LGPLv2.1, LGPLv3 -->
  <license>TODO</license>


  <!-- Url tags are optional, but multiple are allowed, one per tag -->
  <!-- Optional attribute type can be: website, bugtracker, or repository -->
  <!-- Example: -->
  <!-- <url type="website">http://wiki.ros.org/point_publish</url> -->


  <!-- Author tags are optional, multiple are allowed, one per tag -->
  <!-- Authors do not have to be maintainers, but could be -->
  <!-- Example: -->
  <!-- <author email="jane.doe@example.com">Jane Doe</author> -->


  <!-- The *depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
  <!--   <depend>roscpp</depend> -->
  <!--   Note that this is equivalent to the following: -->
  <!--   <build_depend>roscpp</build_depend> -->
  <!--   <exec_depend>roscpp</exec_depend> -->
  <!-- Use build_depend for packages you need at compile time: -->
  <!--   <build_depend>message_generation</build_depend> -->
  <!-- Use build_export_depend for packages you need in order to build against this package: -->
  <!--   <build_export_depend>message_generation</build_export_depend> -->
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use exec_depend for packages you need at runtime: -->
  <!--   <exec_depend>message_runtime</exec_depend> -->
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <!-- Use doc_depend for packages you need only for building documentation: -->
  <!--   <doc_depend>doxygen</doc_depend> -->
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>std_msgs</exec_depend>


  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- Other tools can request additional information be placed here -->

  </export>
</package>

编译通过

记得在devel那边进行source

source devel/setup.bash
roscore
rosrun publish_pointcloud publish_pointcloud

查看下是否有话题,且可以打印出来 

rostopic list
rostopic echo /pointcloud_topic

 

然后打开终端打开rviz

rviz

将PointCloud2 添加进来,话题选择之前的点云话题

 

编写octomap_mapping.launch文件,launch文件在:

将frameid修改即可

<launch>
	<node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
		<param name="resolution" value="0.05" />
		
		<!-- fixed map frame (set to 'map' if SLAM or localization running!) -->
		<param name="frame_id" type="string" value="map" />
		
		<!-- maximum range to integrate (speedup!) -->
		<param name="sensor_model/max_range" value="5.0" />
		
		<!-- data source to integrate (PointCloud2) -->
		<remap from="cloud_in" to="/pointcloud_topic" />
	
	</node>
</launch>

然后就可以运行launch文件了:

roslaunch octomap_server octomap_mapping.launch

总结上面所有的过程 :

1、改完代码后编译

nvidia@Xavier-NX:~/publish_pointcloudtest$ catkin_make

2、编译完后roscore

nvidia@Xavier-NX:~$ roscore

3、运行点云发布代码

nvidia@Xavier-NX:~/publish_pointcloudtest$ rosrun publish_pointcloud publish_pointcloud

4、运行rviz使其显示白色的点云

nvidia@Xavier-NX:~$ rviz

5、运行octomap

nvidia@Xavier-NX:~/publish_pointcloudtest$ roslaunch octomap_server octomap_mapping.launch

上面的点云也是可以测试出来的,如第一张的图,最后用的自己4D毫米波雷达生成的点云也进行了测试,不过有些点云没能显示,后续还需要改进,估计跟坐标系的范围也有关系:

后续考虑实时动态,以及将其转换为二维栅格地图作为无人机的导航地图。

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

SLAM|2. 差异与统一:坐标系变换与外参标定

本章主要内容 1.坐标系变换 2.相机外参标定 上一章我们了解了相机内参的概念&#xff0c;内参主要解决三维世界与二维图像之间的映射关系。有了内参我们可以一定程度上还原相机看到了什么&#xff08;但缺乏尺度&#xff09;。但相机看到的数据只是处于相机坐标系&#xff0c;为…

Solidworks二次开发 获取装配体里面组件列表以及名称

******************************************************************************从装配体里面获取组件******************************************************************************Option Explicit 强制在模块级别显式声明所有变量 *********************定义SOLIDWOR…

《链表篇》---环形链表II(返回节点)

题目传送门 方法一&#xff1a;哈希表&#xff08;与环形链表类似&#xff09; 很容易就可以找到链表的相交位置。 public class Solution {public ListNode detectCycle(ListNode head) {if(head null || head.next null){return null;}Set<ListNode> visited new Ha…

2024 年 MathorCup 数学应用挑战赛——大数据竞赛-赛道 A:台风的分类与预测

2024年MathorCup大数据挑战赛-赛道A初赛-第四版论文.ziphttps://download.csdn.net/download/qq_52590045/89930645 ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ …

解决Github下载速度慢的问题

1. 方式一 先把hosts文件先复制一份到其他文件夹下&#xff0c;以免造成不小心改动出现的后果在C盘的C:\Windows\System32\drivers\etc 下的hosts文件 用编辑器打开后&#xff0c;在末尾处添加访问如下的两个网站所返回的两个IP https://github.com.ipaddress.com/ http://gi…

基于SSM大学生互动交流网站设计与实现

前言 随着社会的发展&#xff0c;系统的管理形势越来越严峻。越来越多的用户利用互联网获得信息&#xff0c;但各种信息鱼龙混杂&#xff0c;信息真假难以辨别。为了方便用户更好的获得信息&#xff0c;因此&#xff0c;设计一种安全高效的大学生互动交流网站极为重要。 开发…

C语言复习第8章 数据在内存中的存储

目录 一、数据类型1.1 数据类型介绍1.2 类型的意义1.3 类型的基本归类整形家族浮点数家族构造类型(自定义类型)指针类型空类型 二、整型在内存中的存储2.1 原反补2.2 为什么内存中要存补码?2.3 大小端介绍2.4 为什么会有大小端之分2.5 写一个程序 判断当前机器的字节序 三、练…

创业板权限开通有何要求?创业板的股票交易佣金最低是多少?

创业板 创业板又称二板市场&#xff08;Second-board Market&#xff09;即第二股票交易市场&#xff0c;是与主板市场&#xff08;Main-Board Market&#xff09;不同的一类证券市场&#xff0c;专为暂时无法在主板市场上市的创业型企业提供融资途径和成长空间的证券交易市场…

使用 FastGPT 工作流实现 AI 赛博算卦,一键生成卦象图

最近那个男人写的汉语新解火遍了全网&#xff0c;那个男人叫李继刚&#xff0c;国内玩 AI 的同学如果不知道这个名字&#xff0c;可以去面壁思过了。 这个汉语新解的神奇之处就在于它只是一段几百字的提示词&#xff0c;效果却顶得上几千行代码写出来的应用程序。 这段提示词…

【Qt】窗口——Qt窗口的概念、常用的窗口函数、菜单栏、工具栏、状态栏、浮动窗口、对话框

文章目录 Qt窗口Qt窗口的概念菜单栏工具栏状态栏浮动窗口对话框 Qt 窗口 Qt窗口的概念 QMainWindow 类概述&#xff1a; QMainWindow 是一个为用户提供主窗口程序的类&#xff0c;它继承自 QWidget 类&#xff0c;并且提供了一个预定义的布局。 菜单栏 菜单栏常用属性&#xf…

深入解析HTTP与HTTPS的区别及实现原理

文章目录 引言HTTP协议基础HTTP响应 HTTPS协议SSL/TLS协议 总结参考资料 引言 HTTP&#xff08;HyperText Transfer Protocol&#xff09;超文本传输协议是用于从Web服务器传输超文本到本地浏览器的主要协议。随着网络安全意识的提高&#xff0c;HTTPS&#xff08;HTTP Secure…

Android 下载进度条HorizontalProgressView 基础版

一个最基础的自定义View 水平横向进度条&#xff0c;只有圆角、下载进度控制&#xff1b;可二次定制度高&#xff1b; 核心代码&#xff1a; Overrideprotected void onDraw(NonNull Canvas canvas) {super.onDraw(canvas);int mW getMeasuredWidth();int mH getMeasuredHei…

服务器数据恢复—异常断电导致服务器挂载分区无法访问的数据恢复案例

服务器数据恢复环境&#xff1a; 某品牌服务器同品牌存储&#xff0c;Linux centos7EXT4文件系统。 服务器故障&#xff1a; 意外断电导致服务器操作系统不能正常启动。经过修复后系统可以正常启动&#xff0c;但是挂载的分区无法正常访问。使用fsck修复这个问题分区&#xff…

网络原理(数据链路层)->以太网帧格式解

前言 大家好我是小帅&#xff0c;今天我们来了解以太网帧格式 个人主页 文章目录 1.数据链路层1.1 认识以太⽹1.2 MAC地址&#xff08;⽹卡的硬件地址&#xff09;1.2.1 对⽐理解MAC地址和IP地址 1.3 认识MTU1.4 MTU对IP协议的影响1. 5 MTU对UDP协议的影响1.6 MTU对于TCP协议的…

隨筆 20241025 Kafka数据一致性的韭菜比喻

在Kafka中&#xff0c;数据一致性是通过Leader和Follower副本之间的协调来实现的。为了更容易理解这个复杂的概念&#xff0c;我们可以用韭菜作为比喻。 韭菜的角色 Leader韭菜&#xff1a;代表数据的主导者&#xff0c;它负责更新和维护最新的数据。Follower韭菜&#xff1a…

CNAS软件测试的好处有哪些?上海软件测试中心推荐

在进行软件测试或其他项目检测需要选择软件测试中心时&#xff0c;我们常常会把该公司有无资质认证考虑进去。那么CNAS认可作为检测机构或实验室的一项重要资质认证&#xff0c;我们可能会产生疑问&#xff1a;CNAS认可什么意思?CNAS软件测试又有什么好处呢? 1、CNAS认可是什…

vivo 轩辕文件系统:AI 计算平台存储性能优化实践

在早期阶段&#xff0c;vivo AI 计算平台使用 GlusterFS 作为底层存储基座。随着数据规模的扩大和多种业务场景的接入&#xff0c;开始出现性能、维护等问题。为此&#xff0c;vivo 转而采用了自研的轩辕文件系统&#xff0c;该系统是基于 JuiceFS 开源版本开发的一款分布式文件…

满足抖音视频剪辑内容要求的四款剪辑工具!!!

抖音作为短视频的主流平台&#xff0c;吸引了大量用户参与视频创作&#xff0c;视频剪辑需求也不断扩大&#xff0c;而市面上功能各异的视频剪辑工具也为创作者提供了丰富的选择。无论是个人分享、品牌宣传还是娱乐内容&#xff0c;剪辑已成为内容制作的关键。以下四款视频剪辑…

类和对象—上

目录 一、面向过程和面向对象初步认识 1.面向过程介绍 2.面向对象 二、类的引入 1.可以利用关键字struct来定义类的原因 1.1.C可以使用struct来定义类的原因是 2.利用关键字struct定义类及访问类成员的案例 3.使用关键字struct定义结构体、定义类的区别 3.1.C语言的结…

掌握机器学习中的偏差与方差:模型性能的关键

引言 在机器学习中&#xff0c;偏差&#xff08;Bias&#xff09;和方差&#xff08;Variance&#xff09;是两个至关重要的概念&#xff0c;它们共同影响了模型的性能。理解偏差与方差的本质&#xff0c;能够帮助我们找到模型的平衡点&#xff0c;提高模型的泛化能力&#xf…