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


C++ Joystick::errorMessage方法代码示例

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


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

示例1: initialize

	virtual bool initialize(SimpleControllerIO* io) override
	{
		ostream& os = io->os();
		Body* body = io->body();
		root = io->body()->rootLink();

		thrusts << body->devices();

		DeviceList<Light> lights(body->devices());

		if(!lights.empty()){
			light = lights.front();

		}

		prevLightButtonState = false;

		if(!joystick.isReady()){
			os << "Joystick is not ready: " << joystick.errorMessage() << endl;

		}

		if(joystick.numAxes() < 5){
			os << "The number of the joystick axes is not sufficient for controlling the robot." << endl;

		}

		if(joystick.numButtons() < 1){
			os << "The number of the joystick buttons is not sufficient for controlling the robot." << endl;

		}

		return true;

	}
开发者ID:kindsenior,项目名称:choreonoid,代码行数:35,代码来源:SubmersibleController.cpp

示例2: initialize

    virtual bool initialize(SimpleControllerIO* io) override
    {
        ostream& os = io->os();
        
        Body* body = io->body();

        steering = body->link("STEERING_RIGHT");
        if(!steering){
            os << " The steering_right link is not found." << endl;
            return false;
        }
        steering->setActuationMode(Link::JOINT_TORQUE);
        io->enableIO(steering);

        drive = body->link("REAR_WHEEL");
        if(!drive){
            os << "The rear_wheel link is not found." << endl;
            return false;
        }
        drive->setActuationMode(Link::JOINT_TORQUE);
        io->enableInput(drive, JOINT_VELOCITY);
        io->enableOutput(drive);
        
        if(!joystick.isReady()){
            os << "Joystick is not ready: " << joystick.errorMessage() << endl;
        }

        timeStep = io->timeStep();
        eold = 0;

        return true;
    }
开发者ID:kindsenior,项目名称:choreonoid,代码行数:32,代码来源:FourWheelCarJoystickController.cpp

示例3: initialize

    virtual bool initialize() {

        crawlerL = ioBody()->link("CRAWLER_TRACK_L");
        crawlerR = ioBody()->link("CRAWLER_TRACK_R");

        if(!crawlerL || !crawlerR){
            os() << "Crawlers are not found" << endl;
            return false;
        }

        for(int i=0; i < 2; i++){
            qRef[i] = 0;
        }

        if(!joystick.isReady()){
            os() << "Joystick is not ready: " << joystick.errorMessage() << endl;
        }
        if(joystick.numAxes() < 5){
            os() << "The number of the joystick axes is not sufficient for controlling the robot." << endl;
        }
        
        return true;
    }
开发者ID:arntanguy,项目名称:choreonoid,代码行数:23,代码来源:SampleCrawlerJoystickController.cpp


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