Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
add_link_command.h
Go to the documentation of this file.
1
26#ifndef TESSERACT_ENVIRONMENT_ADD_LINK_COMMAND_H
27#define TESSERACT_ENVIRONMENT_ADD_LINK_COMMAND_H
28
31#include <boost/serialization/access.hpp>
32#include <memory>
34
38
40{
41class AddLinkCommand : public Command
42{
43public:
44 using Ptr = std::shared_ptr<AddLinkCommand>;
45 using ConstPtr = std::shared_ptr<const AddLinkCommand>;
46
67 AddLinkCommand(const tesseract_scene_graph::Link& link, bool replace_allowed = false)
69 , link_(std::make_shared<tesseract_scene_graph::Link>(link.clone()))
70 , joint_(nullptr)
71 , replace_allowed_(replace_allowed)
72 {
73 }
74
97 bool replace_allowed = false)
99 , link_(std::make_shared<tesseract_scene_graph::Link>(link.clone()))
100 , joint_(std::make_shared<tesseract_scene_graph::Joint>(joint.clone()))
101 , replace_allowed_(replace_allowed)
102 {
103 if (joint_->child_link_name != link.getName())
104 throw std::runtime_error("AddLinkCommand: The provided joint child link name must equal the name of the provided "
105 "link.");
106
108 }
109
112 bool replaceAllowed() const { return replace_allowed_; }
113
114 bool operator==(const AddLinkCommand& rhs) const;
115 bool operator!=(const AddLinkCommand& rhs) const;
116
117private:
120 bool replace_allowed_{ false };
121
123 template <class Archive>
124 void serialize(Archive& ar, const unsigned int version); // NOLINT
125};
126} // namespace tesseract_environment
127
128#include <boost/serialization/export.hpp>
129#include <boost/serialization/tracking.hpp>
130BOOST_CLASS_EXPORT_KEY2(tesseract_environment::AddLinkCommand, "AddLinkCommand")
131
132#endif // TESSERACT_ENVIRONMENT_ADD_COMMAND_H
Definition: add_link_command.h:42
AddLinkCommand(const tesseract_scene_graph::Link &link, bool replace_allowed=false)
Adds or replace a link to the environment.
Definition: add_link_command.h:67
bool replace_allowed_
Definition: add_link_command.h:120
bool operator!=(const AddLinkCommand &rhs) const
Definition: add_link_command.cpp:49
std::shared_ptr< AddLinkCommand > Ptr
Definition: add_link_command.h:44
bool replaceAllowed() const
Definition: add_link_command.h:112
AddLinkCommand(const tesseract_scene_graph::Link &link, const tesseract_scene_graph::Joint &joint, bool replace_allowed=false)
Adds a link and joint in the environment.
Definition: add_link_command.h:95
tesseract_scene_graph::Link::ConstPtr link_
Definition: add_link_command.h:118
AddLinkCommand()
Definition: add_link_command.h:47
std::shared_ptr< const AddLinkCommand > ConstPtr
Definition: add_link_command.h:45
const tesseract_scene_graph::Link::ConstPtr & getLink() const
Definition: add_link_command.h:110
bool operator==(const AddLinkCommand &rhs) const
Definition: add_link_command.cpp:40
const tesseract_scene_graph::Joint::ConstPtr & getJoint() const
Definition: add_link_command.h:111
friend class boost::serialization::access
Definition: add_link_command.h:122
tesseract_scene_graph::Joint::ConstPtr joint_
Definition: add_link_command.h:119
void serialize(Archive &ar, const unsigned int version)
Definition: add_link_command.cpp:52
Definition: command.h:76
Definition: joint.h:281
std::shared_ptr< const Joint > ConstPtr
Definition: joint.h:286
auto clone
Definition: clone_cache_unit.cpp:126
This contains classes for recording operations applied to the environment for tracking changes....
Common Tesseract Macros.
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
Definition: command.h:39
CommandType
Definition: command.h:41
Definition: graph.h:82