当前位置: 首页>>代码示例>>C++>>正文


C++ Actuator::linkTo方法代码示例

本文整理汇总了C++中Actuator::linkTo方法的典型用法代码示例。如果您正苦于以下问题:C++ Actuator::linkTo方法的具体用法?C++ Actuator::linkTo怎么用?C++ Actuator::linkTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Actuator的用法示例。


在下文中一共展示了Actuator::linkTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CylindricalPart

EUITIbotSim::EUITIbotSim()
{
	name="EUITIbot";
	//Units in meters and rad.

	for(int j=0;j<7;j++)q_init.push_back(0);

	vector<Vector2D> list;
	Actuator* actuator;

////////////////////////////////////////////////////////////////////////////
//////////////////////////   BASE = LINK[0]       //////////////////////////
////////////////////////////////////////////////////////////////////////////

//Base = link[0]
	ComposedEntity *link=new ComposedEntity;
	link->setName("Articulación 1");
	link->setRelativePosition(Vector3D(0,0,0.05));
	link->setRelativeOrientation(0,0,0);

	//CILINDRO(Cilindro)
	CylindricalPart *auxCyl=new CylindricalPart(0.05,0.0425);//Altura y radio
	auxCyl->setColor(0.6,0,0);
	auxCyl->setRelativePosition(Vector3D(0,0,0));
	(*link)+=auxCyl;

	links.push_back(link);

	//Joint[0]
	SimpleJoint *auxJoint=new SimpleJoint(PI,-PI,true,0,Z_AXIS,false);
	auxJoint->LinkTo(links[0]);
	auxJoint->setValue(q_init[0]);
	joints.push_back(auxJoint);

	actuator=new Actuator();
	actuator->linkTo(joints[0]);
	actuators.push_back(actuator);


////////////////////////////////////////////////////////////////////////////
//////////////////////////ARTICULACION 2 = LINK[1]//////////////////////////
////////////////////////////////////////////////////////////////////////////
	link=new ComposedEntity;
	link->setName("Articulación 2");
	link->setRelativePosition(Vector3D(0,0,0.05));
	link->setRelativeOrientation(0,0,0);

	// CILINDRO
	auxCyl=new CylindricalPart(0.006,0.0425);//Altura y radio
	auxCyl->setColor(1,1,0);
	(*link)+=auxCyl;

	// PRISMA IRREGULAR DERECHO
	PrismaticPart *auxPrism=new PrismaticPart;
	list.push_back(Vector2D(-0.0155,0));
	list.push_back(Vector2D(0.0155,0));
	list.push_back(Vector2D(0.0155,0.05));
	list.push_back(Vector2D(0.0125,0.055));
	list.push_back(Vector2D(-0.0125,0.055));
	list.push_back(Vector2D(-0.0155,0.05));
	auxPrism->setPolygonalBase(list);
	list.clear();
	auxPrism->setColor(1,1,0);
	auxPrism->setHeight(0.01);
	auxPrism->setRelativePosition(Vector3D(0,0.04,0.006));
	auxPrism->setRelativeOrientation(PI/2, 0, 0);		
	(*link)+=auxPrism;

	// PRISMA IRREGULAR IZQUIERDO
	auxPrism=new PrismaticPart;
	list.push_back(Vector2D(-0.0155,0));
	list.push_back(Vector2D(0.0155,0));
	list.push_back(Vector2D(0.0155,0.05));
	list.push_back(Vector2D(0.0125,0.055));
	list.push_back(Vector2D(-0.0125,0.055));
	list.push_back(Vector2D(-0.0155,0.05));
	auxPrism->setPolygonalBase(list);
	list.clear();
	auxPrism->setColor(1,1,0);
	auxPrism->setHeight(0.01);
	auxPrism->setRelativePosition(Vector3D(0,-0.03,0.006));
	auxPrism->setRelativeOrientation(PI/2, 0 , 0);		
	(*link)+=auxPrism;

	// SERVO3(Servo3)
	auxPrism=new PrismaticPart;
	list.push_back(Vector2D(-0.0095,-0.02));
	list.push_back(Vector2D(0.0095,-0.02));
	list.push_back(Vector2D(0.0095,0.02));
	list.push_back(Vector2D(-0.0095,0.02));
	auxPrism->setPolygonalBase(list);
	list.clear();
	auxPrism->setColor(0,0,0);
	auxPrism->setHeight(0.035);
	auxPrism->setRelativePosition(Vector3D(0,0.05,0.02));
	auxPrism->setRelativeOrientation(Z_AXIS,-PI);
	(*link)+=auxPrism;	

	link->LinkTo(joints[0]);
	links.push_back(link);
//.........这里部分代码省略.........
开发者ID:AlberFernandez,项目名称:MRCore,代码行数:101,代码来源:euitibotsim.cpp

示例2: CylindricalPart

AdeptOneSim::AdeptOneSim()
{
	name="SCARA Adept One Sim";
	
/***
Codo derecho   -> elbow = 1;
Codo izquierdo -> elbow = -1;
***/

//Configuracion inicial

	//Configuracion inicial = ELBOW_RIGHT

//Base =links[0]
	vector<Vector2D> list;
	Actuator* actuator;


	ComposedEntity *link=new ComposedEntity;
	link->setName("Base");
	PrismaticPart *auxPrism=new PrismaticPart;
	list.push_back(Vector2D(0.225,-0.225));
	list.push_back(Vector2D(0.225,0.225));
	list.push_back(Vector2D(-0.475,0.225));
	list.push_back(Vector2D(-0.475,-0.225));
	auxPrism->setPolygonalBase(list);
	list.clear();
	auxPrism->setHeight(0.04);
	auxPrism->setColor(0.445,0.601,0.352);
	(*link)+=auxPrism;

	CylindricalPart *auxCyl=new CylindricalPart(0.22,0.20);
	auxCyl->setColor(0.445,0.601,0.352);
	auxCyl->setRelativePosition(Vector3D(0,0,0.04));
	(*link)+=auxCyl;

	auxCyl=new CylindricalPart(0.05,0.16);
	auxCyl->setColor(0.445,0.601,0.352);
	auxCyl->setRelativePosition(Vector3D(0,0,0.22+0.04));
	(*link)+=auxCyl;

	auxCyl=new CylindricalPart(0.02,0.1);
	auxCyl->setColor(0.5,0.5,0.5);
	auxCyl->setRelativePosition(Vector3D(0,0,0.05+0.22+0.04));
	(*link)+=auxCyl;

	auxPrism=new PrismaticPart;
	list.push_back(Vector2D(0,-0.085));
	list.push_back(Vector2D(0,0.085));
	list.push_back(Vector2D(-0.07,0.085));
	list.push_back(Vector2D(-0.07,-0.085));
	auxPrism->setPolygonalBase(list);
	list.clear();
	auxPrism->setHeight(0.22);
	auxPrism->setColor(0.445,0.601,0.352);
	auxPrism->setRelativePosition(Vector3D(-0.17,0,0.04));
	(*link)+=auxPrism;

	auxPrism=new PrismaticPart;
	list.push_back(Vector2D(0,0.20));
	list.push_back(Vector2D(-0.135,0.20));
	list.push_back(Vector2D(-0.235,0.10));
	list.push_back(Vector2D(-0.235,-0.10));
	list.push_back(Vector2D(-0.135,-0.20));
	list.push_back(Vector2D(0,-0.20));
	auxPrism->setPolygonalBase(list);
	list.clear();
	auxPrism->setHeight(0.22);
	auxPrism->setColor(0.445,0.601,0.352);
	auxPrism->setRelativePosition(Vector3D(-0.24,0,0.04));
	(*link)+=auxPrism;
	
	(*this)+=link;
	links.push_back(link);


//Joint 0
	SimpleJoint *auxJoint=new SimpleJoint(5*PI/6,-5*PI/6,true,0,Z_AXIS,false);
	auxJoint->setRelativePosition(Vector3D(0,0,0.99));
	auxJoint->LinkTo(links[0]);

	actuator=new Actuator();
	actuator->linkTo(auxJoint);
	actuators.push_back(actuator);

	joints.push_back(auxJoint);
//Arm 1
	link=new ComposedEntity;
	link->setName("Link 1");
	auxCyl=new CylindricalPart(0.03,0.12);
	auxCyl->setColor(1,1,1);
	auxCyl->setRelativePosition(Vector3D(0,0,-0.66));
	(*link)+=auxCyl;

	auxCyl=new CylindricalPart(0.47,0.08);
	auxCyl->setColor(1,1,1);
	auxCyl->setRelativePosition(Vector3D(0,0,-0.63));
	(*link)+=auxCyl;

	auxCyl=new CylindricalPart(0.10,0.10);
//.........这里部分代码省略.........
开发者ID:franramirez688,项目名称:MRCore-TEST,代码行数:101,代码来源:adeptonesim.cpp


注:本文中的Actuator::linkTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。