85 "Print measured XYZ position of fingertips of SDH.\n" 86 "C++ demo application using the SDHLibrary-CPP library.)\n" 88 "For every finger the actual axis angles and the finger tip coordinates\n" 92 " - Print finger angles and finger tip xyz coordinates of an SDH connected\n" 93 " via Ethernet. The SDH has IP-Address 192.168.1.42 and is attached to TCP\n" 95 " (Requires at least SDH-firmware v0.0.3.1)\n" 96 " > demo-GetFingerXYZ --tcp=192.168.1.42:23\n" 98 " - Print finger angles and finger tip xyz coordinates of an SDH connected\n" 99 " to port 2 = COM3 once:\n" 100 " > demo-GetFingerXYZ -p 2\n" 102 " - Print finger angles and finger tip xyz coordinates of an SDH connected\n" 103 " to port 2 = COM3 every 500ms:\n" 104 " > demo-GetFingerXYZ -p 2 -t 0.5\n" 106 " - Print finger angles and finger tip xyz coordinates of an SDH connected\n" 107 " to USB to RS232 converter 0 once:\n" 108 " > demo-GetFingerXYZ --sdh_rs_device=/dev/ttyUSB0 \n" 110 " - Get the version info of both the joint controllers and the tactile \n" 111 " sensor firmware from an SDH connected via Ethernet.\n" 112 " The joint controllers and the tactile sensors have a common IP-Address,\n" 113 " here 192.168.1.42. The SDH controller is attached to the \n" 114 " default TCP port 23 and the tactile sensors to the default TCP port 13000.\n" 115 " (Requires at least SDH-firmware v0.0.3.2)\n" 116 " > demo-GetFingerXYZ --tcp=192.168.1.42 --dsa_tcp -v\n" 118 " - Get the version info of an SDH connected to port 2 = COM3 \n" 119 " > demo-GetFingerXYZ --port=2 -v\n" 121 " - Command line parameter \"-R\" does not work when compiled \n" 122 " with MS Visual Studio\n" 124 char const*
__author__ =
"Dirk Osswald: dirk.osswald@de.schunk.com";
125 char const*
__url__ =
"http://www.schunk.com";
126 char const*
__version__ =
"$Id: demo-GetFingerXYZ.cpp 10351 2013-06-18 16:28:14Z Osswald2 $";
133 "usage: demo-GetFingerXYZ [options]\n" 142 int main(
int argc,
char **argv )
160 cdbg <<
"Debug messages of " << argv[0] <<
" are printed like this.\n";
170 cdbg <<
"Successfully created cSDH instance\n";
174 cdbg <<
"Successfully opened communication to SDH\n";
177 cdbg <<
"Caption:\n";
179 cdbg <<
" times are reported in seconds\n";
188 vector<double> angles;
190 vector<double>::const_iterator i;
201 cout << start.
Elapsed() <<
" ";
204 cout <<
"finger " << fi <<
": ";
206 cout.setf(ios::fixed);
208 for ( i = angles.begin(); i != angles.end(); i++ )
209 cout << setw(6) << *i <<
" ";
212 for ( i = xyz.begin(); i != xyz.end(); i++ )
213 cout << setw(6) << *i <<
" ";
226 cdbg <<
"Successfully disabled controllers of SDH and closed connection\n";
230 cerr <<
"demo-GetFingerXYZ main(): Caught exception from SDHLibrary: " << e->
what() <<
". Giving up!\n";
235 cerr <<
"caught unexpected exception!\n";
#SDH::cSDH is the end user interface class to control a SDH (SCHUNK Dexterous Hand).
int Parse(int argc, char **argv, char const *helptext, char const *progname, char const *version, char const *libname, char const *librelease)
This file contains the interface to class #SDH::cSDH, the end user class to access the SDH from a PC...
std::vector< double > GetFingerXYZ(int iFinger, std::vector< double > const &angles)
#define SDH_ASSERT_TYPESIZES()
macro to assert that the defined typedefs have the expected sizes
Interface of auxilliary utility functions for SDHLibrary-CPP.
A class to print colored debug messages.
std::vector< double > GetFingerActualAngle(int iFinger)
int GetNumberOfFingers(void)
Return the number of fingers of the SDH.
double Elapsed(void) const
Return time in seconds elapsed between the time stored in the object and now.
Implementation of a class to parse common SDH related command line options.
static char const * GetLibraryRelease(void)
int main(int argc, char **argv)
void OpenCommunication(NS_SDH cSDH &hand)
Base class for exceptions in the SDHLibrary-CPP.
char const * GetSymbol(void) const
Return the symbol of the external unit (something like "deg" or "ms")
Interface of auxilliary utility functions for SDHLibrary-CPP.
virtual const char * what() const
void Close(bool leave_enabled=false)
const cUnitConverter * uc_angle
unit convert for (axis) angles: default = #SDH::cSDH::uc_angle_degrees
char const * __copyright__
#define USING_NAMESPACE_SDH
This file contains settings to make the SDHLibrary compile on differen systems:
Very simple class to measure elapsed time.
static char const * GetLibraryName(void)
This file contains some basic definitions (defines, macros, datatypes)
class for command line option parsing holding option parsing results
USING_NAMESPACE_SDH NAMESPACE_SDH_START std::ostream * g_sdh_debug_log
char const * GetName(void) const
Return the name of the external unit (something like "degrees" or "milliseconds") ...