Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Allowed saving timestamp-less messages to Cache (using rospy.Time.now() as their timestamp).#636

Closed
peci1 wants to merge 3 commits intoros:indigo-develfrom
peci1:patch-1
Closed

Allowed saving timestamp-less messages to Cache (using rospy.Time.now() as their timestamp).#636
peci1 wants to merge 3 commits intoros:indigo-develfrom
peci1:patch-1

Conversation

@peci1
Copy link
Copy Markdown
Contributor

@peci1 peci1 commented Jul 9, 2015

Also added a convenience getLast method for retrieving the last message in the cache.

…() as their timestamp).

Also added a convenience `getLast` method for retrieving the last message in the cache.
@ros-pull-request-builder
Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

@tfoote
Copy link
Copy Markdown
Member

tfoote commented Jul 9, 2015

I don't believe we should ever automatically stamp unstamped data. An alternative would be to provide a 2nd argument to which the user could add the timestamp explicitly.

@peci1
Copy link
Copy Markdown
Contributor Author

peci1 commented Jul 9, 2015

Okay, what about adding an __init__ argument defaulting to False, which, set to True, would allow for automatic timestamping?

@dirk-thomas
Copy link
Copy Markdown
Member

That constructor argument sounds like a good option.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please keep the list comprehension as simple as possible, e.g.:

[ m for i, m in enumerate(self.cache_msgs) if self.cache_times[i] >= from_stamp and self.cache_times[i] <= to_stamp]

Or even better you could even use zip to iterate over both lists at the same time.

@peci1
Copy link
Copy Markdown
Contributor Author

peci1 commented May 17, 2016

I've implemented your suggestion with the constructor argument. I've also added tests. Should I retarget to kinetic-devel, or is it okay this way?

@tfoote
Copy link
Copy Markdown
Member

tfoote commented May 17, 2016

lgtm, it would be better to target for kinetic and consider backporting only if there's strong demand

@peci1
Copy link
Copy Markdown
Contributor Author

peci1 commented May 17, 2016

Ok, see #806 .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants