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


C++ ModelPtr::GetName方法代码示例

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


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

示例1: setGazeboModel

void ThrusterTask::setGazeboModel( ModelPtr model )
{
    string taskName = "gazebo:" + model->GetWorld()->GetName() + ":" + model->GetName() + ":gazebo_thruster";
    provides()->setName(taskName);
    _name.set(taskName);

    topicName = model->GetName() + "/thrusters";
} 
开发者ID:Brazilian-Institute-of-Robotics,项目名称:simulation-orogen-rock_gazebo,代码行数:8,代码来源:ThrusterTask.cpp

示例2: instantiateSensorComponents

void RockBridge::instantiateSensorComponents(sdf::ElementPtr modelElement, ModelPtr model)
{
    sdf::ElementPtr linkElement = modelElement->GetElement("link");
    while( linkElement ){
        sdf::ElementPtr sensorElement = linkElement->GetElement("sensor");
        while( sensorElement ){
            string sensorName = sensorElement->Get<string>("name");
            string sensorType = sensorElement->Get<string>("type");
            // To support more sensors, test for different sensors types
            if( sensorType == "ray" )
            {
                gzmsg << "RockBridge: creating laser line component: " + sensorName << endl;
                LaserScanTask* laser_line_task = new LaserScanTask();
                string topicName = model->GetName() + "/" + linkElement->Get<string>("name") + "/" + sensorName + "/scan";
                laser_line_task->setGazeboModel( model, sensorName, topicName );
                setupTaskActivity( laser_line_task );
            }
            else if(sensorType == "camera")
            {
                gzmsg << "RockBridge: creating camera component: " + sensorName << endl;
                CameraTask* camera = new CameraTask();
                string topicName = model->GetName() + "/" + linkElement->Get<string>("name") + "/" + sensorName + "/image";
                camera->setGazeboModel(model, sensorName, topicName);
                setupTaskActivity(camera);
            }
            else if(sensorType == "imu")
            {
                gzmsg << "RockBridge: creating imu component: " + sensorName << endl;
                ImuTask *imu = new ImuTask();
                string topicName = model->GetName() + "/" + linkElement->Get<string>("name") + "/" + sensorName + "/imu";
                imu->setGazeboModel(model, sensorName, topicName);
                setupTaskActivity(imu);
            }

            sensorElement = sensorElement->GetNextElement("sensor");
        }
        linkElement = linkElement->GetNextElement("link");
    }
}
开发者ID:D-Alex,项目名称:simulation-rock_gazebo,代码行数:39,代码来源:RockBridge.cpp


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