simple question about #include </control_toolbox/pid.h>
First question about includes
OS: Ubuntu 12.04 64bit ROS: Fuerte
I'm trying to use control_toolbox node as part of my ROS project. This control_toolbox node I have installed manually by svn co the source, building it with rosmake and making sure roscd can find it.
I have included in the beginning of my project header-file
#include < /control_toolbox/pid.h >
But for some reason with this include I always get error:
fatal error: /control_toolbox/pid.h: No such file or directory
On the other hand if I include the whole path to control_toolbox pid.h file
#include < /home/user/ros_workspace/control_toolbox/include/control_toolbox/pid.h >
i do not receive previous error.
Second question about implementing control_toolbox
Also as a secondary question I'm curious how to implement control_toolbox for my use. I have tried following:
- In header mkcontrol.h
namespace project { class ProjectControl { private: public: control_toolbox::Pid pid_vel_x; }; }
- In cpp file
#include "project_control/mkcontrol.h" using namespace project; using namespace control_toolbox; //{ ProjectControl::ProjectControl(ros::NodeHandle nh): n(nh) { pid_vel_x.initPid( 25 , 5 , 0 , 10 , -10 ); }
Just a simple example how i was planning to use it, but i receive following errors (by error i'm referring to these undefined reference outputs from rosmake):
Linking CXX executable ../bin/project_control CMakeFiles/project_control.dir/src/control_node.o: In function `~ProjectControl': ~/mkcontrol.h:58: undefined reference to `control_toolbox::Pid::~Pid()' CMakeFiles/project_control.dir/src/mkcontrol.o: In function `ProjectControl': ~/mkcontrol.cpp:45: undefined reference to `control_toolbox::Pid::Pid(double, double, double, double, double)' ~/mkcontrol.cpp:90: undefined reference to `control_toolbox::Pid::initPid(double, double, double, double, double)' ~/mkcontrol.cpp:45: undefined reference to `control_toolbox::Pid::~Pid()' collect2: ld returned 1 exit status make[3]: *** [../bin/project_control] Error 1 make[3]: Leaving directory `...' make[2]: *** [CMakeFiles/project_control.dir/all] Error 2 make[2]: Leaving directory `...' make[1]: *** [all] Error 2 make[1]: Leaving directory `...'
After editing manifest.xml
I receive following error while trying to rosmake my node:
[100%] Building CXX object CMakeFiles/project_control.dir/src/mkcontrol.o Linking CXX executable ../bin/project_control /home/user/ros_workspace/control_toolbox/lib/libcontrol_toolbox.so: undefined reference to `TiXmlElement::Attribute(char const*) const' collect2: ld returned 1 exit status make[3]: *** [../bin/project_control] Error 1 make[3]: Leaving directory `~/project_control/build' make[2]: *** [CMakeFiles/project_control.dir/all] Error 2 make[2]: Leaving directory `~/project_control/build' make[1]: *** [all] Error 2 make[1]: Leaving directory `~/project_control/build'
If I run make with VERBOSE=1 flag the compilation command with all includes is visible:
Linking CXX executable ../bin/project_control /usr/bin/cmake -E cmake_link_script CMakeFiles/project_control.dir/link.txt --verbose=1 /usr/bin/c++ -O2 -g -Wl,-rpath,~/ROS/control_toolbox/lib -Wl,-rpath,/opt/ros/fuerte/stacks/geometry/tf/lib -Wl,-rpath,/opt/ros/fuerte/stacks/bullet/lib -pthread CMakeFiles/project_control.dir/src/control_node.o CMakeFiles/project_control.dir/src/mkcontrol.o -o ../bin/project_control -rdynamic -L/opt/ros/fuerte/lib -L~/ROS/control_toolbox/lib -L/opt/ros/fuerte/stacks/geometry/tf/lib -L/opt/ros/fuerte/stacks/bullet/lib -lcontrol_toolbox -ltf ...