32 #define _USE_MATH_DEFINES 135 std::vector<double>
const& values,
139 std::vector<double>
const& min_values,
140 std::vector<double>
const& max_values,
146 if (axes.size() != values.size())
148 throw new cSDHErrorInvalidParameter(
cMsg(
"Lengths of axis indices and %s values vectors do not match (%ld != %ld)", name, axes.size(), values.size()) );
152 std::vector<int>::const_iterator ai = axes.begin();
153 std::vector<double>::const_iterator vi = values.begin();
154 for ( axes.begin(), vi = values.begin();
161 used |= (1 << (*ai));
165 cdbg <<
"SetAxisValueVector: axes and values ok, used=" << used <<
"\n";
174 bool c_value_valid =
false;
185 c_value_valid =
true;
188 for ( ai = axes.begin(), vi = values.begin();
202 if (SDH_ISNAN((*vi)))
211 c_value_valid =
true;
221 cdbg <<
"SetAxisValueVector: setting v=" << v <<
"\n";
223 all_values[ *ai ] = v;
229 std::vector<double> rv( axes.size(), 0.0 );
232 for ( i=0, ai = axes.begin();
241 v = returned_values[ *ai ];
260 std::vector<int>::const_iterator ai;
262 for ( ai = axes.begin();
276 std::vector<double> rv( axes.size(), 0.0 );
279 for ( i=0, ai = axes.begin();
288 v = all_values[ *ai ];
298 cSDH::cSDH(
bool _use_radians,
bool _use_fahrenheit,
int _debug_level )
309 cdbg.
PDM(
"Debug messages of cSDH are printed like this.\n" );
321 if ( _use_fahrenheit )
358 (*f0_axis_index)[0] = 0;
359 (*f0_axis_index)[1] = 1;
360 (*f0_axis_index)[2] = 2;
362 (*f1_axis_index)[0] = 7;
363 (*f1_axis_index)[1] = 3;
364 (*f1_axis_index)[2] = 4;
366 (*f2_axis_index)[0] = 0;
367 (*f2_axis_index)[1] = 5;
368 (*f2_axis_index)[2] = 6;
375 f_eps_v = Numeric.array( [
eps for i in range( 0, NUMBER_OF_AXES_PER_FINGER ) ] );
379 f_zeros_v = Numeric.array( [ 0.0
for i in range( 0, NUMBER_OF_AXES_PER_FINGER ) ] );
382 f_ones_v = Numeric.array( [ 1.0
for i in range( 0, NUMBER_OF_AXES_PER_FINGER ) ] );
395 all_real_axes.assign( nb_all_axes-NUMBER_OF_VIRTUAL_AXES, 0 );
450 std::vector<double>* f0_offset =
new std::vector<double>( 3, 0.0 );
451 std::vector<double>* f1_offset =
new std::vector<double>( 3, 0.0 );
452 std::vector<double>* f2_offset =
new std::vector<double>( 3, 0.0 );
454 (*f0_offset)[ 0 ] =
d/2.0;
455 (*f0_offset)[ 1 ] =
d/2.0*tan(
DegToRad(30.0) );
456 (*f0_offset)[ 2 ] =
h;
458 (*f1_offset)[ 0 ] = 0.0;
459 (*f1_offset)[ 1 ] = -
d/(2.0*cos(
DegToRad(30.0) ));
460 (*f1_offset)[ 2 ] =
h;
462 (*f2_offset)[ 0 ] = -
d/2.0;
463 (*f2_offset)[ 1 ] =
d/2.0*tan(
DegToRad(30.0) );
464 (*f2_offset)[ 2 ] =
h;
466 offset.assign( NUMBER_OF_FINGERS, *f0_offset );
479 cdbg <<
"Cleanup: Closing port in destructor ~cSDH\n";
492 std::vector<int>
cSDH::ToIndexVector(
int index, std::vector<int>& all_replacement,
int maxindex,
char const* name )
496 return all_replacement;
501 return std::vector<int>( 1, index );
509 return std::vector<double>( length, *convert( value ) );
529 std::vector<std::vector<double> > cSDH::_GetHandXYZ(
double angles )
532 f1_angles = [ angles[i]
for i in finger_axis_index[1] ];
533 f2_angles = [ angles[i]
for i in finger_axis_index[2] ];
546 std::vector<double> rv(3,0.0);
567 double s_b = sin( r_angles[1] );
568 double s_bc = sin( r_angles[1] + r_angles[2] );
569 double l1_s_b_l2_s_bc = (
l1*s_b +
l2*s_bc);
571 rv[0] = fac_x * (l1_s_b_l2_s_bc) * sin( r_angles[0] ) +
offset[ fi ][0];
572 rv[1] = fac_y * (l1_s_b_l2_s_bc) * cos( r_angles[0] ) +
offset[ fi ][1];
573 rv[2] =
l1*cos( r_angles[1] ) +
l2*cos( r_angles[1] + r_angles[2] ) +
offset[ fi][2];
663 cdbg <<
"GetInfo: " << what <<
" is requested\n";
665 if ( ! strcmp( what,
"release" ) || ! strcmp( what,
"release-library" ) )
667 if ( ! strcmp( what,
"date" ) || ! strcmp( what,
"date-library" ) )
669 if ( ! strcmp( what,
"release-firmware-recommended" ) )
675 if ( ! strcmp( what,
"release-firmware" ) )
677 if ( ! strcmp( what,
"date-firmware") )
679 if ( ! strcmp( what,
"release-soc" ) )
681 if ( ! strcmp( what,
"date-soc" ) )
683 if ( ! strcmp( what,
"date-soc" ) )
685 if ( ! strcmp( what,
"id-sdh") )
687 if ( ! strcmp( what,
"sn-sdh" ) )
699 std::vector<double> rv;
701 for ( std::vector<int>::const_iterator si = sensors.begin();
733 void cSDH::OpenRS232(
int _port,
unsigned long _baudrate,
double _timeout,
char const* _device_format_string )
743 com =
new cRS232( _port, _baudrate, _timeout, _device_format_string );
750 cdbg <<
"cSDH.OpenRS232() successfully opened RS232 port.\n";
760 if ( _timeout < 0.0 )
775 cdbg <<
"cSDH.OpenCAN_ESD() successfully opened CAN port.\n";
788 if ( _timeout < 0.0 )
803 cdbg <<
"cSDH.OpenCAN_ESD() successfully opened CAN port.\n";
816 if ( _timeout < 0.0 )
831 cdbg <<
"cSDH.OpenCAN_PEAK() successfully opened PEAK CAN device \"" << _device <<
"\".\n";
844 if ( _timeout < 0.0 )
859 cdbg <<
"cSDH.OpenCAN_PEAK() successfully reopened CAN device.\n";
883 cdbg <<
"cSDH.OpenTCP() successfully opened TCP connection to \"" << _tcp_adr <<
":" << _tcp_port <<
"\"\n";
894 if (! leave_enabled )
896 cdbg <<
"Switching off power before closing connection to SDH\n";
901 cdbg <<
"Connection to SDH closed.\n";
905 cdbg <<
"Ignoring exception while closing connection to SDH (" << e->
what() <<
")\n";
1019 std::vector<double> motor_currents( axes.size(), motor_current );
1072 std::vector<double> states( axes.size(), state );
1087 std::vector<double> dstates( states.size(), 0.0 );
1088 std::vector<bool>::const_iterator bi;
1089 std::vector<double>::iterator di;
1090 for ( bi = states.begin(), di = dstates.begin();
1091 bi != states.end() && di != dstates.end();
1113 "enabled/disabled" );
1133 std::vector<eAxisState> estates;
1134 std::vector<double>::const_iterator si;
1136 for ( si = fstates.begin();
1137 si != fstates.end();
1140 estates.push_back(
eAxisState(
int( *si ) ) );
1175 std::vector<eAxisState>::const_iterator si;
1176 for( si = states.begin();
1180 finished = finished && (*si != busy );
1183 if (!finished && timeout >= 0.0 && start_time.
Elapsed() > timeout )
1187 }
while ( ! finished );
1194 std::vector<int> axes;
1201 axes.push_back( iAxis );
1226 std::vector<double> angles( axes.size(), angle );
1246 "set target, get actual angle" );
1296 "target velocity" );
1306 std::vector<double> velocities( axes.size(), velocity );
1314 "target velocity" );
1325 "set target, get actual velocity" );
1334 "target velocity" );
1353 double all_velocities[] = { 85.7, 200.0, 157.8, 200.0, 157.8, 200.0, 157.8, 85.7 };
1354 std::vector<double> rv;
1355 std::vector<int>::const_iterator ai;
1357 for ( ai = axes.begin();
1380 double all_accelerations[] = { 5000.0, 400.0, 1500.0, 400.0, 1500.0, 400.0, 1500.0, 400.0 };
1381 std::vector<double> rv;
1382 std::vector<int>::const_iterator ai;
1384 for ( ai = axes.begin();
1396 "acceleration limit" );
1403 std::vector<int> axes( 1, iAxis );
1412 std::vector<int> axes( 1, iAxis );
1424 "actual velocity" );
1443 "reference velocity" );
1464 "target acceleration" );
1474 std::vector<double> accelerations( axes.size(), acceleration );
1482 "target acceleration" );
1492 "target acceleration" );
1508 std::vector<double> rv( axes.size(), 0.0 );
1510 std::vector<int>::const_iterator ai;
1511 std::vector<double>::iterator vi;
1512 for( ai = axes.begin(), vi = rv.begin();
1536 std::vector<double> rv( axes.size(), 0.0 );
1538 std::vector<int>::const_iterator ai;
1539 std::vector<double>::iterator vi;
1540 for( ai = axes.begin(), vi = rv.begin();
1564 std::vector<double> rv( axes.size(), 0.0 );
1566 std::vector<int>::const_iterator ai;
1567 std::vector<double>::iterator vi;
1568 for( ai = axes.begin(), vi = rv.begin();
1592 std::vector<double> rv( axes.size(), 0.0 );
1594 std::vector<int>::const_iterator ai;
1595 std::vector<double>::iterator vi;
1596 for( ai = axes.begin(), vi = rv.begin();
1622 unsigned long nan[2]={0xffffffff, 0x7fffffff};
1623 std::vector<double> all_states(
NUMBER_OF_AXES, *(
double* )nan);
1628 std::vector<int>::const_iterator fi;
1629 std::vector<double>::const_iterator vi;
1630 for( fi = fingers.begin(), vi = states.begin();
1631 fi != fingers.end() && vi != states.end();
1636 std::vector<int>::const_iterator fai;
1641 if ( *fai == 0 && !SDH_ISNAN( all_states[ *fai ] ) && !SDH_ISNAN( *vi ) )
1648 all_states[ *fai ] += *vi;
1650 all_states[ *fai ] = *vi;
1655 if ( !SDH_ISNAN( all_states[ 0 ] ) )
1656 all_states[ 0 ] =
ToRange( all_states[ 0 ], 0.0, 1.0 );
1665 std::vector<double> dstates( states.size(), 0.0 );
1666 std::vector<bool>::const_iterator bi;
1667 std::vector<double>::iterator di;
1668 for ( bi = states.begin(), di = dstates.begin();
1669 bi != states.end() && di != dstates.end();
1681 std::vector<int> axes;
1683 if ( iFinger ==
All )
1694 std::vector<double> states( axes.size(), state );
1716 std::vector<double> rv;
1721 std::vector<int>::const_iterator fi;
1723 for( fi = fingers.begin();
1724 fi != fingers.end();
1729 double finger_state = 0.0;
1730 std::vector<int>::const_iterator fai;
1736 finger_state += 1.0;
1738 finger_state += all_states[ *fai ];
1866 std::vector<double> r_angles;
1888 std::vector<double> a012;
1889 a012.push_back( a0 );
1890 a012.push_back( a1 );
1891 a012.push_back( a2 );
1923 for ( std::vector<int>::const_iterator ai = axes.begin();
1935 a_angles[ *ai ] = t_angles[ *ai ] ;
1962 return MoveAxis( std::vector<int>( 1, iAxis ), sequ );
1992 for ( std::vector<int>::const_iterator fi = fingers.begin();
1993 fi != fingers.end();
2006 a_angles[ *fai ] = t_angles[ *fai ] ;
2034 return MoveFinger( std::vector<int>( 1, iFinger ), sequ );
2055 CheckRange( close, 0.0, 1.0,
"open/close ratio" );
2077 std::vector<double>::iterator vi;
2133 assert(
"controller invalid" ==
NULL );
eAxisState
The state of an axis (see TPOSCON_STATE in global.h of the SDH firmware)
static cUnitConverter const uc_position_meter
Converter for position: external unit = meter.
A meta-value that means "access all possible values".
static cUnitConverter const uc_angle_degrees
Default converter for angles (internal unit == external unit): degrees.
Unit conversion class to convert values between physical unit systems.
std::vector< double > GetAxisTargetAcceleration(std::vector< int >const &axes)
std::vector< int > all_temperature_sensors
A vector with indices of all temperature sensors.
std::vector< double > ones_v
Vector of nb_all_axes 1.0 values.
std::vector< double > _GetFingerXYZ(int fi, std::vector< double > r_angles)
This file contains the interface to class #SDH::cSDH, the end user class to access the SDH from a PC...
cUnitConverter const uc_identity
Identity converter (internal = external)
std::vector< double > GetAxisMaxVelocity(std::vector< int > const &axes)
std::vector< double > GetFingerXYZ(int iFinger, std::vector< double > const &angles)
The base class to control the SCHUNK Dexterous Hand.
Interface of auxilliary utility functions for SDHLibrary-CPP.
void CheckIndex(int index, int maxindex, char const *name="")
Check if index is in [0 .. maxindex-1] or All. Throw a cSDHErrorInvalidParameter exception if not...
void UpdateSettingsFromSDH()
void SetVelocityProfile(eVelocityProfile velocity_profile)
void SetColor(char const *color)
void SetFingerTargetAngle(int iFinger, std::vector< double > const &angles)
double Elapsed(void) const
Return time in seconds elapsed between the time stored in the object and now.
eGraspId
The enum values of the known grasps.
static char const * GetFirmwareReleaseRecommended(void)
#define PROJECT_RELEASE
Release name of the whole software project (a.k.a. as the "version" of the project).
static cUnitConverter const uc_motor_current_milliampere
Converter for motor current: external unit = milli Ampere.
std::vector< double > GetAxisLimitAcceleration(std::vector< int > const &axes)
Interface of class #SDH::cCANSerial_PEAK, class to access CAN bus via PEAK card on cygwin/linux...
std::vector< double > SetAxisTargetGetAxisActualAngle(std::vector< int > const &axes, std::vector< double > const &angles)
int nb_all_axes
The number of all axes including virtual axes.
std::vector< double > f_max_motor_current_v
Maximum allowed motor currents (in internal units (Ampere)), including the virtual axis...
std::vector< double > GetFingerActualAngle(int iFinger)
void WaitAxis(std::vector< int > const &axes, double timeout=-1.0)
cSimpleVector pos(int axis=All, double *dummy=NULL)
cSimpleVector v(int axis=All, double *velocity=NULL)
static cUnitConverter const uc_angular_velocity_degrees_per_second
Default converter for angular velocities (internal unit == external unit): degrees / second...
std::vector< double > GetTemperature(std::vector< int > const &sensors)
A simple vector implementation.
velocity controller, velocities of axes are controlled independently (not implemented in SDH firmware...
void SetAxisEnable(std::vector< int > const &axes, std::vector< double > const &states)
pSetFunction GetMotorCurrentModeFunction(eMotorCurrentMode mode)
std::vector< int > finger_number_of_axes
Mapping of finger index to number of real axes of fingers:
Interface of class #SDH::cTCPSerial, class to access TCP port cygwin/linux.
eMotorCurrentMode
the motor current can be set specifically for these modes:
static cUnitConverter const uc_time_milliseconds
Converter for times: external unit = milliseconds.
static cUnitConverter const uc_time_seconds
Default converter for times (internal unit == external unit): seconds.
velocity controller with acceleration ramp, velocities and accelerations of axes are controlled indep...
cSimpleVector vel(int axis=All, double *dummy=NULL)
std::vector< double > zeros_v
Vector of nb_all_axes 0.0 values.
std::vector< double > f_max_velocity_v
Maximum allowed axis velocity (in internal units (degrees/second)), including the virtual axis...
virtual const char * what() const
Interface of class #SDH::cCANSerial_ESD, class to access CAN bus via ESD card on cygwin/linux.
cSimpleVector tvav(int axis=All, double *velocity=NULL)
void Open(cSerialBase *_com)
int NUMBER_OF_VIRTUAL_AXES
The number of virtual axes.
const cUnitConverter * uc_position
unit converter for position: default = #SDH::cSDH::uc_position_millimeter
cSimpleVector ihold(int axis=All, double *limit=NULL)
static char const * GetLibraryName(void)
cSimpleVector a(int axis=All, double *acceleration=NULL)
cSimpleVector temp_electronics(void)
double MoveFinger(std::vector< int >const &fingers, bool sequ=true)
std::vector< double > GetAxisTargetVelocity(std::vector< int > const &axes)
cSimpleVector vlim(int axis=All, double *dummy=NULL)
cSimpleVector(cSDHSerial::* pSetFunction)(int, double *)
Type of a pointer to a "set-axis-values" function like cSDHSerial::p, cSDHSerial::pos, ..., cSDHSerial::igrip, cSDHSerial::ihold or cSDHSerial::ilim.
Tp map(Function f, Tp sequence)
eVelocityProfile
An enum for all possible SDH internal velocity profile types.
bool CheckFirmwareRelease(void)
std::vector< double > f_min_angle_v
Minimum allowed axis angles (in internal units (degrees)), including the virtual axis.
double selgrip(eGraspId grip, bool sequ)
std::vector< int > ToIndexVector(int index, std::vector< int > &all_replacement, int maxindex, char const *name)
eControllerType con(eControllerType controller)
double l2
length of limb 2 (distal joint to fingertip) in mm
const cUnitConverter * uc_angular_acceleration
unit convert for (axis) angular accelerations: default = #SDH::cSDH::uc_angular_acceleration_degrees_...
double DegToRad(double d)
cSimpleVector rvel(int axis, double *dummy=NULL)
std::vector< double > GetFingerMinAngle(int iFinger)
cSimpleVector ilim(int axis=All, double *limit=NULL)
The motor currents used after "gripping" with a GripHand() command (i.e. "holding") ...
eVelocityProfile GetVelocityProfile(void)
the goal position has not been reached yet
coordinated position controller (position per axis => "pose controller"), all axes start and stop mov...
std::vector< double > GetAxisLimitVelocity(std::vector< int > const &axes)
void SetAxisTargetAcceleration(std::vector< int >const &axes, std::vector< double >const &accelerations)
std::vector< double > GetFingerTargetAngle(int iFinger)
cSimpleVector tpap(int axis=All, double *angle=NULL)
cSimpleVector p(int axis=All, double *angle=NULL)
static cUnitConverter const uc_angle_radians
Converter for angles: external unit = radians.
void OpenTCP(char const *_tcp_adr="192.168.1.1", int _tcp_port=23, double _timeout=0.0)
int NUMBER_OF_AXES
The number of axes.
int CompareReleases(char const *rev1, char const *rev2)
compare release strings
double GripHand(eGraspId grip, double close, double velocity, bool sequ=true)
virtual bool IsOpen(void)
std::vector< double > f_min_acceleration_v
Minimum allowed axis acceleration (in internal units (degrees/(second * second))), including the virtual axis.
int GetFingerNumberOfAxes(int iFinger)
int NUMBER_OF_TEMPERATURE_SENSORS
The number of temperature sensors.
const cUnitConverter * uc_time
unit convert for times: default = uc_time_seconds
const cUnitConverter * uc_angular_velocity
unit convert for (axis) angular velocities: default = #SDH::cSDH::uc_angular_velocity_degrees_per_sec...
Base class for exceptions in the SDHLibrary-CPP.
The motor currents used while "moving" with a MoveHand() or MoveFinger() command. ...
static cUnitConverter const uc_angular_velocity_radians_per_second
Converter for angular velocieties: external unit = radians/second.
std::vector< double > SetAxisValueVector(std::vector< int > const &axes, std::vector< double > const &values, pSetFunction ll_set, pGetFunction ll_get, cUnitConverter const *uc, std::vector< double > const &min_values, std::vector< double > const &max_values, char const *name)
void SetFingerEnable(std::vector< int > const &fingers, std::vector< double > const &states)
virtual bool IsOpen(void)
std::vector< eAxisState > GetAxisActualState(std::vector< int > const &axes)
void SetController(cSDHBase::eControllerType controller)
int NUMBER_OF_FINGERS
The number of fingers.
std::vector< double > f_zeros_v
Vector of 3 epsilon values.
Interface of auxilliary utility functions for SDHLibrary-CPP.
eControllerType controller_type
cached value of the axis controller type
The motor currents used while "gripping" with a GripHand() command.
static cUnitConverter const uc_position_millimeter
Default converter for position (internal unit == external unit): millimeter.
invalid controller_type (needed for cSDHSerial::con() to indicate "read current controller type") ...
void Close(bool leave_enabled=false)
const cUnitConverter * uc_motor_current
unit converter for motor curent: default = #SDH::cSDH::uc_motor_current_ampere
void SetAxisTargetVelocity(std::vector< int > const &axes, std::vector< double > const &velocities)
std::vector< int > all_fingers
A vector with indices of all fingers (in natural order)
std::vector< double > GetAxisValueVector(std::vector< int > const &axes, pGetFunction ll_get, cUnitConverter const *uc, char const *name)
const cUnitConverter * uc_angle
unit convert for (axis) angles: default = #SDH::cSDH::uc_angle_degrees
void CheckRange(double value, double minvalue, double maxvalue, char const *name="")
Check if value is in [minvalue .. maxvalue]. Throw a cSDHErrorInvalidParameter exception if not...
Low-level communication class to access a serial port on Cygwin and Linux.
eControllerType
An enum for all possible SDH internal controller types (order must match that in the SDH firmware in ...
Low-level communication class to access a CAN port.
std::vector< int > all_real_axes
A vector with indices of all real axes (in natural order), excluding the virtual axis.
cDBG cdbg
debug stream to print colored debug messages
void SetAxisTargetAngle(std::vector< int > const &axes, std::vector< double > const &angles)
std::vector< double > GetFingerEnable(std::vector< int > const &fingers)
double ToExternal(double internal) const
cSDHSerial comm_interface
The object to interface with the SDH attached via serial RS232 or CAN or TCP.
cSDH(bool _use_radians=false, bool _use_fahrenheit=false, int _debug_level=0)
Constructor of cSDH class.
int GetFingerAxisIndex(int iFinger, int iFingerAxis)
int NUMBER_OF_AXES_PER_FINGER
The number of axis per finger (for finger 1 this includes the "virtual" base axis) ...
static cUnitConverter const uc_temperature_celsius
Default converter for temparatures (internal unit == external unit): degrees celsius.
char const * GetInfo(char const *what)
cSimpleVector state(int axis=All, double *dummy=NULL)
double ToRange(double v, double min, double max)
std::vector< double > GetAxisMinAngle(std::vector< int > const &axes)
void OpenRS232(int _port=0, unsigned long _baudrate=115200, double _timeout=-1, char const *_device_format_string="/dev/ttyS%d")
#define USING_NAMESPACE_SDH
double(cUnitConverter::* pDoubleUnitConverterFunction)(double) const
Type of a pointer to a function like 'double SDH::cUnitConverter::ToExternal( double ) const' or 'dou...
std::vector< double > GetAxisTargetAngle(std::vector< int > const &axes)
std::vector< double > f_max_acceleration_v
Maximum allowed axis acceleration (in internal units (degrees/(second * second))), including the virtual axis.
double grip(double close, double velocity, bool sequ)
int all_axes_used
Bit field with the bits for all axes set.
double grip_max_velocity
Maximum allowed grip velocity (in internal units (degrees/second))
cSimpleVector alim(int axis=All, double *dummy=NULL)
std::vector< std::vector< int > > finger_axis_index
Mapping of finger index, finger axis index to axis index:
void OpenCAN_ESD(int _net=0, unsigned long _baudrate=1000000, double _timeout=0.0, Int32 _id_read=43, Int32 _id_write=42)
std::vector< double > f_max_angle_v
Maximum allowed axis angles (in internal units (degrees)), including the virtual axis.
std::vector< double > GetAxisMotorCurrent(std::vector< int > const &axes, eMotorCurrentMode mode=eMCM_MOVE)
std::vector< double > GetAxisEnable(std::vector< int > const &axes)
std::vector< double > f_min_velocity_v
Minimum allowed axis velocity (in internal units (degrees/second)), including the virtual axis...
Interface of class #SDH::cRS232, a class to access serial RS232 port on cygwin/linux.
static char const * GetLibraryRelease(void)
static cUnitConverter const uc_angular_acceleration_degrees_per_second_squared
Default converter for angular accelerations (internal unit == external unit): degrees / second...
double MoveAxis(std::vector< int >const &axes, bool sequ=true)
Derived exception class for exceptions related to communication between the SDHLibrary and the SDH...
cSimpleVector igrip(int axis=All, double *limit=NULL)
This file contains settings to make the SDHLibrary compile on differen systems:
static cUnitConverter const uc_motor_current_ampere
Default converter for motor current (internal unit == external unit): Ampere.
static cUnitConverter const uc_angular_acceleration_radians_per_second_squared
Converter for angular velocieties: external unit = radians/second.
static char const * GetStringFromControllerType(eControllerType controller_type)
Return a ptr to a (static) string describing controller type controller_Type.
Low-level communication class to access a CAN port from company PEAK (http://www.peak-system.com)
Very simple class to measure elapsed time.
char const * GetFirmwareRelease(void)
std::string release_firmware
string containing the SDH firmware release of the attaced SDH (something like "0.0.2.7")
eVelocityProfile vp(eVelocityProfile velocity_profile=eVP_INVALID)
std::vector< double > GetAxisActualAngle(std::vector< int > const &axes)
std::vector< double > GetAxisMaxAngle(std::vector< int > const &axes)
void AdjustLimits(cSDHBase::eControllerType controller)
double MoveHand(bool sequ=true)
std::vector< double > f_min_motor_current_v
Minimum allowed motor currents (in internal units (Ampere)), including the virtual axis...
std::vector< double > f_ones_v
Vector of 3 1.0 values.
#define FIRMWARE_RELEASE_RECOMMENDED
eControllerType GetController(void)
bool IsVirtualAxis(int iAxis)
Return true if index iAxis refers to a virtual axis.
#define PROJECT_DATE
Date of the release of the software project.
std::vector< double > SetAxisTargetGetAxisActualVelocity(std::vector< int > const &axes, std::vector< double > const &velocities)
double ToInternal(double external) const
std::vector< double > GetAxisReferenceVelocity(std::vector< int >const &axes)
std::vector< double > GetAxisActualVelocity(std::vector< int >const &axes)
This file contains nothing but C/C++ defines with the name of the project itself (PROJECT_NAME) and t...
Class for short, fixed maximum length text messages.
Derived exception class for exceptions related to invalid parameters.
void SetAxisMotorCurrent(std::vector< int > const &axes, std::vector< double > const &motor_currents, eMotorCurrentMode mode=eMCM_MOVE)
cSimpleVector power(int axis=All, double *flag=NULL)
Low-level communication class to access a CAN port from company ESD (http://www.esd.eu/)
double l1
length of limb 1 (proximal joint to distal joint) in mm
void PDM(char const *fmt,...) SDH__attribute__((format(printf
void OpenCAN_PEAK(unsigned long _baudrate=1000000, double _timeout=0.0, Int32 _id_read=43, Int32 _id_write=42, const char *_device="/dev/pcanusb0")
double eps
epsilon value (max absolute deviation of reported values from actual hardware values) (needed since S...
const cUnitConverter * uc_temperature
unit convert for temperatures: default = #SDH::cSDH::uc_temperature_celsius
Implementation of class #SDH::cRS232, a class to access serial RS232 port with VCC compiler on Window...
std::vector< std::vector< double > > offset
cSimpleVector(cSDHSerial::* pGetFunction)(int, double *)
Type of a pointer to a "get-axis-values" function like cSDHSerial::p, cSDHSerial::pos, ..., cSDHSerial::igrip, cSDHSerial::ihold or cSDHSerial::ilim.
int32_t Int32
signed integer, size 4 Byte (32 Bit)
cDBG dbg
A stream object to print colored debug messages.
std::vector< int > all_axes
A vector with indices of all axes (in natural order), including the virtual axis. ...
NAMESPACE_SDH_START typedef void * tDeviceHandle
generic device handle for CAN devices
static cUnitConverter const uc_temperature_fahrenheit
Converter for temperatures: external unit = degrees fahrenheit.
double GetGripMaxVelocity(void)
int debug_level
debug level of this object
#define PROJECT_NAME
Name of the software project.
std::vector< double > GetAxisMaxAcceleration(std::vector< int > const &axes)
std::vector< double > GetFingerMaxAngle(int iFinger)