43#include <visp3/core/vpConfig.h>
44#include <visp3/robot/vpRobotKinova.h>
46int main(
int argc,
char *argv[])
48#ifdef VISP_HAVE_JACOSDK
49#ifdef ENABLE_VISP_NAMESPACE
53 std::string opt_plugin_path =
"./";
55 bool opt_verbose =
false;
56 unsigned int opt_dof = 6;
58 for (
int i = 1;
i < argc;
i++) {
59 if (std::string(argv[i]) ==
"--plugin" && i + 1 < argc) {
60 opt_plugin_path = std::string(argv[i + 1]);
63 if ((std::string(argv[i]) ==
"--command_layer" || std::string(argv[i]) ==
"-l") && i + 1 < argc) {
64 if (std::string(argv[i + 1]) ==
"usb") {
67 else if (std::string(argv[i + 1]) ==
"ethernet") {
74 else if (std::string(argv[i]) ==
"--dof") {
75 opt_dof =
static_cast<unsigned int>(std::atoi(argv[i + 1]));
77 else if (std::string(argv[i]) ==
"--verbose" || std::string(argv[i]) ==
"-v") {
80 else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
81 std::cout <<
"SYNOPSYS" << std::endl
82 <<
" " << argv[0] <<
" [--plugin <path>] [--command_layer <name>] [--dof <4,6,7>] "
83 <<
"[--verbose] [--help] [-v] [-h]\n"
85 std::cout <<
"DESCRIPTION" << std::endl
86 <<
" --plugin <path>" << std::endl
87 <<
" Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl
89 <<
" --command_layer <name>, -l <name>" << std::endl
90 <<
" Command layer name, either \"usb\" or \"ethernet\"." << std::endl
92 <<
" --dof" << std::endl
93 <<
" Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl
95 <<
" --verbose, -v" << std::endl
96 <<
" Enable verbose mode to print addition information." << std::endl
98 <<
" --help, -h" << std::endl
99 <<
" Print this helper message." << std::endl
101 std::cout <<
"EXAMPLE" << std::endl
103 <<
" " << argv[0] <<
" --plugin /opt/JACO-SDK/API"
105 <<
" " << argv[0] <<
" --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\""
107 <<
" --command_layer usb" << std::endl
118 robot.setVerbose(opt_verbose);
119 robot.setPluginLocation(opt_plugin_path);
120 robot.setCommandLayer(opt_command_layer);
122 unsigned int n_devices = robot.connect();
125 std::cout <<
"There is no Kinova device connected." << std::endl;
138 for (
unsigned int i = 0;
i < 300;
i++) {
168 std::cout <<
"Catch exception: " <<
e.getStringMessage() << std::endl;
171 std::cout <<
"The end" << std::endl;
176 std::cout <<
"Install Jaco SDK, configure and build again ViSP to use this example..." << std::endl;
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
void setDoF(unsigned int dof)
@ STATE_POSITION_CONTROL
Initialize the position controller.
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
VISP_EXPORT int wait(double t0, double t)