48 #include <visp3/core/vpConfig.h> 49 #include <visp3/robot/vpRobotKinova.h> 51 int main(
int argc,
char*argv[])
53 #ifdef VISP_HAVE_JACOSDK 54 std::string opt_plugin_path =
"./";
56 bool opt_verbose =
false;
57 unsigned int opt_dof = 6;
59 for (
int i = 1; i < argc; i++) {
60 if (std::string(argv[i]) ==
"--plugin" && i + 1 < argc) {
61 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" << std::endl;
84 std::cout <<
"DESCRIPTION" << std::endl
85 <<
" --plugin <path>" << std::endl
86 <<
" Path to Jaco SDK .so or .dll plugin location. Default: \"./\"." << std::endl << std::endl
87 <<
" --command_layer <name>, -l <name>" << std::endl
88 <<
" Command layer name, either \"usb\" or \"ethernet\"." << std::endl << std::endl
89 <<
" --dof" << std::endl
90 <<
" Degrees of freedom. Possible values are 4, 6 or 7. Default value: 6." << std::endl << std::endl
91 <<
" --verbose, -v" << std::endl
92 <<
" Enable verbose mode to print addition information." << std::endl << std::endl
93 <<
" --help, -h" << std::endl
94 <<
" Print this helper message." << std::endl << std::endl;
95 std::cout <<
"EXAMPLE" << std::endl
97 <<
" " << argv[0] <<
" --plugin /opt/JACO-SDK/API" 99 <<
" " << argv[0] <<
" --plugin \"C:\\Program Files(x86)\\JACO - SDK\\API\\x64\"" 101 <<
" --command_layer usb" << std::endl << std::endl;
114 int n_devices = robot.
connect();
117 std::cout <<
"There is no Kinova device connected." << std::endl;
130 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;
VISP_EXPORT int wait(double t0, double t)
Initialize the position controller.
error that can be emited by ViSP classes.
void setVerbose(bool verbose)
void setCommandLayer(CommandLayer command_layer)
virtual vpRobotStateType setRobotState(const vpRobot::vpRobotStateType newState)
Initialize the velocity controller.
void setVelocity(const vpRobot::vpControlFrameType frame, const vpColVector &vel)
void getPosition(const vpRobot::vpControlFrameType frame, vpColVector &position)
static double rad(double deg)
void setDoF(unsigned int dof)
Implementation of column vector and the associated operations.
const std::string & getStringMessage() const
Send a reference (constant) related the error message (can be empty).
void setPluginLocation(const std::string &plugin_location)
void setPosition(const vpRobot::vpControlFrameType frame, const vpColVector &q)