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


C++ Actuator类代码示例

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


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

示例1: constructColumnLabels

/**
 * Construct column labels for the inverse dynamics files.
 */
void InverseDynamics::
constructColumnLabels()
{
    Array<string> labels;
    labels.append("time");
    if(_modelWorkingCopy) {
        if( _useModelForceSet ) {
           for (int i=0; i < _numCoordinateActuators; i++) {
              Actuator* act = dynamic_cast<Actuator*>(&_forceSet->get(i));
              if( act )labels.append(act->getName());
           }
        } else {
           auto coordinates = _modelWorkingCopy->getCoordinatesInMultibodyTreeOrder();
           for (int i=0; i < _numCoordinateActuators; i++) {
              Force& force = _forceSet->get(i);
              for(size_t i=0u; i<coordinates.size(); ++i) {
                 const Coordinate& coord = *coordinates[i];
                 if(coord.getName()==force.getName()) {
                    if(coord.getMotionType() == Coordinate::Rotational) {
                        labels.append(force.getName()+"_moment");
                    } else if (coord.getMotionType() == Coordinate::Translational) {
                        labels.append(force.getName()+"_force");
                    } else {
                        labels.append(force.getName());
                    }
                 }
              }
           }
        }
    }
    setColumnLabels(labels);
}
开发者ID:antoinefalisse,项目名称:opensim-core,代码行数:35,代码来源:InverseDynamics.cpp

示例2: addActuator

void Controller::addActuator(const Actuator& actuator)
{
    _actuatorSet.adoptAndAppend(&actuator);

    int found = updProperty_actuator_list().findIndex(actuator.getName());
    if (found < 0) //add if the actuator isn't already in the list
        updProperty_actuator_list().appendValue(actuator.getName());
}
开发者ID:antoinefalisse,项目名称:opensim-core,代码行数:8,代码来源:Controller.cpp

示例3: setActuatorData

void GUIServer::setActuatorData(uint8_t actuatorId, uint8_t dataType,
		char* data) {
	Actuator* actuator = __aquaduino->getActuator(actuatorId);
	//Serial.println("setActuatorData: 2");
	if (dataType == 2) {
		actuator->setName(data);
	}
	__aquaduino->writeConfig(actuator);
}
开发者ID:tkerstan,项目名称:Aquaduino-Next,代码行数:9,代码来源:GUIServer.cpp

示例4: setActuatorConfig

void GUIServer::setActuatorConfig(uint8_t actuatorId, uint8_t type,
		char* value) {
	Actuator* actuator = __aquaduino->getActuator(actuatorId);
	if (type == 2) {
		actuator->setName(value);
	}
	if (type == 3) {
		//sensorUnit����not implemented yet
	}
	__aquaduino->writeConfig(actuator);
}
开发者ID:tkerstan,项目名称:Aquaduino-Next,代码行数:11,代码来源:GUIServer.cpp

示例5: childAdded

void FlowController::childAdded(Component *child)
{  
  Actuator *actuator;

  if ( ( actuator = dynamic_cast<Actuator *>(child) )) {
    actuator->setUnit(unit());
    actuator->setMin(min());
    actuator->setMax(max());
  }
  FlowMeter::childAdded(child);
}
开发者ID:ruby6117,项目名称:ccode,代码行数:11,代码来源:Olfactometer.cpp

示例6: addActuator

void Controller::addActuator(const Actuator& actuator)
{
	// want to keep a reference not make a clone
	// but set interface does not take const pointer
	// just const ref that forces a copy
	// const_cast only to add to the private set of actuators
	Actuator* mutable_act = const_cast<Actuator *>(&actuator);
	_actuatorSet.adoptAndAppend(mutable_act);

	int found = updProperty_actuator_list().findIndex(actuator.getName());
	if (found < 0) //add if the actuator isn't already in the list
		updProperty_actuator_list().appendValue(actuator.getName());
}
开发者ID:sunlixin723,项目名称:opensim-core,代码行数:13,代码来源:Controller.cpp

示例7: run

void Actuator::run()
{
    uint8_t i;
    Actuator *pObject = NULL;

    for ( i = 0; i < objectNum ; i++ )
    {     
        pObject = objectList[i].pObject;
        if ( NULL != pObject )
        {
            pObject->run();
        }
    }
}
开发者ID:DFRobot,项目名称:4Drawing,代码行数:14,代码来源:actuator.cpp

示例8: ActuatorClicked

extern "C" void ActuatorClicked(D4D_OBJECT* pThis)
{
    int idx = -1;
    if (pThis==&scrDeviceTest_actuator1)
        idx = 0;
    else if (pThis==&scrDeviceTest_actuator2)
        idx = 1;
    if (pThis==&scrDeviceTest_actuator3)
        idx = 2;
    
    if (idx>=0) {
        Actuator* actuator = mgr.actuator(idx);
        bool active = !actuator->isActive();
        actuator->setActive(active);
        SetActuatorButtonState(pThis, active, idx);
    }
}
开发者ID:Rukkh,项目名称:firmware,代码行数:17,代码来源:ConnectedDevicesView.cpp

示例9: getActuatorData

void GUIServer::getActuatorData(uint8_t actuatorId) {
	Serial.println("getActuatorData");
	Actuator* actuator = __aquaduino->getActuator(actuatorId);

	//errorcode 0
	m_UdpServer.write((uint8_t) 0);
	//actuatorID:int
	m_UdpServer.write(actuatorId);
	//value:int
	m_UdpServer.write(actuator->isOn());
	//operatingHours:int
	m_UdpServer.write((uint8_t) 0);
	//lastOperatingHoursReset:dateTime
	m_UdpServer.write((uint32_t) 1395867979);
	//lastCalibration:dateTime
	m_UdpServer.write((uint32_t) 1395867979);
}
开发者ID:tkerstan,项目名称:Aquaduino-Next,代码行数:17,代码来源:GUIServer.cpp

示例10: stop

void Actuator::stop()
{
    uint8_t i;   
    Actuator *pObject = NULL;


    for ( i = 0; i < objectNum ; i++ )
    {
        //todo,  add balance
        pObject = objectList[i].pObject;
        if ( NULL != pObject )
        {
            pObject->stop();
        }
    }

}
开发者ID:DFRobot,项目名称:4Drawing,代码行数:17,代码来源:actuator.cpp

示例11: ScreenDeviceTest_OnMain

void ScreenDeviceTest_OnMain()
{
    for (unsigned i=0; i<arraySize(actuator_views); i++) {
        const D4D_OBJECT* obj = actuator_views[i];
        Actuator* actuator = actuatorForView(obj);
        SetActuatorButtonState(obj, actuator->isActive(), i);
    }
    
    static uint32_t last = 0;
    static uint32_t updateTime = 0;
    uint32_t now = millis();
    // make sure updating is only taking 25% of CPU time
    if (now-last>=4*updateTime) {
        last = now;
        mgr.update();
        updateTime = millis()-now;
    }
}
开发者ID:Rukkh,项目名称:firmware,代码行数:18,代码来源:ConnectedDevicesView.cpp

示例12: getAssignedActuators

/**
 * \brief Identifies the actuators assigned to a specific controller.
 *
 * This method iterates over all actuators and checks which actuators
 * are assigned to the controller specified by controller. The resulting
 * objects are stored in the passed array of actuator pointers with size max.
 *
 * returns the number of assigned actuators.
 */
int8_t Aquaduino::getAssignedActuators(Controller* controller,
		Actuator** actuators, int8_t max) {
	int8_t actuatorIdx = -1;
	int8_t nrOfAssignedActuators = 0;
	Actuator* currentActuator;
	int8_t controllerIdx = m_Controllers.findElement(controller);

	for (actuatorIdx = 0; actuatorIdx < MAX_ACTUATORS; actuatorIdx++) {
		currentActuator = m_Actuators.get(actuatorIdx);
		if (currentActuator
				&& currentActuator->getController() == controllerIdx) {
			if (nrOfAssignedActuators < max)
				actuators[nrOfAssignedActuators] = currentActuator;
			nrOfAssignedActuators++;
		}
	}
	return nrOfAssignedActuators;
}
开发者ID:corrado72,项目名称:Aquaduino-Next,代码行数:27,代码来源:Aquaduino.cpp

示例13: computeAcceleration

//=============================================================================
// ANALYSIS
//=============================================================================
//
void InverseDynamics::
computeAcceleration(SimTK::State& s, double *aF,double *rAccel) const
{
	for(int i=0,j=0; i<_forceSet->getSize(); i++) {
        Actuator* act = dynamic_cast<Actuator*>(&_forceSet->get(i));
        if( act ) {
            act->setOverrideForce(s,aF[j++]);
        }
	}

	// NEED TO APPLY OTHER FORCES (e.g. Prescribed) FROM ORIGINAL MODEL 

	_modelWorkingCopy->getMultibodySystem().realize(s,SimTK::Stage::Acceleration);

	SimTK::Vector udot = _modelWorkingCopy->getMatterSubsystem().getUDot(s);

	for(int i=0; i<_accelerationIndices.getSize(); i++) 
		rAccel[i] = udot[_accelerationIndices[i]];

}
开发者ID:chrisdembia,项目名称:opensim-pythonwrap,代码行数:24,代码来源:InverseDynamics.cpp

示例14: while

void GUIServer::getAllActuators() {
	//errorcode 0
	m_UdpServer.write((uint8_t) 0);
	//num of actuators
	m_UdpServer.write((uint8_t) __aquaduino->getNrOfActuators());
	Serial.print("num of Actuators: ");
	Serial.println(__aquaduino->getNrOfActuators());
	//sensor information
	Actuator* actuator;
	__aquaduino->resetActuatorIterator();
	while (__aquaduino->getNextActuator(&actuator) != -1) {
		m_UdpServer.write(__aquaduino->getActuatorID(actuator));
		m_UdpServer.write(strlen(actuator->getName()));
		m_UdpServer.write(actuator->getName());
		//influencesStream:bool
		m_UdpServer.write((uint8_t) 0);
		//influencesHeat:bool
		m_UdpServer.write((uint8_t) 0);
		//ControllerSemanticValue:int
		m_UdpServer.write((uint8_t) 0);
		//calibrationInterval(days):int
		m_UdpServer.write((uint8_t) 0);
	}
}
开发者ID:tkerstan,项目名称:Aquaduino-Next,代码行数:24,代码来源:GUIServer.cpp

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