Skip to content

Commit

Permalink
[format] Format code with clang-format-18
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Jul 6, 2024
1 parent 4a711b3 commit 500e361
Show file tree
Hide file tree
Showing 25 changed files with 160 additions and 109 deletions.
3 changes: 2 additions & 1 deletion dart/collision/CollisionDetector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class CollisionDetector : public std::enable_shared_from_this<CollisionDetector>
/// \brief Create a clone of this CollisionDetector. All the properties will
/// be copied over, but not collision objects.
virtual std::shared_ptr<CollisionDetector> cloneWithoutCollisionObjects()
const = 0;
const
= 0;

/// Return collision detection engine type as a std::string
virtual const std::string& getType() const = 0;
Expand Down
3 changes: 2 additions & 1 deletion dart/collision/CollisionFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class CollisionFilter
/// Returns true if the given two CollisionObjects should be checked by the
/// collision detector, false otherwise.
virtual bool ignoresCollision(
const CollisionObject* object1, const CollisionObject* object2) const = 0;
const CollisionObject* object1, const CollisionObject* object2) const
= 0;
};

class CompositeCollisionFilter : public CollisionFilter
Expand Down
3 changes: 2 additions & 1 deletion dart/collision/DistanceFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class CollisionObject;
struct DistanceFilter
{
virtual bool needDistance(
const CollisionObject* object1, const CollisionObject* object2) const = 0;
const CollisionObject* object1, const CollisionObject* object2) const
= 0;
};

struct BodyNodeDistanceFilter : DistanceFilter
Expand Down
10 changes: 5 additions & 5 deletions dart/common/Aspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,11 @@ class CompositeTrackingAspect : public Aspect
ClassName(const ClassName&) = delete; \
inline ClassName(const PropertiesData& properties = PropertiesData()) \
: AspectWithVersionedProperties< \
Base, \
Derived, \
PropertiesData, \
CompositeType, \
UpdatePropertiesMacro>(properties) \
Base, \
Derived, \
PropertiesData, \
CompositeType, \
UpdatePropertiesMacro>(properties) \
{ \
}

Expand Down
2 changes: 1 addition & 1 deletion dart/common/detail/Aspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace common {
template <class CompositeType>
CompositeTrackingAspect<CompositeType>::CompositeTrackingAspect()
: mComposite(
nullptr) // This will be set later when the Composite calls setComposite
nullptr) // This will be set later when the Composite calls setComposite
{
// Do nothing
}
Expand Down
6 changes: 3 additions & 3 deletions dart/common/detail/CompositeData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ struct ComposeData<CompositeType, GetData, AspectT, Remainder...>
template <typename Arg1, typename... Args>
ComposeData(const Arg1& arg1, const Args&... args)
: ComposeData(
Delegate,
static_cast<const typename ConvertIfData<Arg1>::Type&>(arg1),
args...)
Delegate,
static_cast<const typename ConvertIfData<Arg1>::Type&>(arg1),
args...)
{
// This constructor delegates
}
Expand Down
2 changes: 1 addition & 1 deletion dart/common/detail/CompositeJoiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ template <class Base1, class Base2, class... OtherBases>
template <typename... Args>
CompositeJoiner<Base1, Base2, OtherBases...>::CompositeJoiner(Args&&... args)
: CompositeJoiner<Base1, CompositeJoiner<Base2, OtherBases...>>(
std::forward<Args>(args)...)
std::forward<Args>(args)...)
{
// Do nothing
}
Expand Down
12 changes: 6 additions & 6 deletions dart/common/detail/EmbeddedAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ class EmbeddedStateAspect : public BaseT
template <typename T, typename... RemainingArgs>
EmbeddedStateAspect(const T& arg1, RemainingArgs&&... remainingArgs)
: EmbeddedStateAspect(
Delegate,
static_cast<const typename ConvertIfState<T>::type&>(arg1),
std::forward<RemainingArgs>(remainingArgs)...)
Delegate,
static_cast<const typename ConvertIfState<T>::type&>(arg1),
std::forward<RemainingArgs>(remainingArgs)...)
{
// Do nothing
}
Expand Down Expand Up @@ -302,9 +302,9 @@ class EmbeddedPropertiesAspect : public BaseT
template <typename T, typename... RemainingArgs>
EmbeddedPropertiesAspect(const T& arg1, RemainingArgs&&... remainingArgs)
: EmbeddedPropertiesAspect(
Delegate,
static_cast<const typename ConvertIfProperties<T>::type&>(arg1),
std::forward<RemainingArgs>(remainingArgs)...)
Delegate,
static_cast<const typename ConvertIfProperties<T>::type&>(arg1),
std::forward<RemainingArgs>(remainingArgs)...)
{
// Do nothing
}
Expand Down
4 changes: 2 additions & 2 deletions dart/constraint/BoxedLcpConstraintSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BoxedLcpConstraintSolver::BoxedLcpConstraintSolver(
BoxedLcpSolverPtr boxedLcpSolver,
BoxedLcpSolverPtr secondaryBoxedLcpSolver)
: BoxedLcpConstraintSolver(
std::move(boxedLcpSolver), std::move(secondaryBoxedLcpSolver))
std::move(boxedLcpSolver), std::move(secondaryBoxedLcpSolver))
{
setTimeStep(timeStep);
}
Expand All @@ -71,7 +71,7 @@ BoxedLcpConstraintSolver::BoxedLcpConstraintSolver()
BoxedLcpConstraintSolver::BoxedLcpConstraintSolver(
BoxedLcpSolverPtr boxedLcpSolver)
: BoxedLcpConstraintSolver(
std::move(boxedLcpSolver), std::make_shared<PgsBoxedLcpSolver>())
std::move(boxedLcpSolver), std::make_shared<PgsBoxedLcpSolver>())
{
// Do nothing
}
Expand Down
6 changes: 3 additions & 3 deletions dart/constraint/ContactConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ double ContactConstraint::mConstraintForceMixing = DART_CFM;
ContactConstraint::ContactConstraint(
collision::Contact& contact, double timeStep)
: ContactConstraint(
contact,
timeStep,
DefaultContactSurfaceHandler().createParams(contact, 1u))
contact,
timeStep,
DefaultContactSurfaceHandler().createParams(contact, 1u))
{
// Do nothing
}
Expand Down
10 changes: 5 additions & 5 deletions dart/dynamics/ArrowShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void constructArrowTip(
std::size_t resolution = (mesh->mNumVertices - 1) / 2;
for (std::size_t i = 0; i < resolution; ++i) {
double theta
= (double)(i) / (double)(resolution)*2 * math::constantsd::pi();
= (double)(i) / (double)(resolution) * 2 * math::constantsd::pi();

double R = properties.mRadius;
double x = R * cos(theta);
Expand Down Expand Up @@ -157,7 +157,7 @@ static void constructArrowBody(
std::size_t resolution = mesh->mNumVertices / 2;
for (std::size_t i = 0; i < resolution; ++i) {
double theta
= (double)(i) / (double)(resolution)*2 * math::constantsd::pi();
= (double)(i) / (double)(resolution) * 2 * math::constantsd::pi();

double R = properties.mRadius;
double x = R * cos(theta);
Expand Down Expand Up @@ -314,15 +314,15 @@ void ArrowShape::instantiate(std::size_t resolution)
mesh->mNormals[2 * i].Set(0.0f, 0.0f, 1.0f);

double theta
= (double)(i) / (double)(resolution)*2 * math::constantsd::pi();
= (double)(i) / (double)(resolution) * 2 * math::constantsd::pi();
mesh->mNormals[2 * i + 1].Set(cos(theta), sin(theta), 0.0f);
}
mesh->mNormals[mesh->mNumVertices - 1].Set(0.0f, 0.0f, -1.0f);

mesh = scene->mMeshes[1];
for (std::size_t i = 0; i < resolution; ++i) {
double theta
= (double)(i) / (double)(resolution)*2 * math::constantsd::pi();
= (double)(i) / (double)(resolution) * 2 * math::constantsd::pi();
mesh->mNormals[2 * i].Set(cos(theta), sin(theta), 0.0f);
mesh->mNormals[2 * i + 1].Set(cos(theta), sin(theta), 0.0f);
}
Expand All @@ -332,7 +332,7 @@ void ArrowShape::instantiate(std::size_t resolution)
mesh->mNormals[2 * i].Set(0.0f, 0.0f, -1.0f);

double theta
= (double)(i) / (double)(resolution)*2 * math::constantsd::pi();
= (double)(i) / (double)(resolution) * 2 * math::constantsd::pi();
mesh->mNormals[2 * i + 1].Set(cos(theta), sin(theta), 0.0f);
}
mesh->mNormals[mesh->mNumVertices - 1].Set(0.0f, 0.0f, 1.0f);
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/CompositeNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class CompositeNode : public CompositePropertiesNode<CompositeStateNode<Base>>
template <typename... Args>
CompositeNode(Args&&... args)
: CompositePropertiesNode<CompositeStateNode<Base>>(
std::forward<Args>(args)...)
std::forward<Args>(args)...)
{
// Do nothing
}
Expand Down
3 changes: 2 additions & 1 deletion dart/dynamics/GenericJoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ class GenericJoint

/// Fixed-size version of getRelativeJacobian(positions)
virtual JacobianMatrix getRelativeJacobianStatic(
const Vector& positions) const = 0;
const Vector& positions) const
= 0;

// Documentation inherited
const math::Jacobian getRelativeJacobianTimeDeriv() const override;
Expand Down
6 changes: 4 additions & 2 deletions dart/dynamics/HierarchicalIK.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ class HierarchicalIK : public common::Subject

/// Clone this HierarchicalIK module
virtual std::shared_ptr<HierarchicalIK> clone(
const SkeletonPtr& _newSkel) const = 0;
const SkeletonPtr& _newSkel) const
= 0;

/// This class should be inherited by optimizer::Function classes that have a
/// dependency on the HierarchicalIK module that they belong to. If you
Expand All @@ -137,7 +138,8 @@ class HierarchicalIK : public common::Subject
public:
/// Enable this function to be cloned to a new IK module.
virtual optimizer::FunctionPtr clone(
const std::shared_ptr<HierarchicalIK>& _newIK) const = 0;
const std::shared_ptr<HierarchicalIK>& _newIK) const
= 0;

/// Virtual destructor
virtual ~Function() = default;
Expand Down
8 changes: 4 additions & 4 deletions dart/dynamics/InverseKinematics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,8 @@ class InverseKinematics::ErrorMethod : public common::Subject
virtual ~ErrorMethod() = default;

/// Enable this ErrorMethod to be cloned to a new IK module.
virtual std::unique_ptr<ErrorMethod> clone(
InverseKinematics* _newIK) const = 0;
virtual std::unique_ptr<ErrorMethod> clone(InverseKinematics* _newIK) const
= 0;

/// Override this function with your implementation of the error vector
/// computation. The expectation is that the first three components of the
Expand Down Expand Up @@ -848,8 +848,8 @@ class InverseKinematics::GradientMethod : public common::Subject
virtual ~GradientMethod() = default;

/// Enable this GradientMethod to be cloned to a new IK module
virtual std::unique_ptr<GradientMethod> clone(
InverseKinematics* _newIK) const = 0;
virtual std::unique_ptr<GradientMethod> clone(InverseKinematics* _newIK) const
= 0;

/// Override this function with your implementation of the gradient
/// computation. The direction that this gradient points in should make the
Expand Down
52 changes: 32 additions & 20 deletions dart/dynamics/JacobianNode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ class JacobianNode : public virtual Frame, public Node

/// Return a generalized coordinate index from the array index
/// (< getNumDependentDofs)
virtual std::size_t getDependentGenCoordIndex(
std::size_t _arrayIndex) const = 0;
virtual std::size_t getDependentGenCoordIndex(std::size_t _arrayIndex) const
= 0;

/// Indices of the generalized coordinates which affect this JacobianNode
virtual const std::vector<std::size_t>& getDependentGenCoordIndices()
const = 0;
virtual const std::vector<std::size_t>& getDependentGenCoordIndices() const
= 0;

/// Same as getNumDependentGenCoords()
virtual std::size_t getNumDependentDofs() const = 0;
Expand All @@ -114,8 +114,8 @@ class JacobianNode : public virtual Frame, public Node
virtual const std::vector<DegreeOfFreedom*>& getDependentDofs() = 0;

/// Return a std::vector of DegreeOfFreedom pointers that this Node depends on
virtual const std::vector<const DegreeOfFreedom*>& getDependentDofs()
const = 0;
virtual const std::vector<const DegreeOfFreedom*>& getDependentDofs() const
= 0;

/// Returns a DegreeOfFreedom vector containing the dofs that form a Chain
/// leading up to this JacobianNode from the root of the Skeleton.
Expand All @@ -142,7 +142,8 @@ class JacobianNode : public virtual Frame, public Node
/// A version of getJacobian(const Eigen::Vector3d&) that lets you specify a
/// coordinate Frame to express the Jacobian in.
virtual math::Jacobian getJacobian(
const Eigen::Vector3d& _offset, const Frame* _inCoordinatesOf) const = 0;
const Eigen::Vector3d& _offset, const Frame* _inCoordinatesOf) const
= 0;

/// Return the generalized Jacobian targeting the origin of this JacobianNode.
/// The Jacobian is expressed in the World Frame.
Expand All @@ -151,24 +152,27 @@ class JacobianNode : public virtual Frame, public Node
/// Return the generalized Jacobian targeting an offset in this JacobianNode.
/// The _offset is expected in coordinates of this BodyNode Frame. The
/// Jacobian is expressed in the World Frame.
virtual math::Jacobian getWorldJacobian(
const Eigen::Vector3d& _offset) const = 0;
virtual math::Jacobian getWorldJacobian(const Eigen::Vector3d& _offset) const
= 0;

/// Return the linear Jacobian targeting the origin of this BodyNode. You can
/// specify a coordinate Frame to express the Jacobian in.
virtual math::LinearJacobian getLinearJacobian(
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// Return the generalized Jacobian targeting an offset within the Frame of
/// this BodyNode.
virtual math::LinearJacobian getLinearJacobian(
const Eigen::Vector3d& _offset,
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// Return the angular Jacobian targeting the origin of this BodyNode. You can
/// specify a coordinate Frame to express the Jacobian in.
virtual math::AngularJacobian getAngularJacobian(
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// Return the spatial time derivative of the generalized Jacobian targeting
/// the origin of this BodyNode. The Jacobian is expressed in this BodyNode's
Expand All @@ -188,7 +192,8 @@ class JacobianNode : public virtual Frame, public Node
/// getJacobianClassicDeriv(), getLinearJacobianDeriv(), or
/// getAngularJacobianDeriv() instead.
virtual math::Jacobian getJacobianSpatialDeriv(
const Frame* _inCoordinatesOf) const = 0;
const Frame* _inCoordinatesOf) const
= 0;

/// Return the spatial time derivative of the generalized Jacobian targeting
/// an offset in the Frame of this BodyNode. The Jacobian is expressed in
Expand All @@ -201,12 +206,14 @@ class JacobianNode : public virtual Frame, public Node
///
/// \sa getJacobianSpatialDeriv()
virtual math::Jacobian getJacobianSpatialDeriv(
const Eigen::Vector3d& _offset) const = 0;
const Eigen::Vector3d& _offset) const
= 0;

/// A version of getJacobianSpatialDeriv(const Eigen::Vector3d&) that allows
/// an arbitrary coordinate Frame to be specified.
virtual math::Jacobian getJacobianSpatialDeriv(
const Eigen::Vector3d& _offset, const Frame* _inCoordinatesOf) const = 0;
const Eigen::Vector3d& _offset, const Frame* _inCoordinatesOf) const
= 0;

/// Return the classical time derivative of the generalized Jacobian targeting
/// the origin of this BodyNode. The Jacobian is expressed in the World
Expand All @@ -224,7 +231,8 @@ class JacobianNode : public virtual Frame, public Node
/// classical linear and angular vectors. If you are using spatial vectors,
/// use getJacobianSpatialDeriv() instead.
virtual math::Jacobian getJacobianClassicDeriv(
const Frame* _inCoordinatesOf) const = 0;
const Frame* _inCoordinatesOf) const
= 0;

/// A version of getJacobianClassicDeriv() that can compute the Jacobian for
/// an offset within the Frame of this BodyNode. The offset must be expressed
Expand All @@ -235,7 +243,8 @@ class JacobianNode : public virtual Frame, public Node
/// use getJacobianSpatialDeriv() instead.
virtual math::Jacobian getJacobianClassicDeriv(
const Eigen::Vector3d& _offset,
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// Return the linear Jacobian (classical) time derivative, in terms of any
/// coordinate Frame.
Expand All @@ -244,7 +253,8 @@ class JacobianNode : public virtual Frame, public Node
/// classical linear vectors. If you are using spatial vectors, use
/// getJacobianSpatialDeriv() instead.
virtual math::LinearJacobian getLinearJacobianDeriv(
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// A version of getLinearJacobianDeriv() that can compute the Jacobian for
/// an offset within the Frame of this BodyNode. The offset must be expressed
Expand All @@ -255,12 +265,14 @@ class JacobianNode : public virtual Frame, public Node
/// getJacobianSpatialDeriv() instead.
virtual math::LinearJacobian getLinearJacobianDeriv(
const Eigen::Vector3d& _offset,
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// Return the angular Jacobian time derivative, in terms of any coordinate
/// Frame.
virtual math::AngularJacobian getAngularJacobianDeriv(
const Frame* _inCoordinatesOf = Frame::World()) const = 0;
const Frame* _inCoordinatesOf = Frame::World()) const
= 0;

/// \}

Expand Down
Loading

0 comments on commit 500e361

Please sign in to comment.