question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`ros2 param dump` silently overwrites existing file

See original GitHub issue

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • Debian packages
  • Version or commit hash:
    • ros-rolling-ros2param 0.13.0-1
  • DDS implementation:
    • CycloneDDS
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

In terminal 1:

ros2 run turtlesim turtlesim_node

In terminal 2:

echo "foo" > turtlesim.yaml  # turtlesim.yaml now contains "foo"
ros2 param dump /turtlesim  # this overwrites the existing turtlesim.yaml, which may be surprising

Expected behavior

When ros2 param dump is choosing a filename, it should either error out if a file with the name it chose already exists, or it should keep choosing names until it finds one that has no conflict.

Actual behavior

ros2 param dump silently ovewrites the existing file.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
hidmiccommented, Apr 16, 2021

Sometimes it is practical for it to just overwrite it. Perhaps making opt-in would be best.

1reaction
clalancettecommented, Apr 20, 2021

What if the default were to write to stdout, with an option to write to a named file? Then overwriting is no big deal because the user had to give a filename to write to.

That’s a pretty good idea, I like it. This is also more Unix-y; you could always do ros2 param dump /turtlesim > turtlesim.yaml.

The downside is that this breaks compatibility with earlier releases. That is, in Foxy, if you do ros2 param dump /turtlesim, by default it writes to a file. If you then pass --print, it prints to stdout. If we were to make this change, then in Galactic ros2 param dump /turtlesim would print to stdout, and passing --write <fname> (or whatever) would write it to a file.

I don’t know, how do people feel about a command-line break like that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ROS2 Dashing overwrite default param via yaml - ROS Answers
When running the node, it should be possible to pass a .yaml file with some updated values for one ore more parameters.
Read more >
Commands - PX4 Developer Guide
Dump file utility. Prints file size and contents in binary mode (don't replace LF with CR LF) to stdout. Usage. dumpfile [arguments.
Read more >
Tutorial 4: The launch utility — 240AR060 - Introduction to ROS
Objective: This tutorial session is devoted to learn the ROS mechanism for starting the master and many nodes all at once, using a...
Read more >
Changelog — MARV Robotics 21.12.0 documentation - GitLab
Deprecated . 21.12.0 will remove support for ROS1 message type names, use new ROS2 names instead ... Check not to overwrite existing...
Read more >
s700_800 11.00 PM/VM/UFS/async/scsi/io/DMAPI/JFS/perf patch ...
Under rare conditions, numerous simultaneous access to files on VxFS file systems ... SHMEM_MAGIC processes core dump while trying to access shared memory....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found