1
而不是使用命令行運行的程序包的,我做了一個啓動文件添加ARG啓動文件
COMMANDE行:
rosrun image_view image_saver image:=/the-rgb-image-topic
啓動文件:
<launch>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
<remap from="image" to="/camera/rgb/image_raw"/>
</node>
</launch>
現在我想對此也一樣:
rosrun image_view image_saver image:=/camera/depth/image _encoding:=16UC1
我如何參數添加到啓動文件..
我想我應該開始這樣說,這
<launch>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
<remap from="image" to="/camera/rgb/image_raw"/>
<node name="extract" pkg="image_view" type="extract_images" respawn="false" output="screen" cwd="ROS_HOME">
<remap from="image" to="/camera/depth/image"/>
</node>
</launch>
看看到[roslaunch XML文檔(http://wiki.ros.org/roslaunch/XML ),特別是[''標籤](http://wiki.ros.org/roslaunch/XML/arg)。 –
alextoind
@alextoind:如果我理解正確,OP想要在啓動文件中設置參數。啓動時會使用'arg'標記將參數傳遞給啓動文件。 – luator
@luator,可能你是對的,但你也可以使用''標籤的'default'屬性來提供默認行爲,如你的答案和對該參數的外部訪問(如果需要的話)。 –
alextoind