republish_scan.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 import rospy
3 from sensor_msgs.msg import LaserScan
4 
5 def callback(data):
6  t = rospy.Time(data.header.stamp.secs, data.header.stamp.nsecs)
7  t+=rospy.Duration.from_sec(offset)
8  data.header.stamp = t
9  pub.publish(data)
10 
11 if __name__ == '__main__':
12  rospy.init_node('republish_scan', anonymous=True)
13  pub = rospy.Publisher('base_scan_t', LaserScan, queue_size=1)
14  offset = rospy.get_param('~offset', 0.0)
15  rospy.Subscriber("base_scan", LaserScan, callback)
16  rospy.spin()
def callback(data)


rtabmap_ros
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:42:19