Navigation

    蓝鲸ROS机器人论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    ROS交流群
    ROS Group
    产品服务
    Product Service
    开源代码库
    Github
    官网
    Official website
    技术交流
    Technological exchanges
    激光雷达
    LIDAR
    ROS教程
    ROS Tourials
    深度学习
    Deep Learning
    机器视觉
    Computer Vision

    ROS node的参数的默认值

    技术交流
    1
    1
    2788
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • frank
      frank last edited by frank

      ros的node支持传入缺省参数,这些参数可以在程序中设置默认值,通常c++用法

      nh.param("参数名字",对应变量,默认值);
      

      注意点: 参数名字的命名空间是node的名字,node启动时如果配置了这个参数,这个参数值会一直保存到roscore结束,而不是随着node的结束而删除;当这个node再次启动时,如果此时没有传入参数值,它将使用上次node启动设置的值,而不是默认值。

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright © 2015-2021 BlueWhale community