Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ConcreteRobot limit functions public. #556

Merged
merged 4 commits into from
Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@

* Added Robot, Manipulator, Hand interfaces, and ConcreteRobot, ConcreteManipulator classes: [#325](https://github.com/personalrobotics/aikido/pull/325), [#392](https://github.com/personalrobotics/aikido/pull/392)
* Added Kunz timer to Robot class: [#505](https://github.com/personalrobotics/aikido/pull/505)
* Make ConcreteRobot limit functions public:
brianhou marked this conversation as resolved.
Show resolved Hide resolved
[#556](https://github.com/personalrobotics/aikido/pull/556)
brianhou marked this conversation as resolved.
Show resolved Hide resolved

* RViz

Expand Down
22 changes: 14 additions & 8 deletions include/aikido/robot/ConcreteRobot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,21 +251,27 @@ class ConcreteRobot : public Robot
void setCRRTPlannerParameters(
const util::CRRTPlannerParameters& crrtParameters);

/// Computes velocity limits from the MetaSkeleton. These should be
/// interpreted as absolute in both the positive and negative directions.
/// \param[in] metaSkeleton MetaSkeleton to compute limits for.
/// \return Symmetric velocity limits.
Eigen::VectorXd getVelocityLimits(
const dart::dynamics::MetaSkeleton& metaSkeleton) const;

/// Computes acceleration limits from the MetaSkeleton. These should be
/// interpreted as absolute in both the positive and negative directions.
/// \param[in] metaSkeleton MetaSkeleton to compute limits for.
/// \return Symmetric acceleration limits.
Eigen::VectorXd getAccelerationLimits(
const dart::dynamics::MetaSkeleton& metaSkeleton) const;

private:
// Named Configurations are read from a YAML file
using ConfigurationMap
= std::unordered_map<std::string, const Eigen::VectorXd>;

std::unique_ptr<aikido::common::RNG> cloneRNG();

/// Compute velocity limits from the MetaSkeleton
Eigen::VectorXd getVelocityLimits(
const dart::dynamics::MetaSkeleton& metaSkeleton) const;

/// Compute acceleration limits from the MetaSkeleton
Eigen::VectorXd getAccelerationLimits(
const dart::dynamics::MetaSkeleton& metaSkeleton) const;

/// If this robot belongs to another (Composite)Robot,
/// mRootRobot is the topmost robot containing this robot.
Robot* mRootRobot;
Expand Down
28 changes: 14 additions & 14 deletions src/robot/ConcreteRobot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,6 @@ void ConcreteRobot::step(const std::chrono::system_clock::time_point& timepoint)
mTrajectoryExecutor->step(timepoint);
}

//==============================================================================
Eigen::VectorXd ConcreteRobot::getVelocityLimits(
const MetaSkeleton& metaSkeleton) const
{
return getSymmetricVelocityLimits(metaSkeleton, asymmetryTolerance);
}

//==============================================================================
Eigen::VectorXd ConcreteRobot::getAccelerationLimits(
const MetaSkeleton& metaSkeleton) const
{
return getSymmetricAccelerationLimits(metaSkeleton, asymmetryTolerance);
}

// ==============================================================================
CollisionFreePtr ConcreteRobot::getSelfCollisionConstraint(
const ConstMetaSkeletonStateSpacePtr& space,
Expand Down Expand Up @@ -494,6 +480,20 @@ void ConcreteRobot::setCRRTPlannerParameters(
mCRRTParameters = crrtParameters;
}

//==============================================================================
Eigen::VectorXd ConcreteRobot::getVelocityLimits(
const MetaSkeleton& metaSkeleton) const
{
return getSymmetricVelocityLimits(metaSkeleton, asymmetryTolerance);
}

//==============================================================================
Eigen::VectorXd ConcreteRobot::getAccelerationLimits(
const MetaSkeleton& metaSkeleton) const
{
return getSymmetricAccelerationLimits(metaSkeleton, asymmetryTolerance);
}

//==============================================================================
std::unique_ptr<common::RNG> ConcreteRobot::cloneRNG()
{
Expand Down