Permalink
Browse files

Set gravity vector in rbdl model.

  • Loading branch information...
1 parent 5186df5 commit a39ea2977bf1e49475f7268f5fa6c8d4204a04a7 Antonio El Khoury committed Oct 12, 2012
Showing with 4 additions and 0 deletions.
  1. +3 −0 include/ard/rbdl/tools/types.hh
  2. +1 −0 src/dynamic-robot.cc
View
3 include/ard/rbdl/tools/types.hh
@@ -44,6 +44,9 @@ namespace ard
{
namespace rbdl
{
+ // Define gravity vector.
+ static const vector3d gravity (0, 0, -9.81);
@thomas-moulard
thomas-moulard added a line comment Oct 16, 2012

You should let the user specify the grabity using some getter/setter if possible.
And it may be a good idea to use the real SI value when possible, see: http://en.wikipedia.org/wiki/Standard_gravity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+
// RBDL typedefs.
ARD_RBDL_DEFINE_TYPES (RigidBodyDynamics::Joint, rbdlJoint);
ARD_RBDL_DEFINE_TYPES (RigidBodyDynamics::Body, rbdlBody);
View
1 src/dynamic-robot.cc
@@ -94,6 +94,7 @@ namespace ard
// Initialize rbdl model. This method is called before building
// the model.
rbdlModel_.Init ();
+ rbdlModel_.gravity = gravity;
// Build rbdl model.
if (!buildRbdlModel ())

0 comments on commit a39ea29

Please sign in to comment.