2
* Robot3D Physical realistic 3D simulator for robots
4
* @license GNU Lesser General Public License
7
* @author Anne C. van Rossum
9
#include <srActuator/WheelUniKarl.h>
11
// for CFM and ERP, read the manual of the ODE:
12
// http://www.ode.org/ode-latest-userguide.html
13
#define SUSPENSION_ERP 0.9 //0.8
14
#define SUSPENSION_CFM 0.3 //0.6
15
#define STOP_ERP 0.9 //0.8
16
#define STOP_CFM 0.3 //0.6
23
// Torques are in N*(5cm). 1Nm ^= 20N*(5cm)
24
#define MAX_TORQUE 1000
28
/*! @param body1, body2 the bodies the hinge is attached to.
29
* @param anchorX, anchorY, anchorZ the position of the hinge in the world coordinate system.
30
* @param axisX, axisY, axisZ the orientation of the axis of the hinge in the world coordinate system.
33
WheelUniKarl::WheelUniKarl(dtCore::RefPtr<BodyBase> body1, dtCore::RefPtr<BodyBase> body2,
34
float anchorX, float anchorY, float anchorZ,
35
float axis1_X, float axis1_Y, float axis1_Z,
36
const std::string &name) :
37
HingeActuator(name, "ukaWheel")
41
this->init( body1, body2,
42
anchorX, anchorY, anchorZ,
43
axis1_X, axis1_Y, axis1_Z);
46
// setParam(dParamLoStop, -PI);
47
// setParam(dParamHiStop, PI);
48
//setParam(dParamSuspensionERP, SUSPENSION_ERP);
49
//setParam(dParamSuspensionCFM, SUSPENSION_CFM);
50
setODEParameter(dParamStopERP, STOP_ERP);
51
setODEParameter(dParamStopCFM, STOP_CFM);
52
setODEParameter(dParamFudgeFactor, FUDGE);
53
setODEParameter(dParamBounce, BOUNCE);
54
setODEParameter(dParamFMax, MAX_TORQUE);
56
dJointSetHingeParam (joint, dParamLoStop, -4);
57
dJointSetHingeParam (joint, dParamHiStop, 4);
61
WheelUniKarl::~WheelUniKarl()