81 "Print measured actual axis angles of SDH.\n" 82 "(C++ demo application using the SDHLibrary-CPP library.)\n" 85 " - Print actual angles of an SDH connected via Ethernet.\n" 86 " The SDH has IP-Address 192.168.1.42 and is attached to TCP port 23.\n" 87 " (Requires at least SDH-firmware v0.0.3.1)\n" 88 " > demo-GetAxisActualAngle --tcp=192.168.1.42:23\n" 90 " - Print actual angles of an SDH connected to port 2 = COM3 once:\n" 91 " > demo-GetAxisActualAngle -p 2\n" 93 " - Print actual angles of an SDH connected to port 2 = COM3 every 500ms:\n" 94 " > demo-GetAxisActualAngle -p 2 -t 0.5\n" 96 " - Print actual angles of an SDH connected to USB to RS232 converter 0 once:\n" 97 " > demo-GetAxisActualAngle --sdh_rs_device=/dev/ttyUSB0 \n" 99 " - Get the version info of both the joint controllers and the tactile \n" 100 " sensor firmware from an SDH connected via Ethernet.\n" 101 " The joint controllers and the tactile sensors have a common IP-Address,\n" 102 " here 192.168.1.42. The SDH controller is attached to the \n" 103 " default TCP port 23 and the tactile sensors to the default TCP port 13000.\n" 104 " (Requires at least SDH-firmware v0.0.3.2)\n" 105 " > demo-GetAxisActualAngle --tcp=192.168.1.42 --dsa_tcp -v\n" 107 " - Get the version info of an SDH connected to port 2 = COM3 \n" 108 " > demo-GetAxisActualAngle --port=2 -v\n";
109 char const*
__author__ =
"Dirk Osswald: dirk.osswald@de.schunk.com";
110 char const*
__url__ =
"http://www.schunk.com";
111 char const*
__version__ =
"$Id: demo-GetAxisActualAngle.cpp 10351 2013-06-18 16:28:14Z Osswald2 $";
118 "usage: demo-GetAxisActualAngle [options]\n" 127 int main(
int argc,
char **argv )
144 cdbg <<
"Debug messages of " << argv[0] <<
" are printed like this.\n";
154 cdbg <<
"Successfully created cSDH instance\n";
158 cdbg <<
"Successfully opened communication to SDH\n";
161 cdbg <<
"Caption:\n";
163 cdbg <<
" times are reported in seconds\n";
171 double elapsed = 0.0;
184 cout << elapsed <<
" ";
185 elapsed += options.
period;
187 cout << start.
Elapsed() <<
" ";
191 for ( vector<double>::const_iterator ai = angles.begin();
206 cdbg <<
"Successfully disabled controllers of SDH and closed connection\n";
210 cerr <<
"demo-GetAxisActualAngle main(): Caught exception from SDHLibrary: " << e->
what() <<
". Giving up!\n";
215 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...
#define SDH_ASSERT_TYPESIZES()
macro to assert that the defined typedefs have the expected sizes
Interface of auxilliary utility functions for SDHLibrary-CPP.
double Elapsed(void) const
Return time in seconds elapsed between the time stored in the object and now.
A class to print colored debug messages.
char const * __copyright__
virtual const char * what() const
Implementation of a class to parse common SDH related command line options.
static char const * GetLibraryName(void)
char const * GetSymbol(void) const
Return the symbol of the external unit (something like "deg" or "ms")
void OpenCommunication(NS_SDH cSDH &hand)
Base class for exceptions in the SDHLibrary-CPP.
Interface of auxilliary utility functions for SDHLibrary-CPP.
void Close(bool leave_enabled=false)
const cUnitConverter * uc_angle
unit convert for (axis) angles: default = #SDH::cSDH::uc_angle_degrees
#define USING_NAMESPACE_SDH
char const * GetName(void) const
Return the name of the external unit (something like "degrees" or "milliseconds") ...
int main(int argc, char **argv)
static char const * GetLibraryRelease(void)
This file contains settings to make the SDHLibrary compile on differen systems:
Very simple class to measure elapsed time.
std::vector< double > GetAxisActualAngle(std::vector< int > const &axes)
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
std::vector< int > all_axes
A vector with indices of all axes (in natural order), including the virtual axis. ...