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

[jsk_topic_tools] Add reset option to use boolean_node with rosbag #1796

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

nakane11
Copy link
Member

This PR avoids ROSTimeMovedBackwardsException when boolean_node is running with rosbag with --loop option.
rospy/timer.py

@k-okada
Copy link
Member

k-okada commented Dec 15, 2023

it not work on old rospy, check pkg_resources.get_distribution('rospy').version ?? to set reset ?

2023-12-14T15:47:21.7224461Z [jsk_topic_tools:make] Traceback (most recent call last):
2023-12-14T15:47:21.7225009Z 
2023-12-14T15:47:21.7225253Z                                                                                 
2023-12-14T15:47:21.7226650Z [jsk_topic_tools:make]   File "/github/home/ros/ws_jsk_common/src/jsk_common/jsk_topic_tools/scripts/boolean_node.py", line 102, in <module>
2023-12-14T15:47:21.7227774Z 
2023-12-14T15:47:21.7228011Z                                                                                 
2023-12-14T15:47:21.7228714Z [jsk_topic_tools:make]     node = BooleanNode()
2023-12-14T15:47:21.7243367Z 
2023-12-14T15:47:21.7243376Z 
2023-12-14T15:47:21.7243656Z                                                                                 
2023-12-14T15:47:21.7245578Z [jsk_topic_tools:make]   File "/github/home/ros/ws_jsk_common/src/jsk_common/jsk_topic_tools/scripts/boolean_node.py", line 69, in __init__
2023-12-14T15:47:21.7246758Z 
2023-12-14T15:47:21.7247002Z                                                                                 
2023-12-14T15:47:21.7248045Z [jsk_topic_tools:make]     rospy.Timer(rospy.Duration(1.0 / rate), self.timer_cb, reset=reset)
2023-12-14T15:47:21.7248835Z 
2023-12-14T15:47:21.7249097Z                                                                                 
2023-12-14T15:47:21.7250384Z [jsk_topic_tools:make] TypeError: __init__() got an unexpected keyword argument 'reset'

@nakane11
Copy link
Member Author

Check rospy version and always set reset to True when /use_sim_time is True

@k-okada k-okada merged commit 35ab7b7 into jsk-ros-pkg:master Dec 15, 2023
8 checks passed
@nakane11 nakane11 deleted the timer-reset branch December 15, 2023 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants