Example #1
0
    public static void Main(String[] argv)
    {
        Console.WriteLine("Starting Test");

        Aria.init();

        Console.WriteLine("argumentparser...");
        ArArgumentBuilder argBuilder = new ArArgumentBuilder();
        ArArgumentParser  parser     = new ArArgumentParser(argBuilder);

        parser.loadDefaultArguments();
        Console.WriteLine("arrobot...");
        ArRobot          robot = new ArRobot();
        ArRobotConnector conn  = new ArRobotConnector(parser, robot);

        Console.WriteLine("Connecting to robot...");
        if (!conn.connectRobot())
        {
            Console.WriteLine("Error: Could not connect to robot, exiting.");
            Aria.exit(1);
        }

        Console.WriteLine("Connected to robot.");

        if (!Aria.parseArgs())
        {
            Aria.logOptions();
            Aria.exit(2);
        }

        robot.runAsync(true);
        robot.lockObj();
        Console.WriteLine("Sending command to move forward 1 meter...");
        robot.enableMotors();
        robot.move(1000);
        robot.unlockObj();
        Console.WriteLine("Sleeping for 5 seconds...");
        ArUtil.sleep(5000);
        robot.lockObj();
        Console.WriteLine("Sending command to rotate 90 degrees...");
        robot.setHeading(90);
        robot.unlockObj();
        Console.WriteLine("Sleeping for 5 seconds...");
        ArUtil.sleep(5000);
        robot.lockObj();
        Console.WriteLine("Robot coords: robot.getX()=" + robot.getX() + ", robot.getY()=" + robot.getY() + ", robot.getTh()=" + robot.getTh());
        ArPose p = robot.getPose();

        Console.WriteLine("               pose.getX()=" + p.getX() + ", pose.getY()=" + p.getY() + ",  pose.getTh()=" + p.getTh());
        robot.unlockObj();
        robot.lockObj();
        Console.WriteLine("exiting.");
        robot.stopRunning(true);
        robot.unlockObj();
        robot.lockObj();
        robot.disconnect();
        robot.unlockObj();

        robot.Dispose();
        conn.Dispose();
    }
Example #2
0
 public ArGPSConnector(ArArgumentParser argParser) : this(AriaCSPINVOKE.new_ArGPSConnector(ArArgumentParser.getCPtr(argParser)), true)
 {
 }
Example #3
0
        public bool parseArgs(ArArgumentParser parser)
        {
            bool ret = AriaCSPINVOKE.ArSimpleConnector_parseArgs__SWIG_1(swigCPtr, ArArgumentParser.getCPtr(parser));

            return(ret);
        }
Example #4
0
 public ArSimpleConnector(ArArgumentParser parser) : this(AriaCSPINVOKE.new_ArSimpleConnector__SWIG_2(ArArgumentParser.getCPtr(parser)), true)
 {
 }
Example #5
0
        public bool parseArgumentParser(ArArgumentParser parser, bool continueOnError)
        {
            bool ret = AriaCSPINVOKE.ArConfig_parseArgumentParser__SWIG_2(swigCPtr, ArArgumentParser.getCPtr(parser), continueOnError);

            return(ret);
        }
Example #6
0
        public bool parseArgumentParser(ArArgumentParser parser)
        {
            bool ret = AriaCSPINVOKE.ArConfig_parseArgumentParser__SWIG_3(swigCPtr, ArArgumentParser.getCPtr(parser));

            return(ret);
        }
Example #7
0
 public void useArgumentParser(ArArgumentParser parser)
 {
     AriaCSPINVOKE.ArConfig_useArgumentParser(swigCPtr, ArArgumentParser.getCPtr(parser));
 }
Example #8
0
        public bool parseArgumentParser(ArArgumentParser parser, bool continueOnError, string errorBuffer, uint errorBufferLen)
        {
            bool ret = AriaCSPINVOKE.ArConfig_parseArgumentParser__SWIG_0(swigCPtr, ArArgumentParser.getCPtr(parser), continueOnError, errorBuffer, errorBufferLen);

            return(ret);
        }
 public static global::System.Runtime.InteropServices.HandleRef getCPtr(ArArgumentParser obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
 public ArLaserConnector(ArArgumentParser parser, ArRobot robot, ArRobotConnector robotConnector) : this(AriaCSPINVOKE.new_ArLaserConnector__SWIG_4(ArArgumentParser.getCPtr(parser), ArRobot.getCPtr(robot), ArRobotConnector.getCPtr(robotConnector)), true)
 {
 }
 public ArLaserConnector(ArArgumentParser parser, ArRobot robot, ArRobotConnector robotConnector, bool autoParseArgs, ArLog.LogLevel infoLogLevel) : this(AriaCSPINVOKE.new_ArLaserConnector__SWIG_2(ArArgumentParser.getCPtr(parser), ArRobot.getCPtr(robot), ArRobotConnector.getCPtr(robotConnector), autoParseArgs, (int)infoLogLevel), true)
 {
 }
 public ArLaserConnector(ArArgumentParser parser, ArRobot robot, ArRobotConnector robotConnector, bool autoParseArgs, ArLog.LogLevel infoLogLevel, SWIGTYPE_p_ArRetFunctor1T_bool_char_const_p_t turnOnPowerOutputCB) : this(AriaCSPINVOKE.new_ArLaserConnector__SWIG_1(ArArgumentParser.getCPtr(parser), ArRobot.getCPtr(robot), ArRobotConnector.getCPtr(robotConnector), autoParseArgs, (int)infoLogLevel, SWIGTYPE_p_ArRetFunctor1T_bool_char_const_p_t.getCPtr(turnOnPowerOutputCB)), true)
 {
 }
Example #13
0
 public ArRobotConnector(ArArgumentParser parser, ArRobot robot, bool autoParseArgs) : this(AriaCSPINVOKE.new_ArRobotConnector__SWIG_1(ArArgumentParser.getCPtr(parser), ArRobot.getCPtr(robot), autoParseArgs), true)
 {
 }