8 #include <openrave-core.h> 12 #include <boost/thread/thread.hpp> 13 #include <boost/bind.hpp> 17 void SetViewer(EnvironmentBasePtr penv,
const string& viewername)
19 ViewerBasePtr viewer = RaveCreateViewer(penv, viewername);
20 BOOST_ASSERT(!!viewer);
25 viewer->main(showgui);
31 string scenefilename =
"/opt/pr/pr_ordata/ordata/objects/household/fuze_bottle.kinbody.xml";
32 string viewername =
"or_rviz";
37 if ((strcmp(argv[i],
"-h") == 0) || (strcmp(argv[i],
"-?") == 0)
38 || (strcmp(argv[i],
"/?") == 0)
39 || (strcmp(argv[i],
"--help") == 0)
40 || (strcmp(argv[i],
"-help") == 0))
43 "orloadviewer [--num n] [--scene filename] viewername\n");
46 else if (strcmp(argv[i],
"--scene") == 0)
48 scenefilename = argv[i + 1];
56 viewername = argv[i++];
59 EnvironmentBasePtr penv = RaveCreateEnvironment();
60 RaveLoadPlugin(
"or_octomap");
61 OpenRAVE::SensorSystemBasePtr sensors = RaveCreateSensorSystem(penv,
"or_octomap");
63 sensors->SendCommand(out,
"Enable");
64 RaveSetDebugLevel(Level_Debug);
65 boost::thread thviewer(boost::bind(
SetViewer, penv, viewername));
66 penv->Load(scenefilename);
int main(int argc, char **argv)
void SetViewer(EnvironmentBasePtr penv, const string &viewername)