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

Convenient functions for setting joint limits #703

Merged
merged 2 commits into from
Apr 27, 2016
Merged
Show file tree
Hide file tree
Changes from all 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
246 changes: 246 additions & 0 deletions dart/dynamics/MetaSkeleton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,27 +420,87 @@ void MetaSkeleton::setPositionLowerLimit(std::size_t _index, double _position)
this, _index, _position, "setPositionLowerLimit");
}

//==============================================================================
void MetaSkeleton::setPositionLowerLimits(const Eigen::VectorXd& positions)
{
setAllValuesFromVector<&DegreeOfFreedom::setPositionLowerLimit>(
this, positions, "setPositionLowerLimits", "positions");
}

//==============================================================================
void MetaSkeleton::setPositionLowerLimits(
const std::vector<std::size_t>& indices, const Eigen::VectorXd& positions)
{
setValuesFromVector<&DegreeOfFreedom::setPositionLowerLimit>(
this, indices, positions, "setPositionLowerLimits", "positions");
}

//==============================================================================
double MetaSkeleton::getPositionLowerLimit(std::size_t _index) const
{
return getValueFromIndex<&DegreeOfFreedom::getPositionLowerLimit>(
this, _index, "getPositionLowerLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getPositionLowerLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getPositionLowerLimit>(
this, "getPositionLowerLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getPositionLowerLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getPositionLowerLimit>(
this, indices, "getPositionLowerLimits");
}

//==============================================================================
void MetaSkeleton::setPositionUpperLimit(std::size_t _index, double _position)
{
setValueFromIndex<&DegreeOfFreedom::setPositionUpperLimit>(
this, _index, _position, "setPositionUpperLimit");
}

//==============================================================================
void MetaSkeleton::setPositionUpperLimits(const Eigen::VectorXd& positions)
{
setAllValuesFromVector<&DegreeOfFreedom::setPositionUpperLimit>(
this, positions, "setPositionUpperLimits", "positions");
}

//==============================================================================
void MetaSkeleton::setPositionUpperLimits(
const std::vector<std::size_t>& indices, const Eigen::VectorXd& positions)
{
setValuesFromVector<&DegreeOfFreedom::setPositionUpperLimit>(
this, indices, positions, "setPositionUpperLimits", "positions");
}

//==============================================================================
double MetaSkeleton::getPositionUpperLimit(std::size_t _index) const
{
return getValueFromIndex<&DegreeOfFreedom::getPositionUpperLimit>(
this, _index, "getPositionUpperLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getPositionUpperLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getPositionUpperLimit>(
this, "getPositionUpperLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getPositionUpperLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getPositionUpperLimit>(
this, indices, "getPositionUpperLimits");
}

//==============================================================================
void MetaSkeleton::setVelocity(std::size_t _index, double _velocity)
{
Expand Down Expand Up @@ -497,27 +557,87 @@ void MetaSkeleton::setVelocityLowerLimit(std::size_t _index, double _velocity)
this, _index, _velocity, "setVelocityLowerLimit");
}

//==============================================================================
void MetaSkeleton::setVelocityLowerLimits(const Eigen::VectorXd& velocities)
{
setAllValuesFromVector<&DegreeOfFreedom::setVelocityLowerLimit>(
this, velocities, "setVelocityLowerLimits", "velocities");
}

//==============================================================================
void MetaSkeleton::setVelocityLowerLimits(
const std::vector<std::size_t>& indices, const Eigen::VectorXd& velocities)
{
setValuesFromVector<&DegreeOfFreedom::setVelocityLowerLimit>(
this, indices, velocities, "setVelocityLowerLimits", "velocities");
}

//==============================================================================
double MetaSkeleton::getVelocityLowerLimit(std::size_t _index)
{
return getValueFromIndex<&DegreeOfFreedom::getVelocityLowerLimit>(
this, _index, "getVelocityLowerLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getVelocityLowerLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getVelocityLowerLimit>(
this, "getVelocityLowerLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getVelocityLowerLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getVelocityLowerLimit>(
this, indices, "getVelocityLowerLimits");
}

//==============================================================================
void MetaSkeleton::setVelocityUpperLimit(std::size_t _index, double _velocity)
{
setValueFromIndex<&DegreeOfFreedom::setVelocityUpperLimit>(
this, _index, _velocity, "setVelocityUpperLimit");
}

//==============================================================================
void MetaSkeleton::setVelocityUpperLimits(const Eigen::VectorXd& velocities)
{
setAllValuesFromVector<&DegreeOfFreedom::setVelocityUpperLimit>(
this, velocities, "setVelocityUpperLimits", "velocities");
}

//==============================================================================
void MetaSkeleton::setVelocityUpperLimits(
const std::vector<std::size_t>& indices, const Eigen::VectorXd& velocities)
{
setValuesFromVector<&DegreeOfFreedom::setVelocityUpperLimit>(
this, indices, velocities, "setVelocityUpperLimits", "velocities");
}

//==============================================================================
double MetaSkeleton::getVelocityUpperLimit(std::size_t _index)
{
return getValueFromIndex<&DegreeOfFreedom::getVelocityUpperLimit>(
this, _index, "getVelocityUpperLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getVelocityUpperLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getVelocityUpperLimit>(
this, "getVelocityUpperLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getVelocityUpperLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getVelocityUpperLimit>(
this, indices, "getVelocityUpperLimits");
}

//==============================================================================
void MetaSkeleton::setAcceleration(std::size_t _index, double _acceleration)
{
Expand Down Expand Up @@ -575,27 +695,93 @@ void MetaSkeleton::setAccelerationLowerLimit(std::size_t _index, double _acceler
this, _index, _acceleration, "setAccelerationLowerLimit");
}

//==============================================================================
void MetaSkeleton::setAccelerationLowerLimits(
const Eigen::VectorXd& accelerations)
{
setAllValuesFromVector<&DegreeOfFreedom::setAccelerationLowerLimit>(
this, accelerations, "setAccelerationLowerLimits", "accelerations");
}

//==============================================================================
void MetaSkeleton::setAccelerationLowerLimits(
const std::vector<std::size_t>& indices,
const Eigen::VectorXd& accelerations)
{
setValuesFromVector<&DegreeOfFreedom::setAccelerationLowerLimit>(
this, indices, accelerations, "setAccelerationLowerLimits",
"accelerations");
}

//==============================================================================
double MetaSkeleton::getAccelerationLowerLimit(std::size_t _index) const
{
return getValueFromIndex<&DegreeOfFreedom::getAccelerationLowerLimit>(
this, _index, "getAccelerationLowerLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getAccelerationLowerLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getAccelerationLowerLimit>(
this, "getAccelerationLowerLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getAccelerationLowerLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getAccelerationLowerLimit>(
this, indices, "getAccelerationLowerLimits");
}

//==============================================================================
void MetaSkeleton::setAccelerationUpperLimit(std::size_t _index, double _acceleration)
{
setValueFromIndex<&DegreeOfFreedom::setAccelerationUpperLimit>(
this, _index, _acceleration, "setAccelerationUpperLimit");
}

//==============================================================================
void MetaSkeleton::setAccelerationUpperLimits(
const Eigen::VectorXd& accelerations)
{
setAllValuesFromVector<&DegreeOfFreedom::setAccelerationUpperLimit>(
this, accelerations, "setAccelerationUpperLimits", "accelerations");
}

//==============================================================================
void MetaSkeleton::setAccelerationUpperLimits(
const std::vector<std::size_t>& indices,
const Eigen::VectorXd& accelerations)
{
setValuesFromVector<&DegreeOfFreedom::setAccelerationUpperLimit>(
this, indices, accelerations, "setAccelerationUpperLimits",
"accelerations");
}

//==============================================================================
double MetaSkeleton::getAccelerationUpperLimit(std::size_t _index) const
{
return getValueFromIndex<&DegreeOfFreedom::getAccelerationUpperLimit>(
this, _index, "getAccelerationUpperLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getAccelerationUpperLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getAccelerationUpperLimit>(
this, "getAccelerationUpperLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getAccelerationUpperLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getAccelerationUpperLimit>(
this, indices, "getAccelerationUpperLimits");
}

//==============================================================================
void MetaSkeleton::setForce(std::size_t _index, double _force)
{
Expand Down Expand Up @@ -654,27 +840,87 @@ void MetaSkeleton::setForceLowerLimit(std::size_t _index, double _force)
this, _index, _force, "setForceLowerLimit");
}

//==============================================================================
void MetaSkeleton::setForceLowerLimits(const Eigen::VectorXd& forces)
{
setAllValuesFromVector<&DegreeOfFreedom::setForceLowerLimit>(
this, forces, "setForceLowerLimits", "forces");
}

//==============================================================================
void MetaSkeleton::setForceLowerLimits(const std::vector<std::size_t>& indices,
const Eigen::VectorXd& forces)
{
setValuesFromVector<&DegreeOfFreedom::setForceLowerLimit>(
this, indices, forces, "setForceLowerLimits", "forces");
}

//==============================================================================
double MetaSkeleton::getForceLowerLimit(std::size_t _index) const
{
return getValueFromIndex<&DegreeOfFreedom::getForceLowerLimit>(
this, _index, "getForceLowerLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getForceLowerLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getForceLowerLimit>(
this, "getForceLowerLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getForceLowerLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getForceLowerLimit>(
this, indices, "getForceLowerLimits");
}

//==============================================================================
void MetaSkeleton::setForceUpperLimit(std::size_t _index, double _force)
{
setValueFromIndex<&DegreeOfFreedom::setForceUpperLimit>(
this, _index, _force, "setForceUpperLimit");
}

//==============================================================================
void MetaSkeleton::setForceUpperLimits(const Eigen::VectorXd& forces)
{
setAllValuesFromVector<&DegreeOfFreedom::setForceUpperLimit>(
this, forces, "setForceUpperLimits", "forces");
}

//==============================================================================
void MetaSkeleton::setForceUpperLimits(const std::vector<std::size_t>& indices,
const Eigen::VectorXd& forces)
{
setValuesFromVector<&DegreeOfFreedom::setForceUpperLimit>(
this, indices, forces, "setForceUpperLimits", "forces");
}

//==============================================================================
double MetaSkeleton::getForceUpperLimit(std::size_t _index) const
{
return getValueFromIndex<&DegreeOfFreedom::getForceUpperLimit>(
this, _index, "getForceUpperLimit");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getForceUpperLimits() const
{
return getValuesFromAllDofs<&DegreeOfFreedom::getForceUpperLimit>(
this, "getForceUpperLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getForceUpperLimits(
const std::vector<std::size_t>& indices) const
{
return getValuesFromVector<&DegreeOfFreedom::getForceUpperLimit>(
this, indices, "getForceUpperLimits");
}

//==============================================================================
Eigen::VectorXd MetaSkeleton::getVelocityChanges() const
{
Expand Down
Loading