RobotLibrary is a C++ library for modeling and control of robots arms.
It is an ongoing project and we hope to add more features as time goes on.
- Installation Instructions
- Sections of the Library
RobotLibrary requires the Eigen libraries for linear algebra. If you're using Linux you can install it from the command line:
sudo apt install libeigen3-dev
Otherwise you can go to the Eigen main page to see how you can install it.
-
Clone this repository in to your working directory:
git clone https://github.com/Woolfrey/software_robot_library.git
-
Navigate in to the folder:
cd ~/<your_working_directory>/software_robot_library
-
Create a build directory and navigate in to it:
mkdir build && cd build
-
Run the following commands in the
build
directory:cmake ..
sudo make install
You should now be able to include different parts of the library in your C++ files.
When using RobotLibrary
classes in another project, it is necessary to link both Eigen
and RobotLibrary
when compiling executables. For example, we may want to use the KinematicTree
class in the example.cpp
of the following example project:
example_project/
├── CMakeLists.txt
├── build/
└── src/
└── example.cpp
In the example.cpp
file we can include the KinematicTree
header file under RobotLibrary
:
#include <RobotLibrary/KinematicTree.h>
...
int main(int argc, char **argv)
{
KinematicTree model("path/to/robot.urdf");
}
Then, in the CMakeLists.txt
file, we must:
- Tell the compiler to find both
Eigen3
andRobotLibrary
, and - Link
RobotLibrary
andEigen3
to the executable that uses anyRobotLibrary
classes:
cmake_minimum_required(VERSION 3.8)
project(example)
...
find_package(Eigen3 REQUIRED)
find_package(RobotLibrary REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
...
add_executable(example src/example.cpp)
target_link_libraries(example RobotLibrary::RobotLibrary Eigen3::Eigen)
Inside the example_project/build
folder it should be possible to compile the project:
cmake ..
make
This repository has some simple test code that demonstrates the use of different classes.