forked from AprilRobotics/apriltag
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tag25h9.c
140 lines (137 loc) · 4.23 KB
/
tag25h9.c
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/* Copyright (C) 2013-2016, The Regents of The University of Michigan.
All rights reserved.
This software was developed in the APRIL Robotics Lab under the
direction of Edwin Olson, [email protected]. This software may be
available under alternative licensing terms; contact the address above.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the Regents of The University of Michigan.
*/
#include <stdlib.h>
#include "tag25h9.h"
static uint64_t codedata[35] = {
0x000000000156f1f4UL,
0x0000000001f28cd5UL,
0x00000000016ce32cUL,
0x0000000001ea379cUL,
0x0000000001390f89UL,
0x000000000034fad0UL,
0x00000000007dcdb5UL,
0x000000000119ba95UL,
0x0000000001ae9daaUL,
0x0000000000df02aaUL,
0x000000000082fc15UL,
0x0000000000465123UL,
0x0000000000ceee98UL,
0x0000000001f17260UL,
0x00000000014429cdUL,
0x00000000017248a8UL,
0x00000000016ad452UL,
0x00000000009670adUL,
0x00000000016f65b2UL,
0x0000000000b8322bUL,
0x00000000005d715bUL,
0x0000000001a1c7e7UL,
0x0000000000d7890dUL,
0x0000000001813522UL,
0x0000000001c9c611UL,
0x000000000099e4a4UL,
0x0000000000855234UL,
0x00000000017b81c0UL,
0x0000000000c294bbUL,
0x000000000089fae3UL,
0x000000000044df5fUL,
0x0000000001360159UL,
0x0000000000ec31e8UL,
0x0000000001bcc0f6UL,
0x0000000000a64f8dUL,
};
apriltag_family_t *tag25h9_create()
{
apriltag_family_t *tf = calloc(1, sizeof(apriltag_family_t));
tf->name = strdup("tag25h9");
tf->h = 9;
tf->ncodes = 35;
tf->codes = codedata;
tf->nbits = 25;
tf->bit_x = calloc(25, sizeof(uint32_t));
tf->bit_y = calloc(25, sizeof(uint32_t));
tf->bit_x[0] = 1;
tf->bit_y[0] = 1;
tf->bit_x[1] = 2;
tf->bit_y[1] = 1;
tf->bit_x[2] = 3;
tf->bit_y[2] = 1;
tf->bit_x[3] = 4;
tf->bit_y[3] = 1;
tf->bit_x[4] = 2;
tf->bit_y[4] = 2;
tf->bit_x[5] = 3;
tf->bit_y[5] = 2;
tf->bit_x[6] = 5;
tf->bit_y[6] = 1;
tf->bit_x[7] = 5;
tf->bit_y[7] = 2;
tf->bit_x[8] = 5;
tf->bit_y[8] = 3;
tf->bit_x[9] = 5;
tf->bit_y[9] = 4;
tf->bit_x[10] = 4;
tf->bit_y[10] = 2;
tf->bit_x[11] = 4;
tf->bit_y[11] = 3;
tf->bit_x[12] = 5;
tf->bit_y[12] = 5;
tf->bit_x[13] = 4;
tf->bit_y[13] = 5;
tf->bit_x[14] = 3;
tf->bit_y[14] = 5;
tf->bit_x[15] = 2;
tf->bit_y[15] = 5;
tf->bit_x[16] = 4;
tf->bit_y[16] = 4;
tf->bit_x[17] = 3;
tf->bit_y[17] = 4;
tf->bit_x[18] = 1;
tf->bit_y[18] = 5;
tf->bit_x[19] = 1;
tf->bit_y[19] = 4;
tf->bit_x[20] = 1;
tf->bit_y[20] = 3;
tf->bit_x[21] = 1;
tf->bit_y[21] = 2;
tf->bit_x[22] = 2;
tf->bit_y[22] = 4;
tf->bit_x[23] = 2;
tf->bit_y[23] = 3;
tf->bit_x[24] = 3;
tf->bit_y[24] = 3;
tf->width_at_border = 7;
tf->total_width = 9;
tf->reversed_border = false;
return tf;
}
void tag25h9_destroy(apriltag_family_t *tf)
{
free(tf->bit_x);
free(tf->bit_y);
free(tf->name);
free(tf);
}