Skip to content

Commit

Permalink
Add protected root joint getter in DynamicRobot.
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio El Khoury committed Oct 16, 2012
1 parent 045c22d commit 7293a61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions include/ard/rbdl/model/dynamic-robot.hh
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -333,6 +333,9 @@ namespace ard
/// \retval true if success, false if failure /// \retval true if success, false if failure
virtual bool buildRbdlModel (); 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. /// \brief Set the root joint of the robot.
virtual void rootJoint (joint_t& joint); virtual void rootJoint (joint_t& joint);


Expand Down
11 changes: 6 additions & 5 deletions src/dynamic-robot.cc
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -61,11 +61,7 @@ namespace ard
DynamicRobot::DynamicRobot (const DynamicRobot& robot) : DynamicRobot::DynamicRobot (const DynamicRobot& robot) :
boost::enable_shared_from_this<DynamicRobot> () boost::enable_shared_from_this<DynamicRobot> ()
{ {
if (robot.rootJoint ()) robot.rootJoint (rootJoint_);
getPtrFromBase (rootJoint_, robot.rootJoint ());
else
rootJoint_.reset ();

robot.jointVector (jointVector_); robot.jointVector (jointVector_);
rbdlModel_ = robot.rbdlModel (); rbdlModel_ = robot.rbdlModel ();
configuration_ = robot.currentConfiguration (); configuration_ = robot.currentConfiguration ();
Expand Down Expand Up @@ -484,6 +480,11 @@ namespace ard
return true; return true;
} }


void DynamicRobot::rootJoint (jointShPtr_t& joint) const
{
joint = rootJoint_;
}

void DynamicRobot::rootJoint (joint_t& joint) void DynamicRobot::rootJoint (joint_t& joint)
{ {
rootJoint_ = joint.shared_from_this (); rootJoint_ = joint.shared_from_this ();
Expand Down

0 comments on commit 7293a61

Please sign in to comment.