Skip to content

Commit a282005

Browse files
committed
Add transition functions and mark them as deprecated
1 parent 11f17dd commit a282005

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

src/rl/mdl/Dynamic.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232
#include <rl/math/Spatial.h>
3333
#include <rl/math/Unit.h>
3434

35+
#include "EulerCauchyIntegrator.h"
3536
#include "Exception.h"
3637
#include "Dynamic.h"
3738
#include "Prismatic.h"
3839
#include "Revolute.h"
40+
#include "RungeKuttaNystromIntegrator.h"
3941
#include "World.h"
4042

4143
namespace rl
@@ -172,6 +174,13 @@ namespace rl
172174
invMx = J * invM * J.transpose();
173175
}
174176

177+
void
178+
Dynamic::eulerCauchy(const ::rl::math::Real& dt)
179+
{
180+
EulerCauchyIntegrator integrator(this);
181+
integrator.integrate(dt);
182+
}
183+
175184
void
176185
Dynamic::forwardDynamics()
177186
{
@@ -244,6 +253,13 @@ namespace rl
244253
}
245254
}
246255

256+
void
257+
Dynamic::rungeKuttaNystrom(const ::rl::math::Real& dt)
258+
{
259+
RungeKuttaNystromIntegrator integrator(this);
260+
integrator.integrate(dt);
261+
}
262+
247263
void
248264
Dynamic::update()
249265
{

src/rl/mdl/Dynamic.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ namespace rl
146146
*/
147147
void calculateOperationalMassMatrixInverse(const ::rl::math::Matrix& J, const ::rl::math::Matrix& invM, ::rl::math::Matrix& invMx) const;
148148

149+
RL_MDL_DEPRECATED void eulerCauchy(const ::rl::math::Real& dt);
150+
149151
/**
150152
* Forward dynamics via articulated-body algorithm.
151153
*
@@ -226,6 +228,8 @@ namespace rl
226228

227229
void inverseForce();
228230

231+
RL_MDL_DEPRECATED void rungeKuttaNystrom(const ::rl::math::Real& dt);
232+
229233
virtual void update();
230234

231235
protected:

src/rl/mdl/Kinematic.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <rl/math/Unit.h>
3434

3535
#include "Exception.h"
36+
#include "JacobianInverseKinematics.h"
3637
#include "Kinematic.h"
3738
#include "Prismatic.h"
3839
#include "Revolute.h"
@@ -53,6 +54,17 @@ namespace rl
5354
{
5455
}
5556

57+
bool
58+
Kinematic::calculateInversePosition(const ::rl::math::Transform& x, const ::std::size_t& leaf, const ::rl::math::Real& delta, const ::rl::math::Real& epsilon, const ::std::size_t& iterations)
59+
{
60+
JacobianInverseKinematics ik(this);
61+
ik.setDelta(delta);
62+
ik.setEpsilon(epsilon);
63+
ik.setIterations(iterations);
64+
ik.addGoal(x, leaf);
65+
return ik.solve();
66+
}
67+
5668
void
5769
Kinematic::calculateJacobian(const bool& inWorldFrame)
5870
{

src/rl/mdl/Kinematic.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ namespace rl
4444

4545
virtual ~Kinematic();
4646

47+
RL_MDL_DEPRECATED bool calculateInversePosition(
48+
const ::rl::math::Transform& x,
49+
const ::std::size_t& leaf = 0,
50+
const ::rl::math::Real& delta = ::std::numeric_limits<::rl::math::Real>::infinity(),
51+
const ::rl::math::Real& epsilon = static_cast<::rl::math::Real>(1.0e-6),
52+
const ::std::size_t& iterations = 10000
53+
);
54+
4755
/**
4856
* Calculate Jacobian matrix.
4957
*

src/rl/sg/Shape.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ namespace rl
3838
{
3939
}
4040

41+
Shape::Shape(::SoVRMLShape* shape, Body* body) :
42+
Base(),
43+
body(body),
44+
name()
45+
{
46+
}
47+
4148
Shape::~Shape()
4249
{
4350
}

src/rl/sg/Shape.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#define RL_SG_SHAPE_H
2929

3030
#include <string>
31+
#include <Inventor/VRMLnodes/SoVRMLShape.h>
3132
#include <rl/math/Transform.h>
3233

3334
#include "Base.h"
@@ -43,6 +44,8 @@ namespace rl
4344
public:
4445
Shape(Body* body);
4546

47+
RL_SG_DEPRECATED Shape(::SoVRMLShape* shape, Body* body);
48+
4649
virtual ~Shape();
4750

4851
Body* getBody() const;

0 commit comments

Comments
 (0)