Short overview of the SDHLibrary-CPP and SDH architecture. More...
Short overview of the SDHLibrary-CPP and SDH architecture.
...
// Include the cSDH interface
include <sdh.h>
// Create an instance "hand" of the class cSDH:
cSDH hand;
// Open communication to the SDH device via default serial port 0 == "COM1"
hand.OpenRS232();
// Perform some action:
// get the current actual axis angles of finger 0
std::vector<double> faa = hand.GetFingerActualAngle( 0 );
// modify these by decreasing the proximal and the distal axis angles:
std::vector<double> fta = faa;
fta[1] -= 10;
fta[2] -= 10;
// set modified angles as new target angles:
hand.SetFingerTargetAngle( 0, fta );
// now make the finger move there:
hand.MoveFinger( 0 );
// Finally close connection to SDH again (This automatically
// switches off the axis controllers to prevent overheating):
hand.Close();
Real example code is available in the demo-*.cpp code files, see e.g.