背景
参考鱼师傅的教程走,参数没保存成功
https://fishros.com/d2lros2/#/humble/chapt4/get_started/1.%E5%8F%82%E6%95%B0%EF%BC%88Param%EF%BC%89%E9%80%9A%E4%BF%A1
ros2 param dump /turtlesim
键入后无响应
查询可能原因:
1.没有存储权限
2.没有明确指明存储地
尝试指明存储路径
ros2 param dump /turtlesim --output-dir ./ #保存在终端运行的当前目录下
WARNING: '--output-dir' is deprecated; use redirection to save to a file
Saving to: ./turtlesim.yaml
保存成功
根据这里WARNING: '--output-dir' is deprecated; use redirection to save to a file
语句可以变更为 ros2 param dump /turtlesim > a.yaml
注意:
1.">“是覆盖重定向操作符,它会将命令的输出写入指定文件
2.”>>"是追加重定向操作符,它会将命令的输出写入文件的末尾