⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 initialize.java

📁 一个由c转成java的3D robot 仿真平台
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/*********************************************************************//* File: ~/sopra/RoboPackII/Initialize.java                            *//* The purpose of this file is to initialize all needed values, par- *//* ticularly the robot specifying instances.			     *//*********************************************************************/package RoboPackII;final class RobotInit{	/* This class defines all robot specific variables with use- */	/* ful values.						     */	public static void now(RoboProto rob)	{	   // First: new objects are builded	   Points light = new Points(-800.0, 1500.0, 1000.0);	   double[] linkLengths = { 13.5, 10.0, 10.0, 2.5 };	   int[] angleWeights = { 0, 30, 20, 10, 10, 10 }; 	   int[] power = { 3, 3, 3, 3, 3, 3 };	   AngleDates[] angles = { new AngleDates(Math.PI,     -Math.PI, 0.0),			        new AngleDates(0.523598775,-3.665191429, 0.0),				new AngleDates(0.523598775,-3.665191429, 0.0),				new AngleDates(Math.PI,        -Math.PI, 0.0),		  		new AngleDates(Math.PI/2,    -Math.PI/2, 0.0),  				new AngleDates(Math.PI/2,    -Math.PI/2, 0.0)};	   Points[] line = { new Points(0.0, 2.0, 0.0),	                     new Points(0.0, 0.0, 0.0) } ;	   Edges gkl = new Edges((short)0, (short)1);	   int[] rpl = { 64, 65, 94, 5, 114, 115, 138, 139, 140, 141, 146,	 	         147, 152, 153 };	   Points[] coorpl = { new Points(0, 0, 0), new Points(10, 0, 0), 			       new Points(0, 10, 0),new Points(0, 0, 10) };	   Edges[] coorc = { new Edges((short)0, (short)1), 			     new Edges((short)0, (short)2), 			     new Edges((short)0, (short)3) };		   // Second: the robot gets new references to these objects	   rob.light = light;	   rob.linkLengths = linkLengths;	   rob.angleWeights = angleWeights;	   rob.power = power;	   rob.angles = angles;	   rob.line = line;	   rob.gkl = gkl;	   rob.rpl = rpl;	   rob.coorpl = coorpl;	   rob.coorc = coorc;	   // Instanciation without values:	   int i;	   for (i = 0; i < rob.numberOfAreas; i++)	     rob.apl[i] = new AreasPointsList();	   for (i = 0; i < rob.numberOfPoints; i++)	     rob.pl[i] = new Points();	   for (i = 0; i < 361; i++)	     rob.BListe[i] = new Points();	   for (i = 0; i < 4; i++)	     {	       for (int j = 0; j < 6; j++)	         rob.savedAngles[i][j] = 0;	       rob.savedAngles[i][6] = 0.0; // a totally open hand	     }	  	   // Instanciation with many values:           Points[] helpPL =  { new Points(-25.0 ,   0.0 ,-25.0), // Area 0                                    new Points( -8.3 ,   0.0 ,-25.0),                                   new Points(  8.3 ,   0.0 ,-25.0),                                   new Points( 25.0 ,   0.0 ,-25.0),                                   new Points(-25.0 ,   0.0 , -8.3),                                   new Points( 25.0 ,   0.0 , -8.3),                                   new Points(-25.0 ,   0.0 ,  8.3),                                   new Points( 25.0 ,   0.0 ,  8.3),                                   new Points(-25.0 ,   0.0 , 25.0),                                   new Points( -8.3 ,   0.0 , 25.0),                                   new Points(  8.3 ,   0.0 , 25.0), /* 10 */                                   new Points( 25.0 ,   0.0 , 25.0),                                   new Points(  0.0 ,   0.0 , -5.0), // Base                                    new Points( 3.53 ,   0.0 ,-3.53),                                   new Points(  5.0 ,   0.0 ,  0.0),                                   new Points( 3.53 ,   0.0 , 3.53),                                   new Points(  0.0 ,   0.0 ,  5.0),                                   new Points(-3.53 ,   0.0 , 3.53),                                   new Points( -5.0 ,   0.0 ,  0.0),                                   new Points(-3.53 ,   0.0 ,-3.53),                                   new Points(  0.0 ,   3.0 , -5.0),  /* 20 */                                   new Points( 3.53 ,   3.0 ,-3.53),                                   new Points(  5.0 ,   3.0 ,  0.0),                                   new Points( 3.53 ,   3.0 , 3.53),                                   new Points(  0.0 ,   3.0 ,  5.0),                                   new Points(-3.53 ,   3.0 , 3.53),                                   new Points( -5.0 ,   3.0 ,  0.0),                                   new Points(-3.53 ,   3.0 ,-3.53),                                   new Points(  0.0 ,   3.0 , -1.5), //Turnarea                                   new Points( 1.06 ,   3.0 ,-1.06),                                   new Points(  1.5 ,   3.0 ,  0.0),  /* 30 */                                   new Points( 1.06 ,   3.0 , 1.06),                                   new Points(  0.0 ,   3.0 ,  1.5),                                   new Points(-1.06 ,   3.0 , 1.06),                                   new Points( -1.5 ,   3.0 ,  0.0),                                   new Points(-1.06 ,   3.0 ,-1.06),                                   new Points(  0.0 ,   3.5 , -1.5),                                    new Points( 1.06 ,   3.5 ,-1.06),                                   new Points(  1.5 ,   3.5 ,  0.0),                                   new Points( 1.06 ,   3.5 , 1.06),                                   new Points(  0.0 ,   3.5 ,  1.5),  /* 40 */                                   new Points(-1.06 ,   3.5 , 1.06),                                   new Points( -1.5 ,   3.5 ,  0.0),                                   new Points(-1.06 ,   3.5 ,-1.06),                                   new Points( -1.0 ,   3.5 ,  1.0), // Link 1                                    new Points( -1.0 ,   3.5 , -1.0),                                   new Points(  1.0 ,   3.5 , -1.0),                                   new Points(  1.0 ,   3.5 ,  1.0),                                   new Points( -1.0 ,  12.5 ,  1.0),                                   new Points( -1.0 ,  12.5 , -1.0),                                   new Points(  1.0 ,  12.5 , -1.0),  /* 50 */                                   new Points(  1.0 ,  12.5 ,  1.0),                                   new Points(  1.0 ,  12.5 ,  0.5),                                   new Points( -1.0 ,  12.5 ,  0.5),                                   new Points( -0.5 ,  14.0 ,  1.0),                                   new Points(  0.5 ,  14.0 ,  1.0),                                   new Points(  0.5 ,  14.0 ,  0.5),                                   new Points( -0.5 ,  14.0 ,  0.5),                                   new Points(  1.0 ,  12.5 , -0.5),                                   new Points( -1.0 ,  12.5 , -0.5),                                   new Points( -0.5 ,  14.0 , -0.5),  /* 60 */                                   new Points(  0.5 ,  14.0 , -0.5),                                   new Points(  0.5 ,  14.0 , -1.0),                                   new Points( -0.5 ,  14.0 , -1.0),                                   new Points(  0.0 ,  13.5 ,  0.5), // Axis 2                                   new Points(  0.0 ,  13.5 , -0.5),                                   new Points( -0.3 ,  13.0 ,  0.5), // Link 2                                    new Points(  1.5 ,  13.0 ,  0.5),                                   new Points(  1.5 ,  13.0 , -0.5),                                   new Points( -0.3 ,  13.0 , -0.5),                                   new Points( -0.3 ,  14.0 ,  0.5),  /* 70 */                                   new Points(  1.5 ,  14.0 ,  0.5),                                   new Points(  1.5 ,  14.0 , -0.5),                                   new Points( -0.3 ,  14.0 , -0.5),                                   new Points(  1.5 ,  12.5 ,  1.0),                                   new Points(  1.5 ,  14.5 ,  1.0),                                   new Points(  1.5 ,  14.5 , -1.0),                                   new Points(  1.5 ,  12.5 , -1.0),                                   new Points(  9.0 ,  12.5 ,  1.0),                                   new Points(  9.0 ,  14.5 ,  1.0),                                   new Points(  9.0 ,  14.5 , -1.0),  /* 80 */                                   new Points(  9.0 ,  12.5 , -1.0),                                   new Points(  9.0 ,  12.5 ,  0.5),                                   new Points(  9.0 ,  14.5 ,  0.5),                                   new Points( 10.5 ,  14.0 ,  1.0),                                   new Points( 10.5 ,  14.0 ,  0.5),                                   new Points( 10.5 ,  13.0 ,  0.5),                                   new Points( 10.5 ,  13.0 ,  1.0),                                   new Points(  9.0 ,  12.5 , -0.5),                                   new Points(  9.0 ,  14.5 , -0.5),                                   new Points( 10.5 ,  14.0 , -1.0),  /* 90 */                                   new Points( 10.5 ,  13.0 , -1.0),                                   new Points( 10.5 ,  13.0 , -0.5),                                   new Points( 10.5 ,  14.0 , -0.5),                                   new Points( 10.0 ,  13.5 ,  0.5), // Axis 3                                   new Points( 10.0 ,  13.5 , -0.5),                                   new Points(  9.5 ,  13.8 ,  0.5), // Link 3                                   new Points(  9.5 ,  13.8 , -0.5),                                   new Points( 10.5 ,  13.8 , -0.5),                                   new Points( 10.5 ,  13.8 ,  0.5),                                   new Points( 10.5 ,  11.9 , -0.5),  /* 100 */                                   new Points( 10.5 ,  11.9 ,  0.5),                                   new Points(  9.5 ,  11.9 ,  0.5),                                   new Points(  9.5 ,  11.9 , -0.5),                                   new Points(  9.0 ,  12.0 ,  1.0),                                   new Points(  9.0 ,  12.0 , -1.0),                                   new Points( 11.0 ,  12.0 , -1.0),                                   new Points( 11.0 ,  12.0 ,  1.0),                                   new Points( 11.0 ,   4.5 , -1.0),                                   new Points( 11.0 ,   4.5 ,  1.0),                                   new Points(  9.0 ,   4.5 ,  1.0),  /* 110 */                                   new Points(  9.0 ,   4.5 , -1.0),                                   new Points( 10.0 ,   5.0 ,  0.0), // Axis 4                                   new Points( 10.0 ,   4.0 ,  0.0),                                   new Points( 10.0 ,   3.5 ,  0.5), // Axis 5                                   new Points( 10.0 ,   3.5 , -0.5),                                   new Points( 10.0 ,   4.5 ,  1.0), //link 5                 		   new Points( 10.7 ,   4.2 ,  1.0),				   new Points( 11.0 ,   3.5 ,  1.0),                                   new Points( 10.7 ,   2.8 ,  1.0),                                   new Points( 10.0 ,   2.5 ,  1.0),  /* 120 */                                   new Points(  9.3 ,   2.8 ,  1.0),                                   new Points(  9.0 ,   3.5 ,  1.0),                                   new Points(  9.3 ,   4.2 ,  1.0),                                   new Points( 10.0 ,   4.5 , -1.0),                                   new Points( 10.7 ,   4.2 , -1.0),                                   new Points( 11.0 ,   3.5 , -1.0),                                   new Points( 10.7 ,   2.8 , -1.0),                                   new Points( 10.0 ,   2.5 , -1.0),                                   new Points(  9.3 ,   2.8 , -1.0),                                   new Points(  9.0 ,   3.5 , -1.0),  /* 130 */                                   new Points(  9.3 ,   4.2 , -1.0),                                   new Points( 10.0 ,   3.0 ,  0.0), //Axis 6                                    new Points( 10.0 ,   2.0 ,  0.0),                                   new Points(  9.0 ,   2.5 ,  1.0), // Hand */                                   new Points(  9.0 ,   2.5 , -1.0),                                   new Points( 11.0 ,   2.5 , -1.0),                                   new Points( 11.0 ,   2.5 ,  1.0),                                   new Points( 11.0 ,   2.0 ,  1.0),                                   new Points(  9.0 ,   2.0 ,  1.0),                                   new Points(  9.0 ,   2.0 , -1.0),  /* 140 */                                   new Points( 11.0 ,   2.0 , -1.0),                                   new Points(  9.0 ,   2.0 ,  1.0),                                   new Points(  9.0 ,   2.0 , -1.0),                                   new Points(  9.5 ,   2.0 , -1.0),                                   new Points(  9.5 ,   2.0 ,  1.0),                                   new Points(  9.5 ,   0.5 ,  1.0),                                   new Points(  9.5 ,   0.5 , -1.0),                                   new Points( 11.0 ,   2.0 , -1.0),                                   new Points( 11.0 ,   2.0 ,  1.0),                                   new Points( 10.5 ,   2.0 ,  1.0),  /* 150 */                                   new Points( 10.5 ,   2.0 , -1.0),                                   new Points( 10.5 ,   0.5 , -1.0),                                   new Points( 10.5 ,   0.5 ,  1.0)}; // 153             rob.PL = helpPL;			   Edges[] helpel = { new Edges(0, 3), 		 new Edges( 0, 8),                 new Edges( 8,11),                 new Edges(11, 3),                 new Edges( 1, 9),                 new Edges( 2,10),                 new Edges( 4, 5),                 new Edges( 6, 7),                 new Edges(12,13),   /* Base */                 new Edges(13,14),                 new Edges(14,15),    /*10*/                 new Edges(15,16),                 new Edges(16,17),                 new Edges(17,18),                 new Edges(18,19),                 new Edges(19,12),                 new Edges(20,21),                 new Edges(21,22),                 new Edges(22,23),                 new Edges(23,24),                 new Edges(24,25),   /*20*/                 new Edges(25,26),                 new Edges(26,27),                 new Edges(27,20),                 new Edges(12,20),                 new Edges(13,21),                 new Edges(14,22),                 new Edges(15,23),                 new Edges(16,24),                 new Edges(17,25),                 new Edges(18,26),  /*30*/                 new Edges(19,27),                 new Edges(28,29),    /* turn area */                 new Edges(29,30),                 new Edges(30,31),                 new Edges(31,32),                 new Edges(32,33),                 new Edges(33,34),                 new Edges(34,35),                 new Edges(35,28),                 new Edges(36,37),   /*40*/                 new Edges(37,38),                 new Edges(38,39),                 new Edges(39,40),                 new Edges(40,41),                 new Edges(41,42),                 new Edges(42,43),                 new Edges(43,36),

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -