添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

10年年初开始学习使用bumblebee, 11年年初学习ROS,3月开始将bumblebee用在了项目中,现在将之前碰到的问题,进行简单的整理。

bumblebee 也算是ptgrey公司的明星产品之一,如果大家购买pioneer或者其他机器人,配置双目视觉,常常可选之一就是bumblebee,由于其提供较好的API,可在windows和linux使用。(当年为了让销售给我证明调试 真的是可以在linux下使用,还费了他们不少功夫。。。。真是辛苦了)

http://www.ptgrey.com/products/stereo.asp

它提供了几个库,flycapture ,triclops等。

windows环境下,手册上 triclops介绍了直接获取图像等例程,但是用起来的时候,发现手册上的程序会报一些错误,自带的examples里面,全部使用了flycapture库来进行图像,句柄获取等。所以windows下编程,还是需要两个库结合使用。具体可以参见安装的示例程序。

而linux下,一般是不再使用flycapture库的。University of New Mexico,的 Yang Song 整理了bumblebee在linux下的设置和调试过程,题目是HOW TO SETUP BUMBLEBEE STEREO CAMERA UNDER LINUX,他使用的系统是debian,但是我们在ubuntu下使用完全没有问题。

http://marhes.ece.unm.edu/index.php/TXT-1_Stereo_Camera

在linux下安装好bumblebee,我们就可以 在ROS系统中调试Bumblebee相机了。3月我查阅ros wiki中所有使用过Triclops的个stack,有两个,一个已经不再继续支持,并且从svn上已经无法找到相应代码,另外一个是UBC提供的包。调试了Bumblebee2的包还是存在问题,完全无法获取到图像。出现的图像杂乱无章的花纹。可能是因为相机配置问题,这个问题出现相对还比较普遍。

通过配制1394节点bumblebee1394,可以获取到单个相机彩色未矫正图像。

配置bumblebee 用上UBC的ros包,先用bumblebee1394 再用bumblebee_stereo 但是还是无法获取有效的图像,得到的图像是单个相机灰度未矫正图像。

由于现成的package 无法调试出我们需要的左右相机图像, 我们自己将 http://www.ptgrey.com/support/kb/data/pgr-stereo-examples-libdc-2.0.2.tar.gz 中的示例程序进行修改,来获取左右相机图片,然后用triclops库计算物体深度信息等。

而且两个平台上的triclops库中间有一些函数不一样。windows下以前的测距函数不能使用,必须修改成image16的图像格式,不能用RCD8而得用RCD16.的格式。获取测距信息发现测距数据不准,不能直接计算某个像素点的深度信息。必须使用如下:

int pixelinc = disparityImage.rowinc/2;

int disparity = disparityImage.data[(int)(pic_y *pixelinc) + (int)pic_x];

这份记录是2011年3月的,不知道后来ROS系统中是否更新了一些可直接使用的bumblebee相关的包。用

ptgrey公司的例程进行修改,这个的好处就在于独立于相机设置。能在linux下使用的程序,一般可以再ros下使用的。

其他常见问题:

1 在六台电脑上配置过bumblebee,其中有四台出现过重启电脑后,无法识别设备的问题,类似的问题还出现在陀螺仪等上。

仔细检查,会发现相机1394口又没被打开等,可将

http://marhes.ece.unm.edu/index.php/TXT-1_Stereo_Camera 中的

# create the 1394 devices
mknod /dev/raw 1394 c 171 0
chmod a+rw /dev/raw1394
mkdir /dev/video1394
mknod /dev/video1394/0 c 171 16
mknod /dev/video1394/1 c 171 17
mknod /dev/video1394/2 c 171 18
mknod /dev/video1394/3 c 171 19
chmod a+rw /dev/video1394/0
chmod a+rw /dev/video1394/1
chmod a+rw /dev/video1394/2
chmod a+rw /dev/video1394/3

# install the modules
modprobe raw1394
modprobe video1394

写成bumblebee.script文件,放在etc 中,然后在rc.local 中加上 sh /etc/bumblebee.script。

如果通过脚本文件,有的机器还无法识别设备,而手动输入指令,输入密码之后,可以完成配置,那么解决方法是,在所有命令前加上 sudo。

2 配置环境,相机识别后,运行一会之后就出现segmentation fault。

仔细检查所有的库函数,不要在链接的多个路径中放置库文件。

//2012 /7/6  发现以前记录的一些文档,补录在这里

要求  libdc1394  libraw1394   新得力安装
如果没安装,会报错 找不到dc1394中 头文件

解决方法:

创建设备和设备通道
修改makefile
将triclops库中 三个a库拷贝到 usr/local/lib


ros环境配制
Environment setup

It's convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:

echo "source /opt/ros/diamondback/setup.bash" >> ~/.bashrc
. ~/.bashrc

If you have more than one ROS distribution installed, ~/.bashrc must only source the setup.bash for the version you are currently using.

If you just want to change the environment of your current shell, you can type:

source /opt/ros/diamondback/setup.bash

其他一些关键问题: 如果在新的linux系统上进行配置 切记不要拷贝以前的文件夹和包
文件夹最好通过 create stack
包 create pkg
在 setup.sh 中修改路径,要小心之前存在的 路径失效,导致之后的路径 也无法被加入。


bumblebee launch 文件 :

<!-- -*- mode: XML -*- -->

<launch>
<node pkg="bumblebee2" type="bumblebee2" name="bumblebee2"
output="screen" respawn="false">
<param name="video_mode" value="1024x768_stereo_mono" />
<param name="fps" value="15" />
<param name="gain" value="auto" />
<param name="brightness" value="auto" />
<param name="whitebalance" value="auto" />
<param name="shutter" value="auto" />
<param name="bayer_pattern" value="NONE" />
<param name="bayer_method" value="NONE" />
</node>
</launch>

bumblebee 调试 时窗口 的一些记录:

sudo chmod 777 /dev/raw1394

roscore


coriander

//rosrun camera1394 camera1394_node _guid:=00b09d01007d6d81 _video_mode:=1024x768_rgb8 _iso_speed:=400 _frame_rate:=10


//ROS_NAMESPACE=camera rosrun image_proc image_proc

rosrun image_view image_view image:=camera/image_mono

rosrun dynamic_reconfigure reconfigure_gui camera1394_node

cd ~/ros_package/ubcros/drivers/bumblebee1394/launch
roslaunch bumblebee.launch

ROS_NAMESPACE=bumblebee roslaunch stereo_image_proc.launch
ROS_NAMESPACE=bumblebee2 rosrun stereo_image_proc stereo_image_proc


rosrun image_view stereo_view stereo:=/bumblebee2 image:=image_mono
//image_rect_color


There were 1 camera(s) found attached to your PC
Camera 0 model = 'Bumblebee2 BB2-08S2C'
Using this camera
Setting stereo video capture mode
libdc1394 error: Error: Failed to allocate iso bandwidth
libdc1394 error: Error: Failed to setup DMA capture
Can't setup Bumblebee capture
Could not set up video capture mode

// open the channal  something like that --hardware problem

10年年初开始学习使用bumblebee, 11年年初学习ROS,3月开始将bumblebee用在了项目中,现在将之前碰到的问题,进行简单的整理。bumblebee 也算是ptgrey公司的明星产品之一,如果大家购买pioneer或者其他机器人,配置双目视觉,常常可选之一就是bumblebee,由于其提供较好的API,可在windows和linux使用。(当年为了让销售给我证明调试 真的是可以
ROS - ZED Node To start a ZED ROS node you can use the following commands in a shell console: $ ros launch zed_wrapper zed.launch ZED Mini: $ ros launch zed_wrapper zedm.launch ZED 2: $ ros launch zed_wrapper zed2.launch ZED 2i: $ ros launch z
现在我们跑通了 ROS -Academy-for-Beginners 按照 https://www.guyuehome.com/33866 的方法修改对应的文件,重新编译。 $ source ~/catkin_ws/devel/setup.bash $ ros pack profile $ ros launch robot_sim_demo robot_spawn.launch $ source ~/catkin_ws/devel/setup.bash $ ros pack profile
ROS (机器人操作系统)是一个开源的机器人软件平台,它提供了各种工具和库用于开发机器人的各个方面,包括感知、定位、导航、控制等等。 在 ROS 中进行 双目 相机的校准,主要是为了获得两个相机之间的准确的几何关系,以便进行立体 视觉 或深度感知任务。校准的目标是确定两个相机的相对位置和姿态,以及相机的内部参数(如焦距、畸变等)。 在 ROS 中,使用的主要工具是camera_calibration工具包,在进行 双目 校准前,需要先进行单目相机的校准。这可以通过采集一系列图片并使用该工具包中的 ros run camera_calibration cameracalibrator.py命令来完成。这个过程将根据所采集的图像自动计算相机的内部参数。 当单目校准完成后,可以开始进行 双目 相机的校准。这可以通过采集一组 双目 图像并使用camera_calibration工具包中的 ros run camera_calibration stereo_calibrator.py命令来完成。根据采集的图像,该工具会自动计算相机之间的旋转矩阵和平移向量。 完成 双目 校准后,可以使用 ROS 中的stereo_image_proc工具包进行 双目 图像处理。该工具包可以将 双目 图像转换为深度图像、点云等,并提供了一些其他的立体 视觉 相关功能。 总之, ROS 提供了一组强大的工具和库来完成 双目 相机的校准和应用。通过合理使用这些工具,可以获得准确的 双目 相机几何关系,从而在机器人的感知、导航等任务中提供更精确的信息。
博主您好,本人采用了您前面写的四个步骤,不过效果不是很好,BTW,下面是我的代码,谢谢博主!![code=python] import numpy as np from PIL import Image import os import math from GaussianBlur import GaussianBlur image = Image.open(os.path.join(os.getcwd(), "images", "photos", "001.jpg")).convert('L') image = Image.open(os.path.join(os.getcwd(), "images", "photos", "002.png")).convert('L') image_arr = np.array(image) '''Get inverse''' image_arr_inv = 255 - image_arr image_inv = Image.fromarray(image_arr_inv).convert('L') '''Gaussian blurring''' r = 50 s = 2 G = GaussianBlur(radius=r, sigma=s) template = G.GaussianTemplate() image_arr_inv_filtered = G.GaussianFilter(image_arr_inv, template) image_inv_filtered = Image.fromarray(image_arr_inv_filtered.astype(np.uint8)).convert('L') '''Mixed up''' # C = min( A + (A*B) / (255-B), 255 ) temp_arr = image_arr - (image_arr*image_arr_inv_filtered)/(255-image_arr_inv_filtered) image_sketch_arr = np.clip(temp_arr, 0, 255) image_sketch = Image.fromarray(image_sketch_arr.astype(np.uint8)).conv 学习笔记:GoogLeNet JOYZEN qq_27278153: 这个就和像素差不多是不可能出现0.5的,有小数的话都是直接加一个的,像素也好矩阵也好从来不会出现半个这个情况的 学习笔记:GoogLeNet lynnandwei mic1233: 谢谢你告诉我, 这个博客发表于2015年,当当上显示那本书印刷时间是2016。 ……不言而喻 。 学习笔记:GoogLeNet weixin_40281618: 请问博主用的哪个数据集,那只猫不知道是哪个。