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

Added getType and getStaticType functions to Joint #392

Merged
merged 3 commits into from
May 27, 2015
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
13 changes: 13 additions & 0 deletions dart/dynamics/BallJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ BallJoint::~BallJoint()
// Do nothing
}

//==============================================================================
const std::string& BallJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& BallJoint::getStaticType()
{
static const std::string name = "BallJoint";
return name;
}

//==============================================================================
BallJoint::Properties BallJoint::getBallJointProperties() const
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/BallJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ class BallJoint : public MultiDofJoint<3>
/// Destructor
virtual ~BallJoint();

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

/// Get the Properties of this BallJoint
Properties getBallJointProperties() const;

Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/EulerJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,19 @@ EulerJoint& EulerJoint::operator=(const EulerJoint& _otherJoint)
return *this;
}

//==============================================================================
const std::string& EulerJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& EulerJoint::getStaticType()
{
static const std::string name = "EulerJoint";
return name;
}

//==============================================================================
void EulerJoint::setAxisOrder(EulerJoint::AxisOrder _order, bool _renameDofs)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/EulerJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ class EulerJoint : public MultiDofJoint<3>
/// Same as copy(const EulerJoint&)
EulerJoint& operator=(const EulerJoint& _otherJoint);

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

/// Set the axis order
/// \param[in] _order Axis order
/// \param[in] _renameDofs If true, the names of dofs in this joint will be
Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/FreeJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ Joint* FreeJoint::clone() const
return new FreeJoint(getFreeJointProperties());
}

//==============================================================================
const std::string& FreeJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& FreeJoint::getStaticType()
{
static const std::string name = "FreeJoint";
return name;
}

//==============================================================================
void FreeJoint::integratePositions(double _dt)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/FreeJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class FreeJoint : public MultiDofJoint<6>
/// Get the Properties of this FreeJoint
Properties getFreeJointProperties() const;

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

/// Convert a transform into a 6D vector that can be used to set the positions
/// of a FreeJoint. The positions returned by this function will result in a
/// relative transform of
Expand Down
3 changes: 3 additions & 0 deletions dart/dynamics/Joint.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@ class Joint : public virtual common::Subject
/// Get joint name
const std::string& getName() const;

/// Gets a string representing the joint type
virtual const std::string& getType() const = 0;

/// Set actuator type
void setActuatorType(ActuatorType _actuatorType);

Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/PlanarJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,19 @@ PlanarJoint& PlanarJoint::operator=(const PlanarJoint& _otherJoint)
return *this;
}

//==============================================================================
const std::string& PlanarJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& PlanarJoint::getStaticType()
{
static const std::string name = "PlanarJoint";
return name;
}

//==============================================================================
void PlanarJoint::setXYPlane(bool _renameDofs)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/PlanarJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ class PlanarJoint : public MultiDofJoint<3>
/// Same as copy(const PlanarJoint&)
PlanarJoint& operator=(const PlanarJoint& _otherJoint);

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

/// \brief Set plane type as XY-plane
/// \param[in] _renameDofs If true, the names of dofs in this joint will be
/// renmaed according to the plane type.
Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/PrismaticJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ PrismaticJoint& PrismaticJoint::operator=(const PrismaticJoint& _otherJoint)
return *this;
}

//==============================================================================
const std::string& PrismaticJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& PrismaticJoint::getStaticType()
{
static const std::string name = "PrismaticJoint";
return name;
}

//==============================================================================
void PrismaticJoint::setAxis(const Eigen::Vector3d& _axis)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/PrismaticJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ class PrismaticJoint : public SingleDofJoint

/// Same as copy(const PrismaticJoint&)
PrismaticJoint& operator=(const PrismaticJoint& _otherJoint);

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

///
void setAxis(const Eigen::Vector3d& _axis);
Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/RevoluteJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@ RevoluteJoint& RevoluteJoint::operator=(const RevoluteJoint& _otherJoint)
return *this;
}

//==============================================================================
const std::string& RevoluteJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& RevoluteJoint::getStaticType()
{
static const std::string name = "RevoluteJoint";
return name;
}

//==============================================================================
void RevoluteJoint::setAxis(const Eigen::Vector3d& _axis)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/RevoluteJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ class RevoluteJoint : public SingleDofJoint
/// Copy the Properties of another RevoluteJoint
RevoluteJoint& operator=(const RevoluteJoint& _otherJoint);

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

///
void setAxis(const Eigen::Vector3d& _axis);

Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/ScrewJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,19 @@ ScrewJoint& ScrewJoint::operator=(const ScrewJoint& _otherJoint)
return *this;
}

//==============================================================================
const std::string& ScrewJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& ScrewJoint::getStaticType()
{
static const std::string name = "ScrewJoint";
return name;
}

//==============================================================================
void ScrewJoint::setAxis(const Eigen::Vector3d& _axis)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/ScrewJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ class ScrewJoint : public SingleDofJoint
/// Copy the Properties of another ScrewJoint
ScrewJoint& operator=(const ScrewJoint& _otherJoint);

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

///
void setAxis(const Eigen::Vector3d& _axis);

Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/TranslationalJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ Joint* TranslationalJoint::clone() const
return new TranslationalJoint(getTranslationalJointProperties());
}

//==============================================================================
const std::string& TranslationalJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& TranslationalJoint::getStaticType()
{
static const std::string name = "TranslationalJoint";
return name;
}

//==============================================================================
void TranslationalJoint::updateDegreeOfFreedomNames()
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/TranslationalJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class TranslationalJoint : public MultiDofJoint<3>
/// Get the Properties of this TranslationalJoint
Properties getTranslationalJointProperties() const;

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

protected:

/// Constructor called by Skeleton class
Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/UniversalJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,19 @@ UniversalJoint& UniversalJoint::operator=(const UniversalJoint& _otherJoint)
return *this;
}

//==============================================================================
const std::string& UniversalJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& UniversalJoint::getStaticType()
{
static const std::string name = "UniversalJoint";
return name;
}

//==============================================================================
void UniversalJoint::setAxis1(const Eigen::Vector3d& _axis)
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/UniversalJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ class UniversalJoint : public MultiDofJoint<2>
/// Copy the Properties of another UniversalJoint
UniversalJoint& operator=(const UniversalJoint& _otherJoint);

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

///
void setAxis1(const Eigen::Vector3d& _axis);

Expand Down
13 changes: 13 additions & 0 deletions dart/dynamics/WeldJoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ WeldJoint::~WeldJoint()
// Do nothing
}

//==============================================================================
const std::string& WeldJoint::getType() const
{
return getStaticType();
}

//==============================================================================
const std::string& WeldJoint::getStaticType()
{
static const std::string name = "WeldJoint";
return name;
}

//==============================================================================
WeldJoint::Properties WeldJoint::getWeldJointProperties() const
{
Expand Down
6 changes: 6 additions & 0 deletions dart/dynamics/WeldJoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ class WeldJoint : public ZeroDofJoint
/// Get the Properties of this WeldJoint
Properties getWeldJointProperties() const;

// Documentation inherited
virtual const std::string& getType() const override;

/// Get joint type for this class
static const std::string& getStaticType();

// Documentation inherited
virtual void setTransformFromParentBodyNode(const Eigen::Isometry3d& _T) override;

Expand Down