Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add protected root joint getter in DynamicRobot.

  • Loading branch information...
commit 7293a61af721dc209dce386a4d99198dc3678c59 1 parent 045c22d
Antonio El Khoury authored
Showing with 9 additions and 5 deletions.
  1. +3 −0  include/ard/rbdl/model/dynamic-robot.hh
  2. +6 −5 src/dynamic-robot.cc
View
3  include/ard/rbdl/model/dynamic-robot.hh
@@ -333,6 +333,9 @@ namespace ard
/// \retval true if success, false if failure
virtual bool buildRbdlModel ();
+ /// \brief Get the root joint of the robot.
+ virtual void rootJoint (jointShPtr_t& joint) const;
+
/// \brief Set the root joint of the robot.
virtual void rootJoint (joint_t& joint);
View
11 src/dynamic-robot.cc
@@ -61,11 +61,7 @@ namespace ard
DynamicRobot::DynamicRobot (const DynamicRobot& robot) :
boost::enable_shared_from_this<DynamicRobot> ()
{
- if (robot.rootJoint ())
- getPtrFromBase (rootJoint_, robot.rootJoint ());
- else
- rootJoint_.reset ();
-
+ robot.rootJoint (rootJoint_);
robot.jointVector (jointVector_);
rbdlModel_ = robot.rbdlModel ();
configuration_ = robot.currentConfiguration ();
@@ -484,6 +480,11 @@ namespace ard
return true;
}
+ void DynamicRobot::rootJoint (jointShPtr_t& joint) const
+ {
+ joint = rootJoint_;
+ }
+
void DynamicRobot::rootJoint (joint_t& joint)
{
rootJoint_ = joint.shared_from_this ();
Please sign in to comment.
Something went wrong with that request. Please try again.