-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpositionToFile.tcl
More file actions
50 lines (26 loc) · 881 Bytes
/
positionToFile.tcl
File metadata and controls
50 lines (26 loc) · 881 Bytes
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
if { [info exists _POSITIONTOFILE.TCL] == 0 } {
set _POSITIONTOFILE 1
# Save currentRobot Position(x,y,t) an tags(id,antennaWhichDetected) Detected to file
proc position2File { index fileToWrite position } {
upvar $position pos
set filePointer [open $fileToWrite a]
puts $filePointer "$index $pos(xRob) $pos(yRob) $pos(theta)"
close $filePointer
}
proc tagPosition2File { index fileToWrite position } {
upvar $position pos
set filePointer [open $fileToWrite a]
puts $filePointer "$index $pos(x) $pos(y)"
close $filePointer
}
proc covariance2File { index fileToWrite covariance } {
upvar $covariance cov
set filePointer [open $fileToWrite a]
puts $filePointer "$index $cov(0) $cov(1) $cov(2) $cov(3) $cov(4) $cov(5)"
close $filePointer
}
proc clearFile { fileToWrite } {
set filePointer [open $fileToWrite w]
close $filePointer
}
}