Skip to content

Commit

Permalink
use local time
Browse files Browse the repository at this point in the history
  • Loading branch information
bshimanuki committed Nov 8, 2017
1 parent bde1d97 commit d571eac
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/publishermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ def create_msg(self, msg_dict, msg_type):
msg_cls = getattr(mod.msg, msg_name)
msg = message_converter.convert_dictionary_to_ros_message(
msg_type, msg_dict)
if self.use_local_time and hasattr(msg, "header"):
msg.header.stamp = rospy.get_rostime()
if self.use_local_time:
if hasattr(msg, "header"):
msg.header.stamp = rospy.get_rostime()
elif msg_type == "tf2_msgs/TFMessage":
for t in msg.transforms:
t.header.stamp = rospy.get_rostime()
return msg, msg_cls

# Publishes newly received messages.
Expand Down

0 comments on commit d571eac

Please sign in to comment.