error: undefined reference to

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

error: undefined reference to

agussc
Hello,
I am new on OPENRAVE, I'm using openrave-0.8 on ubuntu 12.04 LTS.
I want to comunicate the Robot Operating System (ROS) with OpenRave, for that I have created a server-client structure where I use some openrave functions to load my environment and realize the desired trayectories.
I use c++ to write my programs, I have also included all the headers I need but still I am getting the following compilation's errors:
undefined reference to `OpenRAVE::RaveInitialize(bool, int)'

undefined reference to `OpenRAVE::RaveCreateEnvironment()'

undefined reference to `OpenRAVE::RaveCreateTrajectory(boost::shared_ptr<OpenRAVE::EnvironmentBase>, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'

undefined reference to `vtable for OpenRAVE::ConfigurationSpecification'

Here is the code where I get these errors (some lines are from ROS don't worry about that):

#include "ros/ros.h"
#include "robot/planificador.h"
#include "robot/openrave-core.h"
#include <vector>
#include <cstring>
#include <sstream>
#include "robot/openrave/planningutils.h"

#include "robot/orexample.h"


using namespace OpenRAVE;
using namespace std;

bool calculo(robot::planificador::Request  &req,
             robot::planificador::Response &res)
{
  int i,k;
  std::vector<dReal> variacion,vi;
  string scenefilename = "staubli.env.xml";
  RaveInitialize(true);
  EnvironmentBasePtr penv = RaveCreateEnvironment();
  penv->Load(scenefilename);
  vector<RobotBasePtr> vrobots;
  penv->GetRobots(vrobots);
  RobotBasePtr staubli = vrobots.at(0);
  std::vector<dReal> q;
  TrajectoryBasePtr traj = RaveCreateTrajectory(penv,"");
  traj->Init(staubli->GetActiveConfigurationSpecification());
  staubli->GetActiveDOFValues(q); // get current values
  traj->Insert(0,q);
  variacion[1]=req.q1-q[1];
  variacion[2]=req.q2-q[2];
  variacion[3]=req.q3-q[3];
  variacion[4]=req.q4-q[4];
  variacion[5]=req.q5-q[5];
  variacion[6]=req.q6-q[6];
  for (i=1;i<101;++i){
        for (k=1;k<7;++k){
        vi[k]=q[k]+variacion[k]*i/100;
        }
  staubli->SetDOFValues(vi);
  }
  res.sal=0;
  return true;
}

int main(int argc, char **argv)
{
  ros::init(argc, argv, "planificador_server");
  ros::NodeHandle n;

  ros::ServiceServer service = n.advertiseService("calculo", calculo);
  ROS_INFO("Esperando coordenadas para mover robot.");
  ros::spin();

  return 0;
}

Actually, this isn't the best way to do it, but I just want to see if I can run OpenRave from a ROS server and show differents dof values from the current position to the desired position.
do you know how can I solve this problem or have any sugestion?

pd:req.q"i" are inputs of the desired position.
Loading...