//constructors CameraSim::CameraSim(void) { setDrawReferenceSystem(); //by default the refence system is drawn setColor(1,1,0); CylindricalPart *glass=new CylindricalPart(0.110,0.053,10); glass->setColor(0.1,0.1,1.0); (*this)+=glass; }
LMS100Sim::LMS100Sim() { //constructor: create the physical representation of the laserscanner //ojo el laserSensor tiene como referencia el centro del haz, luego al montarlo //mecánicamente hay que tener en cuenta la transformación (la altura de la base al haz es 0.01157 m //la resolución tomada es 0.5º 270º CylindricalPart *body1=new CylindricalPart(0.095,0.05025); body1->setColor(0.3,0.3,1.0); body1->setRelativePosition(Vector3D(0,0,-0.1157)); (*this)+=body1; vector<Vector2D> list; PrismaticPart *body2=new PrismaticPart; list.push_back(Vector2D(0.0,-0.05)); list.push_back(Vector2D(-0.0525,-0.05)); list.push_back(Vector2D(-0.0525,0.05)); list.push_back(Vector2D(0.0,0.05)); body2->setPolygonalBase(list); body2->setHeight(0.09); //90mm body2->setColor(0.3,0.3,1.0); body2->setRelativePosition(Vector3D(0,0,-0.1157)); (*this)+=body2; //el cristal se pinta pero no se usa en la detección CylindricalPart *glass=new CylindricalPart(0.100,0.045,10); glass->setColor(0.1,0.1,0.1); glass->setRelativePosition(Vector3D(0,0,-0.0635)); //glass non detectable by raytracing glass->setIntersectable(false); (*this)+=glass; setLaserProperties(DEG2RAD*(-135), DEG2RAD*0.5,541,20.0,0); setDrawReferenceSystem(false); //due to the solid allows the orientation identification //the painting of the ref system is desactivated }
//constructors KinectSim::KinectSim(void) { setDrawReferenceSystem(); //by default the refence system is drawn setColor(1,1,0); PrismaticPart *bod=new PrismaticPart; //ojo el laserSensor tiene como referencia el centro del haz, luego al montarlo //mecánicamente hay que tener en cuenta la transformación double body[9][2]= {{0.063,0.122},{-0.093,0.122},{-0.093,-0.063},{0.063,-0.063}, {0.063,-0.053},{0.0,-0.053},{-0.040,-0.030},{-0.040,0.053},{0.063,0.053}}; vector<Vector2D> list; int i; for(i=0;i<9;i++)list.push_back(Vector2D(body[i][0],body[i][1])); bod->setPolygonalBase(list); bod->setHeight(0.155); //155mm bod->setRelativePosition(Vector3D(0,0.155/2,0)); bod->setRelativeOrientation(X_AXIS,PI/2); bod->setColor(1.0,0.1,1.0); //bod->setIntersectable(false); (*this)+=bod; }
//constructors LaserSensor3DSim::LaserSensor3DSim(void) { setDrawReferenceSystem(); //by default the refence system is drawn setColor(1,1,0); }