因為在tabletop_object_detector這個package裡面的tabletop_segmentation.launch用到了大量的if和unless,所以稍微研究了一下if跟unless的用法(可以用rosed tabletop_object_detector tabletop_segmentation.launch看看)
在這個launch file中,我們可以透過條件的用法來指定要用那一組參數
例如說(我把node部份簡化)
<launch>
<node>
<param if=”$(arg tabletop_segmentation_convert_to_base_link)” name=”processing_frame” value=”base_link” />
<param unless=”$(arg tabletop_segmentation_convert_to_base_link)” name=”processing_frame” value=”” />
</node>
</launch>
如果tabletop_segmentation_convert_to_base_link這個arg是true,if那行會過,processing_frame的值會被設為base_link,反之若tabletop_segmentation_convert_to_base_link是false,unless那行會過,processing_frame的值會被設為None