Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Implement DynamicRobot copy constructor.

  • Loading branch information...
commit 196d8c1317416349e8466f827ab8eb3bd8cef662 1 parent 0416789
authored

Showing 1 changed file with 27 additions and 0 deletions. Show diff stats Hide diff stats

  1. 27  src/dynamic-robot.cc
27  src/dynamic-robot.cc
@@ -58,6 +58,33 @@ namespace ard
58 58
     {
59 59
     }
60 60
 
  61
+    DynamicRobot::DynamicRobot (const DynamicRobot& robot) :
  62
+      boost::enable_shared_from_this<DynamicRobot> ()
  63
+    {
  64
+      if (robot.rootJoint ())
  65
+	getPtrFromBase (rootJoint_, robot.rootJoint ());
  66
+      else
  67
+	rootJoint_.reset ();
  68
+
  69
+      robot.jointVector (jointVector_);
  70
+      rbdlModel_ = robot.rbdlModel ();
  71
+      configuration_ = robot.currentConfiguration ();
  72
+      velocity_ = robot.currentVelocity ();
  73
+      acceleration_ = robot.currentAcceleration ();
  74
+      forces_ = robot.currentForces ();
  75
+      torques_ = robot.currentTorques ();
  76
+      jointTorques_ = matrixNxP (robot.currentJointTorques ());
  77
+      positionCenterOfMass_ = robot.positionCenterOfMass ();
  78
+      velocityCenterOfMass_ = robot.velocityCenterOfMass ();
  79
+      accelerationCenterOfMass_ = robot.accelerationCenterOfMass ();
  80
+      linearMomentumRobot_ = robot.linearMomentumRobot ();
  81
+      derivativeAngularMomentum_ = robot.derivativeAngularMomentum ();
  82
+      mass_ = robot.mass ();
  83
+      inertiaMatrix_ = robot.inertiaMatrix ();
  84
+
  85
+      robot.actuatedJoints (actuatedJoints_);
  86
+    }
  87
+
61 88
     bool DynamicRobot::initialize ()
62 89
     {
63 90
       throw std::runtime_error ("Method not supported.");

0 notes on commit 196d8c1

Please sign in to comment.
Something went wrong with that request. Please try again.