Go to the documentation of this file.
26 #ifndef TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_H
27 #define TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_H
70 using Ptr = std::shared_ptr<EnvironmentMonitor>;
71 using ConstPtr = std::shared_ptr<const EnvironmentMonitor>;
72 using UPtr = std::unique_ptr<EnvironmentMonitor>;
73 using ConstUPtr = std::unique_ptr<const EnvironmentMonitor>;
124 virtual std::shared_ptr<const Environment>
getEnvironment()
const;
150 virtual void startStateMonitor(
const std::string& joint_states_topic,
bool publish_tf =
true) = 0;
195 std::shared_ptr<tesseract_environment::Environment>
env_;
201 #endif // TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_H
EnvironmentMonitor(std::string monitor_namespace)
Constructor.
virtual bool waitForCurrentState(std::chrono::duration< double > duration=std::chrono::seconds(1))=0
Wait for robot state to become more recent than time t.
std::chrono::system_clock::duration duration
virtual double getEnvironmentPublishingFrequency() const =0
Get the maximum frequency at which environment are published (Hz)
std::unique_ptr< EnvironmentMonitor > UPtr
virtual void stopStateMonitor()=0
Stop the state monitor.
Tesseract Environment Monitor Interface Class.
virtual void stopMonitoringEnvironment()=0
Stop monitoring the external environment.
virtual void updateEnvironmentWithCurrentState()=0
Update the scene using the monitored state. This function is automatically called when an update to t...
std::shared_ptr< EnvironmentMonitor > Ptr
virtual void setStateUpdateFrequency(double hz=10)=0
Update the scene using the monitored state at a specified frequency, in Hz. This function has an effe...
virtual void startPublishingEnvironment()=0
Start publishing the maintained environment.
virtual ~EnvironmentMonitor()=default
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
std::string monitor_namespace_
virtual void shutdown()=0
Shutdown advertised services.
virtual const std::string & getNamespace() const
Get the namespace of this monitor.
virtual std::shared_ptr< Environment > getEnvironment()
Returns an threadsafe shared pointer to the current environment.
std::shared_ptr< const EnvironmentMonitor > ConstPtr
virtual double getStateUpdateFrequency() const =0
Get the maximum frequency (Hz) at which the current state of the planning scene is updated.
virtual void stopPublishingEnvironment()=0
Stop publishing the maintained environment.
virtual void setEnvironmentPublishingFrequency(double hz)=0
Set the maximum frequency at which environment are being published.
std::shared_ptr< tesseract_environment::Environment > env_
@ DEFAULT
The default behavior when monitoring another environment is the following.
virtual void startStateMonitor(const std::string &joint_states_topic, bool publish_tf=true)=0
Start the current state monitor.
virtual void startMonitoringEnvironment(const std::string &monitored_namespace, MonitoredEnvironmentMode mode=MonitoredEnvironmentMode::DEFAULT)=0
Start the monitoring of an environment topic.
virtual bool waitForConnection(std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0
Wait for connection to upstream environment.
virtual Environment & environment()
Returns an threadsafe reference to the current environment.
EnvironmentMonitor & operator=(const EnvironmentMonitor &)=default
MonitoredEnvironmentMode mode_
@ SYNCHRONIZED
The synchronized behavior when monitoring another environment is the following.
std::unique_ptr< const EnvironmentMonitor > ConstUPtr