本文整理汇总了C++中Environment::Load方法的典型用法代码示例。如果您正苦于以下问题:C++ Environment::Load方法的具体用法?C++ Environment::Load怎么用?C++ Environment::Load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::Load方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv)
{
ros::init(argc, argv, "trolley");
boost::thread spin_thread(&spinThread);
ros::NodeHandle nh;
ros::Publisher ledPublisher = nh.advertise<kinect_motor::LED>("led", 10);
ros::Publisher motor = nh.advertise<kinect_motor::angle>("angle", 10);
cout << "Start" << endl;
// Prostredi.
Environment * environment = new Environment();
// Nacteni prostredi ze souboru.
environment->Load("configuration.xml");
// Rizeni pohybu robota.
Control control(environment);
while (ros::ok()) {
// Pozice osoby. NITE.
Nullable<XnPoint3D> userPosition = User::getInstance().UserPosition();
// Rizeni pohybu robota.
control.Position(userPosition);
if (userPosition.HasValue()) {
// Osoba byla detekovana.
// Rozsvit celni diodu.
kinect_motor::LED msg;
msg.ledColor = 2;
ledPublisher.publish(msg);
}
else {
// Zhasni celni diodu.
kinect_motor::LED msg;
msg.ledColor = 0;
ledPublisher.publish(msg);
}
}
cout << "Finished" << endl;
spin_thread.join();
delete environment;
return 0;
}
示例2: LoadTerrain
int RobotWorld::LoadTerrain(const string& fn)
{
Environment* t = new Environment;
if(!t->Load(fn.c_str())) {
delete t;
return -1;
}
const char* justfn = GetFileName(fn.c_str());
char* buf = new char[strlen(justfn)+1];
strcpy(buf,justfn);
StripExtension(buf);
string name=buf;
delete [] buf;
int i = AddTerrain(name,t);
return i;
}