Http://www.roboticslibrary.org/api
Http://www.roboticslibrary.org/tutorials/first-steps-windows
RL's library is composed of multiple static libraries, we develop only need to specify a good header file path, and then the library path, you can build QT or vs program.
But RL's source code does not have the head file in a separate directory, and is placed in the SRC, so we can directly use the SRC path as a header file path, or we use the installation version of the header file path as include:
is the source code:
It is the installation package, he has put the include alone.
Here is the QT-based project as follows, which is a pure C + + project :
Run dependent dynamic Library: Libxml2.dll
Template=AppCONFIG+=Consoleconfig-=App_bundleconfig-=Qtprj_root=.. Lib_dir=$ $quote (E:/programfiles (x86)/rl-0.6.2/Lib) BIN=$ $PRJ _root/. /.. /bin/DESTDIR=$ $BINSRC _root=$ $PRJ _root/src/Includepath+=$ $quote (E:/programfiles (x86)/rl-0.6.2/include) Includepath+=$ $quote (E:/programfiles (x86)/rl-0.6.2/include/boost-1_52) Defines+=Coin_dlldefines+=Soqt_dlldefines+=m_pi=3.14159265358979323846#解决Eigenabort的问题 # Reference: http://eigen.tuxfamily.org/dox-devel/topicunalignedarrayassert.htmldefines+=Eigen_dont_align_staticallyconfig (Debug,debug|release) {LIBS+=-l$ $LIB _dir/-lrlmdld-lrlkind-lrlsgd-lrlxmld-lcoin3d-lsoqt1d-LLIBXML2}Else{LIBS+=-l$ $LIB _dir/-lrlmdl-lrlkin-lrlsg-lrlxml-lcoin3-LLIBXML2} SOURCES+=$ $SRC _root/main.cpp
The code is as follows:
#include <iostream>#include<rl/math/Transform.h>#include<rl/math/Unit.h>#include<rl/mdl/Kinematic.h>#include<rl/mdl/Model.h>#include<rl/mdl/XmlFactory.h>intMain (INTARGC,Char**argv) {rl::mdl::xmlfactoryfactory;rl::mdl::kinematic*kinematics=dynamic_cast<rl::mdl::kinematic*> (Factory.create ("E:\\programfiles (x86) \\rl-0.6.2\\share\\rl\\examples\\rlmdl\\unimation-puma560.xml")); Rl::math::vectorq (6); Q<<Ten,Ten,- -, -, -,-Ten; Q*=Rl::math::D eg2rad;kinematics-setposition (q); Kinematics-forwardposition (); RL::MATH::TRANSFORMT=kinematics->getoperationalposition (0); Rl::math::vector3position=t.translation (); Rl::math::vector3orientation=t.rotation (). Eulerangles (2,1,0). reverse (); Std::cout<<"jointconfigurationindegrees:"<<q.transpose () *rl::math::rad2deg<<Std::endl;std::cout<<"End-effectorposition:[m]"<<position.transpose () <<"Orientation[deg]"<<orientation.transpose () *rl::math::rad2deg<<Std::endl;return0;}
10_ Official Example Program 01