12 #include <boost/thread/thread.hpp>
13 #include <boost/bind.hpp>
17 using namespace OpenRAVE;
20 namespace cppexamples {
26 string scenefilename =
"data/pa10grasp2.env.xml";
27 penv->Load(scenefilename);
29 vector<RobotBasePtr> vrobots;
30 penv->GetRobots(vrobots);
34 for(
size_t i = 0; i < probot->GetManipulators().size(); ++i) {
35 if( probot->GetManipulators()[i]->GetName().find(
"arm") != string::npos ) {
36 probot->SetActiveManipulator(probot->GetManipulators()[i]);
44 penv->Add(pikfast,
true,
"");
45 stringstream ssin,ssout;
46 vector<dReal> vsolution;
47 ssin <<
"LoadIKFastSolver " << probot->GetName() <<
" " << (int)
IKP_Transform6D;
48 if( !pikfast->SendCommand(ssout,ssin) ) {
51 if( !pmanip->GetIkSolver()) {
56 penv->Add(pbasemanip,
true,probot->GetName());
60 EnvironmentMutex::scoped_lock lock(penv->GetMutex());
63 Transform t = pmanip->GetEndEffectorTransform();
68 ssin <<
"MoveToHandPosition pose " << t;
71 if( !pbasemanip->SendCommand(ssout,ssin) ) {
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);