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

Replaced bag.isOpen() by checking bag filename #1

Open
wants to merge 2 commits into
base: avidbots-master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rosbag_snapshot/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>rosbag_snapshot</name>
<version>1.0.3</version>
<version>1.1.0</version>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend updating the patch version instead of minor so that we have an easier time incorporating upstream updates.

<description>The rosbag_snapshot package</description>
<author email="[email protected]">Kevin Allen</author>
<maintainer email="[email protected]">David V. Lu!!</maintainer>
Expand Down
4 changes: 2 additions & 2 deletions rosbag_snapshot/src/snapshotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ bool Snapshotter::writeTopic(rosbag::Bag& bag, MessageQueue& message_queue, stri
MessageQueue::range_t range = message_queue.rangeFromTimes(req.start_time, req.stop_time);

// open bag if this the first valid topic and there is data
if (!bag.isOpen() && range.second > range.first)
if (bag.getFileName().empty() && range.second > range.first)
{
try
{
Expand Down Expand Up @@ -425,7 +425,7 @@ bool Snapshotter::triggerSnapshotCb(rosbag_snapshot_msgs::TriggerSnapshot::Reque
}

// If no topics were subscribed/valid/contained data, this is considered a non-success
if (!bag.isOpen())
if (bag.getFileName().empty())
{
res.success = false;
res.message = res.NO_DATA_MESSAGE;
Expand Down
2 changes: 1 addition & 1 deletion rosbag_snapshot_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="2">
<name>rosbag_snapshot_msgs</name>
<version>1.0.3</version>
<version>1.1.0</version>
<description>Service and message definitions for rosbag_snapshot</description>

<author email="[email protected]">Kevin Allen</author>
Expand Down