-
Notifications
You must be signed in to change notification settings - Fork 13
/
test_types.py
executable file
·97 lines (78 loc) · 1.75 KB
/
test_types.py
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/usr/bin/env python3
import rospy2 as rospy
from geometry_msgs.msg import *
from std_msgs.msg import *
print("Testing ROS1 constructors for common data types")
print("Point")
print(Point())
print(Point(1,2,3))
print(Point(1.0, 2.0, 3.0))
print(Point(x=1, y=2, z=3))
print(Point(x=1.0, y=2.0, z=3.0))
print("Quaternion")
print(Quaternion())
print(Quaternion(1,2,3, 4))
print(Quaternion(1.0, 2.0, 3.0, 4.0))
print(Quaternion(x=1, y=2, z=3, w=4))
print(Quaternion(x=1.0, y=2.0, z=3.0, w=4.0))
print("Int8")
print(Int8())
print(Int8(1))
print(Int8(data=1))
print("UInt8")
print(UInt8())
print(UInt8(1))
print(UInt8(data=1))
print("Int16")
print(Int16())
print(Int16(1))
print(Int16(data=1))
print("UInt16")
print(UInt16())
print(UInt16(1))
print(UInt16(data=1))
print("Int32")
print(Int32())
print(Int32(1))
print(Int32(data=1))
print("UInt32")
print(UInt32())
print(UInt32(1))
print(UInt32(data=1))
print("Int64")
print(Int64())
print(Int64(1))
print(Int64(data=1))
print("UInt64")
print(UInt64())
print(UInt64(1))
print(UInt64(data=1))
print("Float32")
print(Float32())
print(Float32(1))
print(Float32(1.0))
print(Float32(data=1.0))
print("Float64")
print(Float64())
print(Float64(1))
print(Float64(1.0))
print(Float64(data=1.0))
print("String")
print(String())
print(String("this is a test"))
print(String(data="this is a test"))
print("ColorRGBA")
print(ColorRGBA())
print(ColorRGBA(1,2,3, 4))
print(ColorRGBA(1.0, 2.0, 3.0, 4.0))
print(ColorRGBA(r=1, g=2, b=3, a=4))
print(ColorRGBA(r=1.0, g=2.0, b=3.0, a=4.0))
print("Header")
print(Header())
print(Header(0, rospy.Time(), "base_link"))
print(Header(seq=0, stamp=rospy.Time(), frame_id="base_link"))
print(Header().seq)
print(Header().stamp.nsecs)
print(Header().stamp.secs)
print(Header().frame_id)
print("Success")