Ejemplo n.º 1
0
	// Use this for initialization
	void Start ()
    { 
        this.pointCloud = this.pointCloudShadow.GetComponent<PointCloud>();
        this.cipcLS = this.CIPCforLS.GetComponent<CIPCReceiverLaserScaner>();
        this.CP = new CalculatePosition();
	
	}
Ejemplo n.º 2
0
        public RobotPosition()
        {
            this.CP = new CalculatePosition(0);

            this.IsChangeVelocity = false;
            this.IsHight = false;
            this.IsJumpVel = false;
            this.IsJump = false;
        }
Ejemplo n.º 3
0
	// Use this for initialization
	void Start ()
    {
        this.CP = new CalculatePosition();
        this.RBM = new RandomBoxMuller();
        this.targetHuman0 = 0;
        this.targetHuman1 = 0;
        this.IsUseKinet = false;

        this.preCenter = Vector3.zero;
        this.preSD = 0;
	
	}
Ejemplo n.º 4
0
        public void Dispose()
        {
            onClicked                 = null;
            onRightClicked            = null;
            texture                   = null;
            guiColor                  = null;
            overrideCalculatePosition = null;

            var disposing = this;

            Pool.Dispose(ref disposing);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Starting method of the program.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ICalculatePosition calculatePosition = new CalculatePosition();
            IRoverPosition     roverPosition     = new RoverPosition();
            ICommandSequence   command           = new CommandSequence();

            Tuple <int, int> gridSize = Tuple.Create(40, 30);
            //Initial Position is set only for the new Rovers, existing Rovers use last executed position
            Tuple <int, int, string> initialPosition = Tuple.Create(10, 10, "N");

            while (true)
            {
                Console.WriteLine("Enter name of the new or existing Rover:");
                string roverName = Console.ReadLine().Trim();
                while (string.IsNullOrEmpty(roverName))
                {
                    Console.WriteLine("Please enter a valid name for Rover:");
                    roverName = Console.ReadLine().Trim();
                }
                if (roverName.Equals("exit", StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }
                Console.WriteLine($"Enter the move sequence for the  Rover : {roverName}");
                string roverMovement = Console.ReadLine().Trim();
                while (string.IsNullOrEmpty(roverMovement))
                {
                    Console.WriteLine($"Please enter valid move sequence for the  Rover : {roverName}");
                    roverMovement = Console.ReadLine().Trim();
                }
                if (roverMovement.Equals("exit", StringComparison.OrdinalIgnoreCase))
                {
                    break;
                }

                try
                {
                    var roverNewPosition = new RobotSpecification(command, roverPosition, calculatePosition).RobotAction(gridSize, roverMovement, roverName, initialPosition);
                    Console.WriteLine($"{roverNewPosition.Item1} {roverNewPosition.Item2} {roverNewPosition.Item3}");
                }
                catch (ArgumentOutOfRangeException)
                {
                    Console.WriteLine($"The given sequence {roverMovement} for Rover {roverName} is taking it out side of the boundary which is invalid.");
                }
                catch (Exception ex)
                {
                    Console.WriteLine("There is an error during the Rover move. Detailed Exception : " + ex.ToString());
                }
            }
            Environment.Exit(0);
        }
Ejemplo n.º 6
0
        private void Setup(HeaderPart headerPart, bool drawsSelectionRect, bool drawsMouseoverRect, string tooltip, [CanBeNull] OnHeaderPartClicked onPartClicked, [CanBeNull] OnHeaderPartClicked onPartRightClicked, bool isSelectable, CalculatePosition setOverrideCalculatePosition)
        {
            part = headerPart;
            rect = default(Rect);
            drawSelectionRect         = drawsSelectionRect;
            drawMouseoverRect         = drawsMouseoverRect;
            onClicked                 = onPartClicked;
            onRightClicked            = onPartRightClicked;
            selectable                = isSelectable;
            overrideCalculatePosition = setOverrideCalculatePosition;

            label.image   = null;
            label.tooltip = tooltip == null ? "" : tooltip;
        }
Ejemplo n.º 7
0
    protected override JobHandle OnUpdate(JobHandle inputDeps)
    {
        Settings settings = Bootstrap.Settings;

        var calculatePositionsJob = new CalculatePosition
        {
            InitialPlayerSize = settings.PlayerInitialSize,
            PlayerMaxSpeed    = settings.PlayerMaxSpeed,
            dt        = Time.deltaTime,
            ArenaSize = settings.ArenaSize * 10
        };

        return(calculatePositionsJob.Schedule(this, inputDeps));
    }
Ejemplo n.º 8
0
    void Start()
    {
        this.robotLight = this.robot.transform.FindChild("RobotLight").gameObject;

        this.cipcKinect = this.CIPCforKinect.GetComponent<CIPCReceiver>();
        this.cipcLS = this.CIPCforLaserScaner.GetComponent<CIPCReceiverLaserScaner>();
        this.pointCloud = this.depth.GetComponent<PointCloud>();
        
        this.List_Human = new List<Human>();
        this.list_humanpos = new List<Vector3>();

        this.cp = new CalculatePosition(0);
        this.centerPos = Vector3.zero;
        this.preCenterPos = new Vector3();

        this.pretime = 0;

        Debug.Log("Light Robot");       
    }
Ejemplo n.º 9
0
        public static HeaderPartDrawer Create(HeaderPart headerPart, bool drawSelectionRect, bool drawMouseoverRect, string tooltip, OnHeaderPartClicked onPartClicked, OnHeaderPartClicked onPartRightClicked = null, bool selectable = true, CalculatePosition overrideCalculatePosition = null)
        {
            HeaderPartDrawer result;

            if (!Pool.TryGet(out result))
            {
                result = new HeaderPartDrawer();
            }

            result.Setup(headerPart, drawSelectionRect, drawMouseoverRect, tooltip, onPartClicked, onPartRightClicked, selectable, overrideCalculatePosition);
            return(result);
        }
Ejemplo n.º 10
0
 public LightAction()
 {
     this.CP = new CalculatePosition(0);
 }