ROS 中的camera支持

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。


在ros中有很多的camera包了,提供了非常好的camera支持。针对我的kinetic 可以搜素一下看看。

$ apt-cache  search  camera | grep ros-kinetic
ros-kinetic-astra-camera - Drivers for Orbbec Astra Devices.
ros-kinetic-avt-vimba-camera - Wrapper of the Allied Vision Technologies (AVT) VIMBA Ethernet and Firewire SDK.
ros-kinetic-axis-camera - Python ROS drivers for accessing an Axis camera's MJPG stream.
ros-kinetic-camera-calibration - camera_calibration allows easy calibration of monocular or stereo cameras using a checkerboard calibration target.
ros-kinetic-camera-calibration-parsers - camera_calibration_parsers contains routines for reading and writing camera calibration parameters.
ros-kinetic-camera-info-manager - This package provides a C++ interface for camera calibration information.
ros-kinetic-camera-info-manager-py - Python interface for camera calibration information.
ros-kinetic-camera-umd - UMD camera metapackage
ros-kinetic-camera1394 - ROS driver for devices supporting the IEEE 1394 Digital Camera (IIDC) protocol.
ros-kinetic-cob-camera-sensors - For more information read the readme.htm file located in
ros-kinetic-cob-driver - The cob_driver stack includes packages that provide access to the Care-O-bot hardware through ROS messages, services and actions.
ros-kinetic-cob-image-flip - Flips the image of Care-O-bots kinect in dependence of the viewing direction of the cameras to receive an upright image all the time.
ros-kinetic-common-msgs - common_msgs contains messages that are widely used by other ROS packages.
ros-kinetic-cv-camera - cv_camera uses OpenCV capture object to capture camera image.
ros-kinetic-depth-image-proc - Contains nodelets for processing depth images such as those produced by OpenNI camera.
ros-kinetic-ecto-image-pipeline - Common tools for image based pipelines.
ros-kinetic-flir-camera-driver - A set of drivers for Flir cameras based on the Spinnaker SDK.
ros-kinetic-freenect-camera - A libfreenect-based ROS driver for the Microsoft Kinect.
ros-kinetic-freenect-launch - Launch files for freenect_camera to produce rectified, registered or disparity images.
ros-kinetic-gscam - A ROS camera driver that uses gstreamer to connect to devices such as webcams.
ros-kinetic-hector-gazebo-thermal-camera - hector_gazebo_thermal_camera provides a gazebo plugin that produces simulated thermal camera images.
ros-kinetic-hironx-calibration - Launch and configuration files for calibrating hironx using the generic calibration_setup_helper package.
ros-kinetic-image-exposure-msgs - Messages related to the Point Grey camera driver.
ros-kinetic-image-geometry - `image_geometry` contains C++ and Python libraries for interpreting images geometrically.
ros-kinetic-image-pipeline - image_pipeline fills the gap between getting raw images from a camera driver and higher-level vision processing.
ros-kinetic-image-rotate - Contains a node that rotates an image stream in a way that minimizes the angle between a vector in some arbitrary frame and a vector in the camera frame.
ros-kinetic-ipcamera-driver - Simple node to publish regular IP camera video streams to a ros topic.
ros-kinetic-librealsense - Library for capturing data from the Intel(R) RealSense(TM) F200, SR300, R200, LR200 and ZR300 cameras.
ros-kinetic-libuvc-camera - USB Video Class camera driver
ros-kinetic-look-at-pose - Rotate camera to look at a given pose.
ros-kinetic-naoqi-driver-py - Python implementation of the driver package for the Naoqi robot, providing access to walking commands, joint angles, and sensor data (odometry, IMU, ...).
ros-kinetic-naoqi-sensors-py - ROS driver for miscellaneous sensors on NAO.
ros-kinetic-nextage-calibration - This package provides .launch files and other tools for calibrating the head-mount cameras to the NEXTAGE Open robot.
ros-kinetic-o3m151-driver - ROS device driver for Ifm O3M151 TOF camera.
ros-kinetic-op3-camera-setting-tool - The op3_camera_setting_tool package
ros-kinetic-openni-camera - A ROS driver for OpenNI depth (+ RGB) cameras.
ros-kinetic-openni2-camera - Drivers for the Asus Xtion and Primesense Devices.
ros-kinetic-openni2-launch - Launch files to start the openni2_camera drivers using rgbd_launch.
ros-kinetic-opt-camera - opt_camera
ros-kinetic-pointgrey-camera-description - URDF descriptions for Point Grey cameras
ros-kinetic-pointgrey-camera-driver - Point Grey camera driver based on libflycapture2.
ros-kinetic-polled-camera - polled_camera contains a service and C++ helper classes for implementing a polled camera driver node and requesting images from it.
ros-kinetic-pr2-camera-synchronizer - The PR2 is equipped with a texture projector that can be used to project a texture onto featureless surfaces, allowing their three-dimensional structure to be determined using stereoscopy.
ros-kinetic-pr2-hardware-interface - This package contains the C++ interfaces to the PR2 hardware components that are controlled over EtherCAT.
ros-kinetic-prosilica-camera - A ROS driver node for AVT/Prosilica Gigabit Ethernet (GigE) cameras.
ros-kinetic-rc-dynamics-api - The rc_dynamics_api provides an API for easy handling of the dynamic-state data streams provided by Roboception's stereo camera with self-localization.
ros-kinetic-rc-genicam-api - GenICam/GigE Vision Convenience Layer.
ros-kinetic-realsense-camera - RealSense Camera package allowing access to Intel 3D cameras and advanced modules
ros-kinetic-romeo-sensors-py - Package that adds the depth camera to Romeo
ros-kinetic-rqt-moveit - An rqt-based tool that assists monitoring tasks for MoveIt! motion planner developers and users.
ros-kinetic-sensor-msgs - This package defines messages for commonly used sensors, including cameras and scanning laser rangefinders.
ros-kinetic-sick-visionary-t - Open source driver for the SICK Visionary-T 3D TOF camera.
ros-kinetic-sick-visionary-t-driver - Open source driver for the SICK Visionary-T 3D TOF camera.
ros-kinetic-spinnaker-camera-driver - Spinnaker camera driver based on Spinnaker.
ros-kinetic-statistics-msgs - Messages related to the Point Grey camera driver.
ros-kinetic-turtlebot3-autorace-camera - TurtleBot3 AutoRace ROS package that controls Raspberry Pi Camera, and process the image
ros-kinetic-tuw-ellipses - The tuw_ellipses package contains a computer vision library which is able to detect ellipses within images.
ros-kinetic-ueye - Driver for IDS Imaging uEye cameras.
ros-kinetic-ueye-cam - A ROS nodelet and node that wraps the driver API for UEye cameras by IDS Imaging Development Systems GMBH.
ros-kinetic-usb-cam - A ROS Driver for V4L USB Cameras
ros-kinetic-uvc-camera - A collection of node(let)s that stream images from USB cameras (UVC) and provide CameraInfo messages to consumers.
ros-kinetic-video-stream-opencv - The video_stream_opencv package contains a node to publish a video stream (the protocols that opencv supports are supported, including rtsp, webcams on /dev/video and video files) in ROS image topics, it supports camera info and basic image flipping (horizontal, vertical or both) capabilities, also adjusting publishing rate.
ros-kinetic-view-controller-msgs - Messages for (camera) view controllers
ros-kinetic-visp-auto-tracker - Online automated pattern-based object tracker relying on visual servoing.
ros-kinetic-visp-camera-calibration - visp_camera_calibration allows easy calibration of cameras using a customizable pattern and ViSP library.
ros-kinetic-visp-hand2eye-calibration - visp_hand2eye_calibration estimates the camera position with respect to its effector using the ViSP library.
ros-kinetic-visp-tracker - Wraps the ViSP moving edge tracker provided by the ViSP visual servoing library into a ROS package.
ros-kinetic-wfov-camera-msgs - Messages related to the Point Grey camera driver.
ros-kinetic-wge100-camera - A ROS node and assorted tools to provide access to the WGE100 camera used in the forearms and the stereo cameras of the PR2 robot.
ros-kinetic-wge100-camera-firmware - Source for the WGE100 Ethernet camera: Verilog source for the FPGA, Forth source for the camera firmware.
ros-kinetic-wge100-driver - This stack contains the ROS driver and firmware for the WGE100 camera used on the PR2 robot.
ros-kinetic-wiimote - The wiimote package allows ROS nodes to communicate with a Nintendo Wiimote and its related peripherals, including the Nunchuk, Motion Plus, and (experimentally) the Classic.
ros-kinetic-xiaoqiang-depth-image-proc - Modified version of depth image process, add occupancy xyz Contains nodelets for processing depth images such as those produced by OpenNI camera.
ros-kinetic-xiaoqiang-freenect-camera - A libfreenect-based ROS driver for the Microsoft Kinect.
ros-kinetic-xiaoqiang-freenect-launch - Launch files for xiaoqiang_freenect_camera to produce rectified, registered or disparity images.


uvc-camera – ros-kinetic-uvc-camera


$ apt-cache search ros-kinetic-uvc*
ros-kinetic-uvc-camera - A collection of node(let)s that stream images from USB cameras (UVC) and provide CameraInfo messages to consumers.
$ sudo apt-get install ros-kinetic-uvc-camera 

$ rospack profile 





$ rosrun uvc_camera uvc_camera_node 
[ INFO] [1539733994.303287863]: using default calibration URL
[ INFO] [1539733994.303379696]: camera calibration URL: file:///home/david/.ros/camera_info/camera.yaml
[ INFO] [1539733994.303427543]: Unable to open camera calibration file [/home/david/.ros/camera_info/camera.yaml]
[ WARN] [1539733994.303453278]: Camera calibration file /home/david/.ros/camera_info/camera.yaml not found.
opening /dev/video0
pixfmt 0 = 'YUYV' desc = 'YUYV 4:2:2'
  discrete: 320x240:   1/30 
  discrete: 640x480:   1/30 
pixfmt 1 = 'MJPG' desc = 'Motion-JPEG'
  discrete: 1280x720:   1/30 

show the image/video

$ rosrun image_view image_view image:=/image_raw
[ INFO] [1539699406.532269649]: Using transport "raw"

And now, you can see a window and show the camera video.


install the usb-camera

$ apt-cache search ros-kinetic-usb
ros-kinetic-usb-cam - A ROS Driver for V4L USB Cameras

install it:

$ sudo apt-get install ros-kinetic-usb-cam 

update the ros pack env.

$ rospack profile 

Test the usb-camera

as you known, begin run an ros node or launch, just start roscore.

$ roslaunch usb_cam usb_cam-test.launch 

... logging to /home/david/.ros/log/5c16034e-d14e-11e8-8d84-001c420ce04e/roslaunch-david-14455.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://david:40285/


 * /image_view/autosize: True
 * /rosdistro: kinetic
 * /rosversion: 1.12.14
 * /usb_cam/camera_frame_id: usb_cam
 * /usb_cam/image_height: 480
 * /usb_cam/image_width: 640
 * /usb_cam/io_method: mmap
 * /usb_cam/pixel_format: yuyv
 * /usb_cam/video_device: /dev/video0

    image_view (image_view/image_view)
    usb_cam (usb_cam/usb_cam_node)


process[usb_cam-1]: started with pid [14472]
process[image_view-2]: started with pid [14473]
[ INFO] [1539699553.695840455]: using default calibration URL
[ INFO] [1539699553.695911035]: camera calibration URL: file:///home/david/.ros/camera_info/head_camera.yaml
[ INFO] [1539699553.695963296]: Unable to open camera calibration file [/home/david/.ros/camera_info/head_camera.yaml]
[ WARN] [1539699553.695987994]: Camera calibration file /home/david/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1539699553.696008195]: Starting 'head_camera' (/dev/video0) at 640x480 via mmap (yuyv) at 30 FPS
[ INFO] [1539699553.724149399]: Using transport "raw"





各位大侠,小弟最近尝试在 android2.2上实现支持双camera,因为实在是太菜了,于是乎在网上搜索一番,找到了Wangxiaozhe的一篇《Android2.2平台上支持多camera》,这篇文章对我帮助很大,但是我的情况还不太一样,先说下我现在的思路:rn1:在Settings.apk中添加一个选项,选择是前置还是后置camera, 将这个index保存在java/android/provider/Settings.java中。rn2:修改camera.apk,在camera.apk初始化的时候获取java/android/provider/Settings.java中的index值,通过frramework层,一路下去告知camera hal层选择了哪个camera.rn这种情况,我已经可以实现了,但是这样做有个问题,其余类似camera的apk就没法去打开正确的camera。也就是说,如果在Settings中选择了另外一个camera,在打开别的camera apk时,是不会有效果的。所以我在想,应该把通知camera hal层是哪个camera 被选中的代码加在framework层,即Framework/base/core/java/android/hardware/camera.java中,因为所有的camera apk都会调用到这个文件,但是问题来了,在这里面怎么去获得java/android/provider/Settings.java中的值呢?用rnContentResolver resolver = getContentResolver();rnmCameraId = Integer.parseInt(String.valueOf(Settings.System.getInt(resolver, CAMERA_INDEX, DEFAULT_CAMERA_INDEX)));;rn会报错,但这两行代码在camera.apk中是可以用的。rnrn各位大侠有什么建议意见,或者更好的解决办法吗,在此谢过了!!rnrn 论坛