Depthimage_to_laserscan安裝並執行,執行清潔安裝
Depthimage_to_laserscan安裝並執行
(前提:以正確安裝kinect驅動)
1、下載fuerte版本的,並放在ros的執行路徑,即ROS_PACKAGE_PATH。
2、執行roscore。
3、執行make,make all,maketest,在bin檔案裡會產生3個可執行檔,分別是
depthimage_to_laserscan,libtest,test_dtl。其中depthimage_to_laserscan為主要節點。
4、執行rostopic list –v,會有很多camera下的話題,包括訂閱的話題scan。
5、mkdir構建.launch檔案,並加入以下內容。
-------------簡潔版----------------
<launch>
<nodepkg="depthimage_to_laserscan" type="depthimage_to_laserscan"name="depthimage_to_laserscan" args= “standalone depthimage_to_lasersacn/DepthImageToLaserScanNodelet”>
<remap from="image" to="/camera/depth_registered/image_raw"/>
<remap from="camera_info" to="/camera/depth_registered/camera_info"/>
<remap from="scan" to="/kinect_scan"/>
<param name="range_max" type="double"value="4"/>
</node>
</launch>
-----------------------------------
----------- depthimage_to_laserscan節點---------
發布的話題:
Image(sensor_msgs/Image)
Camera_info(sensor_msgs/CameraInfo)
訂閱的話題:
Scan(sensor_msgs/LaserScan)
6、執行roslaunch 包名 .launch檔案
7、在.launch檔案中載入openni.launch檔案(因為要啟動ASUSXtion pro live網路攝影機),launch檔案必須包含網路攝影機節點資訊。
以下就是在一個包裡嵌套其它的包。
如下:
---------------------包含openni.launch檔案-----------------------
<launch>
<include file="$(find openni_launch)/launch/openni.launch"/ >
<nodepkg="depthimage_to_laserscan" type="depthimage_to_laserscan"name="depthimage_to_laserscan" args= “standalone depthimage_to_lasersacn/DepthImageToLaserScanNodelet /camera/rgb/image_viewer”>
<remap from="image" to="/camera/depth_registered/image_raw"/>
<remap from="camera_info"to="/camera/depth_registered/camera_info"/>
<remap from="scan" to="/kinect_scan"/>
<param name="range_max"type="double" value="4"/>
</node>
</launch>
--------------------------------------------
8、執行roslaunch depthimage_to_laserscan depthimage_to_laserscan.launch
執行 rosrun depthimage_to_laserscan depthimage_to_laserscanimage:=/camera/depth/image_raw
9、執行rosrun rviz rviz,添加camera和laserscan,就能正確輸出depth image和偽雷射點,如下所示:
10、附件
複雜的.launch檔案
-------------------------------------------
<launch>
<!-- "camera" should uniquelyidentify the device. All topics are pushed down
into the "camera" namespace, and it is prepended to tf frameids. -->
<arg name="camera" default="camera"/>
<arg name="publish_tf" default="true"/>
<!-- Factory-calibrated depth registration -->
<arg name="depth_registration" default="true"/>
<arg if="$(argdepth_registration)" name="depth"value="depth_registered" />
<arg unless="$(arg depth_registration)"name="depth" value="depth" />
<!--Driver parameters -->
<arg name="color_depth_synchronization" default="false" />
<arg name="auto_exposure" default="true"/>
<arg name="auto_white_balance" default="true" />
<!-- Processing Modules -->
<argname="rgb_processing" default="true"/>
<arg name="ir_processing" default="true"/>
<arg name="depth_processing" default="true"/>
<arg name="depth_registered_processing" default="true"/>
<arg name="disparity_processing" default="true"/>
<arg name="disparity_registered_processing"default="true"/>
<arg name="scan_processing" default="true"/>
<!-- Worker threads for the nodelet manager -->
<arg name="num_worker_threads" default="4" />
<include file="$(findopenni_launch)/launch/openni.launch">
</include>
<!-- Laserscan topic -->
<arg name="scan_topic" default="scan"/>
<!-- Laserscan
This uses lazy subscribing, so will not activate until scan isrequested.
-->
<group if="$(arg scan_processing)">
<node pkg="depthimage_to_laserscan"type="depthimage_to_laserscan"name="depthimage_to_laserscan" args="loaddepthimage_to_laserscan/DepthImageToLaserScanNodelet $(arg camera)/$(argcamera)_nodelet_manager">
<!-- Pixel rows to use to generate the laserscan. For each column,the scan will
return the minimum value for those pixels centered vertically in theimage. -->
<param name="scan_height" value="10"/>
<param name="output_frame_id" value="/$(argcamera)_depth_frame"/>
<param name="range_min" value="0.45"/>
<remap from="image" to="$(arg camera)/$(argdepth)/image_raw"/>
<remap from="scan" to="$(arg scan_topic)"/>
<remap from="$(arg camera)/image" to="$(argcamera)/$(arg depth)/image_raw"/>
<remap from="$(arg camera)/scan" to="$(argscan_topic)"/>
</node>
</group>
</launch>
--------------------------------------------
總結:
輸入輸出就是所謂的話題,用rviz進行顯示
發布的話題:
Image(sensor_msgs/Image)
Camera_info(sensor_msgs/CameraInfo)
訂閱的話題:
Scan(sensor_msgs/LaserScan)
問題:rosmake與make的區別?
rosmake是用在rosbuild(roscreate-pkg)建立工作空間的編譯,rosbuild是ROS傳統的編譯系統,屬於老版本。
而make是對已經存在了的包進行的編譯。