realsense D455+ROS+OpenCV4.5完成目标距离检测

2023-05-16

ROS-OpenCV


1. 环境配置

1.1 realsense SDK2.0安装

①通过官网找到最新的SDK包并下载
Intel RealSense SDK 2.0
②解压安装包(librealsense-2.47.0.tar.gz)
③注册服务器的公钥:

sudo apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE

④将服务器添加到存储库列表中:

sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main" -u

⑤安装所用的库

sudo apt-get install librealsense2-dkms
sudo apt-get install librealsense2-utils

⑥可选安装开发和调试包(最好全部安装)

sudo apt-get install librealsense2-dev
sudo apt-get install librealsense2-dbg

⑦检查内核是否更新应包含realsense字符串

modinfo uvcvideo | grep "version:"

⑧重新链接摄像头运行:realsense-viewer打开摄像头

1.2 摄像头打开失败

①检查内核是否更新应包含realsense字符串

modinfo uvcvideo | grep "version:"

②可出现内核版本则是驱动没有安装

1.3 realsense驱动安装

参考信息:https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md
①安装环境

  • 更新 Ubuntu 发行版,包括获取最新的稳定内核
    sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
  • 更新操作系统启动并重新启动以强制执行正确的内核选择
    sudo update-grub && sudo reboot

②拔下任何连接的摄像头

  • 安装构建librealsense二进制文件和受影响的内核模块所需的核心包:
    sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
    
  • 特定于发行版的包:
    sudo apt-get install libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev at
    
  • 定位到上述解压到安装包(librealsense-2.47.0.tar.gz)
    在根目录下运行Intel Realsense 权限脚本:
    ./scripts/setup_udev_rules.sh

③构建librealsense2 SDK

  • 导航到ibrealsense根目录并运行mkdir build && cd build
  • 运行Cmake:
    cmake ../ -DBUILD_EXAMPLES=true
  • 重新编译并安装ibrealsense(开启8线程编译,8倍的快乐)
    sudo make uninstall && make clean && make -j8&& sudo make install
  • 安装完成既可以打开摄像头

④测试摄像头

  • 打开librealsense根目录下的demo程序
    cd librealsense/examples/capture
  • 打开程序rs-capture
    rs-capture

⑤能打开深度图与彩色图则安装完成

1.4 ROS-OpenCV安装

①OpenCV官网

  • 官网链接如下:
    https://opencv.org/releases/page/3/
    在版本下找OpenCV4.5.3
  • 下载解压文件到特定文件夹中

②进入OpenCV文件夹

  • cd opencv-4.5.3
    
  • 安装依赖库
    sudo apt-get install build-essential libgtk2.0-dev libavcodec-dev libavformat-dev libjpeg.dev libtiff5.dev libswscale-dev libjasper-dev  
    
  • 在OpenCV下创建编译文件夹
    mkdir build
    cd build
    
  • 进行文件配置
    cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local/opencv453 ..
    
  • 进行源码包的编译
    sudo make -j8
  • 对OpenCV-4.5.3进行安装
    sudo make install

③对OpenCV进行配置

  • 将OpenCV的库添加到路径
    sudo gedit /etc/ld.so.conf.d/opencv.conf
  • 在文本中加入代码
    /usr/local/lib  
    /usr/local/opencv453/lib/
    
  • 让配置路径生效
    sudo ldconfig
  • 打开环境变量配置文件
    sudo gedit /etc/bash.bashrc
  • 文本末尾添加环境变量
    PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig  
    export PKG_CONFIG_PATH  
    
  • 保存后关闭
  • 使得环境生效
    source /etc/bash.bashrc
  • 更新数据
    sudo updatedb
  • 重启
  • 查询版本
    pkg-config --modversion opencv
  • 安装成功

④尝试打开OpenCV-4.5.3文件下的例程

cd opencv-4.5.3/samples/cpp/example_cmake
  • 编译文件
    make
  • 出现opencv_example,打开程序可以看到经典的Hello OpenCV
    ./opencv_example
  • 若编译失败,可能是路径问题,查询路径是否出现opencv-4.5.3/include/opencv4/opencv2,将opencv2移动到include中,顺便删除opencv4
  • 若编译找不到opencv2/***文件时,如上移动文件

⑤ROS配置OpenCV

  • 进入ros的文件夹中
    cd /opt/ros/noetic/share/cv_bridge/cmake/
    
  • 打开cmake文件
    sudo gedit cv_bridgeConfig.cmake
    
  • 第94行改成 "include;/usr/local/opencv453/include "
  • 第96行改成 "/usr/local/opencv453/include "
  • 其中/usr/local/opencv453/include等地方出现opencv4同上将opencv2移出(参考④)
  • 完成ROS的配置

2. 使用ROS中的OpenCV开发

2.1 创建ROS工作包环境

①生成ROS的依赖包

cd /catkin_ws/src
catkin create pkg YOUR_PKG_NAME --catkin-deps roscpp rospy
cd ~/catkin_ws
source ~/.bashrc
catkin build

②在生成的包下新建新的cpp文件,写入测试代码
参考文献:realsense SDK2.0学习

  • 测试源码

#include "iostream"
#include "sstream"
#include "fstream"
#include "algorithm"
#include "cstring"
using namespace std;

#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/highgui/highgui_c.h"
using namespace cv;

#include "librealsense2/rs.hpp"
#include "librealsense2/rsutil.h"

//获取深度像素对应长度单位转换
float get_depth_scale(const rs2::device& dev)
{
    //前往摄像头传感器
    for (rs2::sensor & sensor : dev.query_sensors())//使用与,两者发生一个既可
    {
        //检查是否有深度图像
        if(rs2::depth_sensor dpt = sensor.as<rs2::depth_sensor>())//检查是否有深度图
        {
            return dpt.get_depth_scale();//在数组中返回数值
        }
    }
    throw std::runtime_error("Device Error!");//发生错误打印
}

//深度图对齐到彩色图像
Mat align_Depth2Color(Mat depth, const Mat &color, rs2::pipeline_profile profile) {
    //定义数据流深度与图像//auto默认类型rs2::video_stream_profile
    auto depth_stream = profile.get_stream(RS2_STREAM_DEPTH).as<rs2::video_stream_profile>();//使用auto可以直接定义之前的数据类型
    auto color_stream = profile.get_stream(RS2_STREAM_COLOR).as<rs2::video_stream_profile>();

    //获得内部参数(使用const只能在内部使用,与静态变量相似)
    const auto intrinDepth = depth_stream.get_intrinsics();//只能在函数内使用
    const auto intrinColor = color_stream.get_intrinsics();

    //直接获取从深度相机坐标系到彩色摄像头坐标系的欧拉转换矩阵
    rs2_extrinsics extrinDepth2Color;//声明
    rs2_error *error;
    rs2_get_extrinsics(depth_stream,color_stream,&extrinDepth2Color,&error);

    //平面点定义
    float pd_uv[2],pc_uv[2];//定义数组
    //空间点定义
    float Pdc3[3],Pcc3[3];

    //获得深度像素与现实单位比例
    float depth_scale = get_depth_scale(profile.get_device());
    int y,x;
    //初始化结果
    Mat result = Mat(color.rows,color.cols,CV_16U,Scalar(0));
    //对深度图像处理
    for(int row=0;row<depth.rows;row++)
    {
        for(int col=0;col<depth.cols;col++)
        {
            pd_uv[0] = col;
            pd_uv[1] = row;
            //得到当前的深度数值
            uint16_t depth_value = depth.at<uint16_t>(row,col);
            //换算单位
            float depth_m = depth_value*depth_scale;//换算成米
            //深度图像的像素点转换为坐标下三维点
            rs2_deproject_pixel_to_point(Pdc3,&intrinDepth,pd_uv,depth_m);
            //深度相机坐标系的三维点转化到彩色的坐标系下
            rs2_transform_point_to_point(Pcc3,&extrinDepth2Color,Pdc3);
            //彩色摄像头坐标系下深度三维点映射到二位平面上
            rs2_project_point_to_pixel(pc_uv,&intrinColor,Pcc3);

            //取得映射后的(u,v)
            x = (int )pc_uv[0];//处理后的数据
            y = (int )pc_uv[1];

            x = x < 0 ? 0 : x;
            x = x > depth.cols-1 ? depth.cols-1 : x;
            y = y < 0 ? 0 : y;
            y = y > depth.rows-1 ? depth.rows-1 : y;

            result.at<uint16_t>(y,x)=depth_value;
        }
    }
    return result;//返回与彩色图对齐的图像
}

void measure_distance(Mat &color,Mat depth,cv::Size range,rs2::pipeline_profile profile)//声明profile
{
    //获得深度像素与现实单位比例
    float depth_scale = get_depth_scale(profile.get_device());
    //定义图像中心点
    cv::Point center(color.cols/2,color.rows/2);
    //定义计算距离的范围
    cv::Rect RectRange(center.x-range.width/2,center.y-range.height/2,range.width,range.height);
    //画出范围
    float distance_sum = 0;
    int   effective_pixel = 0;
    for(int y = RectRange.y;y < RectRange.y + RectRange.height;y++)
    {
        for(int x = RectRange.x;x < RectRange.x + RectRange.width;x++)
        {
            //不是0就有位置信息
            if(depth.at<uint16_t>(y,x))//出现位置信息
            {
                distance_sum += depth_scale*depth.at<uint16_t>(y,x);
                effective_pixel++;
            }
        }
    }
    cout << "有效像素点:" << effective_pixel <<endl;//输出数据
    float effective_distance = distance_sum/effective_pixel;
    cout << "目标距离:" << effective_distance << "m" << endl;
    char distance_str[30];
    sprintf(distance_str,"The distance is:%f m",effective_distance);
    cv::rectangle(color,RectRange, Scalar(0,0,255),2,8);
    cv::putText(color,(string)distance_str,cv::Point(color.cols*0.02,color.rows*0.05),
                cv::FONT_HERSHEY_PLAIN,2,Scalar(0,255,0),2,8);
}

int main()
{
    const char* depth_win = "depth_Image";
    namedWindow(depth_win,WINDOW_AUTOSIZE);//开启窗口
    const char* color_win = "color_Image";
    namedWindow(color_win,WINDOW_AUTOSIZE);

    //深度图像颜色map
    rs2::colorizer c;//声明

    //创建数据管道
    rs2::pipeline pipe;
    rs2::config pipe_config;
    pipe_config.enable_stream(RS2_STREAM_DEPTH,640,480,RS2_FORMAT_Z16,30);
    pipe_config.enable_stream(RS2_STREAM_COLOR,640,480,RS2_FORMAT_BGR8,30);

    //开始函数返回值的profile
    rs2::pipeline_profile profile = pipe.start(pipe_config);

    //定义一个变量从深度转化到距离
    float depth_clipping_distance = 1.f;

    //声明数据
    auto depth_stream = profile.get_stream(RS2_STREAM_DEPTH).as<rs2::video_stream_profile>();
    auto color_stream = profile.get_stream(RS2_STREAM_COLOR).as<rs2::video_stream_profile>();

    //获得内参
    auto intrinDepth = depth_stream.get_intrinsics();
    auto intrinColor = color_stream.get_intrinsics();

    //直接获取从深度摄像头到彩色摄像的欧式变化矩阵
    auto extrinDepth2Color = depth_stream.get_extrinsics_to(color_stream);

    while (cvGetWindowHandle(depth_win)&&cvGetWindowHandle(color_win))
    {
        //堵塞程序到新的帧出现
        rs2::frameset frameset = pipe.wait_for_frames();
        //取得深度图和彩色图
        rs2::frame color_frame = frameset.get_color_frame();//取得彩色图像
        rs2::frame depth_frame = frameset.get_depth_frame();//取得深度图像
        rs2::frame depth_frame_4_show = frameset.get_depth_frame().apply_filter(c);//c为rs2::colorizer
        //获得宽高
        const int depth_w = depth_frame.as<rs2::video_frame>().get_width();
        const int depth_h = depth_frame.as<rs2::video_frame>().get_height();
        const int color_w = color_frame.as<rs2::video_frame>().get_width();
        const int color_h = color_frame.as<rs2::video_frame>().get_height();

        //创造opencv类型传输数据
        Mat depth_image(Size(depth_w, depth_h),
                        CV_16U, (void *) depth_frame.get_data(), Mat::AUTO_STEP);
        Mat depth_image_4_show(Size(depth_w, depth_h),
                               CV_8UC3, (void *) depth_frame_4_show.get_data(), Mat::AUTO_STEP);
        Mat color_image(Size(color_w,color_h),
                        CV_8UC3,(void*)color_frame.get_data(),Mat::AUTO_STEP);

        //实现深度图对齐彩色图
        Mat result = align_Depth2Color(depth_image,color_image,profile);//调用对齐函数
        measure_distance(color_image,result,cv::Size(20,20),profile);

        //显示
        imshow(depth_win,depth_image_4_show);//在深度图显示深度图像
        imshow(color_win,color_image);//在彩色图显示彩色

        waitKey(1);//延时1
    }
    return 0;
}

  • 在ROS依赖包中的CMakeLists.txt中添加OpenCV依赖:
cmake_minimum_required(VERSION 3.16.3)
project(measure_distance)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++14)


## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
        OpenCV REQUIRED
        roscpp
        rospy
)

## 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  # Or other packages containing 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 measure_distance
#  CATKIN_DEPENDS roscpp rospy
#  DEPENDS system_lib
)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(${OpenCV_INCLUDE_DIRS})

## Declare a C++ library
# add_library(${PROJECT_NAME}
#   src/${PROJECT_NAME}/measure_distance.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(realsense_distance src/realsense_distance.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(realsense_distance ${OpenCV_LIBS})

#############
## 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_measure_distance.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)
#添加后进行调试
set( CMAKE_BUILD_TYPE Debug )
set( DEPENDENCIES realsense2)

target_link_libraries(realsense_distance ${DEPENDENCIES})

③添加launch文件夹

  • 在生成包文件夹下
    mkdir launch & cd launch
  • 新建新的文本文件,名字为YOUR_NAME.launch
<launch>
    <node pkg="measure_distance" type="realsense_distance" name="realsense_distance" />
</launch>

④返回工作区,到catkin_ws目录下catkin build
⑤编译完成后开启launchroslaunch YOUR_PKG_NAME LAUNCH_NAME.launch

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

realsense D455+ROS+OpenCV4.5完成目标距离检测 的相关文章

  • PID参数 Ziegler-Nichols基于时域响应曲线的整定 反应曲线法

    PID控制器是工业过程控制中广泛采用的一种控制器 xff0c 其中 xff0c P I D分别为比例 xff08 Proportion xff09 积分 xff08 Integral xff09 微分 xff08 Differential
  • 郑学坚《微型计算机原理及应用》考点精讲 36讲

    链接 xff1a https pan baidu com s 12 vGBRrjOd UtO8P4e9bow 提取码 xff1a tqmp 当初考研时买的网课 xff0c 现在也用不着了 xff0c 赠与有缘人 书籍记录着别人多年时光总结出
  • 几种常用排序算法

    排序算法代码如下 xff1a void Sort Algorithm Bubble Sort int amp nums const int len bool haschange 61 true for int i 61 0 i lt len
  • 四旋翼姿态解算

    代码思路如下 xff1a 姿态解算 void IMU update float dT imu state st state float gyr VEC XYZ s32 acc VEC XYZ s16 mag val VEC XYZ imu
  • 树莓派4B-基于MCP2515的CAN通信过程记录篇

    本文主要记录使用树莓派4B xff0c 通过外接MCP2515模块来实现CAN通信 xff0c 使用基于Can utils实现CAN消息的收发 准备工作 xff1a 树莓派MCP2515模块杜邦线若干 知乎上一篇较为详细的参考 xff0c
  • nuxt踩坑集

    目录结构 assets 资源文件 用于组织未编译的静态资源如 LESS SASS或 JavaScript components 组件 layouts page 模板页面 xff0c 默认为 default vue可以在这个目录下创建全局页面
  • 记录个人在安装D435i驱动时出现的问题及解决方案

    目录 1 驱动安装 xff1a 2 启动Intel RealSense Viewer后报错No Frames Recevied 3 Record时报错Error opening file 1 驱动安装 xff1a 参考这篇博客 xff1a
  • 深度学习常见的优化算法

    文章目录 1 梯度下降算法 xff08 batch gradient descent BGD 2 随机梯度下降法 xff08 Stochastic gradient descent SGD 3 小批量梯度下降 Mini batch grad
  • vscode如何链接github

    1 首先安装配置好vscode xff1a https code visualstudio com download 然后下载git xff1a https git scm com download 根据自己的电脑选择相应的版本的下载就好了
  • 串口(uart)开发流程

    UART概述 UART全称 xff0c Universal Asynchronous Receiver and Transmitter UART xff0c 一般是每个单片机或开发板必备的一个功能模块 xff0c 可以用来调试 xff0c
  • *33.硬中断和软中断是什么?区别?

    1 硬中断 硬件中断 像磁盘 xff0c 网卡 xff0c 键盘 xff0c 时钟等 2 软中断 软件中断 进程产生 区别 xff1a xff08 产生机制 处理顺序 可否屏蔽 中断信号由来 xff09 1 软中断的发生的时间是由程序控制的
  • gazebo学习时遇到的问题(PX4篇)

    最近在研究如何使用UAV xff0c 由于是初学者 xff0c 不好直接上手实体无人机 xff0c 因此考虑通过在gazebo中模拟的方式进行一下无人机的简单使用模拟 xff0c 于是了解到了PX4这个东西 xff0c 他不仅支持固件写入
  • 阿里云服务器的搭建和部署(小白教程)

    阿里云服务器的搭建和部署 xff08 小白教程 xff09 一 购买服务器二 管理云服务器三 环境配置1 JDK的配置与下载2 tomcat的配置与下载3 MySQL的安装与配置 四 外网访问服务器 个人推荐阿里云 因为里面有一个大学生的云
  • 一篇带你搞懂Python3 中的 def __init__

    在学习python 100 days时 xff0c 在面向对象编程基础的那一块 xff0c 封装一个class时 xff0c 突然出现def init 的方法 xff0c 刚开始时 xff0c 对他的理解很模糊 xff0c 为什么定义一个类
  • 时间序列异常检测综述

    1 Introduction 时序异常检测几个可以运用的点 xff1a 1 欺诈检测 2 工业数据检测 简介一下 xff1a 异常检测很久之前就有了 最早可以追溯到 J Fox 1972 Outliers in Time Series Jo
  • Linux基础----Makefile(1)

    前言 刚开始学习Linux xff0c 这些那真的是新知识 xff0c 由于感觉将来FPGA的学习会越来越靠近软件的方向发展 xff0c 所以觉得有必要好好地学习一下嵌入式的东西 xff0c 因此有必要把学习的过程记录下来 xff0c 方便
  • 【OpenCV】ChArUco标定板角点的检测Detection of ChArUco Corners

    opencv3 4 15源文档链接 link ChArUco标定板角点的检测 GoalSource codeCharuco板创建ChArUco板检测ChArUco姿势估计 ArUco标记和板的快速检测和多功能性是非常有用的 然而 xff0c
  • 错误 MSB3721

    错误 MSB3721 命令 C Program Files NVIDIA GPU Computing Toolkit CUDA v10 2 bin nvcc exe gencode 61 arch 61 compute 30 code 61
  • 倒立摆状态反馈控制——分析、建模与仿真(matlab)

    倒立摆状态反馈控制 引言 倒立摆是机器人学中一个非常重要的模型 xff0c 火箭 导弹 独轮车 双足机器人 四足机器人 xff0c 基本都是倒立摆的变形 问题描述 关于倒立摆的问题描述如下 xff1a 如图所示的倒立摆系统 摆的关节连接在一
  • docker pull rabbitmq:management 怎样指定版本

    docker pull rabbitmq 3 8 1 management

随机推荐

  • git 命令学习

    git 命令学习 git clone https github com zhaji01 notes git 克隆远程仓库 git status 本地仓库状态 git add lt file gt 把修改 xff08 包括创建 修改 删除 解
  • 【实例记录】在ubuntu上运行python实现与单片机多线程串口通信

    文章目录 工具步骤 工具 工具 xff1a 自己电脑双系统的ubuntu18 04 单片机esp8266 一个usb转ttl模块 xff0c ubuntu上已经下载了python的3 6和pip xff0c 还需要pip install s
  • 【过程记录 】windows和ubuntu两台电脑局域网进行socket通信收发数据和传输文件

    实验图片和前期准备 xff1a ubuntu作为服务端 xff0c windows客户端传输数据和文件 xff1a windows作为服务端 xff0c ubuntu作为客户端 xff1a 实验图片和前期准备 xff1a 服务端发送和接受i
  • 过程记录 yolov3目标检测输出目标坐标和原图物体像素坐标比较

    设备 xff1a jetsonnano B01 一个usb广角摄像头 语言为python 库为opencv 框架pytorch 大家都知道yolov3的坐标变换过程比较复杂 xff0c 大概要经过图片缩放 xff0c 对数空间变换等等 xf
  • Rt-Thread学习笔记-----信号量(五)

    线程间同步 1 什么是线程间同步 xff1f 同步是指按预定的先后次序进行运行 xff0c 线程同步是指多个线程通过特定的机制来控制线程之间的执行顺序 xff0c 也可以说是在线程之间通过同步建立起执行顺序的关系 xff0c 如果没有同步
  • C++类和对象——空指针访问成员函数

    C 43 43 中空指针也是可以访问成员函数的 xff0c 但是也要注意有没有用到this指针 xff1b 如果用到this指针 xff0c 需要加以判断保证代码的健壮性 span class token macro property sp
  • nodejs实现简单的自动化部署

    如题 xff0c nodejs通过码云提供的web hooks实现简单的服务器自动部署 大致流程 xff1a 1 通过码云提供的web hooks xff0c 创建一个request通过后的回调接口 xff08 说白了就是配置一个码云审批通
  • 2022届春招实习面经(CV岗)——offer经

    已拿offer公司 xff1a 腾讯 ponyai vivo研究院 华为 字节 面了一面就没继续面了 xff1a 海康威视 虎牙 京东 本科211 xff0c 硕士985 二区在投论文 43 顶会下的top5比赛 43 小厂三个月实习经历
  • LeetCode刷题笔记 --- python

    目录 一 python交换两个变量的值1 1 使用tuple1 2 使用临时变量temp 二 python中 和 区别三 python列表的使用3 1 列表的基本操作3 2 列表实现栈操作3 3 列表实现排序3 4 列表的算法效率 四 py
  • 无人机高度控制

    这个第一次看就完全没看懂 xff0c 现在再看还是没看懂orz xff0c 而且定高还是重要的功能和考点 xff0c 详细分析一下程序吧 首先是表示高度信息的结构体 xff1a 数据结构声明 typedef struct float Z S
  • ssh_exchange_identification: Connection closed by remote host

    ssh exchange identification Connection closed by remote host 导致这个问题的原因有很多 xff0c 笔者是因为在ssh中设置了代理 xff0c 这个可以作为阅读者排查问题的一个点
  • 匿名无人机飞控代码整理5

    先跳过高度部分 xff0c 这里看location部分 可以看出来这部分也是直接与我们的循迹 追踪任务相关的 所以这部分的掌握应该很重要把 前面有很多暂时不需要看 xff0c flyctrl那个巨长 所以就先看速度环控制部分了 if swi
  • 匿名无人机飞控代码整理

    看了半天 xff0c 各部分都看得都很零散 xff0c 写的也很简略 xff0c 但目前为止还是无法对系统各部分做具体一点的整合 xff0c 今天试试看 1 先从主函数起 xff0c 进入主轮询函数 Main Task 这个主函数的调用就在
  • 一直没看的无人机定高

    除了定高的部分 xff0c 其他没看的还有一些控制函数 定高的原理的话 xff0c 也是利用了两级pid xff0c 按照原本的理解 xff0c 从外环开始看的话 xff0c 反馈高度比较容易获得 xff0c 就是激光测距得到的高度 期望高
  • 匿名无人机代码FlightCtrl简单分析

    这个flightCtrl文件 xff0c 是真的很长又很难 各种标志位啊 xff0c 判断啊 xff0c 开关啊 xff0c 逻辑判断啊什么的 xff0c 趁通宵把代码梳理一遍 这个文件里的函数虽不算最多 xff0c 但引用的头文件相当多
  • 简历—项目经验范例

    xff08 看着比较专业的一份项目经验样板 xff09 原文链接https mp weixin qq com s rxGTTVKryvYoyst jsayLw 项目一 米乐淘网上商城 项目名称 xff1a 米乐淘网上商城 开发环境 xff1
  • 家庭网络和路由器

    1 什么是家庭网络 xff1f 一个典型的家庭网络由多个设备组成 xff0c 且几乎所有的家庭网络都有一个路由器作为它们的中心设备 路由器连接到 Internet 连接 xff0c 然后与本地网络上的一台或多台计算机共享该连接 家庭网络通常
  • ROS动态调整PID

    64 动态调整PID ROS提供了一个专门用于动态调整参数的功能包dynamic reconfigure 它实现了动态配置参数的机制 我们先来创建一个功能包 添加相应的一些依赖 cd catkin ws src catkin create
  • CubeMX配置串口的程序烧入板子不跑的解决方法

    对于cubeMX配置串口 xff0c keil5编译通过的 xff0c 自己确定无问题的程序 xff0c 以ISP烧入 xff0c 烧入板子后无法运行的情况 xff0c 我暂时的解决策略是按住reset键点击 开始编程 xff0c 点击后松
  • realsense D455+ROS+OpenCV4.5完成目标距离检测

    ROS OpenCV 1 环境配置 1 1 realsense SDK2 0安装 通过官网找到最新的SDK包并下载 Intel RealSense SDK 2 0 解压安装包 xff08 librealsense 2 47 0 tar gz