Ubuntu18.04+ROS+ 乐视三合一深度相机配置使用
生活随笔
收集整理的這篇文章主要介紹了
Ubuntu18.04+ROS+ 乐视三合一深度相机配置使用
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
一、相關配置
1.安裝依賴
sudo apt install ros-$ROS_DISTRO-rgbd-launch ros-$ROS_DISTRO-libuvc ros-$ROS_DISTRO-libuvc-camera ros-$ROS_DISTRO-libuvc-ros2.建立工作空間
mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ catkin_make source devel/setup.bash3.克隆代碼
cd ~/catkin_ws/src git clone https://github.com/orbbec/ros_astra_camera4.創建 udev 規則
roscd astra_camera sudo sh ./scripts/create_udev_rules5.編譯
cd ~/catkin_ws catkin_make --pkg astra_camera6.修改astrapro.launch
6.1 首先查看自己的攝像頭接口號
lsusb?可以看出我的RGB是0501,深度是0403。
6.2 修改Astrapro.launch
cd rgbd_ws/src/ros_astra_camera/launch/ gedit astrapro.launch?將其中的RGB修改為自己的攝像頭所對應的RGB號。
二、獲取深度圖像、RGB圖像
1.啟動
1.0 刷新一下環境
source ~/catkin_ws/devel/setup.bash1.1 先啟動roscore
roscore1.2 在啟動rviz
rosrun rviz rviz?1.3 最后啟動攝像頭
roslaunch astra_camera astrapro.launch2. 顯示深度圖像和RGB圖像
打開rviz下面的Add選項
?
即可獲取深度圖像和RGB圖像。
三、獲取彩色點云圖像
1. 新建rviz文件
cd ~/catkin_ws/src mkdir rviz cd rviz touch depth_camera.rviz2. 使用gedit編輯rviz文件
cd ~/catkin_ws/src/rviz sudo gedit depth_camera.rviz填寫代碼如下:
Panels:- Class: rviz/DisplaysHelp Height: 88Name: DisplaysProperty Tree Widget:Expanded:- /Global Options1- /Status1- /Grid1- /PointCloud21Splitter Ratio: 0.5Tree Height: 453- Class: rviz/SelectionName: Selection- Class: rviz/Tool PropertiesExpanded:- /2D Pose Estimate1- /2D Nav Goal1- /Publish Point1Name: Tool PropertiesSplitter Ratio: 0.588679016- Class: rviz/ViewsExpanded:- /Current View1Name: ViewsSplitter Ratio: 0.5- Class: rviz/TimeExperimental: falseName: TimeSyncMode: 0SyncSource: PointCloud2 Visualization Manager:Class: ""Displays:- Alpha: 0.5Cell Size: 1Class: rviz/GridColor: 159; 147; 147Enabled: trueLine Style:Line Width: 0.0299999993Value: LinesName: GridNormal Cell Count: 0Offset:X: 0Y: 0Z: 0Plane: XZPlane Cell Count: 10Reference Frame: camera_depth_optical_frameValue: true- Alpha: 1Autocompute Intensity Bounds: trueAutocompute Value Bounds:Max Value: 8.875Min Value: 1.28500009Value: trueAxis: XChannel Name: intensityClass: rviz/PointCloud2Color: 255; 255; 255Color Transformer: AxisColorDecay Time: 0Enabled: trueInvert Rainbow: falseMax Color: 255; 255; 255Max Intensity: 4096Min Color: 0; 0; 0Min Intensity: 0Name: PointCloud2Position Transformer: XYZQueue Size: 10Selectable: trueSize (Pixels): 3Size (m): 0.00999999978Style: SquaresTopic: /camera/depth/pointsUnreliable: falseUse Fixed Frame: trueUse rainbow: trueValue: trueEnabled: trueGlobal Options:Background Color: 48; 48; 48Default Light: trueFixed Frame: camera_depth_frameFrame Rate: 30Name: rootTools:- Class: rviz/InteractHide Inactive Objects: true- Class: rviz/MoveCamera- Class: rviz/Select- Class: rviz/FocusCamera- Class: rviz/Measure- Class: rviz/SetInitialPoseTopic: /initialpose- Class: rviz/SetGoalTopic: /move_base_simple/goal- Class: rviz/PublishPointSingle click: trueTopic: /clicked_pointValue: trueViews:Current:Class: rviz/OrbitDistance: 7.51409006Enable Stereo Rendering:Stereo Eye Separation: 0.0599999987Stereo Focal Distance: 1Swap Stereo Eyes: falseValue: falseFocal Point:X: 2.80641723Y: -0.0263374168Z: -0.295807391Focal Shape Fixed Size: trueFocal Shape Size: 0.0500000007Invert Z Axis: falseName: Current ViewNear Clip Distance: 0.00999999978Pitch: 0.305203468Target Frame: <Fixed Frame>Value: Orbit (rviz)Yaw: 3.89040422Saved: ~ Window Geometry:Displays:collapsed: falseHeight: 744Hide Left Dock: falseHide Right Dock: trueQMainWindow State: 000000ff00000000fd00000004000000000000016a0000025efc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f0070006500720074006900650073020000019b000001b500000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c00610079007301000000280000025e000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006500000001a9000001430000000000000000000000010000010f000002c4fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730000000028000002c4000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000005150000003efc0100000002fb0000000800540069006d00650100000000000005150000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000003a50000025e00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000Selection:collapsed: falseTime:collapsed: falseTool Properties:collapsed: falseViews:collapsed: trueWidth: 1301X: 65Y: 243. 在rviz中顯示點云
按照上節方法打開深度相機和rviz,然后找到rviz左上角:File -> Open config,打開剛剛新建的depth_camera.rviz文件即可。
總結
以上是生活随笔為你收集整理的Ubuntu18.04+ROS+ 乐视三合一深度相机配置使用的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《Android 应用案例开发大全(第3
- 下一篇: 某宝移动端用户行为分析---PYTHON