compass&velocity topic test completed
parent
9e32d5168d
commit
4bd113c30c
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
#coding:utf-8
|
||||||
|
import rospy
|
||||||
|
from mavros_msgs.msg import Waypoint
|
||||||
|
|
||||||
|
def callBack(data):
|
||||||
|
print (data.param1)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
nodeName = 'subscriber_py'
|
||||||
|
rospy.init_node(nodeName)
|
||||||
|
topicName = '/DroneStatus'
|
||||||
|
subscriber = rospy.Subscriber(topicName,Waypoint,callBack) #從topic獲取string再呼叫callback
|
||||||
|
rospy.spin()
|
||||||
Loading…
Reference in New Issue