pressure_point_publisher.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 import rospy
00003 from geometry_msgs.msg import PointStamped
00004 from asctec_hl_comm.msg import mav_imu
00005 
00006 def callback(data):
00007     #height = data.differential_height
00008     height = data.height
00009     
00010     rospy.loginfo(rospy.get_caller_id() + "Pressure: %f", height)
00011     pt = PointStamped()
00012     pt.header = data.header
00013     pt.point.z = height
00014     pub = rospy.Publisher('pressure_height_point', PointStamped, queue_size=1)
00015     pub.publish(pt)
00016     
00017 def listener():
00018     # In ROS, nodes are uniquely named. If two nodes with the same
00019     # node are launched, the previous one is kicked off. The
00020     # anonymous=True flag means that rospy will choose a unique
00021     # name for our 'listener' node so that multiple listeners can
00022     # run simultaneously.
00023     rospy.init_node('pressure_point_publisher', anonymous=True)
00024 
00025     rospy.Subscriber("fcu/imu_custom", mav_imu, callback)
00026 
00027     # spin() simply keeps python from exiting until this node is stopped
00028     rospy.spin()
00029 
00030 if __name__ == '__main__':
00031     listener()


asctec_hl_comm
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Thu Jun 6 2019 20:57:06