4 import geometry_msgs.msg
6 rospy.init_node(
'amcl_resample', anonymous=
True)
8 rate = rospy.Duration(5)
9 last = rospy.Time.now()
13 if rospy.Time.now() - last < rate:
20 new_msg.pose.covariance = list(new_msg.pose.covariance)
21 last = rospy.Time.now()
22 for i
in range(len(new_msg.pose.covariance)):
23 new_msg.pose.covariance[i] /= 2.0
31 pub = rospy.Publisher(
'initialpose', geometry_msgs.msg.PoseWithCovarianceStamped, queue_size=1)
32 rospy.Subscriber(
'amcl_pose', geometry_msgs.msg.PoseWithCovarianceStamped, callback)
35 if __name__ ==
'__main__':