TinyURDF 1.0.0
A Modern C++ Library for Parsing and Visualizing URDF Model Files
Loading...
Searching...
No Matches
joint.h
Go to the documentation of this file.
1#ifndef TINYURDF_JOINT_H
2#define TINYURDF_JOINT_H
3
4// Copyright 2025 Wissem CHIHA
5
6#include <memory>
7#include <stdexcept>
8#include <string>
9#include <vector>
10
11#include <loguru/loguru.hpp>
12
13#include "joint_calibration.h"
14#include "joint_dynamics.h"
15#include "joint_limits.h"
16#include "joint_mimic.h"
17#include "joint_safety.h"
18#include "object_base.h"
19#include "pose.h"
20#include "utils.h"
21
22class Joint : public ObjectBase{
23public:
29 Joint();
30 Joint(const Joint& rhs);
31 Joint(Joint&& rhs) noexcept;
32 void clear() override;
33 bool isA(const char* name);
34 void print(std::ostream& os) override;
35 bool empty() const override;
36 const char* getTypename() override;
37 void setDynamics(const std::shared_ptr<JointDynamics> d);
38 void setLimits(const std::shared_ptr<JointLimits> l);
39 void setSafety(const std::shared_ptr<JointSafety> s);
40 void setCalibration(const std::shared_ptr<JointCalibration> c);
41 void setMimic(const std::shared_ptr<JointMimic> m);
42 void setName(const std::string& name_);
43 void setType(const Type& t_);
44 void setType(const char* c_);
45 void setAxis(double x, double y, double z);
46 std::string getName() const;
47 void pushBackChild(const std::string lk);
48 void pushBackParent(const std::string lk);
49 void pushBackTransform(const std::shared_ptr<Pose> t);
50 bool isChild(const char* name) const;
51 bool isParent(const char* name) const;
52 std::vector<std::shared_ptr<Pose>> getTransform() const;
53 Vec3 getAxis() const;
54private:
55 Type type;
56 std::string name;
57 Vec3 axis;
58 std::vector<std::string> child;
59 std::vector<std::string> parent;
60 std::vector<std::shared_ptr<Pose>> transform;
61 std::shared_ptr<JointDynamics> dynamics;
62 std::shared_ptr<JointLimits> limits;
63 std::shared_ptr<JointSafety> safety;
64 std::shared_ptr<JointCalibration> calibration;
65 std::shared_ptr<JointMimic> mimic;
66};
67#endif // TINYURDF_JOINT_H
Definition joint.h:22
std::string getName() const
Definition joint.cc:154
void print(std::ostream &os) override
Definition joint.cc:47
void setMimic(const std::shared_ptr< JointMimic > m)
Definition joint.cc:112
std::vector< std::shared_ptr< Pose > > getTransform() const
Definition joint.cc:183
void setType(const Type &t_)
Definition joint.cc:124
void clear() override
Definition joint.cc:32
void setSafety(const std::shared_ptr< JointSafety > s)
Definition joint.cc:102
void pushBackChild(const std::string lk)
Definition joint.cc:159
void setCalibration(const std::shared_ptr< JointCalibration > c)
Definition joint.cc:107
bool empty() const override
Definition joint.cc:82
Joint()
Definition joint.cc:3
bool isA(const char *name)
Definition joint.cc:42
Vec3 getAxis() const
Definition joint.cc:187
void setLimits(const std::shared_ptr< JointLimits > l)
Definition joint.cc:97
const char * getTypename() override
Definition joint.cc:87
Type
Definition joint.h:25
void setAxis(double x, double y, double z)
Definition joint.cc:149
void setName(const std::string &name_)
Definition joint.cc:117
void pushBackTransform(const std::shared_ptr< Pose > t)
Definition joint.cc:169
void pushBackParent(const std::string lk)
Definition joint.cc:164
bool isChild(const char *name) const
Definition joint.cc:173
void setDynamics(const std::shared_ptr< JointDynamics > d)
Definition joint.cc:92
bool isParent(const char *name) const
Definition joint.cc:178
Definition object_base.h:11
Eigen::Matrix< double, 3, 1 > Vec3
Definition utils.h:14