17#ifndef SDF_JOINTAXIS_HH_
18#define SDF_JOINTAXIS_HH_
23#include <gz/math/Vector3.hh>
24#include <gz/utils/ImplPtr.hh>
34 inline namespace SDF_VERSION_NAMESPACE {
38 struct PoseRelativeToGraph;
39 template <
typename T>
class ScopedGraph;
62 const std::string &_joint =
"",
63 const std::string &_axis =
"axis",
64 double _multiplier = 0.0,
66 double _reference = 0.0);
70 public:
void SetJoint(
const std::string &_joint);
74 public:
void SetAxis(
const std::string &_axis);
93 public:
const std::string &
Joint()
const;
97 public:
const std::string &
Axis()
const;
116 GZ_UTILS_IMPL_PTR(dataPtr)
142 public: gz::math::Vector3d
Xyz()
const;
149 const gz::math::Vector3d &_xyz);
163 public: std::optional<MimicConstraint>
Mimic()
const;
308 gz::math::Vector3d &_xyz,
309 const std::string &_resolveTo =
"")
const;
333 unsigned int _index = 0u)
const;
339 private:
void SetXmlParentName(
const std::string &_xmlParentName);
345 private:
void SetPoseRelativeToGraph(
352 GZ_UTILS_IMPL_PTR(dataPtr)
Parameters related to the axis of rotation for rotational joints, and the axis of translation for pri...
Definition: JointAxis.hh:122
sdf::ElementPtr Element() const
Get a pointer to the SDF element that was used during load.
void SetSpringReference(const double _spring)
Set the spring reference position for this joint axis.
Errors ResolveXyz(gz::math::Vector3d &_xyz, const std::string &_resolveTo="") const
Express xyz unit vector of this axis in the coordinates of another named frame.
std::optional< MimicConstraint > Mimic() const
Get the Mimic constraint parameters.
double Damping() const
Get the physical velocity dependent viscous damping coefficient of the joint axis.
sdf::ElementPtr ToElement(sdf::Errors &_errors, unsigned int _index=0u) const
Create and return an SDF element filled with data from this joint axis.
void SetFriction(const double _friction)
Set the physical static friction value of the joint.
void SetXyzExpressedIn(const std::string &_frame)
Set the name of the coordinate frame in which this joint axis's unit vector is expressed.
void SetMimic(const MimicConstraint &_mimic)
Set the Mimic constraint parameters.
Errors Load(ElementPtr _sdf)
Load the joint axis based on a element pointer.
void SetStiffness(const double _stiffness)
Get the joint stop stiffness.
double Lower() const
Get the lower joint axis limit (radians for revolute joints, meters for prismatic joints).
void SetUpper(const double _upper)
Set the upper joint axis limit (radians for revolute joints, meters for prismatic joints).
void SetEffort(double _effort)
Set the value for enforcing the maximum absolute joint effort that can be applied.
JointAxis()
Default constructor.
sdf::Errors SetXyz(const gz::math::Vector3d &_xyz)
Set the x,y,z components of the axis unit vector.
void SetDissipation(const double _dissipation)
Set the joint stop dissipation.
sdf::ElementPtr ToElement(unsigned int _index=0u) const
Create and return an SDF element filled with data from this joint axis.
void SetDamping(const double _damping)
Set the physical velocity dependent viscous damping coefficient of the joint axis.
double Effort() const
Get the value for enforcing the maximum absolute joint effort that can be applied.
double Dissipation() const
Get the joint stop dissipation.
double SpringReference() const
Get the spring reference position for this joint axis.
void SetLower(const double _lower)
Set the lower joint axis limit (radians for revolute joints, meters for prismatic joints).
void SetMaxVelocity(const double _velocity)
Set the value for enforcing the maximum absolute joint velocity.
gz::math::Vector3d Xyz() const
Get the x,y,z components of the axis unit vector.
double MaxVelocity() const
Get the value for enforcing the maximum absolute joint velocity.
void SetSpringStiffness(const double _spring)
Set the spring stiffness for this joint axis.
double Stiffness() const
Get the joint stop stiffness.
double Friction() const
Get the physical static friction value of the joint.
double SpringStiffness() const
Get the spring stiffness for this joint axis.
double Upper() const
Get the upper joint axis limit (radians for revolute joints, meters for prismatic joints).
const std::string & XyzExpressedIn() const
Get the name of the coordinate frame in which this joint axis's unit vector is expressed.
Helper class to hold contents of a joint axis mimic tag, which define a Mimic constraint.
Definition: JointAxis.hh:50
double Offset() const
Retrieve the offset to the follower position in the linear constraint.
void SetMultiplier(double _multiplier)
Set the multiplier parameter, which represents the ratio between changes in the follower position rel...
const std::string & Axis() const
Retrieve the name of the leader axis, either "axis" or "axis2".
void SetReference(double _reference)
Set the reference for the leader position before applying the multiplier in the linear constraint.
double Reference() const
Retrieve the reference for the leader position before applying the multiplier in the linear constrain...
void SetOffset(double _offset)
Set the offset to the follower position in the linear constraint.
void SetJoint(const std::string &_joint)
Set the leader joint name.
double Multiplier() const
Retrieve the multiplier parameter, which represents the ratio between changes in the follower positio...
const std::string & Joint() const
Retrieve the name of the leader joint.
void SetAxis(const std::string &_axis)
Set the leader axis name, either "axis" or "axis2".
MimicConstraint(const std::string &_joint="", const std::string &_axis="axis", double _multiplier=0.0, double _offset=0.0, double _reference=0.0)
Constructor with arguments.
Definition: Collision.hh:43
std::vector< Error > Errors
A vector of Error.
Definition: Types.hh:95
std::shared_ptr< Element > ElementPtr
Definition: Element.hh:55
namespace for Simulation Description Format parser
Definition: Actor.hh:35
#define SDFORMAT_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system_util.hh:25