auto_reset_heightmap.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 
00003 # automatically reset heightmap integration as robot put on the ground
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()


jsk_robot_startup
Author(s):
autogenerated on Sat Jul 1 2017 02:42:18