Skip to content

Commit

Permalink
expose base class functions of same name in derived classes (#370)
Browse files Browse the repository at this point in the history
* expose base class functions of same name in derived classes

* address JS's comments

* Update Hand.hpp

* Remove whitespace
  • Loading branch information
aditya-vk authored Apr 12, 2018
1 parent d84453a commit 42fa347
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
5 changes: 5 additions & 0 deletions include/aikido/robot/ConcreteManipulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ AIKIDO_DECLARE_POINTERS(ConcreteManipulator)
class ConcreteManipulator : public Manipulator
{
public:
// Expose base class functions
using Robot::getMetaSkeleton;
using Robot::getStateSpace;
using Manipulator::getHand;

/// Constructor.
/// \param[in] robot Robot corresponding to this manipulator.
/// \param[in] hand Hand of this manipulator.
Expand Down
4 changes: 4 additions & 0 deletions include/aikido/robot/ConcreteRobot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ AIKIDO_DECLARE_POINTERS(ConcreteRobot)
class ConcreteRobot : public Robot
{
public:
// Expose base class functions
using Robot::getMetaSkeleton;
using Robot::getStateSpace;

/// Constructor.
/// \param[in] name Name of the robot.
/// \param[in] metaSkeleton Metaskeleton of the robot.
Expand Down
5 changes: 4 additions & 1 deletion include/aikido/robot/Hand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ class Hand
virtual void step(const std::chrono::system_clock::time_point& timepoint) = 0;

/// Returns the metaskeleton corresponding to this hand.
virtual dart::dynamics::MetaSkeletonPtr getMetaSkeleton() const = 0;
virtual dart::dynamics::ConstMetaSkeletonPtr getMetaSkeleton() const = 0;

/// Returns the metaskeleton corresponding to this hand.
virtual dart::dynamics::MetaSkeletonPtr getMetaSkeleton() = 0;

/// Get the end-effector body node.
/// \return DART body node of end-effector
Expand Down
4 changes: 3 additions & 1 deletion include/aikido/robot/Manipulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ class Manipulator : public Robot
public:
virtual ~Manipulator() = default;

/// Returns the hand.
/// Returns the [const] hand.
virtual ConstHandPtr getHand() const = 0;

/// Returns the hand.
HandPtr getHand();
};

Expand Down
8 changes: 6 additions & 2 deletions include/aikido/robot/Robot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ class Robot
/// \return Name of this Robot
virtual std::string getName() const = 0;

/// \return MetaSkeleton of this robot.
/// \return [const] MetaSkeleton of this robot.
virtual dart::dynamics::ConstMetaSkeletonPtr getMetaSkeleton() const = 0;

/// \return MetaSkeleton of this robot.
dart::dynamics::MetaSkeletonPtr getMetaSkeleton();

/// \return MetaSkeletonStateSpace of this robot.
/// \return [const] MetaSkeletonStateSpace of this robot.
virtual aikido::statespace::dart::ConstMetaSkeletonStateSpacePtr
getStateSpace() const = 0;

/// \return MetaSkeletonStateSpace of this robot.
aikido::statespace::dart::MetaSkeletonStateSpacePtr getStateSpace();

/// Sets the root of this robot.
Expand Down

0 comments on commit 42fa347

Please sign in to comment.