ros2+<arg>/<env>/<set_env>/<env>/<param>比较

2023-12-16 05:19:08

<env>

  • Available in ROS 1.

  • Sets an environment variable.

  • It has been replaced with?env,?set_env?and?unset_env:

    • env?can only be used nested in a?node?or?executable?tag.?if?and?unless?tags aren’t supported.

    • set_env?can be nested within the root tag?launch?or in?group?tags. It accepts the same attributes as?env, and also?if?and?unless?tags.

    • unset_env?unsets an environment variable. It accepts a?name?attribute and conditionals.

arg?

  • Available in ROS 1.

  • arg?is used for declaring a launch argument, or to pass an argument when using?include?tags.

  • Differences from ROS 1:

    • value?attribute is not allowed. Use?let?tag for this.

    • doc?is now?description.

    • When nested within an?include?tag,?if,?unless, and?description?attributes aren’t allowed.

param?

  • Available in ROS 1.

  • Used for passing a parameter to a node.

  • There’s no global parameter concept in ROS 2. For that reason, it can only be used nested in a?node?tag. Some attributes aren’t supported in ROS 2:?type,?textfile,?binfile,?executable.

  • The?command?attribute is now?value="$(command?'...'?)".

文章来源:https://blog.csdn.net/geniusChinaHN/article/details/135027281
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。