STEP 1 Install https://github.com/FreeSpacenav
STEP 2 Install kinova libraries
STEP 3 clone this rep
STEP 4 cp kortex_api into kinova_gen3 folder
STEP 5
- Setup (C++ environment)
- Build instructions
- How to use examples
- C++ API documentation
- Reference - Useful Links
- Back to root topic: readme.md
The C++ example projects in this repository use CMake.
The following link has the instructions to install CMake.
- cmake >= 3.10: CMake install page
To check which version of GCC is installed on Windows or Linux
Note: This procedure only works on Windows if you add the MinGW bin directory path to the PATH environment variablegcc --version
sudo apt-get install build-essential
Because GCC is not coded for the Windows operating system, a GCC port of MinGW-w64 for Windows is required. The '-w64' suffix indicates that it can support a 32-bit or 64-bit environment. The 32-bit versions are still available and one of them will be used to compile the affected project.
- Go to https://sourceforge.net/projects/mingw-w64
- Start the installer and click 'Next' until you reach the installation options page
- On the options page ensure that the options look exactly like this (all options are the default values, except for version, which is the version of GCC we want to install - 5.4 in this case)
- Click 'Next' until the end of the installation. The install directory by default is the one set in the build script included with the project.
- Optional: You can add the path of the bin directory to the system path to make all the MinGW commands and tools available system wide.
Manual installation using downloaded archive:
- Download the archive via Kinova's Google Drive: kortex_api
- Uncompress the content of the archive and place in the sub-directory kortex_api
Ensure that you respect one of the following directory hierarchies.
1. using content of a specific Kortex API OS_Compiler_Architecture
examples/kortex_api
┬
├ include/
├ lib/
└ ┬
├ debug/
└ release/
2. using KORTEX_SUB_DIR cmake argument to specify the Kortex API OS_Compiler_Architecture
examples/kortex_api
┬
├ OS_Compiler_Architecture/
└ ┬
├ include/
├ lib/
└ ┬
├ debug/
└ release/
Linux Ubuntu
mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=release [-DKORTEX_SUB_DIR=<OS_Compiler_Architecture dir name>] make
(note that the name of the executable is mingw32-make.exe, even for the 64-bit version)Windows - using GCC
mkdir build cd build cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=release [-DKORTEX_SUB_DIR=<os_arch dir name>] mingw32-make
Windows - using Visual Studio 2017
mkdir build cd build cmake .. -G "Visual Studio 15 2017 [arch]" -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_BUILD_TYPE=release [-DKORTEX_SUB_DIR=<os_arch dir name>]
Windows - using command-line MSVC build
call "C:\Program Files (x86)\Microsoft Visual > Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsamd64_x86.bat" :: Add the cl.exe path the Windows Environment PATH set PATH=%PATH%;C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.15.26726/bin/Hostx64/x64 mkdir build cd build cmake .. -G "NMake Makefiles" -DCMAKE_SH=CMAKE_SH-NOTFOUND -DCMAKE_BUILD_TYPE=Release nmake
We assume the robot is using its default IP address: 102.168.1.12
Before you start make sure you run the test in a safe area - some examples contain movement. Also verify that your Gen3 device is correctly afixed to your working surface.
Prerequisites:
- The examples require a wired connection to your computer
- Configure a static IP on your network interface (e.g: 192.168.1.11/24)
- Add a route to arm actuators:
- under Windows
route ADD -p 10.10.0.0 MASK 255.255.255.0 102.168.1.12 METRIC 1
- under Linux
ip route add 10.10.0.0/24 via 102.168.1.12
- under Windows
Now you're ready to compile the example. There are two ways to build the example: build all, or by sub directory.
To build all, you need change the current directory to the example directory. To build a sub directory you need to change the current directory to the parent directory of the one you want to build. The build instruction below is the same.
examples/kortex_api
┬
├ api_cpp/
└ ┬
├ doc/
├ examples/ (Here to build all example)
└ ┬
├ 000-Getting_started/ (Here to build this specific directory)
└ .../
Create a build directory
mkdir build
Change the current directory to the build directory and build the example using one of the following commands:
cd build
[Windows]: cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .. && minGW32-make
[Linux]: cmake -DCMAKE_BUILD_TYPE=Release .. && make
Each example have it's own main
function so you can run them individually. Change the current directory to the newly-created example folder to execute them.
cd <example_directory>
[Windows]: <example_name>.exe
[Linux]: ./<example_name>
Here is a link to the generated documentation
API C++ Services Documentation
Google Proto Buffer generated C++: | https://developers.google.com/protocol-buffers/docs/reference/cpp-generated |