26#ifndef TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_H
27#define TESSERACT_ENVIRONMENT_ENVIRONMENT_MONITOR_H
64 using Ptr = std::shared_ptr<EnvironmentMonitor>;
65 using ConstPtr = std::shared_ptr<const EnvironmentMonitor>;
66 using UPtr = std::unique_ptr<EnvironmentMonitor>;
67 using ConstUPtr = std::unique_ptr<const EnvironmentMonitor>;
124 virtual bool waitForConnection(std::chrono::duration<double> duration = std::chrono::seconds(0))
const = 0;
143 virtual void startStateMonitor(
const std::string& joint_states_topic,
bool publish_tf =
true) = 0;
Tesseract Environment Monitor Interface Class.
Definition: environment_monitor.h:62
virtual void stopStateMonitor()=0
Stop the state monitor.
EnvironmentMonitor(tesseract_environment::Environment::Ptr env, std::string monitor_namespace)
Constructor.
Definition: environment_monitor.h:80
std::string monitor_namespace_
Definition: environment_monitor.h:189
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 tesseract_environment::Environment & environment()
Returns an threadsafe reference to the current environment.
Definition: environment_monitor.h:97
virtual void stopMonitoringEnvironment()=0
Stop monitoring the external environment.
virtual const tesseract_environment::Environment & environment() const
Returns an threadsafe const reference to the current environment.
Definition: environment_monitor.h:102
MonitoredEnvironmentMode mode_
Definition: environment_monitor.h:190
virtual void startStateMonitor(const std::string &joint_states_topic, bool publish_tf=true)=0
Start the current state monitor.
std::unique_ptr< const EnvironmentMonitor > ConstUPtr
Definition: environment_monitor.h:67
virtual void stopPublishingEnvironment()=0
Stop publishing the maintained environment.
virtual const std::string & getNamespace() const
Get the namespace of this monitor.
Definition: environment_monitor.h:88
virtual void startMonitoringEnvironment(const std::string &monitored_namespace, MonitoredEnvironmentMode mode=MonitoredEnvironmentMode::DEFAULT)=0
Start the monitoring of an environment topic.
std::shared_ptr< const EnvironmentMonitor > ConstPtr
Definition: environment_monitor.h:65
virtual tesseract_environment::Environment::ConstPtr getEnvironment() const
Returns an threadsafe const shared point to the current environment.
Definition: environment_monitor.h:117
EnvironmentMonitor(std::string monitor_namespace)
Constructor.
Definition: environment_monitor.h:73
tesseract_environment::Environment::Ptr env_
Definition: environment_monitor.h:188
virtual bool waitForConnection(std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0
Wait for connection to upstream environment.
virtual bool waitForCurrentState(std::chrono::duration< double > duration=std::chrono::seconds(1))=0
Wait for robot state to become more recent than time t.
virtual void setEnvironmentPublishingFrequency(double hz)=0
Set the maximum frequency at which environment are being published.
std::shared_ptr< EnvironmentMonitor > Ptr
Definition: environment_monitor.h:64
virtual void updateEnvironmentWithCurrentState()=0
Update the scene using the monitored state. This function is automatically called when an update to t...
virtual tesseract_environment::Environment::Ptr getEnvironment()
Returns an threadsafe shared pointer to the current environment.
Definition: environment_monitor.h:111
std::unique_ptr< EnvironmentMonitor > UPtr
Definition: environment_monitor.h:66
virtual double getStateUpdateFrequency() const =0
Get the maximum frequency (Hz) at which the current state of the planning scene is updated.
virtual void startPublishingEnvironment()=0
Start publishing the maintained environment.
virtual double getEnvironmentPublishingFrequency() const =0
Get the maximum frequency at which environment are published (Hz)
virtual ~EnvironmentMonitor()=default
virtual void shutdown()=0
Shutdown advertised services.
Definition: environment.h:65
std::shared_ptr< Environment > Ptr
Definition: environment.h:71
std::shared_ptr< const Environment > ConstPtr
Definition: environment.h:72
MonitoredEnvironmentMode
Definition: environment_monitor.h:35
@ SYNCHRONIZED
The synchronized behavior when monitoring another environment is the following.
@ DEFAULT
The default behavior when monitoring another environment is the following.
auto env
Definition: tesseract_environment_cache_unit.cpp:67