本文主要介绍与camera相关的一些内容,其中首先介绍在ros中使用camera,其次给出了visca库的使用方法,之后我给该库做了一个简单的ros的封装,还有待于改善,最后是一个开源的机载云台。

use ros to read camera

如果是UVC版本的camera,可以是用uvc_camera and image_view 来读取和显示图像。

sudo apt-get install ros-indigo-uvc-camera
sudo apt-get install ros-indigo-image-view

node is called by

$rosrun uvc_camera uvc_camera_node
$rosrun image_view image_view image:=/image_raw

we can check the ros topics

rostopic list

launch file

<launch><node name="uvc_camera" pkg="uvc_camera" type="uvc_camera_node" output="screen" ></node><node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen"><remap from="image" to="/image_raw"/></node>
</launch>

也可以使用另外一个usb_cam的驱动

$ sudo apt-get install ros-indigo-usb-camera

因此所使用launch文件是这样的。

<launch><node name="usb_cam" pkg="usb_cam" type="usb_cam_node" output="screen" ><param name="video_device" value="/dev/video0" /><param name="image_width" value="640" /><param name="image_height" value="480" /><param name="pixel_format" value="mjpeg" /><param name="camera_frame_id" value="usb_cam" /><param name="io_method" value="mmap"/></node><node name="image_view" pkg="image_view" type="image_view" respawn="false" output="screen"><remap from="image" to="/usb_cam/image_raw"/><param name="autosize" value="true" /></node>
</launch>

refer

  1. http://www.voidcn.com/blog/tianyi1991/article/p-4719380.html
  2. http://www.voidcn.com/blog/u013453604/article/p-2088068.html
  3. http://blog.csdn.net/heyijia0327/article/details/41623419
  4. http://blog.csdn.net/jasmine_shine/article/details/46715099

libVISCA

libVISCA is a library for controlling a VISCA(tm) compliant camera through the RS232 port of your PC. VISCA, on its side, is a protocol developed by Sony so that a lot of machine vision cameras from Sony are compliant with VISCA. Typical cameras include the FCB-IX47 family of camera block for OEMs. Note that other devices, such as VCRs, can be controlled. Drop me a line f you know other functions that you would like to be implemented and for which you have the opcodes.
The VISCA protocol makes it possible to control multiple cameras that are chained together. The RS232 cable goes from computer to one camera and the camera connects to the next camera, etc.
There is a forked version of libVISCA available at https://github.com/mkoppanen/libVISCA2
This was tested with:
Sony EVI D70p
The chaining mechanism wasn’t tested yet due to lack of suitable cable.
Building

$ tar -xzf libvisca-2.0.0.tar.gz
$ cd libvisca-2.0.0
$ mkdir build
$ cd build
$ cmake ..
$ make

Also, a preliminary RPM package is available from http://fkooman.fedorapeople.org/libvisca/.
Running

This was tested with a RS232 to VISCA cable using a usb2serial device to make it work as a serial device on ttyUSB3. In order to run the included test, we did the following:

$ sudo ./testvisca /dev/ttyUSB3

Some camera info:

vendor: 0x0001
model: 0x040e
ROM version: 0x0105
socket number: 0x02
Zoom value: 0x1234
power status: 0x02
Setting pan tilt home
Setting pan tilt absolute position
Absolute position, Pan value: -16, Tilt value: 15
Setting pan tilt absolute position
Absolute position, Pan value: -16, Tilt value: 15
Setting pan tilt home
libvisca should also work on Windows (untested).
Mac OS X

libvisca works on Mac OS X after PL2303 Driver has been installed. The open source driver can be found here: http://osx-pl2303.sourceforge.net/
After the driver installation the following command can be used to run testvisca:

$ ls -l  /dev/tty.PL2303-*
crw-rw-rw-  1 root  wheel   10,  32 13 Apr 12:00 /dev/tty.PL2303-00002006
$ ./testvisca /dev/tty.PL2303-00002006
Windows

When using USB to RS232 adapter the address for the serial port is usually COM3. So the following testvisca command should work:
testvisca COM3
Hardware

The following RS232 cable has been tested to work on Mac OS X: Startech USB to RS-232 Serial DB9 Adapter
Cable

Visca cable wiring diagram: http://www.chuktech.net/video/visca_connector_and_wiring.pdf
简介:这是一个canera control librarry.
依赖:../visca/libvisca.h
重要函数: setZoomValue –> VISCA_set_zoom_value
getZoomValue –> VSICA_get_zoom_value

初始化:定义 VISCAInterface_t 和一个VISCACAmera_t型的变量。
然后是解析argv参数,(主要是读出串口号,串口设备),然后打开该串口,读取camera information. 所有的信息存储在VISCAcamera_t型变量中,其中信息包含vendor,model, rom version, and socket number.

sleep(500000);

如果需要用到手动聚焦的模式,给lib中没有,需要改动libvisca.c
在libvisca.c中增加

VISCA_set_focus_mode_manual(VISCAInterface_t *iface, VISCACamera_t *camera)
{VISCAPacket_t packet;_VISCA_init_packet(&packet);_VISCA_append_byte(&packet, VISCA_COMMAND);_VISCA_append_byte(&packet, VISCA_CATEGORY_CAMERA1);_VISCA_append_byte(&packet, VISCA_FOCUS_AUTO);_VISCA_append_byte(&packet, VISCA_FOCUS_AUTO_OFF);return _VISCA_send_packet_with_reply(iface, camera, &packet);
}VISCA_set_focus_mode_auto(VISCAInterface_t *iface, VISCACamera_t *camera)
{VISCAPacket_t packet;_VISCA_init_packet(&packet);_VISCA_append_byte(&packet, VISCA_COMMAND);_VISCA_append_byte(&packet, VISCA_CATEGORY_CAMERA1);_VISCA_append_byte(&packet, VISCA_FOCUS_AUTO);_VISCA_append_byte(&packet, VISCA_FOCUS_AUTO_ON);return _VISCA_send_packet_with_reply(iface, camera, &packet);
}

在libvisca.h中增加

VISCA_set_focus_mode_manual(VISCAInterface_t *iface, VISCACamera_t *camera);VISCA_set_focus_mode_auto(VISCAInterface_t *iface, VISCACamera_t *camera);

即可。

ros warper for VISCA

这里不适合使用message定期发布zoom value,因此使用了service,server节点发布service

ros::ServiceServer visca_service = nh.advertiseService("zoom_service_calbak", &viscaControl::zoom_service_calbak,&m_VSCtrl);

用户节点订阅service

ros::ServiceClient visca_client = nh.serviceClient<visca::gs_zv>("zoom_service_calbak");

这里使用srv文件

int32 set_zv
---
int32 get_zv

service 回调函数

bool viscaControl::zoom_service_calbak( visca::gs_zv::Request &req,visca::gs_zv::Response &res)
{if (req.set_zv >= 0 ){setZoomValue(req.set_zv);}ros::Duration(0.1).sleep();if(VISCA_get_zoom_value(&iface,&camera,&zoom_value)!=VISCA_SUCCESS)fprintf(stderr,"error getting zoom value");elsefprintf(stderr,"get zoom value %x",zoom_value);res.get_zv = zoom_value;
}

注意这个回调函数的返回值应该是bool类型的。

云台

本文中主要介绍记载云台,按照电机分类,比较新的是无刷电机电机,另外有舵机云台等。我们这里主要介绍无刷电机云台,机载云台,使用2各陀螺仪,一个置于主控板上,一个置于末端。另有无刷电机控制器(brushless motor controller)。
开源云台
ardupilot stom32,这时一个开源的3轴云台,因此如果想深入研究云台的制作等,可以参考该设计。
wiki page关于该云台的教程,使用方法,github page都在其中.
我在组装飞机的时候买了一个xcam的云台,发现,无法读取 3 axis的角度。因此用的欲望不大。

Camera in ROS and VISCA相关推荐

  1. 去掉Echarts饼状图的引导线

    <!DOCTYPE html> <html><head><meta charset="utf-8"><title>五分钟 ...

  2. Linux学习之ROS的uvc camera(笔记本的摄像头)

    相机相当于机器人的眼睛.从相机获得的图像对于识别机器人周围的环境非常有用. 例如,利用相机图像的对象识别和脸部识别:使用两台相机(立体相机)从两个不同图像 之间的差异获得的距离值:利用距离值生成3维地 ...

  3. 使用ros发布UVC相机和串口IMU数据

    1.目的:为了可以标定普通USB相机和固定在相机上的外置IMU的外参,我希望通过ROS获取更高分辨率和更高频率的图像数据,并且可以将图像和imu的topic发布出来,直接使用rosbag record ...

  4. ROS 学习系列 -- iRobot 第二代机座 Roomba 作为Turtlebot使用时无法开关机

     iRobot 推出了第二代机座 Roomba来取代Create.  这是一个绿脸的机座. 如果使用在turtlebot上,几乎是完全兼容的,不用该什么代码,但是波特率提高了一倍,所以需要更改环境 ...

  5. ros电脑摄像头标定,并用rviz查看

    目录 一.环境配置 1. 安装openncv 2. 安装ros 二.摄像头的标定 三.rviz进行查看摄像头图像 一.环境配置 镜像采用的是ubuntu18 安装的ros版本:melodic 1. 安 ...

  6. AprilTag_ros的使用

    目录 前言 一. usb摄像头的安装和使用 ​ 二.AprilTag_ros包的安装 三.单目摄像机的标定 四.AprilTag_ros的使用 五.其他 前言 平台:VM虚拟机 ROS版本:noeti ...

  7. woge.xyz index.php,ghowoght

    修改 1.0 添加一个点云建图线程,接收来自 Tracking线程的关键帧. 使用 彩色图和深度图 生成点云 对关键帧 的 彩色图 使用 mobilenetv2-ssd-lite 进行目标检测. 对每 ...

  8. 十五. 单线激光雷达和视觉信息融合

    单线激光雷达和视觉信息融合案例 很多智能应用场景涉及到激光雷达和相机视觉信息融合,一般都是指多线激光雷达,至少也得16线激光吧;但多线激光雷达动不动数万的价格,让很多技术人员无法尝试.我尝试使用微型机 ...

  9. SLAM算法实习生——两周工作经验总结

    SLAM算法实习生--两周工作经验总结 首先,非常幸运能够以SLAM算法工程师的身份实习 来总结一下这两周的工作情况,搭建并测试了以下几种slam平台: 1, ROS indigo+ORB-SLAM2 ...

最新文章

  1. SpringJpa多对多映射关系
  2. python迭代列表_Python迭代列表中列的元素
  3. LPC55S69 IoT Kit专属 Micropython模组和库函数简介
  4. 《github一天一道算法题》:分治法求数组最大连续子序列和
  5. 支持向量机原理(二)
  6. 创建商品类java_SSH框架网上商城项目第9战之添加和更新商品类别功能实现
  7. Oracle Rman 命令详解(List report backup configure)
  8. 一步步编写操作系统 56 门、调用门与RPL序 1
  9. 【JAVA基础篇】运算符
  10. Problem E:结构体---点坐标结构体
  11. 【LoadRunner技术讲座8】LoadRunner函数中的几个陷阱
  12. Linux 中的 【 TOP 】 命令,查看CUP的使用率
  13. ASP.NET Core MVC 源码学习:详解 Action 的激活
  14. h5故障代码_H5故障与内机有关?
  15. 计算机基础知识试题及答案填空题,计算机基础知识练习题及答案解析
  16. Phototshop三种蒙版(图层蒙版、剪贴蒙版、快速蒙版)的基础使用。
  17. office 论文 页码_毕业论文页码格式word操作
  18. Uptime-Kuma 一个花哨的开源监控工具
  19. 关于纳什均衡与博弈论
  20. python mysqldb 安装_python MySQLdb在windows环境下的快速安装、问题解决方式

热门文章

  1. kaggle竞赛 | Quora Question Pairs | 判断相似的Question
  2. (2)组合数学-拉丁方
  3. 基于用户画像的电影推荐系统论文
  4. Qt窗口置顶的俩种方法
  5. AK F.*ing leetcode 流浪计划之线段树
  6. 丽江旅游景点以一城一山一湖 150
  7. [Oracle datagard]从库恢复之 ORA-16032: parameter ORA-07286:问题
  8. DP/eDP协议学习--协议简介
  9. html垂直居中方案及示例
  10. HBuilder X 下载安装内置浏览器失败