import org.armedbear.lisp.Environment; import casa.Agent; import casa.CASAProcess; import casa.LispAccessible; import casa.ML; import casa.Status; import casa.TransientAgent; import casa.URLDescriptor; import casa.abcl.CasaLispOperator; import casa.abcl.ParamsMap; import casa.exceptions.URLDescriptorException; import casa.ui.AgentUI; /** * 1. use LISP command line (in casa chat) to do sample moves with the robot * 2. create a LISP accessible java method to (a) be called from (1), and then (b) execute more than 1 LISP command * have extra parameters, e.g. speed, duration, angle * 3. ("sleep" bad) drive robot and then create time event (for queuing) to stop robot (call event.start) * 4. new casa lisp operator (has optional & keyed parameters) * 5. having a request instead of LISP commands */ public class DrEvil extends Agent { public static void main(String[] p) { String cmd = "(let (\n"+ " (trace-tags \"-info,warning,msg,iRobot,-boundSymbols,-policies9,-commitments,-eventqueue,-conversations\")\n"+ " (trace-code 10) ; bit 1=off, 2=on, 4=to-monitor-window, 8=trace-to-file\n"+ " (sleep-time 2) ; time to sleep between starting dependent agents, adjust for slower machines\n"+ // " (outstream \"/dev/tty.ElementSerial-ElementSe\")\n"+ // " (instream \"/dev/tty.ElementSerial-ElementSe\")\n"+ " (outstream \"robot.out\")\n"+ " (instream \"robot.in\")\n"+ " )\n"+ " \n"+ ";; Set the options for the agent running the commandline\n"+ "(agent.options :options.tracing T)\n"+ "(agent.options :options.tracetags trace-tags)\n"+ "\n"+ ";(agent.new-agent \"casa.LAC\" \"ResearchLAC\" 9000 :process \"CURRENT\" :markup \"KQML\" :trace :traceFile :traceTags \"warning,msg,commitments,policies5\")\n"+ ";(sleep 2)\n"+ "\n"+ "(agent.new-agent \"iRobotCreate.iRobotCreate\" \"MiniMe\" 6903 :LAC 9000 :process \"CURRENT\" :trace trace-code :traceTags trace-tags :markup \"KQML\" :outstream outstream :instream instream)\n"+ "(agent.new-agent \"DrEvil\" \"Dr.Evil\" 6909 :LAC 9000 :process \"CURRENT\" :trace trace-code :traceTags trace-tags :markup \"KQML\")\n"+ "\n"+ ") ;let\n"; CASAProcess.main(new String[] {"-LAC", cmd}); } static { createCasaLispOperators( DrEvil.class ); } public DrEvil(ParamsMap params, AgentUI ui) throws Exception { super(params, ui); } }