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


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

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


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

示例1: 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

示例2: 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

示例3: if

/**
 * 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

示例4: getAllActuators

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

示例5: target


//.........这里部分代码省略.........

    // Static optimization
    _modelWorkingCopy->getMultibodySystem().realize(sWorkingCopy,SimTK::Stage::Velocity);
    target.prepareToOptimize(sWorkingCopy, &_parameters[0]);

    //LARGE_INTEGER start;
    //LARGE_INTEGER stop;
    //LARGE_INTEGER frequency;

    //QueryPerformanceFrequency(&frequency);
    //QueryPerformanceCounter(&start);

    try {
        target.setCurrentState( &sWorkingCopy );
        optimizer->optimize(_parameters);
    }
    catch (const SimTK::Exception::Base& ex) {
        cout << ex.getMessage() << endl;
        cout << "OPTIMIZATION FAILED..." << endl;
        cout << endl;
        cout << "StaticOptimization.record:  WARN- The optimizer could not find a solution at time = " << s.getTime() << endl;
        cout << endl;

        double tolBounds = 1e-1;
        bool weakModel = false;
        string msgWeak = "The model appears too weak for static optimization.\nTry increasing the strength and/or range of the following force(s):\n";
        for(int a=0;a<na;a++) {
            Actuator* act = dynamic_cast<Actuator*>(&_forceSet->get(a));
            if( act ) {
                Muscle*  mus = dynamic_cast<Muscle*>(&_forceSet->get(a));
                if(mus==NULL) {
                    if(_parameters(a) < (lowerBounds(a)+tolBounds)) {
                        msgWeak += "   ";
                        msgWeak += act->getName();
                        msgWeak += " approaching lower bound of ";
                        ostringstream oLower;
                        oLower << lowerBounds(a);
                        msgWeak += oLower.str();
                        msgWeak += "\n";
                        weakModel = true;
                    } else if(_parameters(a) > (upperBounds(a)-tolBounds)) {
                        msgWeak += "   ";
                        msgWeak += act->getName();
                        msgWeak += " approaching upper bound of ";
                        ostringstream oUpper;
                        oUpper << upperBounds(a);
                        msgWeak += oUpper.str();
                        msgWeak += "\n";
                        weakModel = true;
                    } 
                } else {
                    if(_parameters(a) > (upperBounds(a)-tolBounds)) {
                        msgWeak += "   ";
                        msgWeak += mus->getName();
                        msgWeak += " approaching upper bound of ";
                        ostringstream o;
                        o << upperBounds(a);
                        msgWeak += o.str();
                        msgWeak += "\n";
                        weakModel = true;
                    }
                }
            }
        }
        if(weakModel) cout << msgWeak << endl;
开发者ID:chrisdembia,项目名称:opensim-core,代码行数:66,代码来源:StaticOptimization.cpp


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