亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rescuevansim.java

?? 一個多機器人的仿真平臺
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
        /**         * Clear the trail.         */        public void clearTrail()		{		trail.clear();		}        /**         * Draw the robot in a specific spot.         */        public void draw(Vec2 pos, Graphics g, int w, int h,                double t, double b, double l, double r)                {                Vec2 old_pos = position;                position = pos;                draw(g,w,h,t,b,l,r);                position = old_pos;                }        /**         * Draw the robot as an icon.         */        public void drawIcon(Graphics g, int w, int h,                double t, double b, double l, double r)                {                Vec2[] body = new Vec2[6];                int[] bodyx = new int[6];                int[] bodyy = new int[6];                top =t; bottom =b; left =l; right =r;                if (DEBUG) System.out.println("draw "+                        w + " " +                        h + " " +                        t + " " +                        b + " " +                        l + " " +                        r + " ");                double meterspp = (r - l) / (double)w;                if (DEBUG) System.out.println("meterspp "+meterspp);                int radius = (int)(RADIUS / meterspp);                //int visionr = (int)(VISION_RANGE / meterspp);                int xpix = (int)((position.x - l) / meterspp);                int ypix = (int)((double)h - ((position.y - b) / meterspp));                if (DEBUG) System.out.println("position is "+position.x+","+position.y);                if (DEBUG) System.out.println("robot at"+                        " at "+xpix+","+ypix);                /*--- draw the main body ---*/                body[0] = new Vec2( 2.0, 1.2);                body[1] = new Vec2( 2.4, 0.8);                body[2] = new Vec2( 2.4,-0.8);                body[3] = new Vec2( 2.0,-1.2);                body[4] = new Vec2(-2.4,-1.2);                body[5] = new Vec2(-2.4, 1.2);                for(int j = 0; j<6; j++) // scale and rotate                        {                        //body[j].setr(body[j].r / meterspp);                        body[j].setr(body[j].r * 5);                        body[j].sett(body[j].t - steer.t);                        bodyx[j] = (int)body[j].x + xpix;                        bodyy[j] = (int)body[j].y + ypix;                        }                g.setColor(foreground);                g.fillPolygon(bodyx, bodyy, 6);                g.setColor(background);                g.drawPolygon(bodyx, bodyy, 6);                }        /**         * Draw the robot.         */        public void draw(Graphics g, int w, int h,                double t, double b, double l, double r)                {                Vec2[] body = new Vec2[6];                int[] bodyx = new int[6];                int[] bodyy = new int[6];                top =t; bottom =b; left =l; right =r;                if (DEBUG) System.out.println("draw "+                        w + " " +                        h + " " +                        t + " " +                        b + " " +                        l + " " +                        r + " ");                double meterspp = (r - l) / (double)w;                if (DEBUG) System.out.println("meterspp "+meterspp);                int radius = (int)(RADIUS / meterspp);                //int visionr = (int)(VISION_RANGE / meterspp);                int xpix = (int)((position.x - l) / meterspp);                int ypix = (int)((double)h - ((position.y - b) / meterspp));                if (DEBUG) System.out.println("robot at"+                        " at "+xpix+","+ypix);                /*--- draw the main body ---*/                body[0] = new Vec2( 2.0, 1.2);                body[1] = new Vec2( 2.4, 0.8);                body[2] = new Vec2( 2.4,-0.8);                body[3] = new Vec2( 2.0,-1.2);                body[4] = new Vec2(-2.4,-1.2);                body[5] = new Vec2(-2.4, 1.2);                for(int j = 0; j<6; j++) // scale and rotate                        {                        body[j].setr(body[j].r / meterspp);                        //body[j].setr(body[j].r * 10);                        body[j].sett(body[j].t - steer.t);                        bodyx[j] = (int)body[j].x + xpix;                        bodyy[j] = (int)body[j].y + ypix;                        }                g.setColor(foreground);                g.fillPolygon(bodyx, bodyy, 6);                g.setColor(background);                g.drawPolygon(bodyx, bodyy, 6);                }	/**	 * Clean up.	 */	public void quit()		{		}	/**	 * Gets time elapsed since the robot was instantiated. 	 * Since this is simulation, it may not match real elapsed time.	 */	public long getTime()		{		return(time);		}	private	long	last_Obstaclest = 0;	private	Vec2	last_Obstacles[];	private	int	num_Obstacles;	/**	 * Get an array of Vec2s that point egocentrically from the	 * center of the robot to the obstacles currently sensed by the 	 * bumpers and sonars.	 * @param timestamp only get new information 	 *	if timestamp > than last call or timestamp == -1 .	 * @return the sensed obstacles.	 */	public Vec2[] getObstacles(long timestamp)		{		if((timestamp > last_Obstaclest)||(timestamp == -1))			{			if (timestamp != -1) last_Obstaclest = timestamp;			Vec2 tmp_objs[] = new Vec2[all_objects.length];			num_Obstacles = 0;			/*--- check all objects ---*/			for(int i = 0; i<all_objects.length; i++)				{				/*--- check if it's an obstacle and not self ---*/				if (all_objects[i].isObstacle() &&					(all_objects[i].getID() != unique_id))					{					Vec2 tmp = all_objects[i].getClosestPoint(							position);					if (tmp.r<obstacle_rangeM)					tmp_objs[num_Obstacles++] = tmp;					}				}			last_Obstacles = new Vec2[num_Obstacles];			for(int i = 0; i<num_Obstacles; i++)			last_Obstacles[i] = new Vec2(tmp_objs[i].x,				tmp_objs[i].y);			}		Vec2[] retval = new Vec2[num_Obstacles];		for(int i = 0; i<num_Obstacles; i++)			retval[i] = new Vec2(last_Obstacles[i].x,				last_Obstacles[i].y);		return(retval);		}	private	double	obstacle_rangeM = 1.0;	/**	 * Set the maximum range at which a sensor reading should be considered	 * an obstacle.  Beyond this range, the readings are ignored.	 * The default range on startup is 1 meter.	 * @param range the range in meters.	 */	public void setObstacleMaxRange(double range)		{		obstacle_rangeM = range;		}	private	long	last_VisualObjectst = 0;	private Vec2[]	last_VisualObjects;	private	int	num_VisualObjects = 0;	private	int	last_channel = 0;	/**	 * Get an array of Vec2s that represent the	 * locations of visually sensed objects egocentrically 	 * from center of the robot to the objects currently sensed by the 	 * vision system.		 * @param timestamp only get new information 	 *	if timestamp > than last call or timestamp == -1 .	 * @param channel (1-6) which type/color of object to retrieve.	 * @return the sensed objects.	 */	public Vec2[] getVisualObjects(long timestamp, int channel)		{		if(((timestamp > last_VisualObjectst)||			(channel != last_channel))||(timestamp == -1))			{			if (timestamp != -1) last_VisualObjectst = timestamp;			last_channel = channel;			num_VisualObjects = 0;			Vec2 tmp_objs[] = new Vec2[all_objects.length];			/*--- check all objects ---*/			for(int i = 0; i<all_objects.length; i++)				{				/*--- check if it's of the right code and not self ---*/				if (all_objects[i].getVisionClass()==channel &&					(all_objects[i].getID() != unique_id))					{					Vec2 tmp = all_objects[i].getCenter(							position);					if (tmp.r<RescueVan.VISION_RANGE)						tmp_objs[num_VisualObjects++] = tmp;					}				}			last_VisualObjects = new Vec2[num_VisualObjects];			for(int i = 0; i<num_VisualObjects; i++)			last_VisualObjects[i] = new Vec2(tmp_objs[i].x,				tmp_objs[i].y);			}		Vec2[] retval = new Vec2[num_VisualObjects];		for(int i = 0; i<num_VisualObjects; i++)			retval[i] = new Vec2(last_VisualObjects[i].x,				last_VisualObjects[i].y);		return(retval);		}	  /**	    * this is a dummy implementation to keep compatibility with VisualSensorObject.	    * at this point, vision noise is not built into the class. for an example,	    * see SimpleCyeSim.	    */	  public void setVisionNoise(double mean, double stddev, long seed) { }	private	long	last_VisualSizest = 0;	/**	 * NOT IMPLEMENTED:	 * Get an array of doubles that represent an estimate of the	 * size in square meters of the visually sensed objects.	 * @param timestamp only get new information if 	 * 	timestamp > than last call or timestamp == -1 .	 * @param channel (1-6) which type/color of object to retrieve.	 * @return the sizes of the sensed objects.	 */	public double[] getVisualSizes(long timestamp, int channel)		{		/* todo */		return(new double[0]);		}	private	long	last_VisualAxest = 0;	/**	 * NOT IMPLEMENTED:	 * Get an array of doubles that represent the	 * major axis orientation of the visually sensed objects.	 * 0 and PI are horizontal, PI/2 is vertical.	 * @param timestamp only get new information 	 *	if timestamp > than last call or timestamp == -1 .	 * @param channel (1-6) which type/color of object to retrieve.	 * @return the major axes of the sensed objects.	 */	public double[] getVisualAxes(long timestamp, int channel)		{		/* todo */		return(new double[0]);		}	/**	 * Get the position of the robot in global coordinates.	 * @param timestamp only get new information 	 *	if timestamp > than last call or timestamp == -1.	 * @return the position.	 */	public Vec2 getPosition(long timestamp)		{		return(new Vec2(position.x, position.y));		}			/**	 * Get the position of the robot in global coordinates.	 * @return the position.	 */	public Vec2 getPosition()		{		return(new Vec2(position.x, position.y));		}			/**	 * Reset the odometry of the robot in global coordinates.	 * This might be done when reliable sensor information provides	 * a very good estimate of the robot's location, or if you	 * are starting the robot in a known location other than (0,0).	 * Do this only if you are certain you're right!	 * @param position the new position.	 */	public void resetPosition(Vec2 posit)		{                    if (DEBUG) System.out.println("position reset to "+posit.x+","+posit.y);		position.setx(posit.x);		position.setx(posit.y);		}	private boolean	in_reverse = false;	/**	*/	public double getSteerHeading(long timestamp)		{		return(steer.t);		}		/**	*/	public void resetSteerHeading(double heading)		{		/* ensure in legal range */		heading = Units.ClipRad(heading); 		/* if we're in reverse, the steer heading is PI out */		if (in_reverse) heading = Units.ClipRad(heading + Math.PI);		/* set the angle */		steer.sett(heading);		}	private double desired_heading;	/**	*/	public void setSteerHeading(long timestamp, double heading)		{		/* ensure in legal range */		desired_heading = Units.ClipRad(heading);		/* check if we should go in reverse */		// NEVER GO IN REVERSE FOR A VAN		//double turn = Units.BestTurnRad(steer.t, desired_heading);		//if (Math.abs(turn)>(Math.PI/2))			//{			//in_reverse = true;			//desired_heading = 				//Units.ClipRad(desired_heading+Math.PI);			//}		//else in_reverse = false;		}		private double desired_speed = 0;	/**	*/ 	public void setSpeed(long timestamp, double speed)		{		/* ensure legal range */		if (speed > 1.0) speed = 1.0;		else if (speed < 0) speed = 0;		desired_speed = speed;		}	protected double base_speed = MAX_TRANSLATION;	/**	*/	public void setBaseSpeed(double speed)		{		if (speed > MAX_TRANSLATION) speed = MAX_TRANSLATION;		else if (speed < 0) speed = 0;		base_speed = speed;		}        private long    last_Opponentst = 0;        private Vec2    last_Opponents[];        /**         * Get an array of Vec2s that point egocentrically from the         * center of the robot to the opponents currently sensed by the         * robot         * @param timestamp only get new information if 	 *		timestamp > than last call or timestamp == -1 .         * @return the sensed Opponents.         */        public Vec2[] getOpponents(long timestamp)                {                if((timestamp > last_Opponentst)||(timestamp == -1))                        {                        if (timestamp != -1) last_Opponentst = timestamp;                        last_Opponents = kin_sensor.getOpponents(all_objects);                        }                return(last_Opponents);                }        /**         * Return an int represting the player's ID on the team.         * This value may not be valid if the simulation has not         * been "set up" yet.  Do not use it during initialization.         * @param timestamp only get new information if         *      timestamp > than last call or timestamp == -1 .         * @return the number.         */        public int getPlayerNumber(long timestamp)                {                return(kin_sensor.getPlayerNumber(all_objects));                }        private long    last_Teammatest = 0;        private Vec2    last_Teammates[] = new Vec2[0];        /**         * Get an array of Vec2s that point egocentrically from the         * center of the robot to the teammates currently sensed by the         * robot.         * @param timestamp only get new information if         *      timestamp > than last call or timestamp == -1 .         * @return the sensed teammates.         */        public Vec2[] getTeammates(long timestamp)                {                if((timestamp > last_Teammatest)||(timestamp == -1))                        {                        if (timestamp != -1) last_Teammatest = timestamp;                        last_Teammates = kin_sensor.getTeammates(all_objects);                        }                return(last_Teammates);                }        private double  kin_rangeM = 4.0;        /**         * Set the maximum range at which a sensor reading should be considered         * kin.  Beyond this range, the readings are ignored.         * Also used by opponent sensor.         * The default range on startup is 1 meter.         * @param range the range in meters.         */        public void setKinMaxRange(double range)                {                kin_rangeM = range;                kin_sensor.setKinMaxRange(range);                }	/**	 * NOT IMPLEMENTED	 */	public void setGripperHeight(long timestamp, double position)		{		/* todo */		}        /*--- Transceiver methods ---*/        public void multicast(int[] ids, Message m)                throws CommunicationException                {                transceiver.multicast(ids, m, all_objects);                }        public void broadcast(Message m)                {                transceiver.broadcast(m, all_objects);                }        public void unicast(int id, Message m)                throws CommunicationException                {                transceiver.unicast(id, m, all_objects);                }        public CircularBufferEnumeration getReceiveChannel()                {                return(transceiver.getReceiveChannel());                }        public void setCommunicationMaxRange(double m)                {                transceiver.setCommunicationMaxRange(m);                }        public void receive(Message m)                {                transceiver.receive(m);                }        public boolean connected()                {                return(true);                }	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲精品免费| 国产亲近乱来精品视频| 91麻豆.com| 26uuu国产电影一区二区| 欧美日韩成人一区| 18欧美乱大交hd1984| 精品一区二区三区香蕉蜜桃| 一本一道波多野结衣一区二区| 欧美日韩国产成人在线91| 中文字幕第一页久久| 久久成人免费网站| 在线国产电影不卡| 中文字幕第一区第二区| 久久国产精品99精品国产| 欧美体内she精高潮| 综合色天天鬼久久鬼色| 国产综合久久久久久鬼色| 色国产精品一区在线观看| 国产精品婷婷午夜在线观看| 亚洲一区在线电影| 色婷婷久久综合| 国产精品丝袜在线| 国产酒店精品激情| 日韩精品一区二区三区视频在线观看| 亚洲精品乱码久久久久久| 91色视频在线| 18涩涩午夜精品.www| 99久久精品国产一区二区三区| 国产亚洲人成网站| 国产精品一区二区久久不卡| 2欧美一区二区三区在线观看视频| 日本视频在线一区| 欧美视频精品在线观看| 亚洲丝袜另类动漫二区| 色哟哟日韩精品| 亚洲欧美日韩国产另类专区| 成人av电影免费观看| 亚洲欧美日韩在线播放| 色播五月激情综合网| 亚洲综合在线免费观看| 欧美日韩一区二区欧美激情| 亚洲成人激情av| 欧美视频精品在线| 日韩av在线免费观看不卡| 欧美日韩免费一区二区三区视频| 亚洲h精品动漫在线观看| 欧美精品v国产精品v日韩精品 | 激情综合色播激情啊| 欧美mv日韩mv国产| 国产精品一区2区| 国产精品美女久久久久aⅴ国产馆| 久久99精品国产麻豆婷婷| 久久久电影一区二区三区| 成人av动漫在线| 一区二区欧美在线观看| 91精品国产一区二区三区香蕉| 久久电影网站中文字幕| 国产精品网站在线| 91久久久免费一区二区| 日韩国产欧美在线视频| 欧美成人aa大片| 美腿丝袜亚洲综合| 国产精品激情偷乱一区二区∴| 欧洲一区二区三区免费视频| 久久精品国产成人一区二区三区| 精品盗摄一区二区三区| 91在线你懂得| 精品一二三四区| 亚洲欧美偷拍卡通变态| 欧美一级二级三级蜜桃| 波多野结衣精品在线| 日本色综合中文字幕| 中文字幕免费不卡| 欧美一区二区三区四区久久 | 一本一道久久a久久精品综合蜜臀| 日韩毛片一二三区| 欧美一级电影网站| 91久久线看在观草草青青 | 日韩欧美国产综合| 99在线热播精品免费| 琪琪久久久久日韩精品| 亚洲天堂成人在线观看| 日韩女优av电影在线观看| 色成年激情久久综合| 国产精品99久久久| 日韩—二三区免费观看av| 国产精品白丝在线| 欧美v国产在线一区二区三区| 99久久精品久久久久久清纯| 国产在线麻豆精品观看| 丝瓜av网站精品一区二区| 国产精品对白交换视频| 精品福利一二区| 欧美丰满一区二区免费视频| 色综合久久88色综合天天6 | 久久色.com| 制服丝袜av成人在线看| 一本高清dvd不卡在线观看| 午夜精品久久久久久久久| 一区二区三区在线观看视频| 国产欧美日韩综合| 久久久久综合网| 日韩精品一区二| 91精品国产全国免费观看| 色88888久久久久久影院野外| 成人午夜电影网站| 国v精品久久久网| 久久99精品国产.久久久久| 日本欧美肥老太交大片| 丝袜亚洲另类欧美综合| 香蕉久久一区二区不卡无毒影院 | 欧美影视一区二区三区| 97久久精品人人做人人爽50路 | 国产精品传媒在线| 久久精品人人爽人人爽| 国产亚洲精品资源在线26u| 亚洲精品一区二区三区99| 久久夜色精品国产噜噜av| www国产成人免费观看视频 深夜成人网| 欧美蜜桃一区二区三区| 欧美精品免费视频| 欧美久久久久久久久久| 91精品国产91久久久久久一区二区| 欧美日韩国产影片| 91精品国产综合久久香蕉的特点| 欧美精品123区| 精品人在线二区三区| 精品卡一卡二卡三卡四在线| 2022国产精品视频| 国产精品国产精品国产专区不片| 国产精品毛片久久久久久| 中文字幕在线观看一区| 亚洲伊人色欲综合网| 男人操女人的视频在线观看欧美 | 亚洲午夜免费福利视频| 亚洲成人777| 久久精品国产澳门| 国产69精品久久久久毛片| 成人激情黄色小说| 精品视频123区在线观看| 欧美大片一区二区三区| 国产欧美中文在线| 亚洲免费在线观看视频| 日本怡春院一区二区| 国产精品99久久久| 欧美亚洲一区二区三区四区| 欧美一区二区三区在线看| 国产欧美日韩在线| 一区二区免费看| 久久av资源站| 91亚洲精华国产精华精华液| 欧美猛男超大videosgay| 久久久亚洲精品石原莉奈| 国产精品私人自拍| 日韩av一二三| 成人99免费视频| 日韩一卡二卡三卡四卡| 中文字幕乱码一区二区免费| 日本强好片久久久久久aaa| 成人性生交大合| 欧美一区二区福利视频| 国产精品国产三级国产专播品爱网| 日韩国产成人精品| 99riav一区二区三区| 精品国产免费一区二区三区香蕉| 亚洲色图.com| 国产精品1区2区3区| 欧美日韩精品欧美日韩精品| 国产精品免费网站在线观看| 亚洲成人动漫精品| 97精品国产97久久久久久久久久久久| 日韩一区二区在线观看视频| 亚洲乱码国产乱码精品精小说| 精品中文字幕一区二区| 欧美日韩久久久一区| 国产精品久久久久久户外露出| 极品少妇xxxx精品少妇| 欧美日韩综合色| 亚洲人成网站精品片在线观看| 老司机精品视频一区二区三区| 欧美亚洲动漫制服丝袜| 欧美激情一区二区三区在线| 美女任你摸久久| 欧美精品色一区二区三区| 亚洲一区二区av在线| 不卡在线视频中文字幕| 久久精品视频网| 国产成人午夜精品5599| 精品国产不卡一区二区三区| 石原莉奈在线亚洲二区| 欧美日韩精品一区二区三区| 一级女性全黄久久生活片免费| 99riav一区二区三区| 国产精品日韩成人| 国产成人精品免费网站| 国产日韩欧美电影| 成人在线一区二区三区| 中日韩av电影| 国产精品99久久久久久宅男| 日本一区二区三区视频视频|