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

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

Closed
peci1 wants to merge 3 commits intoros:kinetic-develfrom
peci1:allow-headerless
Closed

Allow saving timestamp-less messages to Cache (using rospy.Time.now() as their timestamp).#806
peci1 wants to merge 3 commits intoros:kinetic-develfrom
peci1:allow-headerless

Conversation

@peci1
Copy link
Copy Markdown
Contributor

@peci1 peci1 commented May 17, 2016

Retargeting #636 to kinetic-devel.

peci1 and others added 2 commits May 17, 2016 18:53
…() as their timestamp).

Also added a convenience `getLast` method for retrieving the last message in the cache.
if m.header.stamp >= from_stamp and m.header.stamp <= to_stamp]

return [msg for (msg, time) in zip(self.cache_msgs, self.cache_times)
if from_stamp <= time <= to_stamp]
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.

This is not valid logic. The first operator results in a boolean which is then used in the second comparison.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If I understand you objection correctly, I think it is incorrect :) Check http://stackoverflow.com/questions/26502775/pycharm-simplify-chained-comparison

Copy link
Copy Markdown
Member

@dirk-thomas dirk-thomas May 18, 2016

Choose a reason for hiding this comment

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

Omg scary syntax, I guess I just learned something new. Thanks for the reference. Please forget my comment.

@dirk-thomas
Copy link
Copy Markdown
Member

Thank you for iterating on this. I have squashed and cherry-picked your changes in 005191b.

@gavanderhoorn
Copy link
Copy Markdown
Contributor

Just came across this and it seems like a useful feature.

@peci1: will you also update the wiki on message_filters? I do not see this mentioned anywhere right now.

@peci1
Copy link
Copy Markdown
Contributor Author

peci1 commented Jun 2, 2017

@gavanderhoorn Thanks for the hint, I've edited the page accordingly.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants