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

ORB-SLAM3 erros when run

terminate called after throwing an instance of ‘cv::Exception’
what(): OpenCV(3.4.16) /home/seu/wsh/study/ch5/opencv-3.4.16/modules/imgproc/src/median_blur.dispatch.cpp:283: error: (-215:Assertion failed) !_src0.empty() in function ‘medianBlur’

path erro

-Camera 1 parameters (Pinhole): [ 718.856 718.856 607.193 185.216 ]
./run_stereo_kitti.sh: line 1: 68995 Segmentation fault      (core dumped) ./stereo_kitti ~/dev_ws_ros1_SLAM/ORB_SLAM3/Vocabulary/ORBvoc.txt /home/dry/Documents/SLAM/ORB_SLAM/ORB_SLAM3/Examples/Stereo/KITTI00-02.yaml /home/dry/Documents/data/KITTI/01

ros cv_bidge using opencv may confilct with you own,so reintall cv_bridge

(ORB-SLAM3: Current Frame:3598): Gtk-ERROR **: 19:51:33.694: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

```

sudo apt remove libgtk3*

```

remove gtk3 , rebuild opencv and orbslam .run the demo again

orb-slam3 ros coreDump

ros opencv version confilct with orbslam version. changge the opencv version(you build frome source) or remove cvbridge and build it from source

To install `cv_bridge` from source, you will need to follow these steps:

1. **Setup ROS Workspace:**
Create a new ROS workspace if you haven't already done so. Here's how you can create a new workspace:

   ```bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
source devel/setup.bash
```

2. **Clone cv_bridge Repository:**
Clone the `cv_bridge` repository into the `src` folder of your ROS workspace:

   ```bash
cd ~/catkin_ws/src
git clone https://github.com/ros-perception/vision_opencv.git
```

   The `vision_opencv` repository contains the `cv_bridge` package along with other related packages.

3. **Configure and Build:**
Configure and build the `cv_bridge` package and its dependencies within your workspace:

   ```bash
cd ~/catkin_ws
catkin_make
```

4. **Source Setup:**
Source the setup files to set up your environment:

   ```bash
source devel/setup.bash
```

5. **Test Installation:**
Test the installation by running a simple node that uses `cv_bridge`. For example, you can write a small ROS node that subscribes to a camera topic and displays the image using `cv_bridge`.

### Detailed Steps:

#### Step 1: Create a ROS Workspace

If you haven't created a ROS workspace yet, you can do so by following these commands:

```bash
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
source devel/setup.bash
```

#### Step 2: Clone the Repository

Clone the `vision_opencv` repository, which contains `cv_bridge`:

```bash
cd ~/catkin_ws/src
git clone https://github.com/ros-perception/vision_opencv.git
```

#### Step 3: Build the Workspace

Build the `vision_opencv` packages and their dependencies:

```bash
cd ~/catkin_ws
catkin_make
```

#### Step 4: Set Up Environment

Set up the environment by sourcing the setup files:

```bash
source devel/setup.bash
```

#### Step 5: Test Installation

To test the installation, you can write a simple ROS node that subscribes to a camera topic and displays the image using `cv_bridge`. Here's an example of how you can do this:

```cpp
#include "ros/ros.h"
#include "sensor_msgs/Image.h"
#include "cv_bridge/cv_bridge.h"
#include <opencv2/highgui/highgui.hpp>

void imageCallback(const sensor_msgs::ImageConstPtr& msg)
{
try
{
cv::Mat image = cv_bridge::toCvShare(msg, "bgr8")->image;
cv::imshow("Image window", image);
cv::waitKey(30);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str());
}
}

int main(int argc, char** argv)
{
ros::init(argc, argv, "image_listener");
ros::NodeHandle nh;

  ros::Subscriber sub = nh.subscribe("/camera/image_raw", 1, imageCallback);

  ros::spin();

  return 0;
}
```

Compile the node and run it:

```bash
cd ~/catkin_ws/src
mkdir my_image_subscriber
cd my_image_subscriber
catkin_create_pkg my_image_subscriber rospy std_msgs cv_bridge
cd src
touch image_subscriber.cpp
vim image_subscriber.cpp
```

Copy the above code into `image_subscriber.cpp` and save the file. Then, build the package and run the node:

```bash
cd ~/catkin_ws
catkin_make
source devel/setup.bash
rosrun my_image_subscriber image_subscriber
```

Make sure to replace `/camera/image_raw` with the appropriate topic name for your camera.

If everything is set up correctly, you should see the images displayed in a window when you run the node.

If you encounter any issues during the build or while testing the installation, feel free to ask for further assistance!

http://www.dtcms.com/a/479184.html

相关文章:

  • 手机网站模板使用方法wordpress 主题 英文
  • [手写系列]Go手写db — — 第五版(实现数据库操作模块)
  • 网站购买域名朝阳企业网站建设
  • 停车全生态系统架构
  • html电影网站模板下载工具网站推广适合哪种公司做
  • Docker 资源限制与容器管理
  • 2025直播美颜sdk洞察报告:人脸美型算法、AI修复与实时渲染创新
  • 鸿蒙:实现列表单项左滑删除
  • 【TIDE DIARY 4】Agentic Retrieval-Augmented Generation: A Survey on Agentic RAG
  • 免费 网站点击wordpress移动端禁止放大
  • s3fs 取消挂载
  • 新增模块介绍:教师代课统计系统(由社区 @记得微笑 贡献)
  • 15. shell编程之#!与/bin/bas 之间需要空格吗
  • 套模板网站网络seo优化推广
  • 聪明的上海网站帮别人做网站推广犯法吗
  • HTML 总结
  • HTML应用指南:利用POST请求获取全国塔斯汀门店位置信息
  • 鞍山 网站建设网站规划网站建设报价表
  • 云服务器怎么设置虚拟IP,云服务器能起虚拟ip吗
  • Fast DDS 默认传输机制详解:共享内存与 UDP 的智能选择
  • thinkphp开发企业网站如何做优酷网站点击赚钱
  • 供应链金融对生命科学仪器企业市场竞争力的影响研究
  • 高性能高可用设计
  • 【系统分析师】写作框架:需求分析方法及应用
  • dedecms 做网站青岛企业网站建设公司
  • wordpress网仿站建设项目前期收费查询网站
  • tcp和udp协议报文段的报文格式
  • C#异步编程:async修饰方法的返回类型说明
  • MC33PT2000控制主要功能函数代码详解三
  • C语言--数据类型