environment_monitor_interface.h
Go to the documentation of this file.
1 
25 #ifndef TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_INTERFACE_H
26 #define TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_INTERFACE_H
27 
30 #include <vector>
31 #include <chrono>
32 #include <memory>
33 #include <unordered_map>
34 #include <Eigen/Core>
36 
39 
40 namespace tesseract_environment
41 {
42 class Command;
43 class Environment;
44 
46 {
47 public:
48  using Ptr = std::shared_ptr<EnvironmentMonitorInterface>;
49  using ConstPtr = std::shared_ptr<const EnvironmentMonitorInterface>;
50  using UPtr = std::unique_ptr<EnvironmentMonitorInterface>;
51  using ConstUPtr = std::unique_ptr<const EnvironmentMonitorInterface>;
52 
53  explicit EnvironmentMonitorInterface(std::string env_name);
54  virtual ~EnvironmentMonitorInterface() = default;
59 
65  virtual bool wait(std::chrono::duration<double> duration = std::chrono::seconds(0)) const = 0;
66 
73  virtual bool waitForNamespace(const std::string& monitor_namespace,
74  std::chrono::duration<double> duration = std::chrono::seconds(0)) const = 0;
75 
80  virtual void addNamespace(std::string monitor_namespace) = 0;
81 
86  virtual void removeNamespace(const std::string& monitor_namespace) = 0;
87 
93  virtual std::vector<std::string> applyCommand(const Command& command) const = 0;
94  virtual std::vector<std::string> applyCommands(const std::vector<std::shared_ptr<const Command>>& commands) const = 0;
95  virtual std::vector<std::string> applyCommands(const std::vector<Command>& commands) const = 0;
96 
103  virtual bool applyCommand(const std::string& monitor_namespace, const Command& command) const = 0;
104  virtual bool applyCommands(const std::string& monitor_namespace,
105  const std::vector<std::shared_ptr<const Command>>& commands) const = 0;
106  virtual bool applyCommands(const std::string& monitor_namespace, const std::vector<Command>& commands) const = 0;
107 
113  virtual tesseract_scene_graph::SceneState getEnvironmentState(const std::string& monitor_namespace) const = 0;
114 
120  virtual bool setEnvironmentState(const std::string& monitor_namespace,
121  const std::unordered_map<std::string, double>& joints,
122  const tesseract_common::TransformMap& floating_joints = {}) const = 0;
123  virtual bool setEnvironmentState(const std::string& monitor_namespace,
124  const std::vector<std::string>& joint_names,
125  const std::vector<double>& joint_values,
126  const tesseract_common::TransformMap& floating_joints = {}) const = 0;
127  virtual bool setEnvironmentState(const std::string& monitor_namespace,
128  const std::vector<std::string>& joint_names,
129  const Eigen::Ref<const Eigen::VectorXd>& joint_values,
130  const tesseract_common::TransformMap& floating_joints = {}) const = 0;
131  virtual bool setEnvironmentState(const std::string& monitor_namespace,
132  const tesseract_common::TransformMap& floating_joints) const = 0;
133 
138  virtual std::vector<std::string>
139  setEnvironmentState(const std::unordered_map<std::string, double>& joints,
140  const tesseract_common::TransformMap& floating_joints = {}) const = 0;
141  virtual std::vector<std::string>
142  setEnvironmentState(const std::vector<std::string>& joint_names,
143  const std::vector<double>& joint_values,
144  const tesseract_common::TransformMap& floating_joints = {}) const = 0;
145  virtual std::vector<std::string>
146  setEnvironmentState(const std::vector<std::string>& joint_names,
147  const Eigen::Ref<const Eigen::VectorXd>& joint_values,
148  const tesseract_common::TransformMap& floating_joints = {}) const = 0;
149  virtual std::vector<std::string>
150  setEnvironmentState(const tesseract_common::TransformMap& floating_joints = {}) const = 0;
151 
157  virtual std::unique_ptr<Environment> getEnvironment(const std::string& monitor_namespace) const = 0;
158 
159 protected:
160  std::string env_name_;
161 };
162 } // namespace tesseract_environment
163 #endif // TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_INTERFACE_H
tesseract_environment
Definition: command.h:45
duration
std::chrono::system_clock::duration duration
tesseract_environment::Command
Definition: command.h:83
tesseract_environment::EnvironmentMonitorInterface::applyCommand
virtual std::vector< std::string > applyCommand(const Command &command) const =0
Apply provided command to all monitor namespaces.
tesseract_environment::EnvironmentMonitorInterface
Definition: environment_monitor_interface.h:45
tesseract_common::TransformMap
AlignedMap< std::string, Eigen::Isometry3d > TransformMap
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
tesseract_environment::EnvironmentMonitorInterface::getEnvironment
virtual std::unique_ptr< Environment > getEnvironment(const std::string &monitor_namespace) const =0
Pull information from the environment in the provided namespace and create a Environment Object.
tesseract_scene_graph::SceneState
tesseract_environment::EnvironmentMonitorInterface::env_name_
std::string env_name_
Definition: environment_monitor_interface.h:160
tesseract_environment::EnvironmentMonitorInterface::removeNamespace
virtual void removeNamespace(const std::string &monitor_namespace)=0
Remove monitor namespace from interface.
tesseract_environment::EnvironmentMonitorInterface::ConstPtr
std::shared_ptr< const EnvironmentMonitorInterface > ConstPtr
Definition: environment_monitor_interface.h:49
tesseract_environment::EnvironmentMonitorInterface::applyCommands
virtual std::vector< std::string > applyCommands(const std::vector< std::shared_ptr< const Command >> &commands) const =0
tesseract_environment::EnvironmentMonitorInterface::waitForNamespace
virtual bool waitForNamespace(const std::string &monitor_namespace, std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0
This will wait for a given namespace to begin publishing.
TESSERACT_COMMON_IGNORE_WARNINGS_POP
tesseract_environment::EnvironmentMonitorInterface::Ptr
std::shared_ptr< EnvironmentMonitorInterface > Ptr
Definition: environment_monitor_interface.h:48
tesseract_environment::EnvironmentMonitorInterface::EnvironmentMonitorInterface
EnvironmentMonitorInterface(std::string env_name)
Definition: environment_monitor_interface.cpp:30
fwd.h
eigen_types.h
tesseract_environment::EnvironmentMonitorInterface::getEnvironmentState
virtual tesseract_scene_graph::SceneState getEnvironmentState(const std::string &monitor_namespace) const =0
Pull current environment state from the environment in the provided namespace.
tesseract_environment::EnvironmentMonitorInterface::UPtr
std::unique_ptr< EnvironmentMonitorInterface > UPtr
Definition: environment_monitor_interface.h:50
tesseract_environment::EnvironmentMonitorInterface::operator=
EnvironmentMonitorInterface & operator=(const EnvironmentMonitorInterface &)=default
tesseract_environment::EnvironmentMonitorInterface::wait
virtual bool wait(std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0
This will wait for all namespaces to begin publishing.
tesseract_environment::EnvironmentMonitorInterface::~EnvironmentMonitorInterface
virtual ~EnvironmentMonitorInterface()=default
tesseract_environment::EnvironmentMonitorInterface::setEnvironmentState
virtual bool setEnvironmentState(const std::string &monitor_namespace, const std::unordered_map< std::string, double > &joints, const tesseract_common::TransformMap &floating_joints={}) const =0
Set environments state in the provided namespace.
tesseract_environment::EnvironmentMonitorInterface::addNamespace
virtual void addNamespace(std::string monitor_namespace)=0
Add monitor namespace to interface.
tesseract_environment::EnvironmentMonitorInterface::ConstUPtr
std::unique_ptr< const EnvironmentMonitorInterface > ConstUPtr
Definition: environment_monitor_interface.h:51
macros.h


tesseract_environment
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:21