Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
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>
33
36
38{
40{
41public:
42 using Ptr = std::shared_ptr<EnvironmentMonitorInterface>;
43 using ConstPtr = std::shared_ptr<const EnvironmentMonitorInterface>;
44 using UPtr = std::unique_ptr<EnvironmentMonitorInterface>;
45 using ConstUPtr = std::unique_ptr<const EnvironmentMonitorInterface>;
46
47 EnvironmentMonitorInterface(std::string env_name) : env_name_(std::move(env_name)) {}
48
49 virtual ~EnvironmentMonitorInterface() = default;
50
56 virtual bool wait(std::chrono::duration<double> duration = std::chrono::seconds(0)) const = 0;
57
64 virtual bool waitForNamespace(const std::string& monitor_namespace,
65 std::chrono::duration<double> duration = std::chrono::seconds(0)) const = 0;
66
71 virtual void addNamespace(std::string monitor_namespace) = 0;
72
77 virtual void removeNamespace(const std::string& monitor_namespace) = 0;
78
84 virtual std::vector<std::string> applyCommand(const tesseract_environment::Command& command) const = 0;
85 virtual std::vector<std::string> applyCommands(const tesseract_environment::Commands& commands) const = 0;
86 virtual std::vector<std::string> applyCommands(const std::vector<tesseract_environment::Command>& commands) const = 0;
87
94 virtual bool applyCommand(const std::string& monitor_namespace,
95 const tesseract_environment::Command& command) const = 0;
96 virtual bool applyCommands(const std::string& monitor_namespace,
97 const tesseract_environment::Commands& commands) const = 0;
98 virtual bool applyCommands(const std::string& monitor_namespace,
99 const std::vector<tesseract_environment::Command>& commands) const = 0;
100
106 virtual tesseract_scene_graph::SceneState getEnvironmentState(const std::string& monitor_namespace) const = 0;
107
113 virtual bool setEnvironmentState(const std::string& monitor_namespace,
114 const std::unordered_map<std::string, double>& joints) const = 0;
115 virtual bool setEnvironmentState(const std::string& monitor_namespace,
116 const std::vector<std::string>& joint_names,
117 const std::vector<double>& joint_values) const = 0;
118 virtual bool setEnvironmentState(const std::string& monitor_namespace,
119 const std::vector<std::string>& joint_names,
120 const Eigen::Ref<const Eigen::VectorXd>& joint_values) const = 0;
121
126 virtual std::vector<std::string> setEnvironmentState(const std::unordered_map<std::string, double>& joints) const = 0;
127 virtual std::vector<std::string> setEnvironmentState(const std::vector<std::string>& joint_names,
128 const std::vector<double>& joint_values) const = 0;
129 virtual std::vector<std::string> setEnvironmentState(const std::vector<std::string>& joint_names,
130 const Eigen::Ref<const Eigen::VectorXd>& joint_values) const = 0;
131
137 virtual tesseract_environment::Environment::UPtr getEnvironment(const std::string& monitor_namespace) const = 0;
138
139protected:
140 std::string env_name_;
141};
142} // namespace tesseract_environment
143#endif // TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_INTERFACE_H
Definition: command.h:76
Definition: environment_monitor_interface.h:40
virtual std::vector< std::string > setEnvironmentState(const std::vector< std::string > &joint_names, const Eigen::Ref< const Eigen::VectorXd > &joint_values) const =0
virtual void removeNamespace(const std::string &monitor_namespace)=0
Remove monitor namespace from interface.
EnvironmentMonitorInterface(std::string env_name)
Definition: environment_monitor_interface.h:47
virtual std::vector< std::string > applyCommands(const tesseract_environment::Commands &commands) const =0
std::shared_ptr< EnvironmentMonitorInterface > Ptr
Definition: environment_monitor_interface.h:42
virtual bool setEnvironmentState(const std::string &monitor_namespace, const std::vector< std::string > &joint_names, const Eigen::Ref< const Eigen::VectorXd > &joint_values) const =0
virtual bool applyCommands(const std::string &monitor_namespace, const std::vector< tesseract_environment::Command > &commands) const =0
virtual tesseract_scene_graph::SceneState getEnvironmentState(const std::string &monitor_namespace) const =0
Pull current environment state from the environment in the provided namespace.
std::string env_name_
Definition: environment_monitor_interface.h:140
virtual bool applyCommands(const std::string &monitor_namespace, const tesseract_environment::Commands &commands) const =0
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.
std::shared_ptr< const EnvironmentMonitorInterface > ConstPtr
Definition: environment_monitor_interface.h:43
std::unique_ptr< EnvironmentMonitorInterface > UPtr
Definition: environment_monitor_interface.h:44
virtual bool setEnvironmentState(const std::string &monitor_namespace, const std::vector< std::string > &joint_names, const std::vector< double > &joint_values) const =0
virtual std::vector< std::string > setEnvironmentState(const std::vector< std::string > &joint_names, const std::vector< double > &joint_values) const =0
virtual bool setEnvironmentState(const std::string &monitor_namespace, const std::unordered_map< std::string, double > &joints) const =0
Set environments state in the provided namespace.
virtual bool wait(std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0
This will wait for all namespaces to begin publishing.
virtual bool applyCommand(const std::string &monitor_namespace, const tesseract_environment::Command &command) const =0
Apply provided command to only the provided namespace. The namespace does not have to be one that is ...
std::unique_ptr< const EnvironmentMonitorInterface > ConstUPtr
Definition: environment_monitor_interface.h:45
virtual std::vector< std::string > applyCommands(const std::vector< tesseract_environment::Command > &commands) const =0
virtual std::vector< std::string > setEnvironmentState(const std::unordered_map< std::string, double > &joints) const =0
Set environment state for all monitor namespaces.
virtual void addNamespace(std::string monitor_namespace)=0
Add monitor namespace to interface.
virtual std::vector< std::string > applyCommand(const tesseract_environment::Command &command) const =0
Apply provided command to all monitor namespaces.
virtual tesseract_environment::Environment::UPtr getEnvironment(const std::string &monitor_namespace) const =0
Pull information from the environment in the provided namespace and create a Environment Object.
std::unique_ptr< Environment > UPtr
Definition: environment.h:73
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
std::vector< Command::ConstPtr > Commands
Definition: command.h:101
This holds a state of the scene.
Definition: scene_state.h:54
joint_state joint_names
Definition: tesseract_common_serialization_unit.cpp:75
object joints["j_1"]
Definition: tesseract_scene_graph_serialization_unit.cpp:224