15 using namespace OpenRAVE;
18 namespace cppexamples {
25 string scenefilename =
"data/wamtest1.env.xml";
26 penv->Load(scenefilename);
28 vector<RobotBasePtr> vrobots;
29 penv->GetRobots(vrobots);
31 vector<dReal> vlower,vupper,v(probot->GetDOF());
32 probot->GetDOFLimits(vlower,vupper);
35 vector<int> vindices(probot->GetDOF());
36 for(
size_t i = 0; i < vindices.size(); ++i) {
39 probot->SetActiveDOFs(vindices);
42 penv->Add(pbasemanip,
true,probot->GetName());
46 EnvironmentMutex::scoped_lock lock(penv->GetMutex());
52 for(
size_t i = 0; i < vlower.size(); ++i) {
55 probot->SetActiveDOFValues(v);
56 if( !penv->CheckCollision(probot) && !probot->CheckSelfCollision() ) {
63 stringstream cmdin,cmdout;
64 cmdin <<
"MoveActiveJoints goal ";
65 for(
size_t i = 0; i < v.size(); ++i) {
71 if( !pbasemanip->SendCommand(cmdout,cmdin) ) {
77 while(!probot->GetController()->IsDone() && IsOk()) {
78 boost::this_thread::sleep(boost::posix_time::milliseconds(1));
86 int main(
int argc,
char ** argv)
89 return example.
main(argc,argv);