当前位置:网站首页>ROS knowledge: how to realize camera access
ROS knowledge: how to realize camera access
2022-04-21 20:01:00 【Mr anhydrous】
One 、 explain
Connect the camera to ros System ,ROS Basic functions of ; What preparations are needed to access the camera ?
1) Prepare one USB The camera ;
2) Installed Ubuntu20.04、ros-neotic
Two 、 install usb_cam ROS Function pack
2.1 Generate workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
2.2 from git-hub Download the driver package
Enter the created workspace :
cd ~/catkin_ws/src
git clonehttps://github.com/bosch-ros-pkg/usb_cam.git
2.3 compile
Then go back to the workspace , Compile code :
cd~/catkin_ws
catkin_make
After compiling , Add the compiled file to the environment variable :
source devel/setup.bash
2.4 test usb_cam
First run usb_cam node :
rosrun usb_cam usb_cam_node
Run the above command and find that the camera is turned on . This is because ros released topic yes /usb_cam/image_raw.
Open a new terminal , Check it with the following command :
rostopic list
give the result as follows :
/rosout
/rosout_agg
/usb_cam/camera_info/usb_cam/image_raw
/usb_cam/image_raw/compressed
/usb_cam/image_raw/compressed/parameter_descriptions
/usb_cam/image_raw/compressed/parameter_updates
/usb_cam/image_raw/compressedDepth
/usb_cam/image_raw/compressedDepth/parameter_descriptions
/usb_cam/image_raw/compressedDepth/parameter_updates
/usb_cam/image_raw/theora
/usb_cam/image_raw/theora/parameter_descriptions
/usb_cam/image_raw/theora/parameter_updates
2.5 Open a node to view the image
We need to run the following command to see the image :
rosrun image_view image_view image:=/usb_cam/image_raw

2.6 use launch file open
direct writing launch file , So you don't need a terminal to run node, One terminal looks at the image . newly build usb_cam_test.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="yuyv" />
<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>
Then the terminal runs directly :
roslaunch usb_cam usb_cam_test.launch
3、 ... and 、 Reference article
ROS introduction :ROS Use a computer camera to run ORB_Slam2 - Ancient Moon House (guyuehome.com)
install usb_cam ROS Function pack - Simple books (jianshu.com)
stay ROS Use camera in _ I just woke up -CSDN Blog _ros The camera
版权声明
本文为[Mr anhydrous]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211939285777.html
边栏推荐
- Interesting souls are the same. It takes only 2 steps to slide the computer off
- VIM from dislike to dependence (6) -- insertion mode
- Comprehensive solution for digital construction of double prevention mechanism in hazardous chemical enterprises
- Jerry's VDDIO_ SYSVDD_ DC14 system voltage configuration description [chapter]
- 长安深蓝C385产品信息曝光 瞄准20万级别,头号目标Model 3!
- Solution of "unable to load and save data" in Eldon law ring
- 80. (leaflet chapter) leaflet calls the PostGIS data layer published by GeoServer
- PyCharm failed to create JVM
- B/S端界面控件DevExtreme ASP.NET MVC入门指南 - 模板语法(一)
- Introduction to applet project files
猜你喜欢

高端制造業企業信息化解决方案,工業電商平臺設備、數據、體系預測性維護

Yijia announced that its products will enter oppo stores in the future and will launch the group's new resources

危化品企业双预防机制数字化建设综合解决方案

接口非幂等性解决

URL to download network resources

图像中stride的含义
![[线性代数]向量究竟是什么?](/img/71/1c34808b67a12cf8b402c846293f4f.png)
[线性代数]向量究竟是什么?

Solution when the port is occupied

表面点云法线

Discussion on the hot and cold issues of open source license grounding gas
随机推荐
Jerry's system core voltage [chapter]
Experience and guidance of seniors preparing for the postgraduate entrance examination of labor health and environmental hygiene of Southeast University in 2023
【玩转Lighthouse】使用腾讯云轻量实现微信支付业务
小程序项目文件介绍
[timing] lstnet: a time series prediction model combining CNN, RNN and ar
Registration for PMP examination starts in the second half of 2022. Notice
危化品企业双预防机制数字化建设综合解决方案
Jerry's interrupt list [chapter]
B / s interface control devextreme ASP Net MVC Getting Started Guide - template syntax (I)
牛客BM40. 重建二叉树
Built in annotation explanation
PostgreSql postgres_fdw
Interface non idempotent solution
int count= cmd. ExecuteNonQuery(); There is a syntax error nearby
[play with lighthouse] use Tencent cloud to realize wechat payment business in light weight
图像中stride的含义
PyCharm failed to create JVM
一加宣布未来产品将入驻 OPPO 门店,还将首发集团新资源
80.(leaflet篇)leaflet调用geoserver发布的postgis数据图层
StopWatch