-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPositionTarget.py
More file actions
61 lines (47 loc) · 1.46 KB
/
Copy pathPositionTarget.py
File metadata and controls
61 lines (47 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import rospy
from mavros_msgs.msg import PositionTarget
def publish():
pub = rospy.Publisher('/mavros/setpoint_raw/local',PositionTarget,queue_size=1)
data = PositionTarget()
data.header.stamp = rospy.Time.now()
data.header.frame_id = "test"
data.coordinate_frame = 8
data.type_mask = 1991
#type mask kisminda hangi veriler kullanilmayacaksa alttaki sayilar toplanip yazilmali kod yoksa calismaz
data.velocity.x = int(10)
data.velocity.y = 0
data.velocity.z = 0
data.yaw_rate = 0.0
pub.publish(data)
rospy.sleep(2)
print(data)
def publish_veri():
rospy.init_node("test",anonymous=True)
if __name__ == "__main__":
publish_veri()
while not rospy.is_shutdown():
publish()
"""std_msgs/Header header
uint8 coordinate_frame
uint8 FRAME_LOCAL_NED = 1
uint8 FRAME_LOCAL_OFFSET_NED = 7
uint8 FRAME_BODY_NED = 8
uint8 FRAME_BODY_OFFSET_NED = 9
uint16 type_mask
uint16 IGNORE_PX = 1 # Position ignore flags
uint16 IGNORE_PY = 2
uint16 IGNORE_PZ = 4
uint16 IGNORE_VX = 8 # Velocity vector ignore flags
uint16 IGNORE_VY = 16
uint16 IGNORE_VZ = 32
uint16 IGNORE_AFX = 64 # Acceleration/Force vector ignore flags
uint16 IGNORE_AFY = 128
uint16 IGNORE_AFZ = 256
uint16 FORCE = 512 # Force in af vector flag
uint16 IGNORE_YAW = 1024
uint16 IGNORE_YAW_RATE = 2048
geometry_msgs/Point position
geometry_msgs/Vector3 velocity
geometry_msgs/Vector3 acceleration_or_force
float32 yaw
float32 yaw_rate"""