Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rosbag] Expose snapshot functionality #1941

Open
gabrielSoudry opened this issue Apr 27, 2020 · 1 comment
Open

[rosbag] Expose snapshot functionality #1941

gabrielSoudry opened this issue Apr 27, 2020 · 1 comment

Comments

@gabrielSoudry
Copy link

gabrielSoudry commented Apr 27, 2020

Unlike #1414 I don't need more features, I just want the return of the deprecated command rosrecord -s like this topic in ros forum.
The functionnality seem to yet exist

if (options_.snapshot)
{
record_thread = boost::thread(boost::bind(&Recorder::doRecordSnapshotter, this));
// Subscribe to the snapshot trigger
trigger_sub = nh.subscribe<std_msgs::Empty>("snapshot_trigger", 100, boost::bind(&Recorder::snapshotTrigger, this, _1));
}

But not in any options
desc.add_options()
("help,h", "produce help message")
("all,a", "record all topics")
("regex,e", "match topics using regular expressions")
("exclude,x", po::value<std::string>(), "exclude topics matching regular expressions")
("quiet,q", "suppress console output")
("publish,p", "Publish a msg when the record begin")
("output-prefix,o", po::value<std::string>(), "prepend PREFIX to beginning of bag name")
("output-name,O", po::value<std::string>(), "record bagnamed NAME.bag")
("buffsize,b", po::value<int>()->default_value(256), "Use an internal buffer of SIZE MB (Default: 256)")
("chunksize", po::value<int>()->default_value(768), "Set chunk size of message data, in KB (Default: 768. Advanced)")
("limit,l", po::value<int>()->default_value(0), "Only record NUM messages on each topic")
("min-space,L", po::value<std::string>()->default_value("1G"), "Minimum allowed space on recording device (use G,M,k multipliers)")
("bz2,j", "use BZ2 compression")
("lz4", "use LZ4 compression")
("split", po::value<int>()->implicit_value(0), "Split the bag file and continue recording when maximum size or maximum duration reached.")
("max-splits", po::value<int>(), "Keep a maximum of N bag files, when reaching the maximum erase the oldest one to keep a constant number of files.")
("topic", po::value< std::vector<std::string> >(), "topic to record")
("size", po::value<uint64_t>(), "The maximum size of the bag to record in MB.")
("duration", po::value<std::string>(), "Record a bag of maximum duration in seconds, unless 'm', or 'h' is appended.")
("node", po::value<std::string>(), "Record all topics subscribed to by a specific node.")
("tcpnodelay", "Use the TCP_NODELAY transport hint when subscribing to topics.")
("udp", "Use the UDP transport hint when subscribing to topics.");

Just add :
("snapshot,s","(EXPERIMENTAL) Enable snapshot recording (don't write to file unless triggered)")
("trigger,t","(EXPERIMENTAL) Trigger snapshot recording")
And
if (vm.count("snapshot")) { opts.snapshot = true; } if (vm.count("trigger")) { opts.trigger = true; }
And it's fixed.

Do you have any idea why it's not implemented ?

@dirk-thomas
Copy link
Member

Do you have any idea why it's not implemented ?

There is no need for a trigger option. That is being done through the topic snapshot_trigger shown in the above snippet.

For a snapshot option please consider to provide a pull request for this. I assume it wasn't added when the feature was implemented because the author only used the API rather than the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants