From tk at edam.speech.cs.cmu.edu Thu Nov 1 22:19:16 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 1 Nov 2007 22:19:16 -0400 Subject: [TeamTalk 327]: [863] trunk/TeamTalk: Removed Olympus externals in preparation for using shared Olympus hierarchy . Message-ID: <200711020219.lA22JG2V028786@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071101/6a2a07cc/attachment.html -------------- next part -------------- Property changes on: trunk/TeamTalk/Agents ___________________________________________________________________ Name: svn:ignore - Agents.ncb Agents.suo Ankh.Load Name: svn:externals - Pythia http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Pythia Helios http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Helios3 Kalliope http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Kalliope MultiDecoder/Audio_Server http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/MultiDecoder/Audio_Server MultiDecoder/Sphinx_Engine http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/MultiDecoder/Sphinx_Engine NlgServer http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/NlgServer2 Phoenix http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Phoenix2 DateTime http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/DateTime4 Property changes on: trunk/TeamTalk/Libraries ___________________________________________________________________ Name: svn:ignore - Cepstral Ankh.Load Ankh.Unload *.ncb *.suo Name: svn:externals - Galaxy http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Galaxy Phoenix http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Phoenix RavenClaw http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/RavenClaw Rosetta http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Rosetta sphinx2 https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/sphinx2 sphinx2msdev http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/trunkSphinx2msdev Property changes on: trunk/TeamTalk/Tools ___________________________________________________________________ Name: svn:externals - MakeLM http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/MakeLM VBScribe http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/VBScribe From tk at edam.speech.cs.cmu.edu Fri Nov 2 07:47:07 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Fri, 2 Nov 2007 07:47:07 -0400 Subject: [TeamTalk 328]: [864] trunk/moast-bth/TeamTalkSimulator: Adding scripts for running bots across the queue Message-ID: <200711021147.lA2Bl72c002575@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071102/a1841bf4/attachment.html -------------- next part -------------- Added: trunk/moast-bth/TeamTalkSimulator/qSimulator.pl =================================================================== --- trunk/moast-bth/TeamTalkSimulator/qSimulator.pl (rev 0) +++ trunk/moast-bth/TeamTalkSimulator/qSimulator.pl 2007-11-02 11:47:06 UTC (rev 864) @@ -0,0 +1,75 @@ +#!/usr/bin/perl + +use strict; +use File::Spec; + +my $SCRIPT='runBotServer.sh'; +my $BOTSCRIPT=File::Spec->rel2abs('runBot.pl'); +unlink glob "$SCRIPT.*"; + +my @robots = &get_bots('peerfile.txt'); +my $num_bots = scalar @robots; + +my $ticket = `qsub -q i686 -l nodes=$num_bots $SCRIPT`; +chomp $ticket; +print "ticket: $ticket$/"; +my $hoststring; +do { + sleep 1; + open(STATUS, "qstat -f $ticket|"); + $hoststring = (split(/ = /,(grep(/exec_host =/, ))[0]))[1]; +} until ($hoststring); +chomp $hoststring; +my @hosts; +foreach(split(/\+/, $hoststring)) { + s|/.*||; + push @hosts, $_; +} +die "Needed $num_bots" if(scalar @hosts != $num_bots); +for(0..$#robots) { + ${$robots[$_]}{'host'} = $hosts[$_]; +} +print &render_bots(@robots); + +foreach(@robots) { + my %robot = %$_; + my $cmd = "ssh $robot{'host'} $BOTSCRIPT -type=$robot{'type'} -name=$robot{'name'}"; + print $cmd, $/; + system $cmd; +} + +sub get_bots { + my $peerfile = shift; + open(PEERS, $peerfile) || die "Can't open peerfile: $peerfile"; + + my @robots; + while() { + next if /^\#/ || !/\S/; + my @tokens = split; + my $name = $tokens[0]; + next if $name eq 'optrader' || $name eq 'mapserver'; + my %robot; + $robot{'name'} = $name; + my @addr = split(':', $tokens[1]); + $robot{'ip'} = $addr[0]; + $robot{'port'} = $addr[1] if scalar @addr == 2; + $robot{'voice'} = $tokens[2]; + $robot{'type'} = $tokens[3]; + push @robots, \%robot; + } + + return @robots; +} + +sub render_bots { + my @robots = @_; + my $ret_string; + foreach(@robots) { + my %robot = %{$_}; + for(keys %robot) { + $ret_string .= "$_: $robot{$_} "; + } + $ret_string .= $/; + } + return $ret_string; +} Property changes on: trunk/moast-bth/TeamTalkSimulator/qSimulator.pl ___________________________________________________________________ Name: svn:executable + * Deleted: trunk/moast-bth/TeamTalkSimulator/qSimulator.sh =================================================================== --- trunk/moast-bth/TeamTalkSimulator/qSimulator.sh 2007-11-02 02:19:14 UTC (rev 863) +++ trunk/moast-bth/TeamTalkSimulator/qSimulator.sh 2007-11-02 11:47:06 UTC (rev 864) @@ -1,5 +0,0 @@ -#!/bin/bash - -rm -f runSimulator.sh.* - -qsub runSimulator.sh Added: trunk/moast-bth/TeamTalkSimulator/runBot.pl =================================================================== --- trunk/moast-bth/TeamTalkSimulator/runBot.pl (rev 0) +++ trunk/moast-bth/TeamTalkSimulator/runBot.pl 2007-11-02 11:47:06 UTC (rev 864) @@ -0,0 +1,12 @@ +#!/usr/bin/perl + +use strict; + +my $MOAST = `pwd`.'/../moast'; +$ENV{'CONFIG_NML'} = "$MOAST/etc/moast.nml"; +$ENV{'CONFIG_INI'} = "$MOAST/etc/moast.ini"; +open(TMP, '>/tmp/tk.txt'); +print TMP join(' ', @ARGV), $/; +close TMP; +system("date >> /tmp/tk.txt"); +sleep 10; Property changes on: trunk/moast-bth/TeamTalkSimulator/runBot.pl ___________________________________________________________________ Name: svn:executable + * Added: trunk/moast-bth/TeamTalkSimulator/runBotServer.sh =================================================================== --- trunk/moast-bth/TeamTalkSimulator/runBotServer.sh (rev 0) +++ trunk/moast-bth/TeamTalkSimulator/runBotServer.sh 2007-11-02 11:47:06 UTC (rev 864) @@ -0,0 +1,16 @@ +#!/bin/bash + +echo "This job was submitted by user: $PBS_O_LOGNAME" +echo "This job was submitted to host: $PBS_O_HOST" +echo "This job was submitted to queue: $PBS_O_QUEUE" +echo "PBS working directory: $PBS_O_WORKDIR" +echo "PBS job id: $PBS_JOBID" +echo "PBS job name: $PBS_JOBNAME" +echo "PBS environment: $PBS_ENVIRONMENT" +echo " " +echo "This script is running on `hostname` " + +MOAST=`pwd`/../moast +export CONFIG_NML=${MOAST}/etc/moast.nml +export CONFIG_INI=${MOAST}/etc/moast.ini +sleep 10; Property changes on: trunk/moast-bth/TeamTalkSimulator/runBotServer.sh ___________________________________________________________________ Name: svn:executable + * From tk at edam.speech.cs.cmu.edu Wed Nov 7 00:38:33 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 7 Nov 2007 00:38:33 -0500 Subject: [TeamTalk 329]: [865] trunk/TeamTalk: This is an intermediate commit. Message-ID: <200711070538.lA75cXBu017864@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071107/0c7dd113/attachment-0001.html -------------- next part -------------- Modified: trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj =================================================================== --- trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj 2007-11-02 11:47:06 UTC (rev 864) +++ trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj 2007-11-07 05:38:33 UTC (rev 865) @@ -43,7 +43,7 @@ GetLastInput(); + + string sParseString = ""; + if (parse->Matches("[4_BusAfterThatRequest]")) { + sResult += "period_spec\tnow\n"; + sResult += "time\t{\n"; + sResult += "type\tdeparture\n"; + sResult += "now\ttrue\n"; + sResult += "}\n}"; + return sResult; + } + else { +// THIS IS SOMEWHAT OF AN UGLY HACK: +// we recreate a Galaxy frame containing the parse from the input, +// so that it matches what DateTime expects... + sParseString = "{c parse :slots " + + parse->GetStringProperty("[h4_gal_slotsframe]") + "}"; + } + // call the DateTime.ParseDateTime function and feed it the whole // parse tree TGIGalaxyCall gcGalaxyCall; gcGalaxyCall.sModuleFunction = "datetime.ParseDateTime"; gcGalaxyCall.bBlockingCall = true; - gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", - ((CPhoenixInput *)(pInputManager->GetLastInput()))->PhoenixParseToString())); + gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", + sParseString)); // set the outputs gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":month", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day", "")); @@ -88,7 +112,6 @@ gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_date", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":start_time", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":end_time", "")); - gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":time_duration", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":timeperiod_spec", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_time", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_date", "")); @@ -112,70 +135,210 @@ GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED); // construct the results string - string sResult = "{\n"; - // start with the date part - sResult += "date\t{\n"; if(gcGalaxyCall.s2sOutputs[":valid_date"] == "true") { - if(gcGalaxyCall.s2sOutputs[":month"] != "") + sResult += "date\t{\n"; + + if(gcGalaxyCall.s2sOutputs[":month"] != "") sResult += "month\t" + gcGalaxyCall.s2sOutputs[":month"] + "\n"; if(gcGalaxyCall.s2sOutputs[":day"] != "") sResult += "day\t" + gcGalaxyCall.s2sOutputs[":day"] + "\n"; if(gcGalaxyCall.s2sOutputs[":year"] != "") sResult += "year\t" + gcGalaxyCall.s2sOutputs[":year"] + "\n"; - sResult += "valid_date\ttrue\n"; - if(gcGalaxyCall.s2sOutputs[":past_date"] != "") - sResult += "past_date\t" + gcGalaxyCall.s2sOutputs[":past_date"] + "\n"; if(gcGalaxyCall.s2sOutputs[":weekday"] != "") sResult += "weekday\t" + gcGalaxyCall.s2sOutputs[":weekday"] + "\n"; + + sResult += "}\n"; } - if(gcGalaxyCall.s2sOutputs[":need_date"] != "") - sResult += "need_date\t" + gcGalaxyCall.s2sOutputs[":need_date"] + "\n"; - if(gcGalaxyCall.s2sOutputs[":date_exists"] != "") - sResult += "date_exists\t" + gcGalaxyCall.s2sOutputs[":date_exists"] + "\n"; - if(gcGalaxyCall.s2sOutputs[":ambiguous"] != "") - sResult += "ambiguous\t" + gcGalaxyCall.s2sOutputs[":ambiguous"] + "\n"; - else - sResult += "ambiguous\tfalse\n"; - if(gcGalaxyCall.s2sOutputs[":date_choice"] != "") - sResult += "date_choice\t" + gcGalaxyCall.s2sOutputs[":date_choice"] + "\n"; - // finish the date part - sResult += "}\n"; - // start the time part - sResult += "time\t{\n"; if(gcGalaxyCall.s2sOutputs[":valid_time"] == "true") { - // hacks for adapting to the way DateTime4 returns default values in some of the - // fields (i.e start_time, end_time) - if((gcGalaxyCall.s2sOutputs[":start_time"] != "") && - (gcGalaxyCall.s2sOutputs[":start_time"] != "0") && - ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 1)) - sResult += "start_time\t" + gcGalaxyCall.s2sOutputs[":start_time"] + "\n"; - if((gcGalaxyCall.s2sOutputs[":end_time"] != "") && - (gcGalaxyCall.s2sOutputs[":end_time"] != "0") && - ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 59) && - ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 99) && - (gcGalaxyCall.s2sOutputs[":end_time"] != gcGalaxyCall.s2sOutputs[":start_time"])) - sResult += "end_time\t" + gcGalaxyCall.s2sOutputs[":end_time"] + "\n"; - if(gcGalaxyCall.s2sOutputs[":valid_time"] != "") - sResult += "valid_time\ttrue\n"; - if(gcGalaxyCall.s2sOutputs[":day_skip"] != "") - sResult += "day_skip\t" + gcGalaxyCall.s2sOutputs[":day_skip"] + "\n"; - if(gcGalaxyCall.s2sOutputs[":past_time"] != "") - sResult += "past_time\t" + gcGalaxyCall.s2sOutputs[":past_time"] + "\n"; - if(gcGalaxyCall.s2sOutputs[":timeperiod_spec"] != "") - sResult += "timeperiod_spec\t" + gcGalaxyCall.s2sOutputs[":timeperiod_spec"] + "\n"; - } - if(gcGalaxyCall.s2sOutputs[":time_duration"] != "") - sResult += "time_duration\t" + gcGalaxyCall.s2sOutputs[":time_duration"] + "\n"; - // finish the time part + + sResult += "time\t{\n"; + + // for now, we ignore intervals (i.e. "morning" or "between two and three p m" + // and only accept exact times + if (gcGalaxyCall.s2sOutputs[":start_time"] == + gcGalaxyCall.s2sOutputs[":end_time"]) { + + if((gcGalaxyCall.s2sOutputs[":start_time"] != "") && + (gcGalaxyCall.s2sOutputs[":start_time"] != "1199")) { + // This is a hack to infer am/pm + // "six" means 6am when it is 5am and 6pm when it is 5pm + time_t l_time; + time(&l_time); + struct tm s_time; + localtime_s(&s_time, &l_time); + int i_time = s_time.tm_hour*100 + s_time.tm_min; + int dt_time = atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()); + if (dt_time >= 1200) dt_time -= 1200; + if (i_time < 1200) { + // NB: if people say "six" at "6:10am" it still + // means "6am" (hence the "-15") + if (dt_time < i_time-15) dt_time += 1200; + } + else { + if (dt_time >= i_time-1215) dt_time += 1200; + } + + if (gcGalaxyCall.s2sOutputs[":timeperiod_spec"] == "now ") { + char tmp[256]; + sprintf_s(tmp, "value\t%d\n", dt_time); + sResult += tmp; + sResult += "now\ttrue\n"; + } + else if ((gcGalaxyCall.s2sOutputs[":timeperiod_spec"] == "")&& + (gcGalaxyCall.s2sOutputs[":day"] == "-1")) { + char tmp[256]; + sprintf_s(tmp, "value\t%d\n", dt_time); + sResult += tmp; + + } + else { + sResult += "value\t" + gcGalaxyCall.s2sOutputs[":start_time"] + "\n"; + } + + bGotTime = true; + } + } + + if (bGotTime) { + // Is the given time a desired departure or arrival time? + if (parse->Matches("[4_ArrivalTime]")|| + parse->Matches("[3_ArrivalPlace]")|| + parse->Matches("[DisambiguateArrival]")) { + sResult += "type\tarrival\n"; + } + // Default value is departure + else { + sResult += "type\tdeparture\n"; + } + } + + sResult += "}\n"; + + } + + // Adds the time period specifier if there is one + if (gcGalaxyCall.s2sOutputs[":timeperiod_spec"] != "") { + sResult += "period_spec\t" + gcGalaxyCall.s2sOutputs[":timeperiod_spec"] + "\n"; + } + sResult += "}\n"; - - // close it all - sResult += "}\n"; return sResult; } +//// D: Filter for transforming an ascii string representation of a date into +//// an actual date structure: uses the DateTime4 Hub Galaxt module +//string DateTime4_DateTimeBindingFilter(string sSlotName, string sSlotValue) { +// +// // call the DateTime.ParseDateTime function and feed it the whole +// // parse tree +// TGIGalaxyCall gcGalaxyCall; +// gcGalaxyCall.sModuleFunction = "datetime.ParseDateTime"; +// gcGalaxyCall.bBlockingCall = true; +// gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", +// ((CPhoenixInput *)(pInputManager->GetLastInput()))->PhoenixParseToString())); +// +// // set the outputs +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":month", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":year", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_date", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":start_time", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":end_time", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":time_duration", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":timeperiod_spec", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_time", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_date", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day_skip", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":weekday", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_time", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":need_date", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":date_exists", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":ambiguous", "")); +// gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":date_choice", "")); +// +// // retrieve the current thread id +// DWORD dwThreadId = GetCurrentThreadId(); +// +// // send the message to the Galaxy Interface Thread +// PostThreadMessage(g_idDMInterfaceThread, WM_GALAXYCALL, +// (WPARAM)&gcGalaxyCall, dwThreadId); +// +// // and wait for a reply +// MSG Message; +// GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED); +// +// // construct the results string +// string sResult = "{\n"; +// +// // start the time part +// sResult += "time\t{\n"; +// if(gcGalaxyCall.s2sOutputs[":valid_time"] == "true") { +// // hacks for adapting to the way DateTime4 returns default values in some of the +// // fields (i.e start_time, end_time) +// if((gcGalaxyCall.s2sOutputs[":start_time"] != "") && +// (gcGalaxyCall.s2sOutputs[":start_time"] != "0") && +// ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 1) && +// (atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) > 0) && +// (atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) < 2400) && +// ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 59) && +// ((atoi(gcGalaxyCall.s2sOutputs[":start_time"].c_str()) % 100) != 99)) +// sResult += "start_time\t" + gcGalaxyCall.s2sOutputs[":start_time"] + "\n"; +// if((gcGalaxyCall.s2sOutputs[":end_time"] != "") && +// (gcGalaxyCall.s2sOutputs[":end_time"] != "0") && +// ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 1) && +// (atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) > 0) && +// (atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) < 2400) && +// ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 59) && +// ((atoi(gcGalaxyCall.s2sOutputs[":end_time"].c_str()) % 100) != 99) && +// (gcGalaxyCall.s2sOutputs[":end_time"] != gcGalaxyCall.s2sOutputs[":start_time"])) +// sResult += "end_time\t" + gcGalaxyCall.s2sOutputs[":end_time"] + "\n"; +// if(gcGalaxyCall.s2sOutputs[":timeperiod_spec"] != "") { +// string sTimePeriodSpec = Trim(gcGalaxyCall.s2sOutputs[":timeperiod_spec"]); +// if(sTimePeriodSpec == "pm") +// sTimePeriodSpec = "afternoon"; +// else if(sTimePeriodSpec == "am") +// sTimePeriodSpec = "morning"; +// if((sTimePeriodSpec != "anytime") && (sTimePeriodSpec != "now")) +// sResult += "timeperiod_spec\t" + sTimePeriodSpec + "\n"; +// } +// } +// if(gcGalaxyCall.s2sOutputs[":time_duration"] != "") +// sResult += "time_duration\t" + gcGalaxyCall.s2sOutputs[":time_duration"] + "\n"; +// // finish the time part +// sResult += "}\n"; +// +// // now do the date part +// sResult += "date\t{\n"; +// if(gcGalaxyCall.s2sOutputs[":valid_date"] == "true") { +// if(gcGalaxyCall.s2sOutputs[":month"] != "") +// sResult += "month\t" + gcGalaxyCall.s2sOutputs[":month"] + "\n"; +// if(gcGalaxyCall.s2sOutputs[":day"] != "") +// sResult += "day\t" + gcGalaxyCall.s2sOutputs[":day"] + "\n"; +// if(gcGalaxyCall.s2sOutputs[":year"] != "") +// sResult += "year\t" + gcGalaxyCall.s2sOutputs[":year"] + "\n"; +// sResult += "valid_date\ttrue\n"; +// if(gcGalaxyCall.s2sOutputs[":past_date"] != "") +// sResult += "past_date\t" + gcGalaxyCall.s2sOutputs[":past_date"] + "\n"; +// if(gcGalaxyCall.s2sOutputs[":weekday"] != "") +// sResult += "weekday\t" + gcGalaxyCall.s2sOutputs[":weekday"] + "\n"; +// } +// if(gcGalaxyCall.s2sOutputs[":ambiguous"] != "") +// sResult += "ambiguous\t" + gcGalaxyCall.s2sOutputs[":ambiguous"] + "\n"; +// else if(gcGalaxyCall.s2sOutputs[":valid_date"] == "true") +// sResult += "ambiguous\tfalse\n"; +// if(gcGalaxyCall.s2sOutputs[":date_choice"] != "") +// sResult += "date_choice\t" + gcGalaxyCall.s2sOutputs[":date_choice"] + "\n"; +// // finish the date part +// sResult += "}\n"; +// +// // close it all +// sResult += "}\n"; +// +// +// return sResult; +//} @@ -185,15 +348,40 @@ // and if the start and end times are the same, then it considers it an // end_time. This is basically just a hack to deal with inconsistencies in // DateTime4 -string DateTime4_EndTimeBindingFilter(string sSlotName, string sSlotValue) { +string EndTimeBindingFilter(string sSlotName, string sSlotValue) { + bool bGotTime = false; + + string sResult = "{\n"; + + // Get the parse of the last utterance + CPhoenixInput *parse = (CPhoenixInput*)pInteractionEventManager->GetLastInput(); + + string sParseString = ""; + if (parse->Matches("[4_BusAfterThatRequest]")) { + sResult += "period_spec\tnow\n"; + sResult += "time\t{\n"; + sResult += "type\tdeparture\n"; + sResult += "now\ttrue\n"; + sResult += "}\n}"; + return sResult; + } + else { +// THIS IS SOMEWHAT OF AN UGLY HACK: +// we recreate a Galaxy frame containing the parse from the input, +// so that it matches what DateTime expects... + sParseString = "{c parse :slots " + + parse->GetStringProperty("[h4_gal_slotsframe]") + "}"; + } + // call the DateTime.ParseDateTime function and feed it the whole // parse tree TGIGalaxyCall gcGalaxyCall; gcGalaxyCall.sModuleFunction = "datetime.ParseDateTime"; gcGalaxyCall.bBlockingCall = true; - gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", - ((CPhoenixInput *)(pInputManager->GetLastInput()))->PhoenixParseToString())); + gcGalaxyCall.s2sInputs.insert(STRING2STRING::value_type(":Date_Time_Parse", + sParseString)); + // set the outputs gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":month", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":day", "")); @@ -201,7 +389,6 @@ gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_date", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":start_time", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":end_time", "")); - gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":time_duration", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":timeperiod_spec", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":valid_time", "")); gcGalaxyCall.s2sOutputs.insert(STRING2STRING::value_type(":past_date", "")); @@ -224,9 +411,6 @@ MSG Message; GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED); - // construct the results string - string sResult = "{\n"; - // only the time part sResult += "time\t{\n"; if(gcGalaxyCall.s2sOutputs[":valid_time"] == "true") { @@ -283,4 +467,4 @@ GetMessage(&Message, NULL, WM_ACTIONFINISHED, WM_ACTIONFINISHED); return gcGalaxyCall.s2sOutputs[":number_int"]; -} \ No newline at end of file +} Modified: trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.h =================================================================== --- trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.h 2007-11-02 11:47:06 UTC (rev 864) +++ trunk/TeamTalk/Agents/TeamTalkDM/BindingFilters.h 2007-11-07 05:38:33 UTC (rev 865) @@ -73,7 +73,7 @@ // D: Filter for transforming an ascii string representation of a date into // an actual date structure: uses the DateTime4 Hub Galaxt module -string DateTime4_DateTimeBindingFilter(string sSlotName, string sSlotValue); +string DateTimeBindingFilter(string sSlotName, string sSlotValue); // D: Filter for transforming an ascii string representation of a date into // an actual date structure: uses the DateTime4 Hub Galaxt module. This @@ -81,7 +81,7 @@ // and if the start and end times are the same, then it considers it an // end_time. This is basically just a hack to deal with inconsistencies in // DateTime4 -string DateTime4_EndTimeBindingFilter(string sSlotName, string sSlotValue); +string EndTimeBindingFilter(string sSlotName, string sSlotValue); // D: Filter for transforming an ascii string representation of a number (i.e. // five hundred thirty four) to the ascii numerical representation (i.e. Modified: trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj =================================================================== --- trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj 2007-11-02 11:47:06 UTC (rev 864) +++ trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj 2007-11-07 05:38:33 UTC (rev 865) @@ -43,7 +43,7 @@ true") + EXPECT_CONCEPT(report_command_issued) + GRAMMAR_MAPPING("[HumanReportCommand]>true") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/Report/InformReport //----------------------------------------------------------------------------- DEFINE_INFORM_AGENT(CInformReport, - PROMPT("inform my_report true") + EXPECT_CONCEPT(report_location_command_issued) + GRAMMAR_MAPPING("[HumanLocationQuery]>true") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/QueryLocation/ExecuteGetLocation //----------------------------------------------------------------------------- DEFINE_EXECUTE_AGENT(CExecuteGetLocation, - CALL("gal_be.launch_query query=location_query true") + EXPECT_CONCEPT(move_cardinal_command_issued) + GRAMMAR_MAPPING("[MoveVectorCardinal]>true") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/MoveRelative/ExpectMoveRelativeCommand //----------------------------------------------------------------------------- DEFINE_EXPECT_AGENT(CExpectMoveRelativeCommand, - EXPECT_CONCEPT(move_relative_command_issued) - //EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") || - // *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))) - GRAMMAR_MAPPING("[MoveVectorRelative]>true") + EXPECT_CONCEPT(move_relative_command_issued) + GRAMMAR_MAPPING("[MoveVectorRelative]>true") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/Move/RequestCardinalDirection //----------------------------------------------------------------------------- DEFINE_REQUEST_AGENT(CRequestCardinalDirection, - REQUEST_CONCEPT(direction) - //EXPECT_WHEN((*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") || - // *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))) - PROMPT("request direction report") + PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance)) + CALL("gal_be.launch_query query=move_cardinal_command report") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/Move/ExecuteRelativeMove //----------------------------------------------------------------------------- DEFINE_EXECUTE_AGENT(CExecuteRelativeMove, - PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance)) - CALL("gal_be.launch_query query=move_relative_command report") + PRECONDITION(AVAILABLE(direction) && AVAILABLE(distance)) + CALL("gal_be.launch_query query=move_relative_command report") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/ReportMove //----------------------------------------------------------------------------- DEFINE_AGENCY(CReportMove, - PRECONDITION(UPDATED(move_report) && - (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") || - *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))) - DEFINE_SUBAGENTS( - SUBAGENT(ExpectReportMove, CExpectReportMove, "") - SUBAGENT(InformMove, CInformMove, "") - ) + PRECONDITION(UPDATED(move_report) && + (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") || + *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))) + DEFINE_SUBAGENTS( + SUBAGENT(ExpectReportMove, CExpectReportMove, "") + SUBAGENT(InformMove, CInformMove, "") + ) ) //----------------------------------------------------------------------------- // /TeamTalk/Task/ReportMove/ExpectReportMove //----------------------------------------------------------------------------- DEFINE_EXPECT_AGENT(CExpectReportMove, - EXPECT_CONCEPT(move_report) - EXPECT_WHEN( - (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") || - *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))) - GRAMMAR_MAPPING("[RobotMessage.Move]") + EXPECT_CONCEPT(move_report) + EXPECT_WHEN( + (*C("current_addressee").CreateMergedHistoryConcept() == C("robot_name") || + *C("current_addressee").CreateMergedHistoryConcept() == C("everyone"))) + GRAMMAR_MAPPING("[RobotMessage.Move]") ) //----------------------------------------------------------------------------- // /TeamTalk/Task/ReportMove/InformMove //----------------------------------------------------------------------------- DEFINE_INFORM_AGENT(CInformMove, - PROMPT("inform report_move_status An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071107/207e661a/attachment.html -------------- next part -------------- Property changes on: tags/2007-tt-fallback/Agents ___________________________________________________________________ Name: svn:externals - Pythia http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Pythia Helios http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Helios3 Kalliope http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Kalliope MultiDecoder/Audio_Server http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/MultiDecoder/Audio_Server MultiDecoder/Sphinx_Engine http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/MultiDecoder/Sphinx_Engine NlgServer http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/NlgServer2 Phoenix http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Phoenix2 DateTime http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/DateTime4 + Pythia -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Pythia Helios -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Helios3 Kalliope -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Kalliope MultiDecoder/Audio_Server -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/MultiDecoder/Audio_Server MultiDecoder/Sphinx_Engine -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/MultiDecoder/Sphinx_Engine NlgServer -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/NlgServer2 Phoenix -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/Phoenix2 DateTime -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Agents/DateTime4 Property changes on: tags/2007-tt-fallback/Libraries ___________________________________________________________________ Name: svn:externals - Galaxy http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Galaxy Phoenix http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Phoenix RavenClaw http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/RavenClaw Rosetta http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Rosetta sphinx2 https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/sphinx2 sphinx2msdev http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/trunkSphinx2msdev + Galaxy -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Galaxy Phoenix -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Phoenix RavenClaw -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/RavenClaw Rosetta -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/Rosetta sphinx2 -r7289 https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/sphinx2 sphinx2msdev -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Libraries/trunkSphinx2msdev Property changes on: tags/2007-tt-fallback/Tools ___________________________________________________________________ Name: svn:externals - MakeLM http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/MakeLM VBScribe http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/VBScribe + MakeLM -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/MakeLM VBScribe -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/VBScribe From tk at edam.speech.cs.cmu.edu Wed Nov 7 13:01:34 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 7 Nov 2007 13:01:34 -0500 Subject: [TeamTalk 331]: [867] trunk/TeamTalk/Agents/PenDecoder: Made PenDecoder ant script use OLYMPUS_ROOT to access Galaxy java bindings . Message-ID: <200711071801.lA7I1YMo022068@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071107/6747e8be/attachment.html -------------- next part -------------- Modified: trunk/TeamTalk/Agents/PenDecoder/build.xml =================================================================== --- trunk/TeamTalk/Agents/PenDecoder/build.xml 2007-11-07 16:33:02 UTC (rev 866) +++ trunk/TeamTalk/Agents/PenDecoder/build.xml 2007-11-07 18:01:34 UTC (rev 867) @@ -66,4 +66,16 @@ nbproject/build-impl.xml file. --> + + + + + + + + + + + + Modified: trunk/TeamTalk/Agents/PenDecoder/nbproject/project.properties =================================================================== --- trunk/TeamTalk/Agents/PenDecoder/nbproject/project.properties 2007-11-07 16:33:02 UTC (rev 866) +++ trunk/TeamTalk/Agents/PenDecoder/nbproject/project.properties 2007-11-07 18:01:34 UTC (rev 867) @@ -16,11 +16,15 @@ dist.dir=dist dist.jar=${dist.dir}/PenDecoder.jar dist.javadoc.dir=${dist.dir}/javadoc +file.reference.bsh-core-2.0b4.jar=bsh-core-2.0b4.jar +file.reference.bsh-util-2.0b4.jar=bsh-util-2.0b4.jar +file.reference.galaxy.jar=${Env-OLYMPUS_ROOT}/Libraries/Galaxy/contrib/MITRE/bindings/java/lib/galaxy.jar file.reference.PenDecoder-src=src jar.compress=false javac.classpath=\ - ${libs.BeanShell.classpath}:\ - ${libs.Galaxy.classpath} + ${file.reference.bsh-core-2.0b4.jar}:\ + ${file.reference.bsh-util-2.0b4.jar}:\ + ${file.reference.galaxy.jar} # Space-separated list of extra javac options javac.compilerargs=-Xlint javac.deprecation=false @@ -41,12 +45,6 @@ javadoc.use=true javadoc.version=false javadoc.windowtitle= -# Property libs.BeanShell.classpath is set here just to make sharing of project simpler. -# The library definition has always preference over this property. -libs.BeanShell.classpath=bsh-core-2.0b4.jar;bsh-util-2.0b4.jar -# Property libs.Galaxy.classpath is set here just to make sharing of project simpler. -# The library definition has always preference over this property. -libs.Galaxy.classpath=../../Libraries/Galaxy/contrib/MITRE/bindings/java/lib/galaxy.jar main.class=edu.cmu.ravenclaw.pendecoder.PenDecoderServer manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF From tk at edam.speech.cs.cmu.edu Wed Nov 7 16:58:55 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Wed, 7 Nov 2007 16:58:55 -0500 Subject: [TeamTalk 332]: [868] trunk/TeamTalk/Resources/DecoderConfig/AcousticModels/: Adding continuous models. Message-ID: <200711072158.lA7LwtLK025641@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071107/ba25a170/attachment.html -------------- next part -------------- Property changes on: trunk/TeamTalk/Resources/DecoderConfig/AcousticModels ___________________________________________________________________ Name: svn:externals + hub4_cd_continuous_8gau_1s_c_d_dd https://cmusphinx.svn.sourceforge.net/svnroot/cmusphinx/trunk/sphinx3/model/hmm/hub4_cd_continuous_8gau_1s_c_d_dd From tk at edam.speech.cs.cmu.edu Thu Nov 8 17:05:23 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 8 Nov 2007 17:05:23 -0500 Subject: [TeamTalk 333]: [869] trunk/TeamTalk/Agents/TeamTalkBackend: Dynamic processes now use OLYMPUS_ROOT. Message-ID: <200711082205.lA8M5NwX030791@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071108/d2aa6cfc/attachment-0001.html -------------- next part -------------- Modified: trunk/TeamTalk/Agents/TeamTalkBackend/agent.cpp =================================================================== --- trunk/TeamTalk/Agents/TeamTalkBackend/agent.cpp 2007-11-07 21:58:55 UTC (rev 868) +++ trunk/TeamTalk/Agents/TeamTalkBackend/agent.cpp 2007-11-08 22:05:23 UTC (rev 869) @@ -1,7 +1,7 @@ #include "agent.h" #include #ifdef WIN32 -#include +# include #endif #include @@ -23,14 +23,14 @@ void Agent::spawnHub(const string& uppername) { - static const string HUB = "..\\..\\Libraries\\Galaxy\\Bin\\x86-nt\\hub.exe"; + static const string HUB = OLYMPUS_ROOT + "\\Bin\\x86-nt\\HUB.exe"; - map subs; - subs["%%DialogManager%%"] = uppername; - subs["%%DMPort%%"] = stringOf(iDMPort); - subs["%%HeliosPort%%"] = stringOf(iHeliosPort); + map subs; + subs["%%DialogManager%%"] = uppername; + subs["%%DMPort%%"] = stringOf(iDMPort); + subs["%%HeliosPort%%"] = stringOf(iHeliosPort); - string cfilename = writeSpecializedConfig("TeamTalk-hub-desktop", "pgm", subs, uppername); + string cfilename = writeSpecializedConfig("TeamTalk-hub-desktop", "pgm", subs, uppername); ostringstream cmd, title; cmd << HUB << " -verbosity 3 -pgm_file " << cfilename; @@ -41,12 +41,12 @@ void Agent::spawnHelios(const string& uppername) { - static const string HELIOS = "..\\..\\Bin\\x86-nt\\Helios3.exe"; + static const string HELIOS = OLYMPUS_ROOT + "\\Bin\\x86-nt\\Helios.exe"; map subs; - subs["%%NAME%%"] = uppername; + subs["%%NAME%%"] = uppername; - string cfilename = writeSpecializedConfig("helios", "cfg", subs, uppername); + string cfilename = writeSpecializedConfig("helios", "cfg", subs, uppername); ostringstream cmd, title; cmd << HELIOS << " -maxconns 6 -port " << iHeliosPort << " -config " << cfilename; @@ -60,23 +60,23 @@ static const string DM = "..\\..\\Bin\\x86-nt\\TeamTalkDM.exe"; map subs; - subs["%%ServerName%%"] = uppername; - subs["%%ServerPort%%"] = stringOf(iDMPort); - if(safeness == "SAFE") { - subs["%%EXPLORATION_MODE%%"] = "epsilon-greedy"; - subs["%%EXPL_CONF-CONFIDENT%%"] = "-"; - subs["%%ACCEPT-UNCONFIDENT%%"] = "10"; - subs["%%EXPL_CONF-UNCONFIDENT%%"] = "-"; - } else { - subs["%%EXPLORATION_MODE%%"] = "greedy"; - subs["%%EXPL_CONF-CONFIDENT%%"] = "0"; - subs["%%ACCEPT-UNCONFIDENT%%"] = "-100"; - subs["%%EXPL_CONF-UNCONFIDENT%%"] = "10"; - } + subs["%%ServerName%%"] = uppername; + subs["%%ServerPort%%"] = stringOf(iDMPort); + if(safeness == "SAFE") { + subs["%%EXPLORATION_MODE%%"] = "epsilon-greedy"; + subs["%%EXPL_CONF-CONFIDENT%%"] = "-"; + subs["%%ACCEPT-UNCONFIDENT%%"] = "10"; + subs["%%EXPL_CONF-UNCONFIDENT%%"] = "-"; + } else { + subs["%%EXPLORATION_MODE%%"] = "greedy"; + subs["%%EXPL_CONF-CONFIDENT%%"] = "0"; + subs["%%ACCEPT-UNCONFIDENT%%"] = "-100"; + subs["%%EXPL_CONF-UNCONFIDENT%%"] = "10"; + } - writeSpecializedConfig("expl", "pol", subs, uppername); - writeSpecializedConfig("grounding", "policies", subs, uppername); - string cfilename = writeSpecializedConfig("TeamTalkDM", "cfg", subs, uppername); + writeSpecializedConfig("expl", "pol", subs, uppername); + writeSpecializedConfig("grounding", "policies", subs, uppername); + string cfilename = writeSpecializedConfig("TeamTalkDM", "cfg", subs, uppername); ostringstream cmd, title; cmd << DM << " -maxconns 6 -config " << cfilename; @@ -96,120 +96,120 @@ const map& subs, const string name) { - ostringstream cfilename; - cfilename << temp; - if(!name.empty()) cfilename << '-' << name; - cfilename << '.' << ext; - ostringstream tfilename; - tfilename << temp << "-template" << '.' << ext; + ostringstream cfilename; + cfilename << temp; + if(!name.empty()) cfilename << '-' << name; + cfilename << ".instance." << ext; + ostringstream tfilename; + tfilename << temp << "-template" << '.' << ext; - //get config template - string ss; - { - ifstream ctemplate(tfilename.str().c_str()); - stringbuf s; - ctemplate.get(s, char_traits::eof()); - ss = s.str(); - } + //get config template + string ss; + { + ifstream ctemplate(tfilename.str().c_str()); + stringbuf s; + ctemplate.get(s, char_traits::eof()); + ss = s.str(); + } - substitute(ss, subs); + substitute(ss, subs); - //write new config file - ofstream config(cfilename.str().c_str()); - config << ss; + //write new config file + ofstream config(cfilename.str().c_str()); + config << ss; - return cfilename.str(); + return cfilename.str(); } Gal_Frame Agent::galaxyFrame(const Msg* msgp) { - Gal_Frame f; + Gal_Frame f; - //robot reporting location - const MsgRobLocation *rloc = dynamic_cast(msgp); - if(rloc != NULL) { - f = Gal_MakeFrame("robot_message", GAL_CLAUSE); - Gal_SetProp(f, ":type", Gal_StringObject("location")); - Gal_SetProp(f, ":robot_name", Gal_StringObject(rloc->getSender().c_str())); - Gal_SetProp(f, ":x", Gal_FloatObject((float)rloc->getX())); - Gal_SetProp(f, ":y", Gal_FloatObject((float)rloc->getY())); - Gal_SetProp(f, ":r", Gal_FloatObject((float)rloc->getAngle())); + //robot reporting location + const MsgRobLocation *rloc = dynamic_cast(msgp); + if(rloc != NULL) { + f = Gal_MakeFrame("robot_message", GAL_CLAUSE); + Gal_SetProp(f, ":type", Gal_StringObject("location")); + Gal_SetProp(f, ":robot_name", Gal_StringObject(rloc->getSender().c_str())); + Gal_SetProp(f, ":x", Gal_FloatObject((float)rloc->getX())); + Gal_SetProp(f, ":y", Gal_FloatObject((float)rloc->getY())); + Gal_SetProp(f, ":r", Gal_FloatObject((float)rloc->getAngle())); Gal_SetProp(f, ":error", Gal_IntObject(rloc->getErrorState())); - return f; - } + return f; + } - //robot reporting a movement - const MsgCmdGoTo *move = dynamic_cast(msgp); - if(move != NULL) { - f = Gal_MakeFrame("robot_message", GAL_CLAUSE); - Gal_SetProp(f, ":type", Gal_StringObject("goal")); - Gal_SetProp(f, ":robot_name", Gal_StringObject(move->getSender().c_str())); - Gal_SetProp(f, ":relative", Gal_IntObject(move->isRelative()? 1: 0)); - Gal_SetProp(f, ":x", Gal_FloatObject((float)move->getX())); - Gal_SetProp(f, ":y", Gal_FloatObject((float)move->getY())); + //robot reporting a movement + const MsgCmdGoTo *move = dynamic_cast(msgp); + if(move != NULL) { + f = Gal_MakeFrame("robot_message", GAL_CLAUSE); + Gal_SetProp(f, ":type", Gal_StringObject("goal")); + Gal_SetProp(f, ":robot_name", Gal_StringObject(move->getSender().c_str())); + Gal_SetProp(f, ":relative", Gal_IntObject(move->isRelative()? 1: 0)); + Gal_SetProp(f, ":x", Gal_FloatObject((float)move->getX())); + Gal_SetProp(f, ":y", Gal_FloatObject((float)move->getY())); Gal_SetProp(f, ":status", Gal_StringObject(move->getStatus())); Gal_SetProp(f, ":taskid", Gal_IntObject(move->getTaskID())); - return f; - } + return f; + } - //robot reporting halt - const MsgCmdHalt *halt = dynamic_cast(msgp); - if(halt != NULL) { - f = Gal_MakeFrame("robot_message", GAL_CLAUSE); - Gal_SetProp(f, ":type", Gal_StringObject("halt")); - Gal_SetProp(f, ":robot_name", Gal_StringObject(halt->getSender().c_str())); - return f; - } + //robot reporting halt + const MsgCmdHalt *halt = dynamic_cast(msgp); + if(halt != NULL) { + f = Gal_MakeFrame("robot_message", GAL_CLAUSE); + Gal_SetProp(f, ":type", Gal_StringObject("halt")); + Gal_SetProp(f, ":robot_name", Gal_StringObject(halt->getSender().c_str())); + return f; + } - //robot reporting going to home - const MsgCmdHome *home = dynamic_cast(msgp); - if(home != NULL) { - f = Gal_MakeFrame("robot_message", GAL_CLAUSE); - Gal_SetProp(f, ":type", Gal_StringObject("goal")); - Gal_SetProp(f, ":robot_name", Gal_StringObject(home->getSender().c_str())); - Gal_SetProp(f, ":relative", Gal_IntObject(0)); - Gal_SetProp(f, ":x", Gal_FloatObject(0)); - Gal_SetProp(f, ":y", Gal_FloatObject(0)); + //robot reporting going to home + const MsgCmdHome *home = dynamic_cast(msgp); + if(home != NULL) { + f = Gal_MakeFrame("robot_message", GAL_CLAUSE); + Gal_SetProp(f, ":type", Gal_StringObject("goal")); + Gal_SetProp(f, ":robot_name", Gal_StringObject(home->getSender().c_str())); + Gal_SetProp(f, ":relative", Gal_IntObject(0)); + Gal_SetProp(f, ":x", Gal_FloatObject(0)); + Gal_SetProp(f, ":y", Gal_FloatObject(0)); Gal_SetProp(f, ":status", Gal_StringObject(home->getStatus())); - return f; - } + return f; + } - //robot reporting follow - const MsgCmdFollow *follow = dynamic_cast(msgp); - if(home != NULL) { - f = Gal_MakeFrame("robot_message", GAL_CLAUSE); - Gal_SetProp(f, ":type", Gal_StringObject("follow")); - Gal_SetProp(f, ":robot_name", Gal_StringObject(follow->getSender().c_str())); + //robot reporting follow + const MsgCmdFollow *follow = dynamic_cast(msgp); + if(home != NULL) { + f = Gal_MakeFrame("robot_message", GAL_CLAUSE); + Gal_SetProp(f, ":type", Gal_StringObject("follow")); + Gal_SetProp(f, ":robot_name", Gal_StringObject(follow->getSender().c_str())); Gal_SetProp(f, ":status", Gal_StringObject(follow->getStatus())); - //string host = follow->content()->leader; - //string::size_type i = host.find(':'); - //int port = 0; - //if(i != string::npos) { - // port = atoi(string(host, i+1, host.size()-i-1).c_str()); - // host.resize(i); - //} - //Gal_SetProp(f, ":followee", Gal_StringObject(client.find(host, port).c_str())); - return f; - } + //string host = follow->content()->leader; + //string::size_type i = host.find(':'); + //int port = 0; + //if(i != string::npos) { + // port = atoi(string(host, i+1, host.size()-i-1).c_str()); + // host.resize(i); + //} + //Gal_SetProp(f, ":followee", Gal_StringObject(client.find(host, port).c_str())); + return f; + } - //robot reporting cover - const MsgCmdCover *cover = dynamic_cast(msgp); - if(cover != NULL) { - f = Gal_MakeFrame("robot_message", GAL_CLAUSE); - Gal_SetProp(f, ":type", Gal_StringObject("cover")); - Gal_SetProp(f, ":robot_name", Gal_StringObject(cover->getSender().c_str())); + //robot reporting cover + const MsgCmdCover *cover = dynamic_cast(msgp); + if(cover != NULL) { + f = Gal_MakeFrame("robot_message", GAL_CLAUSE); + Gal_SetProp(f, ":type", Gal_StringObject("cover")); + Gal_SetProp(f, ":robot_name", Gal_StringObject(cover->getSender().c_str())); geometry::Polygon polygon = cover->getPolygon(); Gal_Object *xs = new Gal_Object[polygon.size()]; - Gal_Object *ys = new Gal_Object[polygon.size()]; - for(unsigned int i=0; igetStatus())); - return f; - } + return f; + } //robot sending camera image const MsgMap *image = dynamic_cast(msgp); @@ -221,12 +221,12 @@ Gal_SetProp(f, ":height", Gal_IntObject(image->getHeight())); Gal_SetProp(f, ":invoice", Gal_IntObject(image->getInvoice())); Gal_SetProp(f, ":jpeg", - Gal_BinaryObject((void *) image->getImageData().c_str(), - (int) image->getImageDataSize())); + Gal_BinaryObject((void *) image->getImageData().c_str(), + (int) image->getImageDataSize())); return f; } - return Gal_MakeFrame("bogus", GAL_CLAUSE); + return Gal_MakeFrame("bogus", GAL_CLAUSE); } void Agent::spawnMinorGalaxy(const string& name, const string& safeness) @@ -235,6 +235,7 @@ string uppersafeness(safeness); toupper(uppername); toupper(uppersafeness); info << "got new robot: " << uppername << ' ' << uppersafeness << endl; + OLYMPUS_ROOT = getenv("OLYMPUS_ROOT"); spawnHelios(uppername); spawnDM(uppername, uppersafeness); spawnHub(uppername); @@ -246,20 +247,18 @@ Agent::Agent(TeamTalk::RobotClient* robotClient, GalIO_CommStruct* comm) : name_(robotClient->getName()), robotClient_(robotClient), comm_(comm) {} -Agent::~Agent() -{ -} +Agent::~Agent() {} void Agent::processMessage(const Msg* m) { Gal_Frame f; const MsgRobLocation *rloc = dynamic_cast(m); - if(rloc != NULL) { - if(location_ == *rloc) return; + if(rloc != NULL) { + if(location_ == *rloc) return; if(location_.getErrorState() != rloc->getErrorState()) SendErrorStatusToDM(rloc->getErrorState()); - location_ = *rloc; - } + location_ = *rloc; + } const MsgCmdGoTo *move = dynamic_cast(m); if(move != NULL) SendMoveStatusToDM(move); const MsgRobDone *done = dynamic_cast(m); @@ -277,12 +276,12 @@ commitments_.erase(i); } } else f = galaxyFrame(m); - char *frame_name = Gal_FrameName(f); - if(frame_name != NULL && !strcmp(frame_name, "robot_message")) { - debug << "sending to '" << name_ << "' hub: " << m->render() << endl; - writeFrame(f); - Gal_FreeFrame(f); - } + char *frame_name = Gal_FrameName(f); + if(frame_name != NULL && !strcmp(frame_name, "robot_message")) { + debug << "sending to '" << name_ << "' hub: " << m->render() << endl; + writeFrame(f); + Gal_FreeFrame(f); + } } void Agent::writeFrame(Gal_Frame f) const @@ -306,76 +305,76 @@ void Agent::SendMessageToDM(const string& sMsgType, const map& sMessages) const { - // variables holding the nested galaxy parse frame - Gal_Frame gfInput, gfParse, gfSlot, gfNet; - Gal_Object *pgoParses, *pgoSlots, *pgoNets; + // variables holding the nested galaxy parse frame + Gal_Frame gfInput, gfParse, gfSlot, gfNet; + Gal_Object *pgoParses, *pgoSlots, *pgoNets; - // start assembling the frame - gfInput = Gal_MakeFrame("main", GAL_CLAUSE); + // start assembling the frame + gfInput = Gal_MakeFrame("main", GAL_CLAUSE); - pgoParses = (Gal_Object *)malloc(sizeof(Gal_Object)); - gfParse = Gal_MakeFrame("parse", GAL_CLAUSE); + pgoParses = (Gal_Object *)malloc(sizeof(Gal_Object)); + gfParse = Gal_MakeFrame("parse", GAL_CLAUSE); - pgoSlots = (Gal_Object *)malloc(sizeof(Gal_Object)); - gfSlot = Gal_MakeFrame("slot", GAL_CLAUSE); + pgoSlots = (Gal_Object *)malloc(sizeof(Gal_Object)); + gfSlot = Gal_MakeFrame("slot", GAL_CLAUSE); - pgoNets = (Gal_Object *)calloc(sMessages.size(), sizeof(Gal_Object)); + pgoNets = (Gal_Object *)calloc(sMessages.size(), sizeof(Gal_Object)); string hyp; string parse; - // construct the nets + // construct the nets map::const_iterator smi = sMessages.begin(); for(int i = 0; smi != sMessages.end(); smi++, i++) { if(i) { hyp.append(" "); parse.append(" "); } - gfNet = Gal_MakeFrame("net", GAL_CLAUSE); + gfNet = Gal_MakeFrame("net", GAL_CLAUSE); string sNetName = " " + smi->first + " "; - Gal_SetProp(gfNet, ":name", Gal_StringObject(sNetName.c_str())); - Gal_SetProp(gfNet, ":contents", Gal_StringObject(smi->second.c_str())); + Gal_SetProp(gfNet, ":name", Gal_StringObject(sNetName.c_str())); + Gal_SetProp(gfNet, ":contents", Gal_StringObject(smi->second.c_str())); hyp.append(smi->second); parse.append("( " + smi->first + "( " + smi->second + " ) )"); - pgoNets[i] = Gal_FrameObject(gfNet); + pgoNets[i] = Gal_FrameObject(gfNet); } - // then construct the encompassing slot - Gal_SetProp(gfSlot, ":nets", Gal_ListObject(pgoNets, (int)sMessages.size())); - Gal_SetProp(gfSlot, ":numnets", Gal_IntObject((int)sMessages.size())); + // then construct the encompassing slot + Gal_SetProp(gfSlot, ":nets", Gal_ListObject(pgoNets, (int)sMessages.size())); + Gal_SetProp(gfSlot, ":numnets", Gal_IntObject((int)sMessages.size())); string sNetName = " " + sMsgType + " "; - Gal_SetProp(gfSlot, ":name", Gal_StringObject(sNetName.c_str())); - Gal_SetProp(gfSlot, ":contents", Gal_StringObject(hyp.c_str())); - Gal_SetProp(gfSlot, ":frame", Gal_StringObject(" RobotMessage ")); - pgoSlots[0] = Gal_FrameObject(gfSlot); + Gal_SetProp(gfSlot, ":name", Gal_StringObject(sNetName.c_str())); + Gal_SetProp(gfSlot, ":contents", Gal_StringObject(hyp.c_str())); + Gal_SetProp(gfSlot, ":frame", Gal_StringObject(" RobotMessage ")); + pgoSlots[0] = Gal_FrameObject(gfSlot); - // then construct the encompassing parse - Gal_SetProp(gfParse, ":slots", Gal_ListObject(pgoSlots, 1)); - Gal_SetProp(gfParse, ":numslots", Gal_IntObject(1)); - Gal_SetProp(gfParse, ":uttid", Gal_StringObject("-1")); - Gal_SetProp(gfParse, ":hyp", Gal_StringObject(hyp.c_str())); - Gal_SetProp(gfParse, ":hyp_index", Gal_IntObject(0)); - Gal_SetProp(gfParse, ":hyp_num_parses", Gal_IntObject(1)); - Gal_SetProp(gfParse, ":decoder_score", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":am_score", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":lm_score", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":frame_num", Gal_IntObject(0)); - Gal_SetProp(gfParse, ":acoustic_gap_norm", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":avg_wordconf", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":min_wordconf", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":max_wordconf", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":avg_validwordconf", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":min_validwordconf", Gal_FloatObject(0)); - Gal_SetProp(gfParse, ":max_validwordconf", Gal_FloatObject(0)); - string sParseString = "RobotMessage \n" + sMsgType + " " + parse + "\n\n"; - Gal_SetProp(gfParse, ":parsestring", Gal_StringObject(sParseString.c_str())); - pgoParses[0] = Gal_FrameObject(gfParse); + // then construct the encompassing parse + Gal_SetProp(gfParse, ":slots", Gal_ListObject(pgoSlots, 1)); + Gal_SetProp(gfParse, ":numslots", Gal_IntObject(1)); + Gal_SetProp(gfParse, ":uttid", Gal_StringObject("-1")); + Gal_SetProp(gfParse, ":hyp", Gal_StringObject(hyp.c_str())); + Gal_SetProp(gfParse, ":hyp_index", Gal_IntObject(0)); + Gal_SetProp(gfParse, ":hyp_num_parses", Gal_IntObject(1)); + Gal_SetProp(gfParse, ":decoder_score", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":am_score", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":lm_score", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":frame_num", Gal_IntObject(0)); + Gal_SetProp(gfParse, ":acoustic_gap_norm", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":avg_wordconf", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":min_wordconf", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":max_wordconf", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":avg_validwordconf", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":min_validwordconf", Gal_FloatObject(0)); + Gal_SetProp(gfParse, ":max_validwordconf", Gal_FloatObject(0)); + string sParseString = "RobotMessage \n" + sMsgType + " " + parse + "\n\n"; + Gal_SetProp(gfParse, ":parsestring", Gal_StringObject(sParseString.c_str())); + pgoParses[0] = Gal_FrameObject(gfParse); - Gal_SetProp(gfInput, ":parses", Gal_ListObject(pgoParses, 1)); - Gal_SetProp(gfInput, ":total_numparses", Gal_IntObject(1)); - Gal_SetProp(gfInput, ":input_source", Gal_StringObject("TeamTalkBackend")); + Gal_SetProp(gfInput, ":parses", Gal_ListObject(pgoParses, 1)); + Gal_SetProp(gfInput, ":total_numparses", Gal_IntObject(1)); + Gal_SetProp(gfInput, ":input_source", Gal_StringObject("TeamTalkBackend")); - // finally, write it to the hub + // finally, write it to the hub writeFrame(gfInput); //and free everything @@ -388,7 +387,7 @@ void Agent::SendErrorStatusToDM(int error) const { string error_report = (error? "I am experiencing an error condition. Please help.": "All systems are OK."); - SendMessageToDM("ERROR", error_report); +SendMessageToDM("ERROR", error_report); } void Agent::SendMoveStatusToDM(const MsgCmdGoTo* move) const { @@ -443,290 +442,290 @@ void Agent::location_query() const { static const char *const compass_points[] = { - "east", "east north east", "north east", "north north east", - "north", "north north west", "north west", "west north west", - "west", "west south west", "south west", "south south west", - "south", "south south east", "south east", "east south east"}; - static const float precision = 1.1F; //110 cm precision + "east", "east north east", "north east", "north north east", + "north", "north north west", "north west", "west north west", + "west", "west south west", "south west", "south south west", + "south", "south south east", "south east", "east south east"}; + static const float precision = 1.1F; //110 cm precision - ostringstream ossMessage; - const Point p = location_.getLocation(); - double distanceFromHome = p.length(); - if(distanceFromHome < precision) { - ossMessage << "I am home."; - } else { - ossMessage << setiosflags(ios_base::fixed) << setprecision(1); - ossMessage << "I am " - << p.length() << " meters from home; bearing is "; - int a = ((int)(p.angle()*180/PI+PI/16)/16)%16; - ossMessage << compass_points[a] << '.'; - } - SendMessageToDM("Location", ossMessage.str()); + ostringstream ossMessage; + const Point p = location_.getLocation(); + double distanceFromHome = p.length(); + if(distanceFromHome < precision) { + ossMessage << "I am home."; + } else { + ossMessage << setiosflags(ios_base::fixed) << setprecision(1); + ossMessage << "I am " + << p.length() << " meters from home; bearing is "; + int a = ((int)(p.angle()*180/PI+PI/16)/16)%16; + ossMessage << compass_points[a] << '.'; + } + SendMessageToDM("Location", ossMessage.str()); } void Agent::move_cardinal_command(const Gal_Frame& inframe) { - debug << "sending move query to backend" << endl; - string s_distance(Gal_GetString(inframe, ":distance")); - string s_units(Gal_GetString(inframe, ":units")); - string s_direction(Gal_GetString(inframe, ":direction")); - if(!(s_distance.empty() && s_direction.empty())) { - error("agent") << "distance or direction missing" << endl; - } else { - Point vec(static_cast(GetNumber999(s_distance)), 0); - if(!s_distance.empty()) { - if(!s_units.empty()) { - if(s_units == "FOOT" || s_units == "FEET") { - vec.x *= 0.3048F; - } else if(s_units == "YARD" || s_units == "YARDS") { - vec.x *= 0.9144F; - } - } - MsgCmdGoTo *go = NULL; - if(s_direction == "NORTH") - go = new MsgCmdGoTo(vec.rotate(PI/2)); - else if(s_direction == "NORTHEAST") - go = new MsgCmdGoTo(vec.rotate(PI/4)); - else if(s_direction == "NORTHWEST") - go = new MsgCmdGoTo(vec.rotate(3*PI/4)); - else if(s_direction == "EAST") - go = new MsgCmdGoTo(vec); - else if(s_direction == "SOUTH") - go = new MsgCmdGoTo(vec.rotate(-PI/2)); - else if(s_direction == "SOUTHEAST") - go = new MsgCmdGoTo(vec.rotate(-PI/4)); - else if(s_direction == "SOUTHWEST") - go = new MsgCmdGoTo(vec.rotate(-3*PI/4)); - else if(s_direction == "WEST") - go = new MsgCmdGoTo(vec.rotate(PI)); - if(go != NULL) { + debug << "sending move query to backend" << endl; + string s_distance(Gal_GetString(inframe, ":distance")); + string s_units(Gal_GetString(inframe, ":units")); + string s_direction(Gal_GetString(inframe, ":direction")); + if(!(s_distance.empty() && s_direction.empty())) { + error("agent") << "distance or direction missing" << endl; + } else { + Point vec(static_cast(GetNumber999(s_distance)), 0); + if(!s_distance.empty()) { + if(!s_units.empty()) { + if(s_units == "FOOT" || s_units == "FEET") { + vec.x *= 0.3048F; + } else if(s_units == "YARD" || s_units == "YARDS") { + vec.x *= 0.9144F; + } + } + MsgCmdGoTo *go = NULL; + if(s_direction == "NORTH") + go = new MsgCmdGoTo(vec.rotate(PI/2)); + else if(s_direction == "NORTHEAST") + go = new MsgCmdGoTo(vec.rotate(PI/4)); + else if(s_direction == "NORTHWEST") + go = new MsgCmdGoTo(vec.rotate(3*PI/4)); + else if(s_direction == "EAST") + go = new MsgCmdGoTo(vec); + else if(s_direction == "SOUTH") + go = new MsgCmdGoTo(vec.rotate(-PI/2)); + else if(s_direction == "SOUTHEAST") + go = new MsgCmdGoTo(vec.rotate(-PI/4)); + else if(s_direction == "SOUTHWEST") + go = new MsgCmdGoTo(vec.rotate(-3*PI/4)); + else if(s_direction == "WEST") + go = new MsgCmdGoTo(vec.rotate(PI)); + if(go != NULL) { #ifdef USE_TXT_COMMANDS - sendAction(go); + sendAction(go); #else - r->sendGoToCmd(1, go->content()->taskid, - go->content()->x, go->content()->y, go->content()->angle, - go->content()->useAngle(), go->content()->useRelative()); + r->sendGoToCmd(1, go->content()->taskid, + go->content()->x, go->content()->y, go->content()->angle, + go->content()->useAngle(), go->content()->useRelative()); #endif - delete go; - } else - error("agent") << "unknown direction " << s_direction << endl; - } - } + delete go; + } else + error("agent") << "unknown direction " << s_direction << endl; + } + } } void Agent::move_relative_command(const Gal_Frame& inframe) { - debug << "sending move relative query to backend" << endl; - string s_distance; - if (Gal_GetString(inframe, ":distance")) - s_distance = Gal_GetString(inframe, ":distance"); - string s_direction; - if (Gal_GetString(inframe, ":direction")) - s_direction = Gal_GetString(inframe, ":direction"); - string s_units; - if (Gal_GetString(inframe, ":units")) - s_units = Gal_GetString(inframe, ":units"); - if(s_distance.empty() || s_direction.empty()) { - error("agent") << "distance or direction missing" << endl; - } else { - if(!s_distance.empty()) { - Point vec(static_cast(GetNumber999(s_distance)), 0); - if(!s_units.empty()) { - if(s_units == "FOOT" || s_units == "FEET") { - vec.x *= 0.3048F; - } else if(s_units == "YARD" || s_units == "YARDS") { - vec.x *= 0.9144F; - } - } - MsgCmdGoTo *go = NULL; - if(s_direction == "STRAIGHT" || - s_direction == "FORWARD" || - s_direction == "FORWARDS" || - s_direction == "AROUND") - go = new MsgCmdGoTo(vec); - else if(s_direction.substr(0, 5) == "RIGHT") - go = new MsgCmdGoTo(vec.rotate(-PI/2)); - else if(s_direction.substr(0, 4) == "LEFT") - go = new MsgCmdGoTo(vec.rotate(PI/2)); - else if(s_direction == "BACK" || - s_direction == "BACKWARD" || - s_direction == "BACKWARDS") - go = new MsgCmdGoTo(vec.rotate(PI)); - if(go != NULL) { + debug << "sending move relative query to backend" << endl; + string s_distance; + if (Gal_GetString(inframe, ":distance")) + s_distance = Gal_GetString(inframe, ":distance"); + string s_direction; + if (Gal_GetString(inframe, ":direction")) + s_direction = Gal_GetString(inframe, ":direction"); + string s_units; + if (Gal_GetString(inframe, ":units")) + s_units = Gal_GetString(inframe, ":units"); + if(s_distance.empty() || s_direction.empty()) { + error("agent") << "distance or direction missing" << endl; + } else { + if(!s_distance.empty()) { + Point vec(static_cast(GetNumber999(s_distance)), 0); + if(!s_units.empty()) { + if(s_units == "FOOT" || s_units == "FEET") { + vec.x *= 0.3048F; + } else if(s_units == "YARD" || s_units == "YARDS") { + vec.x *= 0.9144F; + } + } + MsgCmdGoTo *go = NULL; + if(s_direction == "STRAIGHT" || + s_direction == "FORWARD" || + s_direction == "FORWARDS" || + s_direction == "AROUND") + go = new MsgCmdGoTo(vec); + else if(s_direction.substr(0, 5) == "RIGHT") + go = new MsgCmdGoTo(vec.rotate(-PI/2)); + else if(s_direction.substr(0, 4) == "LEFT") + go = new MsgCmdGoTo(vec.rotate(PI/2)); + else if(s_direction == "BACK" || + s_direction == "BACKWARD" || + s_direction == "BACKWARDS") + go = new MsgCmdGoTo(vec.rotate(PI)); + if(go != NULL) { commitments_.push_back(new MsgCmdGoTo(*go)); #ifdef USE_TXT_COMMANDS - sendAction(go); + sendAction(go); #else - r->sendGoToCmd(go->content()->priority, go->content()->taskid, - go->content()->x, go->content()->y, go->content()->angle, - go->content()->useAngle(), go->content()->useRelative()); + r->sendGoToCmd(go->content()->priority, go->content()->taskid, + go->content()->x, go->content()->y, go->content()->angle, + go->content()->useAngle(), go->content()->useRelative()); #endif - delete go; - } else - error("agent") << "unknown direction " << s_direction << endl; - } - } + delete go; + } else + error("agent") << "unknown direction " << s_direction << endl; + } + } } void Agent::halt_command() { - MsgCmdHalt halt; + MsgCmdHalt halt; #ifdef USE_TXT_COMMANDS - sendAction(&halt); + sendAction(&halt); #else - r->sendHalt(halt.content()->priority, halt.content()->taskid); + r->sendHalt(halt.content()->priority, halt.content()->taskid); #endif } void Agent::follow_command(const Gal_Frame& inframe) { - debug << "sending follow command to backend" << endl; - string followee = Gal_GetString(inframe, ":followee"); - if(followee.empty()) { - error("agent") << "no followee" << endl; - } else { - MsgCmdFollow follow; + debug << "sending follow command to backend" << endl; + string followee = Gal_GetString(inframe, ":followee"); + if(followee.empty()) { + error("agent") << "no followee" << endl; + } else { + MsgCmdFollow follow; #ifdef USE_TXT_COMMANDS - sendAction(&follow); + sendAction(&follow); #else - r->sendFollow(follow.content()->priority, follow.content()->taskid); + r->sendFollow(follow.content()->priority, follow.content()->taskid); #endif - } + } } void Agent::move_to_goal_command(const Gal_Frame& inframe) { - debug << "sending goal movement to backend" << endl; - string ordinal(Gal_GetString(inframe, ":ordinal")); - if(ordinal == "home") { - string sRelDist(Gal_GetString(inframe, ":relDist")); - if(sRelDist == "1") { - MsgCmdHome home; + debug << "sending goal movement to backend" << endl; + string ordinal(Gal_GetString(inframe, ":ordinal")); + if(ordinal == "home") { + string sRelDist(Gal_GetString(inframe, ":relDist")); + if(sRelDist == "1") { + MsgCmdHome home; robotClient_->sendHome(home.getPriority(), home.getTaskID()); - //p_client->sendPacket(robot, MsgCmdHome()); - } else if(sRelDist == "2") { - error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; - return; - } else if(sRelDist == "3") { - error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; - return; - } else if(sRelDist == "4") { - error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; - return; - } else if(sRelDist == "5") { - error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; - return; - } else if(sRelDist == "6") { - error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; - return; - } else { - error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; - return; - } - } else { - //absolute ordinal - istringstream issOrdinal(ordinal); - string token; - issOrdinal >> token; - float f_xcoord, f_ycoord; - if(token == "NEGATIVE") { - debug << "got negative x" << endl; - issOrdinal >> token; - ostringstream dispval; - debug << '"' << token << '"' << endl; - f_xcoord = static_cast(-GetNumber999(token)); - } else { - debug << '"' << token << '"' << endl; - f_xcoord = static_cast(GetNumber999(token)); - } - debug("agent") << "got x" << endl; - issOrdinal >> token; - if(token == "NEGATIVE") { - debug("agent") << "got negative y" << endl; - issOrdinal >> token; - debug("agent") << '"' << token << '"' << endl; - f_ycoord = static_cast(-GetNumber999(token)); - } else { - debug("agent") << '"' << token << '"' << endl; - f_ycoord = static_cast(GetNumber999(token)); - } - debug("agent") << "got y" << endl; - MsgCmdGoTo go(Point(f_xcoord, f_ycoord), true); + //p_client->sendPacket(robot, MsgCmdHome()); + } else if(sRelDist == "2") { + error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; + return; + } else if(sRelDist == "3") { + error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; + return; + } else if(sRelDist == "4") { + error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; + return; + } else if(sRelDist == "5") { + error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; + return; + } else if(sRelDist == "6") { + error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; + return; + } else { + error("agent") << "relative to goal '" << sRelDist << '\'' << " not understood" << endl; + return; + } + } else { + //absolute ordinal + istringstream issOrdinal(ordinal); + string token; + issOrdinal >> token; + float f_xcoord, f_ycoord; + if(token == "NEGATIVE") { + debug << "got negative x" << endl; + issOrdinal >> token; + ostringstream dispval; + debug << '"' << token << '"' << endl; + f_xcoord = static_cast(-GetNumber999(token)); + } else { + debug << '"' << token << '"' << endl; + f_xcoord = static_cast(GetNumber999(token)); + } + debug("agent") << "got x" << endl; + issOrdinal >> token; + if(token == "NEGATIVE") { + debug("agent") << "got negative y" << endl; + issOrdinal >> token; + debug("agent") << '"' << token << '"' << endl; + f_ycoord = static_cast(-GetNumber999(token)); + } else { + debug("agent") << '"' << token << '"' << endl; + f_ycoord = static_cast(GetNumber999(token)); + } + debug("agent") << "got y" << endl; + MsgCmdGoTo go(Point(f_xcoord, f_ycoord), true); #ifdef USE_TXT_COMMANDS - sendAction(&go); + sendAction(&go); #else - r->sendGoToCmd(go.content()->priority, go.content()->taskid, - go.content()->x, go.content()->y, go.content()->angle, - go.content()->useAngle(), go.content()->useRelative()); + r->sendGoToCmd(go.content()->priority, go.content()->taskid, + go.content()->x, go.content()->y, go.content()->angle, + go.content()->useAngle(), go.content()->useRelative()); #endif - } + } } void Agent::turn_command(const Gal_Frame& inframe) { - debug("agent") << "got turn command" << endl; - string sDirection(Gal_GetString(inframe, ":direction")); - bool bRel(false); - double fRad; - if(sDirection == "NORTH") fRad = PI/2; - else if(sDirection == "NORTHEAST") fRad = PI/4; - else if(sDirection == "NORTHWEST") fRad = 3*PI/4; - else if(sDirection == "EAST") fRad = 0; - else if(sDirection == "WEST") fRad = PI; - else if(sDirection == "SOUTH") fRad = 3*PI/2; - else if(sDirection == "SOUTHEAST") fRad = 7*PI/4; - else if(sDirection == "SOUTHWEST") fRad = 5*PI/4; - else if(sDirection == "STRAIGHT" || - sDirection == "FORWARD" || - sDirection == "FORWARDS") { - bRel = true; - fRad = 0; - } else if(sDirection.substr(0, 5) == "RIGHT") { - string sQual; - if(Gal_GetString(inframe, ":increment")) - sQual = (Gal_GetString(inframe, ":increment")); - bRel = true; - if(sQual.empty() || sQual == "") { - fRad = -PI/2; - } else { - fRad = -GetNumber999(sQual)*PI/180; - } - } else if(sDirection.substr(0, 4) == "LEFT") { - string sQual; - if(Gal_GetString(inframe, ":increment")) - sQual = (Gal_GetString(inframe, ":increment")); - bRel = true; - if(sQual.empty() || sQual == "") { - fRad = PI/2; - } else { - fRad = GetNumber999(sQual)*PI/180; - } - } else if(sDirection == "AROUND" || - sDirection == "BACK" || - sDirection == "BACKWARD" || - sDirection == "BACKWARDS") { - bRel = true; - fRad = PI; - } else { - error("agent") << "unknown direction " << sDirection << endl; - return; - } - MsgCmdGoTo turn((float)fRad); + debug("agent") << "got turn command" << endl; + string sDirection(Gal_GetString(inframe, ":direction")); + bool bRel(false); + double fRad; + if(sDirection == "NORTH") fRad = PI/2; + else if(sDirection == "NORTHEAST") fRad = PI/4; + else if(sDirection == "NORTHWEST") fRad = 3*PI/4; + else if(sDirection == "EAST") fRad = 0; + else if(sDirection == "WEST") fRad = PI; + else if(sDirection == "SOUTH") fRad = 3*PI/2; + else if(sDirection == "SOUTHEAST") fRad = 7*PI/4; + else if(sDirection == "SOUTHWEST") fRad = 5*PI/4; + else if(sDirection == "STRAIGHT" || + sDirection == "FORWARD" || + sDirection == "FORWARDS") { + bRel = true; + fRad = 0; + } else if(sDirection.substr(0, 5) == "RIGHT") { + string sQual; + if(Gal_GetString(inframe, ":increment")) + sQual = (Gal_GetString(inframe, ":increment")); + bRel = true; + if(sQual.empty() || sQual == "") { + fRad = -PI/2; + } else { + fRad = -GetNumber999(sQual)*PI/180; + } + } else if(sDirection.substr(0, 4) == "LEFT") { + string sQual; + if(Gal_GetString(inframe, ":increment")) + sQual = (Gal_GetString(inframe, ":increment")); + bRel = true; + if(sQual.empty() || sQual == "") { + fRad = PI/2; + } else { + fRad = GetNumber999(sQual)*PI/180; + } + } else if(sDirection == "AROUND" || + sDirection == "BACK" || + sDirection == "BACKWARD" || + sDirection == "BACKWARDS") { + bRel = true; + fRad = PI; + } else { + error("agent") << "unknown direction " << sDirection << endl; + return; + } + MsgCmdGoTo turn((float)fRad); #ifdef USE_TXT_COMMANDS - sendAction(&turn); + sendAction(&turn); #else - r->sendGoToCmd(turn.content()->priority, turn.content()->taskid, - turn.content()->x, turn.content()->y, turn.content()->angle, - turn.content()->useAngle(), turn.content()->useRelative()); + r->sendGoToCmd(turn.content()->priority, turn.content()->taskid, + turn.content()->x, turn.content()->y, turn.content()->angle, + turn.content()->useAngle(), turn.content()->useRelative()); #endif } void Agent::set_pose_command(const Gal_Frame& inframe) { - debug("agent") << "got set pose command" << endl; - const char* x = Gal_GetString(inframe, ":x"); - const char* y = Gal_GetString(inframe, ":y"); - const char* a = Gal_GetString(inframe, ":angle"); + debug("agent") << "got set pose command" << endl; + const char* x = Gal_GetString(inframe, ":x"); + const char* y = Gal_GetString(inframe, ":y"); + const char* a = Gal_GetString(inframe, ":angle"); if(!x) { error("agent") << "x is null" << endl; return; @@ -739,9 +738,9 @@ error("agent") << "angle is null" << endl; return; } - MsgCmdSetPos set_pos((float)atof(x), (float)atof(y), (float)atof(a)); - debug("agent") << "setpos (" << x << ' ' << y << ") " << a; - + MsgCmdSetPos set_pos((float)atof(x), (float)atof(y), (float)atof(a)); + debug("agent") << "setpos (" << x << ' ' << y << ") " << a; + sendAction(&set_pos); } Modified: trunk/TeamTalk/Agents/TeamTalkBackend/agent.h =================================================================== --- trunk/TeamTalk/Agents/TeamTalkBackend/agent.h 2007-11-07 21:58:55 UTC (rev 868) +++ trunk/TeamTalk/Agents/TeamTalkBackend/agent.h 2007-11-08 22:05:23 UTC (rev 869) @@ -15,6 +15,9 @@ //The Agent represents a robot, including its connections to the hub and //its spawned galaxy servers + +static string OLYMPUS_ROOT; + class Agent { private: GalIO_CommStruct* comm_; //hub connection for this agent From tk at edam.speech.cs.cmu.edu Thu Nov 8 17:05:44 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 8 Nov 2007 17:05:44 -0500 Subject: [TeamTalk 334]: [870] trunk/TeamTalk/Libraries: Use _WIN32 macro instead of WIN32. Message-ID: <200711082205.lA8M5iFd030801@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071108/9db316bc/attachment.html -------------- next part -------------- Modified: trunk/TeamTalk/Libraries/PrimitiveComm/PrimitiveComm.vcproj =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/PrimitiveComm.vcproj 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/PrimitiveComm.vcproj 2007-11-08 22:05:43 UTC (rev 870) @@ -42,7 +42,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".;../boeingLib/boeing;../boeingLib/coralshared" - PreprocessorDefinitions="_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;WIN32;_DEBUG" + PreprocessorDefinitions="_SCL_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_DEBUG" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -92,7 +92,6 @@ > + + Modified: trunk/TeamTalk/Libraries/PrimitiveComm/netutils.cpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/netutils.cpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/netutils.cpp 2007-11-08 22:05:43 UTC (rev 870) @@ -17,13 +17,13 @@ lpMsgBuf[e.size()] = '\0'; } -#ifdef WIN32 +#ifdef _WIN32 NetUtilsException::NetUtilsException(DWORD errorCode) throw() #else NetUtilsException::NetUtilsException() throw() #endif { -#ifdef WIN32 +#ifdef _WIN32 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, @@ -48,7 +48,7 @@ string NetUtilsException::what() throw() {return lpMsgBuf;} void initializeSockets(struct fd_set* sockets) { -#ifdef WIN32 +#ifdef _WIN32 WORD wVersionRequested; WSADATA wsaData; int err; Modified: trunk/TeamTalk/Libraries/PrimitiveComm/netutils.h =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/netutils.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/netutils.h 2007-11-08 22:05:43 UTC (rev 870) @@ -1,7 +1,7 @@ #ifndef NETUTILS_H #define NETUTILS_H -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -20,7 +20,7 @@ char* lpMsgBuf; public: NetUtilsException(const string& e) throw(); -#ifdef WIN32 +#ifdef _WIN32 NetUtilsException(DWORD errorCode=WSAGetLastError()) throw(); #else NetUtilsException() throw(); Modified: trunk/TeamTalk/Libraries/PrimitiveComm/robot_client.cpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/robot_client.cpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/robot_client.cpp 2007-11-08 22:05:43 UTC (rev 870) @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -14,7 +14,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include typedef int socklen_t; #else @@ -37,7 +37,7 @@ void RobotClient::spawnServer() { //spawn server -#ifdef WIN32 +#ifdef _WIN32 serverThread_ = (HANDLE)_beginthread(readMessages, 0, (void*)this); _beginthread(trackbots, 0, (void*)this); #else @@ -47,7 +47,7 @@ #endif } -#ifdef WIN32 +#ifdef _WIN32 void RobotClient::trackbots(void* thisp) #else void* RobotClient::trackbots(void* thisp) @@ -77,7 +77,7 @@ //--------------------------- // receiving messages -#ifdef WIN32 +#ifdef _WIN32 void RobotClient::readMessages(void *thisp) #else void* RobotClient::readMessages(void *thisp) @@ -146,7 +146,7 @@ void RobotClient::wait() const { -#ifdef WIN32 +#ifdef _WIN32 WaitForSingleObject(serverThread_, INFINITE); #else pthread_join(serverThread_, NULL); @@ -170,14 +170,14 @@ { // issue: close recieve thread somehow? -#ifdef WIN32 +#ifdef _WIN32 WSACleanup(); #endif } void RobotsClient::initializeSocketLayer() { -#ifdef WIN32 +#ifdef _WIN32 initializeSockets(); #endif } Modified: trunk/TeamTalk/Libraries/PrimitiveComm/robot_client.hpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/robot_client.hpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/robot_client.hpp 2007-11-08 22:05:43 UTC (rev 870) @@ -1,7 +1,7 @@ #ifndef __ROBOT_CLIENT_H__ #define __ROBOT_CLIENT_H__ -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -59,7 +59,7 @@ protected: bool connect(); //returns true if connection succeeded void spawnServer(); -#ifdef WIN32 +#ifdef _WIN32 static void trackbots(void *thisp); static void readMessages(void *thisp); HANDLE serverThread_; Modified: trunk/TeamTalk/Libraries/PrimitiveComm/robot_packet2.cpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/robot_packet2.cpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/robot_packet2.cpp 2007-11-08 22:05:43 UTC (rev 870) @@ -210,7 +210,7 @@ void Msg::stamp(Boeing::MsgHeader& h) { -#ifdef WIN32 +#ifdef _WIN32 struct __timeb64 timebuffer; _ftime64(&timebuffer); #else Modified: trunk/TeamTalk/Libraries/PrimitiveComm/robot_server.cpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/robot_server.cpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/robot_server.cpp 2007-11-08 22:05:43 UTC (rev 870) @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -12,7 +12,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include typedef int socklen_t; #else @@ -49,7 +49,7 @@ { // issue: close recieve thread somehow? -#ifdef WIN32 +#ifdef _WIN32 WSACleanup(); #endif } @@ -62,13 +62,13 @@ strncpy(hostname, inet_ntoa(me), Boeing::SADDR_LENGTH); } -#ifdef WIN32 +#ifdef _WIN32 HANDLE RobotServer::spawnServer() { #else pthread_t RobotServer::spawnServer() { #endif //spawn server -#ifdef WIN32 +#ifdef _WIN32 //_beginthread(keepalive, 0, (void *) this); return (HANDLE)_beginthread(readMessages, 0, (void *) this); #else @@ -92,7 +92,7 @@ //--------------------------- // receiving messages -#ifdef WIN32 +#ifdef _WIN32 void RobotServer::readMessages(void *thisp) #else void* RobotServer::readMessages(void *thisp) @@ -134,7 +134,7 @@ } void RobotServer::wait() const { -#ifdef WIN32 +#ifdef _WIN32 WaitForSingleObject(serverThread_, INFINITE); #else pthread_join(serverThread_, NULL); Modified: trunk/TeamTalk/Libraries/PrimitiveComm/robot_server.hpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/robot_server.hpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/robot_server.hpp 2007-11-08 22:05:43 UTC (rev 870) @@ -3,7 +3,7 @@ // client class to manage UDP connections to robots -#ifdef WIN32 +#ifdef _WIN32 #include #include "win32dep.h" #else @@ -53,7 +53,7 @@ char ip[16]; // our ip address in presentation format string handle_; //our handle -#ifdef WIN32 +#ifdef _WIN32 static void readMessages(void *thisp); //static void keepalive(void *thisp); HANDLE serverThread_; @@ -70,7 +70,7 @@ protected: //void initializeSockets(); void getMyAddress(); -#ifdef WIN32 +#ifdef _WIN32 HANDLE spawnServer(); #else pthread_t spawnServer(); Modified: trunk/TeamTalk/Libraries/PrimitiveComm/udpsocket.cc =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/udpsocket.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/udpsocket.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -9,7 +9,7 @@ /* LICENSE: */ -#ifdef WIN32 +#ifdef _WIN32 typedef int socklen_t; #endif @@ -25,7 +25,7 @@ #include -#ifndef WIN32 +#ifndef _WIN32 #include #include #endif @@ -94,7 +94,7 @@ double UDPSocket::getTime() { -#ifdef WIN32 +#ifdef _WIN32 struct __timeb64 timebuffer; _ftime64(&timebuffer); return timebuffer.time + (float)timebuffer.millitm/1000; @@ -139,7 +139,7 @@ return status; } -#ifndef WIN32 +#ifndef _WIN32 int flags = fcntl(fd, F_GETFD); fcntl(fd, F_SETFD, flags|FD_CLOEXEC); #endif @@ -176,7 +176,7 @@ if (connect(fd, (struct sockaddr*) &serv_addr, sizeof(serv_addr)) < 0) { perror("connect"); -#ifdef WIN32 +#ifdef _WIN32 closesocket(fd); #else close(fd); @@ -200,7 +200,7 @@ int UDPSocket::disconnect() { if (status > 0) { -#ifdef WIN32 +#ifdef _WIN32 closesocket(fd); #else close(fd); Modified: trunk/TeamTalk/Libraries/PrimitiveComm/udpsocket.h =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/udpsocket.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/udpsocket.h 2007-11-08 22:05:43 UTC (rev 870) @@ -16,7 +16,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #else Modified: trunk/TeamTalk/Libraries/PrimitiveComm/utils.cpp =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/utils.cpp 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/utils.cpp 2007-11-08 22:05:43 UTC (rev 870) @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef _WIN32 #include #else #include @@ -137,7 +137,7 @@ } } -#ifndef WIN32 +#ifndef _WIN32 int spawn(bool wait, const string& working_dir, const string& cmd, vector args) { char** argv = new char*[args.size()+2]; @@ -232,7 +232,7 @@ bool testLastConfig(const string& source, const string& target) { //return true if target is newer than source -#ifdef WIN32 +#ifdef _WIN32 struct _stat source_stat, target_stat; if(_stat(source.c_str(), &source_stat)) { #else @@ -242,7 +242,7 @@ error << "problem stating source: " << source << endl; return false; } -#ifdef WIN32 +#ifdef _WIN32 if(_stat(target.c_str(), &target_stat)) { #else if(stat(target.c_str(), &target_stat)) { Modified: trunk/TeamTalk/Libraries/PrimitiveComm/utils.h =================================================================== --- trunk/TeamTalk/Libraries/PrimitiveComm/utils.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/PrimitiveComm/utils.h 2007-11-08 22:05:43 UTC (rev 870) @@ -12,7 +12,7 @@ * - Filesystem */ -#ifdef WIN32 +#ifdef _WIN32 #include #include #include @@ -121,7 +121,7 @@ // ** Process ********************************************************* -#ifndef WIN32 +#ifndef _WIN32 int spawn(bool wait, const string& wdir, const string& cmd, vector args=vector()); int spawn(bool wait, const string& title, const string& wdir, Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_client.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_client.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_client.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -6,7 +6,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #endif Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_packet.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_packet.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_packet.h 2007-11-08 22:05:43 UTC (rev 870) @@ -15,11 +15,11 @@ namespace Boeing { #endif -#ifdef WIN32 +#ifdef _WIN32 #pragma pack(1) #endif #ifndef PACKED -#ifdef WIN32 +#ifdef _WIN32 #define PACKED #else #define PACKED __attribute__((packed)) @@ -153,7 +153,7 @@ unsigned char buff[sizeof(MsgMap)+sizeof(int)*2000*2000]; } PACKED; -#ifdef WIN32 +#ifdef _WIN32 // reset packing.... #pragma pack() #endif Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_server.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_server.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_server.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include #include #include @@ -81,7 +81,7 @@ if (!sock->isConnected()) return (NULL); - // fprintf(stderr,"%s:4 0x%x \n",__FUNCTION__,addr); + //fprintf(stderr,"%s:4 0x%x \n",__FUNCTION__,addr); // receive the header... int rv = sock->recv(rxdata.buff,sizeof(rxdata),addr); Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_server.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_server.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_map_server.h 2007-11-08 22:05:43 UTC (rev 870) @@ -5,7 +5,7 @@ #ifndef __BOEING_MAP_SERVER_H__ #define __BOEING_MAP_SERVER_H__ -#ifndef WIN32 +#ifndef _WIN32 #include #else #include Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_net.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_net.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_net.h 2007-11-08 22:05:43 UTC (rev 870) @@ -11,12 +11,12 @@ namespace Boeing { #endif -#ifdef WIN32 +#ifdef _WIN32 #pragma pack(1) #endif #ifndef PACKED -#ifdef WIN32 +#ifdef _WIN32 #define PACKED #else #define PACKED __attribute__((packed)) @@ -24,7 +24,7 @@ #endif #ifndef SOCKET -#ifndef WIN32 +#ifndef _WIN32 #define SOCKET int #endif #endif @@ -79,7 +79,7 @@ inline int hasFailed(int v) { return v<=FAILED; } -#ifdef WIN32 +#ifdef _WIN32 // reset packing.... #pragma pack() #endif Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_client.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_client.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_client.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -6,7 +6,7 @@ #include #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #else #define isfinite(x) (true) //hack! isfinite is in C99 but not C90, msc++ doesn't quite do C99 Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_packet.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_packet.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_packet.h 2007-11-08 22:05:43 UTC (rev 870) @@ -15,11 +15,11 @@ #endif /// required for compilation under Win32 and linux -#ifdef WIN32 +#ifdef _WIN32 #pragma pack(1) #endif #ifndef PACKED -#ifdef WIN32 +#ifdef _WIN32 #define PACKED #else #define PACKED __attribute__((packed)) @@ -306,7 +306,7 @@ char buff[50000]; } PACKED; -#ifdef WIN32 +#ifdef _WIN32 // reset packing.... #pragma pack() #endif Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_server.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_server.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_server.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -2,7 +2,7 @@ Boeing robot server == */ -#ifndef WIN32 +#ifndef _WIN32 #include #endif #include Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_server.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_server.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_robot_server.h 2007-11-08 22:05:43 UTC (rev 870) @@ -7,7 +7,7 @@ #include -#ifdef WIN32 +#ifdef _WIN32 #else //#include "geometry.h" Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_client.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_client.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_client.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -5,7 +5,7 @@ #include #include //#include -#ifndef WIN32 +#ifndef _WIN32 #include #endif Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_packet.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_packet.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_packet.h 2007-11-08 22:05:43 UTC (rev 870) @@ -14,7 +14,7 @@ #endif #ifndef PACKED -#ifdef WIN32 +#ifdef _WIN32 #pragma pack(1) #define PACKED #else @@ -88,7 +88,7 @@ char buff[1]; } PACKED; -#ifdef WIN32 +#ifdef _WIN32 // reset packing.... #pragma pack() #endif Modified: trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_server.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_server.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/boeing/boeing_trader_server.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -1,4 +1,4 @@ -#ifndef WIN32 +#ifndef _WIN32 #include #endif #include Modified: trunk/TeamTalk/Libraries/boeingLib/coralshared/timer.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/coralshared/timer.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/coralshared/timer.h 2007-11-08 22:05:43 UTC (rev 870) @@ -18,7 +18,7 @@ #include #include -#ifndef WIN32 +#ifndef _WIN32 #include #include #else Modified: trunk/TeamTalk/Libraries/boeingLib/coralshared/win32dep.cc =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/coralshared/win32dep.cc 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/coralshared/win32dep.cc 2007-11-08 22:05:43 UTC (rev 870) @@ -1,4 +1,4 @@ -#ifdef WIN32 +#ifdef _WIN32 #include "win32dep.h" Modified: trunk/TeamTalk/Libraries/boeingLib/coralshared/win32dep.h =================================================================== --- trunk/TeamTalk/Libraries/boeingLib/coralshared/win32dep.h 2007-11-08 22:05:23 UTC (rev 869) +++ trunk/TeamTalk/Libraries/boeingLib/coralshared/win32dep.h 2007-11-08 22:05:43 UTC (rev 870) @@ -1,7 +1,7 @@ #ifndef __WIN32DEP_H__ #define __WIN32DEP_H__ -#ifdef WIN32 +#ifdef _WIN32 // win32 dependencies From tk at edam.speech.cs.cmu.edu Thu Nov 8 22:38:08 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 8 Nov 2007 22:38:08 -0500 Subject: [TeamTalk 335]: [871] trunk/TeamTalk/Configurations/DesktopConfiguration: Rewrote hub programs for olympus2. Message-ID: <200711090338.lA93c8rV031336@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071108/517fbf11/attachment-0001.html -------------- next part -------------- Property changes on: trunk/TeamTalk/Configurations/DesktopConfiguration ___________________________________________________________________ Name: svn:ignore - peerfile.txt *.user + peerfile.txt *.user *.log *.instance.* Modified: trunk/TeamTalk/Configurations/DesktopConfiguration/TeamTalk-hub-desktop-skeleton.pgm =================================================================== --- trunk/TeamTalk/Configurations/DesktopConfiguration/TeamTalk-hub-desktop-skeleton.pgm 2007-11-08 22:05:43 UTC (rev 870) +++ trunk/TeamTalk/Configurations/DesktopConfiguration/TeamTalk-hub-desktop-skeleton.pgm 2007-11-09 03:38:07 UTC (rev 871) @@ -1,50 +1,34 @@ DOMAIN: cmu LOG_DIR: ..\..\logs -TIMESTAMP: start_listening stop_listening set_lm setattr speak reset resetlast restart_decoder add_value choose_parse launch_query begin_session process_parse start_inactivity_timeout cancel_inactivity_timeout end_session new_session end_session increment_utterance nop goto_page notify_output_manager relay_input_source restart_decoder add_voice +TIMESTAMP: request_init_session notify_closing_session set_config reset resetlast phoenixparse choose_parse launch_query begin_session process_parse end_session new_session increment_utterance nop goto_page handle_event perform_action process_event restart_decoder add_voice ;; This is used as a toplevel subdir in LOG_DIR, if not specified ;; its default is "sls" USER_ID: TeamTalk ;; ------------------------------------------------- -;; S E R V E R S +;; OLYMPUS SERVERS +;; Servers listed in order of port number ;; ------------------------------------------------- ;; ------------------------------------------------- -;; The tty-sphinx server handles keyboard input -;; ------------------------------------------------- - -;;SERVER: tty-sphinx at localhost:11001 -;;OPERATIONS: -;;INIT: :greeting "Welcome to the CMU zap2 1.0!" - -;; ------------------------------------------------- ;; The sphinx server handles decoding speech ;; ------------------------------------------------- -SERVER: sphinx at localhost:11000 -OPERATIONS: start_listening stop_listening set_lm restart_decoder -INIT: :greeting "Welcome to the CMU zap2 1.0!" +SERVER: audio_server at localhost:11000 +OPERATIONS: begin_session end_session set_lm restart_decoder +INIT: :greeting "Welcome to TeamTalk!" ;; ------------------------------------------------- -;; The PenDecoder server will display robot locations -;; on a map, and allow for some map-based interactions. -;; ------------------------------------------------- - -SERVER: PenDecoder at localhost:11002 -OPERATIONS: set_cover speak map_update info_update task_update -INIT: :greeting "Welcome to the CMU zap 2.0 PenDecoder!" - -;; ------------------------------------------------- ;; The Kalliope server will convert text from the ;; language generation (NLG) server to speech heard ;; by the caller ;; ------------------------------------------------- SERVER: kalliope at localhost:12001 -OPERATIONS: speak reset add_voice -INIT: :greeting "Welcome to the CMU zap2 1.0!" +OPERATIONS: begin_session end_session speak reset add_voice +INIT: :greeting "Welcome to TeamTalk!" ;; ------------------------------------------------- ;; The phoenix server will parse utterances @@ -54,15 +38,15 @@ SERVER: phoenix at localhost:13000 OPERATIONS: restart_decoder -INIT: :greeting "Welcome to the %%DialogManager%%!" +INIT: :greeting "Welcome to TeamTalk!" ;; ------------------------------------------------- -;; Backend - Server (gal_be) +;; Interaction Manager ;; ------------------------------------------------- -SERVER: gal_be at localhost:18000 -OPERATIONS: begin_session end_session launch_query -INIT: :greeting "Welcome to the CMU zap2 1.0!" +SERVER: apollo at localhost:20000 +OPERATIONS: begin_session end_session reinitialize process_event perform_action set_dialog_state +INIT: :greeting "Welcome to the TeamTalk!" ;; ------------------------------------------------- ;; The Builtin server is implemented by the hub to @@ -76,67 +60,110 @@ MODE: singlethread ;; ------------------------------------------------- +;; TEAMTALK-SPECIFIC SERVERS +;; Servers listed in order of port number +;; ------------------------------------------------- + +;; ------------------------------------------------- +;; The PenDecoder server will display robot locations +;; on a map, and allow for some map-based interactions. +;; ------------------------------------------------- + +SERVER: PenDecoder at localhost:11002 +OPERATIONS: set_cover speak map_update info_update task_update +INIT: :greeting "Welcome to TeamTalk!" + +;; ------------------------------------------------- +;; Backend - Server (gal_be) +;; ------------------------------------------------- + +SERVER: gal_be at localhost:18000 +OPERATIONS: begin_session end_session launch_query +INIT: :greeting "Welcome to TeamTalk!" + +;; ------------------------------------------------- ;; P R O G R A M S ;; ------------------------------------------------- PROGRAM: main -LOG_IN: :init_session :close_session :startutt :endutt :emptyhyp :partialhyp :confhyps :nword :beginout :continueout :endout :resetout :parse :set_lm :goto_page +LOG_IN: :init_session :close_session :startutt :endutt :emptyhyp :confhyps :id :parse :set_config :action_type :action_id :properties :speaktext :session_start_timestamp -;; The decoder's continuous listener detected a new -;; utterance. +;; The VAD/Interaction Manager detected a new utterance +;; increment the utt counter RULE: :startutt --> Builtin.increment_utterance IN: OUT: +;; send startutt to the audio server to begin ASR +RULE: :startutt --> audio_server.start_utt +IN: :id :timestamp +OUT: +;; The VAD/Interaction Manager detected the end of the current utterance +;; send utt to the AudioServer to finalize ASR results +RULE: :endutt --> audio_server.end_utt +IN: :id :timestamp +OUT: + ;; The session server has triggered a new session -RULE: :init_session | :call_answered --> Builtin.new_session +RULE: :init_session --> Builtin.new_session IN: OUT: ;; The session server has triggered a new session - Tell the decoder to start listening to input -RULE: :init_session | :call_answered --> sphinx.start_listening -IN: :hub_logdir :hub_log_prefix +RULE: :init_session --> audio_server.begin_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp OUT: +LOG_IN: +LOG_OUT: +;; The session server has triggered a new session - initialize the IM +RULE: :init_session --> apollo.begin_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp +OUT: +LOG_IN: :session_start_timestamp +LOG_OUT: + ;; The session server has triggered a new session - initialize backend -RULE: :init_session | :call_answered --> gal_be.begin_session -IN: :hub_logdir +RULE: :init_session --> gal_be.begin_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp OUT: +;; The session server has triggered a new session - initialize kalliope +RULE: :init_session --> kalliope.begin_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp +OUT: + ;; The session server has closed the session - Tell the decoder to stop listening to input -RULE: :close_session | :call_hungup --> sphinx.stop_listening -IN: +RULE: :close_session --> audio_server.end_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp OUT: -;; The session server has closed the session - Make kalliope shut up so that the next caller doesn't -;; get the tail end of the output -RULE: :close_session | :call_hungup --> kalliope.reset +;; The session server has closed the session - Tell the DM to ignore spurious inputs between sessions +RULE: :close_session --> DialogManager.end_session IN: OUT: -;; This is an expedient way to do barge-in. There -;; are better ways to do this. -RULE: :partialhyp & :nword >0 --> kalliope.reset +;; The session server has closed the session - Tell the DM to ignore spurious inputs between sessions +RULE: :close_session --> apollo.end_session IN: OUT: -RULE: :confhyps --> kalliope.reset +;; The session server has closed the session - Tell the kalliope something +RULE: :close_session --> kalliope.end_session IN: OUT: ;; The session server has closed the session - Tell the DM to ignore spurious inputs between sessions -RULE: :close_session | :call_hungup --> Builtin.end_session +RULE: :close_session --> Builtin.end_session IN: OUT: PROGRAM: system_error -MESSAGE: nlg.launch_query -LOG_IN: :inframe -LOG_IN: :interruptable -MESSAGE: abe.launch_query -LOG_IN: :inframe -LOG_OUT: :outframe +;; ------------------------------------------------- +;; APPLICATION-DEPENDENT PROGRAMS +;; ------------------------------------------------- + PROGRAM: restart_decoder RULE: --> sphinx.restart_decoder @@ -166,3 +193,26 @@ RULE: :type = "ack" | :type = "done" --> PenDecoder.task_update IN: :type :taskid :status OUT: + +;; ------------------------------------------------- +;; APPLICATION-DEPENDENT MESSAGES +;; ------------------------------------------------- + +;; There a none. + +;; ------------------------------------------------- +;; APPLICATION-INDEPENDENT MESSAGES +;; ------------------------------------------------- + +MESSAGE: nlg.launch_query +LOG_IN: :action_id :id :inframe :interruptable :dont_listen + +MESSAGE: apollo.process_event +LOG_IN: :event_type :event_timestamp :properties :event_complete + +MESSAGE: apollo.perform_action +LOG_IN: :action_type :properties :utt_count :dialog_state + +MESSAGE: apollo.set_dialog_state +LOG_IN: :dialog_state + Modified: trunk/TeamTalk/Configurations/DesktopConfiguration/TeamTalk-hub-desktop-template.pgm =================================================================== --- trunk/TeamTalk/Configurations/DesktopConfiguration/TeamTalk-hub-desktop-template.pgm 2007-11-08 22:05:43 UTC (rev 870) +++ trunk/TeamTalk/Configurations/DesktopConfiguration/TeamTalk-hub-desktop-template.pgm 2007-11-09 03:38:07 UTC (rev 871) @@ -1,32 +1,25 @@ DOMAIN: cmu LOG_DIR: ..\..\logs -TIMESTAMP: start_listening stop_listening set_lm setattr speak reset resetlast phoenixparse add_value choose_parse launch_query begin_session process_parse start_inactivity_timeout cancel_inactivity_timeout end_session new_session end_session increment_utterance nop goto_page notify_output_manager relay_input_source +TIMESTAMP: set_lm setattr speak reset resetlast phoenixparse add_value choose_parse launch_query begin_session process_parse start_inactivity_timeout cancel_inactivity_timeout end_session new_session end_session increment_utterance nop goto_page notify_output_manager relay_input_source ;; This is used as a toplevel subdir in LOG_DIR, if not specified ;; its default is "sls" USER_ID: %%DialogManager%% ;; ------------------------------------------------- -;; S E R V E R S +;; OLYMPUS SERVERS +;; Servers listed in order of port number ;; ------------------------------------------------- ;; ------------------------------------------------- -;; The sphinx server handles decoding speech -;; ------------------------------------------------- - -SERVER: sphinx at localhost:11000 -OPERATIONS: -INIT: :greeting "Welcome to the %%DialogManager%%!" - -;; ------------------------------------------------- ;; The PenDecoder server will display robot locations ;; on a map, and allow for some map-based interactions. ;; ------------------------------------------------- SERVER: PenDecoder at localhost:11002 OPERATIONS: set_bot speak process_parse select_bot image set_goal -INIT: :greeting "Welcome to the %%DialogManager%%!" +INIT: :greeting "Welcome to %%DialogManager%%!" ;; ------------------------------------------------- ;; The Kalliope server will convert text from the @@ -35,17 +28,17 @@ ;; ------------------------------------------------- SERVER: kalliope at localhost:12001 -OPERATIONS: speak reset add_voice -INIT: :greeting "Welcome to the %%DialogManager%%!" +OPERATIONS: begin_session end_session synthesize speak reset beep add_voice +INIT: :greeting "Welcome to %%DialogManager%%!" ;; ------------------------------------------------- ;; The phoenix server will parse utterances -;; emitted by the sphinx server +;; emitted by the audio server ;; ------------------------------------------------- SERVER: phoenix at localhost:13000 -OPERATIONS: phoenixparse -INIT: :greeting "Welcome to the %%DialogManager%%!" +OPERATIONS: phoenixparse parsepartialhyp +INIT: :greeting "Welcome to %%DialogManager%%!" ;; ------------------------------------------------- ;; The helios server will query domain agents to @@ -53,50 +46,64 @@ ;; ------------------------------------------------- SERVER: helios at localhost:%%HeliosPort%% -OPERATIONS: begin_session add_value choose_parse relay_input_source set_dialog_state -INIT: :greeting "Welcome to the %%DialogManager%%!" +OPERATIONS: begin_session add_value choose_parse annotate_partialparse set_dialog_state +INIT: :greeting "Welcome to %%DialogManager%%!" ;; ------------------------------------------------- -;; Natural language generator - Server (nlg_remote) +;; Interaction Manager ;; ------------------------------------------------- -SERVER: nlg at localhost:16000 -OPERATIONS: launch_query -INIT: :greeting "Welcome to the %%DialogManager%%!" +SERVER: apollo at localhost:20000 +OPERATIONS: begin_session end_session reinitialize process_event perform_action set_dialog_state +INIT: :greeting "Welcome to the TeamTalk!" ;; ------------------------------------------------- -;; Backend - Server (gal_be) +;; The Builtin server is implemented by the hub to +;; provide some commonly used functions. ;; ------------------------------------------------- -SERVER: gal_be at localhost:18000 -OPERATIONS: begin_session end_session launch_query -INIT: :greeting "Welcome to the %%DialogManager%%!" +SERVER: Builtin +OPERATIONS: new_session end_session increment_utterance nop +;; Do not try to match multiple rules for a given +;; token. This mode serializes rule firing. +MODE: singlethread ;; ------------------------------------------------- +;; MEETINGLINE-SPECIFIC SERVERS +;; Servers listed in order of port number +;; ------------------------------------------------- + +;; ------------------------------------------------- +;; Natural language generator - Server (nlg_remote) +;; ------------------------------------------------- + +SERVER: nlg at localhost:16000 +OPERATIONS: launch_query +INIT: :greeting "Welcome to %%DialogManager%%!" + +;; ------------------------------------------------- ;; Dialog Manager ;; ------------------------------------------------- SERVER: %%DialogManager%%@localhost:%%DMPort%% -OPERATIONS: begin_session process_parse start_inactivity_timeout cancel_inactivity_timeout end_session notify_output_manager reset_variables -INIT: :greeting "Welcome to the %%DialogManager%%!" +OPERATIONS: begin_session handle_event process_parse end_session notify_output_manager +INIT: :greeting "Welcome to %%DialogManager%%!" ;; ------------------------------------------------- -;; The Builtin server is implemented by the hub to -;; provide some commonly used functions. +;; Backend - Server (gal_be) ;; ------------------------------------------------- -SERVER: Builtin -OPERATIONS: new_session end_session increment_utterance nop -;; Do not try to match multiple rules for a given -;; token. This mode serializes rule firing. -MODE: singlethread +SERVER: gal_be at localhost:18000 +OPERATIONS: begin_session end_session launch_query +INIT: :greeting "Welcome to %%DialogManager%%!" ;; ------------------------------------------------- ;; P R O G R A M S ;; ------------------------------------------------- PROGRAM: main -LOG_IN: :init_session :close_session :startutt :endutt :emptyhyp :partialhyp :confhyps :nword :beginout :continueout :endout :resetout :parse :set_lm :goto_page +LOG_IN: :init_session :close_session :startutt :endutt :emptyhyp :confhyps :id :parse :set_config :action_type :action_id :properties :speaktext :session_start_timestamp + ;; The decoder's continuous listener detected a new ;; utterance. RULE: :startutt --> Builtin.increment_utterance @@ -104,107 +111,90 @@ OUT: ;; The session server has triggered a new session -RULE: :init_session | :call_answered --> Builtin.new_session +RULE: :init_session --> Builtin.new_session IN: OUT: ;; The session server has triggered a new session - initialize helios -RULE: :init_session | :call_answered --> helios.begin_session -IN: :hub_logdir +RULE: :init_session --> helios.begin_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp OUT: ;; The session server has triggered a new session - initialize the DM -RULE: :init_session | :call_answered --> %%DialogManager%%.begin_session -IN: :hub_logdir +RULE: :init_session --> %%DialogManager%%.begin_session +IN: :hub_logdir :hub_log_prefix :session_start_timestamp OUT: +LOG_IN: ;; The session server has closed the session - Tell the DM to ignore spurious inputs between sessions -RULE: :close_session | :call_hungup --> %%DialogManager%%.end_session +RULE: :close_session --> %%DialogManager%%.end_session IN: -OUT: -;; Multiple phrases can be enqueued to be spoken by the TTS -;; system. For each phrase, there will be a message with -;; the :beginout keyword sent by the TTS when it begins -;; speaking the phrase. DM may want to distinquish this -;; timeout-cancel condition from the :startutt -;; timeout-cancel condition. The :why input keyword -;; is sent to the cancel_inactivity_timeout operation -;; to enable the DM to make this distinction if necessary. -;; -RULE: :startutt --> %%DialogManager%%.cancel_inactivity_timeout -IN: (:why "startutt") -OUT: +;; A partial hypothesis was generated, parse it +RULE: :partial_hyp & !:partial_parse --> phoenix.parsepartialhyp +IN: :timestamp :hyp_properties +OUT: :partial_parse :timestamp :hyp_properties +LOG_IN: :partial_hyp :timestamp :hyp_properties +LOG_OUT: :timestamp :hyp_properties -RULE: :beginout --> %%DialogManager%%.cancel_inactivity_timeout -IN: (:why "beginout") -OUT: +;; A partial parse was generated, annotate it +RULE: :partial_parse --> helios.annotate_partialparse +IN: :timestamp :hyp_properties +OUT: :event_type :event_timestamp :properties :event_complete +LOG_IN: :timestamp :hyp_properties +LOG_OUT: :event_type :event_timestamp :properties :event_complete -;; The session server has closed the session - it is not clear what this message does... -RULE: :close_session | :call_hungup --> %%DialogManager%%.cancel_inactivity_timeout -IN: (:why "hangup") -OUT: - -;; when the TTS finishes with a phrase, start the clock running -;; to wait for the user to respond to the output. If another -;; phrase is hard on the heels of this one, it will cancel -;; the timeout when it begins. But when it ends, it will cause -;; the DM to re-start the timeout. -RULE: :endout --> %%DialogManager%%.start_inactivity_timeout -IN: -OUT: - ;; If we have a confidence annotated hypothesis, but ;; no parse, call phoenix to parse it ;; --- RULE: :confhyps & !:parses --> phoenix.phoenixparse -IN: :confhyps :npow :pow -OUT: :total_numparses :parses :input_source +IN: :confhyps :npow :pow :timestamp +OUT: :total_numparses :parses :input_source :timestamp +LOG_IN: :confhyps :npow :pow LOG_OUT: :parses ;; Choose one of the parses based on confidence, and annotate ;; input with other features ;; --- RULE: !:parse & :total_numparses & :parses --> helios.choose_parse -IN: :total_numparses :parses :input_source :confhyps :npow :pow -OUT: :parse :input_features -LOG_OUT: :parse :input_features +IN: :total_numparses :parses :input_source :confhyps :npow :pow :timestamp +OUT: :parse :properties :event_type :event_timestamp :event_complete +LOG_IN: :parses :timestamp +LOG_OUT: :event_type :event_timestamp :parse :properties :event_complete -RULE: :parse --> PenDecoder.process_parse -IN: :parse :input_features +RULE: :parse --> tty-sphinx.process_parse +IN: :parse :properties OUT: +LOG_IN: :parse :properties -RULE: :parse --> %%DialogManager%%.process_parse -IN: :parse :input_features +;; An event was generated by a "sensor" module, send it to the IM +RULE: :event_type --> apollo.process_event +IN: :event_type :event_timestamp :properties :event_complete OUT: +LOG_IN: :event_type :event_timestamp :properties :event_complete +RULE: :parse --> tty-sphinx.process_parse +IN: :parse (:input_features :properties) +OUT: +LOG_IN: :parse (:input_features :properties) + ;; Handle any :speaktext keywords by sending to ;; kalliope -RULE: :speaktext --> kalliope.speak -LOG_IN: :phrase -IN: (:phrase :speaktext) :interruptable :id -OUT: +RULE: :speaktext --> kalliope.synthesize +LOG_IN: :phrase :id +LOG_OUT: :id +IN: (:phrase :speaktext) :id +OUT: ;; Handle any :speaktext keywords by sending to -;; PenDecoder also -RULE: :speaktext --> PenDecoder.speak -LOG_IN: :tty-phrase -IN: (:robot_name :id) :speaktext +;; tty-sphinx also +RULE: :speaktext --> tty-sphinx.speak +LOG_IN: :tty-phrase :id +IN: (:tty-phrase :speaktext) :id OUT: -;; When kalliope has outputted, notifies Dialog Manager -RULE: :conveyance --> %%DialogManager%%.notify_output_manager -LOG_IN: :conveyance -IN: :phrase :conveyance :bargein :id -OUT: +PROGRAM: system_error -;; -;; TTY Sphinx can send this when the user types "reset" -;; -RULE: :resetdm --> %%DialogManager%%.reset_variables -IN: -OUT: destroy! - PROGRAM: robot_message RULE: :type = "location" --> PenDecoder.set_bot From tk at edam.speech.cs.cmu.edu Thu Nov 8 23:03:41 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Thu, 8 Nov 2007 23:03:41 -0500 Subject: [TeamTalk 336]: [872] trunk/TeamTalk/Resources/DecoderConfig: Removed old acoustic models and configurations. Message-ID: <200711090403.lA943fUe031439@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071108/68fc133f/attachment.html -------------- next part -------------- Deleted: trunk/TeamTalk/Resources/DecoderConfig/female-16khz.arg =================================================================== --- trunk/TeamTalk/Resources/DecoderConfig/female-16khz.arg 2007-11-09 03:38:07 UTC (rev 871) +++ trunk/TeamTalk/Resources/DecoderConfig/female-16khz.arg 2007-11-09 04:03:41 UTC (rev 872) @@ -1,36 +0,0 @@ - -live TRUE - -normmean TRUE - -nmprior TRUE - -samp 16000 - -topsenfrm 4 - -topsenthresh -80000 - -fwdflat FALSE - -compallsen TRUE - -bestpath FALSE - -latsize 500000 - -top 4 - -fillpen 1e-10 - -nwpen 0.01 - -silpen 0.005 - -inspen 0.65 - -langwt 8.5 - -ugwt 0.7 - -beam 2e-6 - -npbeam 2e-6 - -nwbeam 5e-4 - -lpbeam 2e-5 - -lponlybeam 5e-4 - -fwdflatbeam 1e-8 - -fwdflatnwbeam 3e-4 - -rescorelw 9.5 - -lmfn LanguageModel\TeamTalkLM.arpa - -dictfn Dictionary\TeamTalk.dict.reduced_phoneset - -ndictfn Dictionary\noise.dict - -phnfn HMM-16khz.ss/phone - -mapfn HMM-16khz.ss/map - -sendumpfn HMM-16khz.ss/sendump - -hmmdir HMM-16khz.ss\ - -hmmdirlist HMM-16khz.ss\ - -cbdir HMM-16khz.ss\ - -8bsen TRUE - -logfn .\sphinx_female-16khz.log \ No newline at end of file Deleted: trunk/TeamTalk/Resources/DecoderConfig/male-16khz.arg =================================================================== --- trunk/TeamTalk/Resources/DecoderConfig/male-16khz.arg 2007-11-09 03:38:07 UTC (rev 871) +++ trunk/TeamTalk/Resources/DecoderConfig/male-16khz.arg 2007-11-09 04:03:41 UTC (rev 872) @@ -1,36 +0,0 @@ - -live TRUE - -normmean TRUE - -nmprior TRUE - -samp 16000 - -topsenfrm 4 - -topsenthresh -80000 - -fwdflat FALSE - -compallsen TRUE - -bestpath FALSE - -latsize 500000 - -top 4 - -fillpen 1e-10 - -nwpen 0.01 - -silpen 0.005 - -inspen 0.65 - -langwt 8.5 - -ugwt 0.7 - -beam 2e-6 - -npbeam 2e-6 - -nwbeam 5e-4 - -lpbeam 2e-5 - -lponlybeam 5e-4 - -fwdflatbeam 1e-8 - -fwdflatnwbeam 3e-4 - -rescorelw 9.5 - -lmctlfn LanguageModel\TeamTalk.ctl - -dictfn Dictionary\TeamTalk.dict.reduced_phoneset - -ndictfn Dictionary\noise.dict - -phnfn HMM-16khz.ss/phone - -mapfn HMM-16khz.ss/map - -sendumpfn HMM-16khz.ss/sendump - -hmmdir HMM-16khz.ss\ - -hmmdirlist HMM-16khz.ss\ - -cbdir HMM-16khz.ss\ - -logfn .\sphinx_male-16khz.log - -8bsen TRUE From tk at edam.speech.cs.cmu.edu Sun Nov 11 15:46:32 2007 From: tk at edam.speech.cs.cmu.edu (tk@edam.speech.cs.cmu.edu) Date: Sun, 11 Nov 2007 15:46:32 -0500 Subject: [TeamTalk 337]: [873] trunk/TeamTalk: 1) Moved from WIN32 to inherent _WIN32 in TeamTalkBackend and TeamTalkDM. Message-ID: <200711112046.lABKkW0h009913@edam.speech.cs.cmu.edu> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071111/cde4b4bf/attachment.html -------------- next part -------------- Modified: trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj =================================================================== --- trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj 2007-11-09 04:03:41 UTC (rev 872) +++ trunk/TeamTalk/Agents/TeamTalkBackend/TeamTalkBackend.vcproj 2007-11-11 20:46:32 UTC (rev 873) @@ -44,7 +44,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=""$(OLYMPUS_ROOT)\Libraries\Galaxy\include";"$(OLYMPUS_ROOT)\Libraries\Galaxy\contrib\MITRE\utilities\include";..\..\Libraries\PrimitiveComm;..\..\Libraries\boeingLib\boeing;..\..\Libraries\boeingLib\coralshared;"$(OLYMPUS_ROOT)\Agents\Pythia\PythiaDynamicClient"" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -128,7 +128,7 @@ -#ifdef WIN32 +#ifdef _WIN32 # include #endif Modified: trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj =================================================================== --- trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj 2007-11-09 04:03:41 UTC (rev 872) +++ trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj 2007-11-11 20:46:32 UTC (rev 873) @@ -44,10 +44,10 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories=".;"$(OLYMPUS_ROOT)\Libraries\RavenClaw\DialogTask";"$(OLYMPUS_ROOT)\Libraries\RavenClaw";"$(OLYMPUS_ROOT)\Libraries\Galaxy\include"" - PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32;GALAXY" + PreprocessorDefinitions="_DEBUG;_CONSOLE;GALAXY" MinimalRebuild="true" BasicRuntimeChecks="0" - RuntimeLibrary="2" + RuntimeLibrary="3" StructMemberAlignment="0" BufferSecurityCheck="true" EnableFunctionLevelLinking="true" @@ -69,7 +69,7 @@ /> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071111/833f8171/attachment.html -------------- next part -------------- Modified: trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj =================================================================== --- trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj 2007-11-11 20:46:32 UTC (rev 873) +++ trunk/TeamTalk/Agents/TeamTalkDM/TeamTalkDM.vcproj 2007-11-11 21:51:45 UTC (rev 874) @@ -69,7 +69,7 @@ /> An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071113/3d91126f/attachment-0001.html -------------- next part -------------- Modified: trunk/TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/PenDecoderServer.java =================================================================== --- trunk/TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/PenDecoderServer.java 2007-11-11 21:51:45 UTC (rev 874) +++ trunk/TeamTalk/Agents/PenDecoder/src/edu/cmu/ravenclaw/pendecoder/PenDecoderServer.java 2007-11-13 06:38:53 UTC (rev 875) @@ -20,14 +20,39 @@ import galaxy.lang.*; import java.awt.geom.Point2D; +/** + * This is the main interface for the Galaxy server. + */ public class PenDecoderServer extends galaxy.server.Server { + /** + * This is port for the Galaxy server. + */ public static final int PORT = 11002; + + /** + * This is the main application frame. + */ protected static PenDecoderDisplay frame = null; + /** + * This is an artifact required in Olympus1, but probably not + * required in Olympus2. + */ protected static int lastUttID = 0; + /** + * This is the system that keeps track of the robot's locations. + */ public static BotTracker botTracker = null; - /** Creates a new instance of PenDecoderServer */ + /** + * Created a new galaxy server instance. The first instance will + * instantiate the PenDecoderDisplay and the bot tracker. + * @param mainserver the main galaxy server that accepts connections from + * hubs and spawns galaxy servers + * @param socket the socket that the mainserver hands off to the + * servers + * @exception java.io.IOException there are problems handling the socket this is thrown + */ public PenDecoderServer(MainServer mainserver, java.net.Socket socket) throws IOException { super(mainserver, socket); if(frame == null) { @@ -39,6 +64,11 @@ frame.addServer(this); } + /** + * This is called when a hub connects (when else?). + * We set the bot to be at the origin. + * @param f the galaxy frame with the server info + */ public void serverOpReinitialize(GFrame f) { String botName = (String)f.getProperty(":user_id"); if(!botName.equals("TeamTalk")) { @@ -46,6 +76,12 @@ } } + /** + * This is called when evidence arises of a bot position change. + * We inform the bot tracker. + * @param f the Galaxy frame with the bot location information. + * @return the unaltered Galaxy frame. + */ public GFrame serverOpSetBot(GFrame f) { String name = (String)f.getProperty(":robot_name"); //we operate in centimeter space @@ -58,6 +94,13 @@ return (GFrame) null; } + /** + * This function is called when evidence of "treasure" comes up. + * We set an "object" in the bot tracker. + * @param f The Galaxy frame with the trasure information. + * @ return The unmodified Galaxy frame. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpInfoUpdate(GFrame f) { System.err.println("got info update"); String ip = (String)f.getProperty(":ip"); @@ -70,6 +113,13 @@ return (GFrame) null; } + /** + * This function is called when there is a status update on a task. + * We update the taskkeeper with the information and print out status info + * about the task to the console for now. + * @param f The galaxy frame with the task status info. + * @return An unmodified galaxy frame. + */ public GFrame serverOpTaskUpdate(GFrame f) { System.err.println("got task update"); String type = (String)f.getProperty(":type"); @@ -108,6 +158,12 @@ return (GFrame) null; } + /** + * This function is called when there is evidence that a bot has a goal + * position. + * @param f A Galaxy frame with information about a robot translation goal. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpSetGoal(GFrame f) { String name = (String)f.getProperty(":robot_name"); boolean relative = (((Integer)f.getProperty(":relative")).intValue() == 1); @@ -125,12 +181,26 @@ return (GFrame) null; } + /** + * This function is called when there is evidence that a robot has been halted. + * For now this is a noop. There's probably a nice way to display this though. + * @param f A Galaxy frame with the name of a robot that has been halted. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpSetHalt(GFrame f) { String name = (String)f.getProperty(":robot_name"); System.err.println(name + " should halt"); return (GFrame) null; } + /** + * This function is called when there is evidence that a robot is planning to + * follow another robot. + * For now this function is a noop, but there's probably a nice graphical + * way to display this information. + * @param f A Galaxy frame with following information. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpSetFollow(GFrame f) { String name = (String)f.getProperty(":robot_name"); String followee = (String)f.getProperty(":followee"); @@ -138,6 +208,13 @@ return (GFrame) null; } + /** + * This function is called when there is evidence that a robot is planning to + * "cover" an "area". For now the "area" is just a set of waypoints. + * This function is currently just a noop. + * @param f A Galaxy frame with robot covering intention information. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpSetCover(GFrame f) { String name = (String)f.getProperty(":robot_name"); GVector x = f.getList(":x"); @@ -146,6 +223,12 @@ return (GFrame) null; } + /** + * This function is called when a robot says something. + * The text of what the robot says is displayed in the console window. + * @param f A Galaxy frame with information about which robot sais what. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpSpeak(GFrame f) { String utt = (String)f.getProperty(":speaktext"); utt.trim(); @@ -164,6 +247,14 @@ return (GFrame) null; } + /** + * This function is called when the human operator says something. The + * information comes from helios, so it represents the best guess (possibly + * using multiple sources of information) as to what the person said. + * We display the hypothesized utterance and a confidence score in the console. + * @param f A galaxy frame with the annotated utterance. + * @return An unmodified galaxy frame. + */ public GFrame serverOpProcessParse(GFrame f) { //lets only listen to one parse per utt //this may be the wrong bot's parse, but they're normally almost identical @@ -187,6 +278,17 @@ return (GFrame) null; } + /** + * This function is called when a bot believes that it is the current addressee. + * This occurs in three distinct ways: + * 1) The robot is selected on the GUI. + * 2) The robot hears its name called by the human operator. + * 3) The robot starts a conversation. + * We change the color of this bot to yellow, and non-selected bots are changed + * to red. + * @param f A Galaxy frame with the name of the selected bot. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpSelectBot(GFrame f) { System.err.println("got select_bot: " + f.toString()); String inframe = (String)f.getProperty(":inframe"); @@ -198,6 +300,13 @@ return (GFrame)null; } + /** + * The function is called when there is new map data from the map server. + * We update the map. + * @param f A Galaxy frame with the new map data. The map data may be a full + * map or a diff on the previous map. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpMapUpdate(GFrame f) { System.err.println("got map update"); String type = (String)f.getProperty(":type"); @@ -220,6 +329,13 @@ return (GFrame)null; } + /** + * This function is called when we get a camera image from a robot with a + * camera. + * We display the image in the lower right corner. + * @param f A Galaxy frame with the camera image. + * @return An unmodified Galaxy frame. + */ public GFrame serverOpImage(GFrame f) { GBinary gb = f.getBinary(":jpeg"); try { @@ -232,6 +348,11 @@ return (GFrame)null; } + /** + * This function sends a robot selection to the hub. We use this to express + * a desired conversation addressee. + * @param name The name of the robot that we wish to address. + */ public void saySelectBot(String name) { System.err.println("selecting from server: " + name); Map rname = new HashMap(); @@ -239,6 +360,14 @@ sayToBot("Commands", "[HumanReportCommand]", rname); } + /** + * This function sends a location and an orientation to a robot. We use this + * to tell robots where we think they are. + * @param name The name of the robot that we're talking about. + * @param x The x location of the robot w.r.t. the map (in centimeters) + * @param y The y location of the robot w.r.t. the map (in centimeters) + * @param theta The yaw of the robot (in radians?) + */ public void placeBot(String name, float x, float y, float theta) { System.err.println("placing bot " + name + ": (" + x/100 + " " + y/100 + ") " + theta); Map pose = new HashMap(); @@ -248,6 +377,13 @@ sayToBot("Commands", "[HumanSetPoseCommand]", pose); } + /** + * This function sends an instruction for the robots to search an "area". + * The "area" here is defined by a rectangle. + * For now this is not used as the robots don't have this capability. + * @param shape A rectangle within whose bounds the robots are requested to + * search. The rectangle is w.r.t. the map and it's verticies are in centimeters. + */ public void search(RectangleShape shape) { System.err.println("Searching..."); Map loc = new HashMap(); @@ -259,6 +395,12 @@ sayToBot("Commands", "[HumanSearchCommand]", loc); } + /** + * This function sends an instruction for the robots to explore an "area". + * The "area" here is defined by an ordered set of waypoints. + * @param shape An ordered set of waypoints the robots are requested to + * search along. Waypoints are in centimeters. + */ public void explore(PolyLineShape shape) { System.err.println("Exploring..."); Map loc = new HashMap(); @@ -271,6 +413,10 @@ sayToBot("Commands", "[HumanExploreCommand]", loc); } + /** + * This function attempts to cancel the specified task. + * @param taskid The taskid of the task to cancel. + */ public void cancelTask(Integer taskid) { System.err.println("Cancelling " + taskid); Map task = new HashMap(); @@ -278,6 +424,12 @@ sayToBot("Commands", "[HumanCancelTaskCommand]", task); } + /** + * This function sends an instruction for the robots to search an "area". + * The "area" here is defined by an ordered set of waypoints. + * @param shape An ordered set of waypoints along which the robots are requested to + * search. The waypoints are in centimeters. + */ public void search(PolyLineShape shape) { System.err.println("Searching..."); Map loc = new HashMap(); @@ -290,6 +442,10 @@ sayToBot("Commands", "[HumanSearchCommand]", loc); } + /** + * This functions sents a "start session" to the hub. A "start session" + * indicates that the operator is ready to speak and listen to the robots. + */ public void startSession() { GFrame f = new Clause("main"); long time = System.currentTimeMillis()/1000; @@ -298,29 +454,47 @@ send_to_hub(f); } + /** + * This functions sents an "end session" to the hub. An "end session" + * indicates that the operator is not ready to speak or listen to the robots. + */ public void endSession() { GFrame f = new Clause("main"); f.setProperty(":close_session", ""); send_to_hub(f); } + /** + * This function tells all of the robots to immediately stop. It is designed + * for emergency situations. + */ public void eStop() { System.err.println("estop..."); sayToBot("Commands", "[HumanHaltCommand]", null); } + /** + * This function instructs a robot to pause what it's currently attempting, + * but not necessarily to abandon its task. + */ public void pauseRobot() { System.err.println("Pausing..."); - //Map loc = new HashMap(); sayToBot("Commands", "[HumanPauseCommand]", null); } + /** + * This function instructs a robot to resume from a pause. + */ public void unpauseRobot() { System.err.println("Unpausing..."); - //Map loc = new HashMap(); sayToBot("Commands", "[HumanContinueCommand]", null); } + /** + * This function simulates a spoken utterance, and is called when words are + * typed in the console window. It's primary pupose is a debugging and testing aid. + * @param utt The utterance to be simulated. + */ public void say(String utt) { GFrame f = new Clause("main"); @@ -338,6 +512,17 @@ send_to_hub(f); } + /** + * This function packages the things that the operator expresses with the + * pendecoder as parsed utterances to be sent to helios. This is a bit of + * a kludge, since those expressions are not utterances at all, and features + * such as "acoustic_gap_norm" have no meaning. Ultimately Helios will need + * to be generalized to handle this a little better. + * @param frame This is the type of utterance (FUNCTION in Phoenix parlance) + * for the time being "Commands" is the only type used. + * @param slot This is the top-level slot for the pseudo-utterance. + * @param net This is a list of second-level nets and associated pseudo-words. + */ public void sayToBot(String frame, String slot, Map net) { GFrame f = new Clause("main"); @@ -377,25 +562,41 @@ pgoSlots.addElement(gfSlot); // then construct the encompassing parse - gfParse.setProperty(":slots", pgoSlots); - gfParse.setProperty(":numslots", 1); + gfParse.setProperty(":hyp", hyp); //bogus but so what? + gfParse.setProperty(":confhyp", hyp); //bogus but so what? gfParse.setProperty(":uttid", "-1"); - gfParse.setProperty(":hyp", hyp); //bogus but so what? - gfParse.setProperty(":hyp_index", 0); - gfParse.setProperty(":hyp_num_parses", 1); + gfParse.setProperty(":engine_name", "bogus"); + gfParse.setProperty(":nbest_index", 0); gfParse.setProperty(":decoder_score", 0.0F); + gfParse.setProperty(":lm_score", 0.0F); gfParse.setProperty(":am_score", 0.0F); - gfParse.setProperty(":lm_score", 0.0F); gfParse.setProperty(":frame_num", 0); gfParse.setProperty(":acoustic_gap_norm", 0.0F); + gfParse.setProperty(":avg_sphinxwordconf", 0.0F); + gfParse.setProperty(":min_sphinxwordconf", 0.0F); + gfParse.setProperty(":max_sphinxwordconf", 0.0F); gfParse.setProperty(":avg_wordconf", 0.0F); gfParse.setProperty(":min_wordconf", 0.0F); gfParse.setProperty(":max_wordconf", 0.0F); gfParse.setProperty(":avg_validwordconf", 0.0F); gfParse.setProperty(":min_validwordconf", 0.0F); gfParse.setProperty(":max_validwordconf", 0.0F); + gfParse.setProperty(":startframes", "0"); + gfParse.setProperty(":endframes", "0"); + gfParse.setProperty(":init_timestamp", 0); + gfParse.setProperty(":end_timestamp", 0); + gfParse.setProperty(":slots", pgoSlots); + gfParse.setProperty(":numslots", 1); + int tokens = 0; + for(String phrase: net.values()) { + tokens += phrase.split(" +").length; + } + gfParse.setProperty(":numtokens", tokens); gfParse.setProperty(":parsestring", frame + "\n" + slot + " " + parse + "\n\n"); + gfParse.setProperty(":hyp_index", 0); + gfParse.setProperty(":hyp_num_parses", 1); + gfParse.setProperty(":gal_slotstring", gfSlot.toString()); pgoParses.addElement(gfParse); f.setProperty(":parses", pgoParses); @@ -404,6 +605,10 @@ send_to_hub(f); } + /** + * This function marshals a constructed Galaxy frame to the hub. + * @param f The frame that we wish to send to the hub. + */ public void send_to_hub(GFrame f) { System.err.println("sending the frame: " + f.toString()); @@ -416,6 +621,15 @@ } } + /** + * This function reads a peerfile configuration to determine the ip address of + * the opatrader. At one time this was required because the maps were registered + * to the bot that running the optrader server. Now this function is probably + * irrelevant since the map server handles that registration internally. + * @param peerfilename The filename of the peerfile configuration. + * @return The name of the bot that is running the optrader as specified in the + * peerfile configuration. + */ private static String getOpTraderFrameHolder(String peerfilename) { try { BufferedReader reader = new BufferedReader(new FileReader(peerfilename)); @@ -433,6 +647,13 @@ return "CLYDE"; } + /** + * This main block gets the optrader frame holder (probably uneccessary) and + * then starts the mainserver. The mainserver waits for hub connections and + * instantiates this class for every connecting hub. + * @param args The command line args. Only the peerfile may be specified, and + * even that is probably not neccessary. + */ public static void main(String[] args) { for(int i=0; i An HTML attachment was scrubbed... URL: http://mailman.srv.cs.cmu.edu/pipermail/teamtalk-developers/attachments/20071115/b50116d7/attachment.html -------------- next part -------------- Property changes on: tags/2007-tt-fallback/Tools ___________________________________________________________________ Name: svn:externals - MakeLM -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/MakeLM VBScribe -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/VBScribe + MakeLM -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/MakeLM/trunk VBScribe -r2419 http://edam.speech.cs.cmu.edu/repos/olympus/trunk/Tools/VBScribe