本文整理汇总了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;
}
示例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;
}
示例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;
}