Go to the documentation of this file.
62 "Make the SDH move one finger in \"velocity with acceleration ramp\" control mode.\n(C++ demo application using the SDHLibrary-CPP library.)\n"
64 " - Make SDH connected via Ethernet move.\n"
65 " The SDH has IP-Address 192.168.1.42 and is attached to TCP port 23.\n"
66 " (Requires at least SDH-firmware v0.0.3.1)\n"
67 " > demo-velocity-acceleration --tcp=192.168.1.42:23\n"
70 " - Make SDH connected to port 2 = COM3 move:\n"
71 " > demo-velocity-acceleration -p 2\n"
73 " - Make SDH connected to USB to RS232 converter 0 move:\n"
74 " > demo-velocity-acceleration --sdh_rs_device=/dev/ttyUSB0 \n"
76 " - Get the version info of both the joint controllers and the tactile \n"
77 " sensor firmware from an SDH connected via Ethernet.\n"
78 " The joint controllers and the tactile sensors have a common IP-Address,\n"
79 " here 192.168.1.42. The SDH controller is attached to the \n"
80 " default TCP port 23 and the tactile sensors to the default TCP port 13000.\n"
81 " (Requires at least SDH-firmware v0.0.3.2)\n"
82 " > demo-velocity-acceleration --tcp=192.168.1.42 --dsa_tcp -v\n"
84 " - Get the version info of an SDH connected to port 2 = COM3 \n"
85 " > demo-velocity-acceleration --port=2 -v\n";
87 char const*
__author__ =
"Dirk Osswald: dirk.osswald@de.schunk.com";
88 char const*
__url__ =
"http://www.schunk.com";
89 char const*
__version__ =
"$Id: demo-velocity-acceleration.cpp 10351 2013-06-18 16:28:14Z Osswald2 $";
96 "usage: demo-velocity-acceleration [options]\n";
99 int main(
int argc,
char** argv )
116 cdbg <<
"Debug messages of " << argv[0] <<
" are printed like this.\n";
127 cdbg <<
"Successfully created cSDH instance\n";
131 cdbg <<
"Successfully opened communication to SDH\n";
135 std::cout <<
"Preparation:\n";
136 std::cout <<
" Moving to start position with \"pose\" controller type:\n\n";
150 std::cout <<
"Moving in \"velocity with acceleration ramp\" controller type:\n";
151 std::cout <<
" Now move back and forth with increasing acceleration\n";
152 std::cout <<
" and target velocities of alternating sign:\n";
164 double accelerations[] = { 10.0, 20.0, 40.0, 80.0, 160.0, 0.0 };
165 double velocity = 40.0;
172 for (
double sign = -1.0; sign <= 1.0; sign += 2.0 )
174 std::cout <<
"Setting target acceleration,velocity= " << std::setw(7) << accelerations[i] <<
" deg/(s*s) " << std::setw(7) << sign * velocity <<
" deg/s\n";
181 bool position_reached =
false;
182 while ( !position_reached )
196 }
while ( accelerations[i] != 0.0);
204 std::cout <<
"Setting target acceleration,velocity= " << std::setw(7) << 100.0 <<
" deg/(s*s) " << std::setw(7) << 0.0 <<
" deg/s (for stopping)\n";
231 std::cerr <<
"demo-velocity-acceleration main(): An exception was caught: " << e->
what() <<
"\n";
void SetAxisTargetVelocity(std::vector< int > const &axes, std::vector< double > const &velocities)
#define USING_NAMESPACE_SDH
Base class for exceptions in the SDHLibrary-CPP.
@ eCT_VELOCITY_ACCELERATION
velocity controller with acceleration ramp, velocities and accelerations of axes are controlled indep...
char const * __copyright__
void SetAxisTargetAngle(std::vector< int > const &axes, std::vector< double > const &angles)
std::vector< double > GetAxisActualAngle(std::vector< int > const &axes)
Implementation of a class to parse common SDH related command line options.
double MoveHand(bool sequ=true)
std::vector< double > GetAxisReferenceVelocity(std::vector< int >const &axes)
std::vector< double > GetAxisActualVelocity(std::vector< int >const &axes)
void OpenCommunication(NS_SDH cSDH &hand)
static char const * GetLibraryRelease(void)
@ eCT_POSE
coordinated position controller (position per axis => "pose controller"), all axes start and stop mov...
int main(int argc, char **argv)
class for command line option parsing holding option parsing results
#SDH::cSDH is the end user interface class to control a SDH (SCHUNK Dexterous Hand).
A class to print colored debug messages.
void WaitAxis(std::vector< int > const &axes, double timeout=-1.0)
This file contains some basic definitions (defines, macros, datatypes)
void SetAxisEnable(std::vector< int > const &axes, std::vector< double > const &states)
This file contains settings to make the SDHLibrary compile on differen systems:
static char const * GetLibraryName(void)
USING_NAMESPACE_SDH NAMESPACE_SDH_START std::ostream * g_sdh_debug_log
This file contains the interface to class #SDH::cSDH, the end user class to access the SDH from a PC.
void SetAxisTargetAcceleration(std::vector< int >const &axes, std::vector< double >const &accelerations)
virtual const char * what() const
int Parse(int argc, char **argv, char const *helptext, char const *progname, char const *version, char const *libname, char const *librelease)
void SetController(cSDHBase::eControllerType controller)
void Close(bool leave_enabled=false)
Interface of auxilliary utility functions for SDHLibrary-CPP.
#define SDH_ASSERT_TYPESIZES()
macro to assert that the defined typedefs have the expected sizes
@ All
A meta-value that means "access all possible values".
sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:58