Go to the documentation of this file.00001
00002
00003
00004
00005 import rospy
00006 from std_msgs.msg import Empty as EmptyMsg
00007 from std_srvs.srv import Empty as EmptySrv
00008 import subprocess
00009
00010 def callback(msg):
00011 rospy.loginfo("Clearing /accumulated_heightmap/reset")
00012 srv = rospy.ServiceProxy("/accumulated_heightmap/reset", EmptySrv)
00013 try:
00014 srv()
00015 except:
00016 rospy.logerr("Failed to reset /accumulated_heightmap")
00017 srv2 = rospy.ServiceProxy("/octomap_server/reset", EmptySrv)
00018 try:
00019 srv2()
00020 except:
00021 rospy.logerr("Failed to reset /octomap_server")
00022
00023 if __name__ == "__main__":
00024 rospy.init_node("auto_reset_heightmap")
00025 sub = rospy.Subscriber("/odom_init_trigger", EmptyMsg, callback)
00026 rospy.spin()