Revision: 7104
http://playerstage.svn.sourceforge.net/playerstage/?rev=7104&view=rev
Author: gerkey
Date: 2008-10-17 16:48:26 +0000 (Fri, 17 Oct 2008)
Log Message:
-----------
updated parser to add a place for bumper geometry
Modified Paths:
--------------
code/player/trunk/server/codetools/saphconv/mktypedef.tcl
code/player/trunk/server/codetools/saphconv/parseparam.tcl
code/player/trunk/server/codetools/saphconv/saphconv.tcl
Modified: code/player/trunk/server/codetools/saphconv/mktypedef.tcl
===================================================================
--- code/player/trunk/server/codetools/saphconv/mktypedef.tcl 2008-10-17
05:14:50 UTC (rev 7103)
+++ code/player/trunk/server/codetools/saphconv/mktypedef.tcl 2008-10-17
16:48:26 UTC (rev 7104)
@@ -17,11 +17,13 @@
# replacing old ones. this way we'll get the union of all variable names
array set vars {}
set maxsonarnum 0
+set maxbumpernum 0
foreach fname $argv {
set fd [open $fname r]
set sonarnum 0
+ set bumpernum 0
while {![eof $fd]} {
set line [gets $fd]
if {![string length $line] ||
@@ -35,20 +37,16 @@
if {![string compare $name "Section"]} { continue; }
if {![string compare $name "SonarUnit"]} {incr sonarnum; continue; }
set value [lindex $line 1]
+ if {![string compare $name "NumFrontBumpers"]} {incr bumpernum $value; }
+ if {![string compare $name "NumRearBumpers"]} {incr bumpernum $value; }
- # If we determine the value to begin with ;, then the file doesn't give
- # a value (a apparently newly allowed syntatic construct in a .p file).
- # So we'll assume that an empty string is appropriate.
- if {![string compare [string index $value 0] "\;"]} {
- set value ""
- }
-
set vars($name) $value
}
close $fd
if {$sonarnum > $maxsonarnum} {set maxsonarnum $sonarnum}
+ if {$bumpernum > $maxbumpernum} {set maxbumpernum $bumpernum}
}
# they took this one out for some reason, and only give the info in the manual
@@ -64,6 +62,14 @@
puts "\} sonar_pose_t;\n\n"
puts "typedef struct\n\{"
+puts " double x;"
+puts " double y;"
+puts " double th;"
+puts " double length;"
+puts " double radius;"
+puts "\} bumper_def_t;\n\n"
+
+puts "typedef struct\n\{"
# write each variable name out, inferring its type
foreach name [lsort [array names vars]] {
@@ -86,6 +92,7 @@
}
}
puts " sonar_pose_t sonar_pose\[$maxsonarnum\];"
+puts " bumper_def_t bumper_geom\[$maxbumpernum\];"
puts "\} RobotParams_t;"
puts "\n\nextern RobotParams_t PlayerRobotParams\[\];"
Modified: code/player/trunk/server/codetools/saphconv/parseparam.tcl
===================================================================
--- code/player/trunk/server/codetools/saphconv/parseparam.tcl 2008-10-17
05:14:50 UTC (rev 7103)
+++ code/player/trunk/server/codetools/saphconv/parseparam.tcl 2008-10-17
16:48:26 UTC (rev 7104)
@@ -18,11 +18,13 @@
# replacing old ones. this way we'll get the union of all variable names
array set vars {}
set maxsonarnum 0
+set maxbumpernum 0
foreach fname $argv {
set fd [open $fname r]
set sonarnum 0
+ set bumpernum 0
while {![eof $fd]} {
set line [gets $fd]
if {![string length $line] ||
@@ -36,6 +38,8 @@
if {![string compare $name "Section"]} { continue; }
if {![string compare $name "SonarUnit"]} {incr sonarnum; continue; }
set value [lindex $line 1]
+ if {![string compare $name "NumFrontBumpers"]} {incr bumpernum $value; }
+ if {![string compare $name "NumRearBumpers"]} {incr bumpernum $value; }
set vars($name) $value
}
@@ -43,6 +47,7 @@
close $fd
if {$sonarnum > $maxsonarnum} {set maxsonarnum $sonarnum}
+ if {$bumpernum > $maxbumpernum} {set maxbumpernum $bumpernum}
}
# they took this one out for some reason, and only give the info in the manual
@@ -137,6 +142,14 @@
#puts " \{ 0, 0, 0 \},"
#incr i
#}
+ puts " \},"
+
+ puts " \{"
+ set i 0
+ while {$i < $maxbumpernum} {
+ puts " \{ 0, 0, 0, 0, 0 \},"
+ incr i
+ }
puts " \}"
puts "\};"
Modified: code/player/trunk/server/codetools/saphconv/saphconv.tcl
===================================================================
--- code/player/trunk/server/codetools/saphconv/saphconv.tcl 2008-10-17
05:14:50 UTC (rev 7103)
+++ code/player/trunk/server/codetools/saphconv/saphconv.tcl 2008-10-17
16:48:26 UTC (rev 7104)
@@ -47,7 +47,7 @@
puts $fdc " * $fname"
}
puts $fdc "*/
-#include <robot_params.h>
+#include \"robot_params.h\"
"
puts $fdh "/*
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit