45 #include <visp3/core/vpConfig.h>
46 #include <visp3/robot/vpRobotKinova.h>
48 int main(
int argc,
char *argv[])
50 #ifdef VISP_HAVE_JACOSDK
51 std::string opt_plugin_path =
"./";
53 bool opt_verbose =
false;
54 unsigned int opt_dof = 6;
56 for (
int i = 1; i < argc; i++) {
57 if (std::string(argv[i]) ==
"--plugin" && i + 1 < argc) {
58 opt_plugin_path = std::string(argv[i + 1]);
61 if ((std::string(argv[i]) ==
"--command_layer" || std::string(argv[i]) ==
"-l") && i + 1 < argc) {
62 if (std::string(argv[i + 1]) ==
"usb") {
64 }
else if (std::string(argv[i + 1]) ==
"ethernet") {
69 }
else if (std::string(argv[i]) ==
"--dof") {
70 opt_dof =
static_cast<unsigned int>(std::atoi(argv[i + 1]));
71 }
else if (std::string(argv[i]) ==
"--verbose" || std::string(argv[i]) ==
"-v") {
73 }
else if (std::string(argv[i]) ==
"--help" || std::string(argv[i]) ==
"-h") {
74 std::cout <<
"SYNOPSYS" << std::endl
75 <<
" " << argv[0] <<
" [--plugin <path>] [--command_layer <name>] [--dof <4,6,7>] "
76 <<
"[--verbose] [--help] [-v] [-h]\n"
78 std::cout <<
"DESCRIPTION" << std::endl
79 <<
" --plugin <path>" << std::endl
80 <<
" Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl
82 <<
" --command_layer <name>, -l <name>" << std::endl
83 <<
" Command layer name, either \"usb\" or \"ethernet\"." << std::endl
85 <<
" --dof" << std::endl
86 <<
" Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl
88 <<
" --verbose, -v" << std::endl
89 <<
" Enable verbose mode to print addition information." << std::endl
91 <<
" --help, -h" << std::endl
92 <<
" Print this helper message." << std::endl
94 std::cout <<
"EXAMPLE" << std::endl
96 <<
" " << argv[0] <<
" --plugin /opt/JACO-SDK/API"
98 <<
" " << argv[0] <<
" --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\""
100 <<
" --command_layer usb" << std::endl
110 robot.setDoF(opt_dof);
112 robot.setPluginLocation(opt_plugin_path);
113 robot.setCommandLayer(opt_command_layer);
115 unsigned int n_devices = robot.connect();
118 std::cout <<
"There is no Kinova device connected." << std::endl;
131 for (
unsigned int i = 0; i < 300; i++) {
163 std::cout <<
"The end" << std::endl;
168 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.
const std::string & getStringMessage() const
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel) vp_override
void setVerbose(bool verbose)
@ STATE_POSITION_CONTROL
Initialize the position controller.
@ STATE_VELOCITY_CONTROL
Initialize the velocity controller.
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
VISP_EXPORT int wait(double t0, double t)