Tesseract Environment Monitor Interface Class. More...
#include <environment_monitor.h>
Public Types | |
using | ConstPtr = std::shared_ptr< const EnvironmentMonitor > |
using | ConstUPtr = std::unique_ptr< const EnvironmentMonitor > |
using | Ptr = std::shared_ptr< EnvironmentMonitor > |
using | UPtr = std::unique_ptr< EnvironmentMonitor > |
Public Member Functions | |
virtual Environment & | environment () |
Returns an threadsafe reference to the current environment. More... | |
virtual const Environment & | environment () const |
Returns an threadsafe const reference to the current environment. More... | |
EnvironmentMonitor (const EnvironmentMonitor &)=default | |
EnvironmentMonitor (EnvironmentMonitor &&)=default | |
EnvironmentMonitor (std::shared_ptr< Environment > env, std::string monitor_namespace) | |
Constructor. More... | |
EnvironmentMonitor (std::string monitor_namespace) | |
Constructor. More... | |
virtual std::shared_ptr< Environment > | getEnvironment () |
Returns an threadsafe shared pointer to the current environment. More... | |
virtual std::shared_ptr< const Environment > | getEnvironment () const |
Returns an threadsafe const shared point to the current environment. More... | |
virtual double | getEnvironmentPublishingFrequency () const =0 |
Get the maximum frequency at which environment are published (Hz) More... | |
virtual const std::string & | getNamespace () const |
Get the namespace of this monitor. More... | |
virtual double | getStateUpdateFrequency () const =0 |
Get the maximum frequency (Hz) at which the current state of the planning scene is updated. More... | |
EnvironmentMonitor & | operator= (const EnvironmentMonitor &)=default |
EnvironmentMonitor & | operator= (EnvironmentMonitor &&)=default |
virtual void | setEnvironmentPublishingFrequency (double hz)=0 |
Set the maximum frequency at which environment are being published. More... | |
virtual void | setStateUpdateFrequency (double hz=10)=0 |
Update the scene using the monitored state at a specified frequency, in Hz. This function has an effect only when updates from the CurrentStateMonitor are received at a higher frequency. In that case, the updates are throttled down, so that they do not exceed a maximum update frequency specified here. More... | |
virtual void | shutdown ()=0 |
Shutdown advertised services. More... | |
virtual void | startMonitoringEnvironment (const std::string &monitored_namespace, MonitoredEnvironmentMode mode=MonitoredEnvironmentMode::DEFAULT)=0 |
Start the monitoring of an environment topic. More... | |
virtual void | startPublishingEnvironment ()=0 |
Start publishing the maintained environment. More... | |
virtual void | startStateMonitor (const std::string &joint_states_topic, bool publish_tf=true)=0 |
Start the current state monitor. More... | |
virtual void | stopMonitoringEnvironment ()=0 |
Stop monitoring the external environment. More... | |
virtual void | stopPublishingEnvironment ()=0 |
Stop publishing the maintained environment. More... | |
virtual void | stopStateMonitor ()=0 |
Stop the state monitor. More... | |
virtual void | updateEnvironmentWithCurrentState ()=0 |
Update the scene using the monitored state. This function is automatically called when an update to the current state is received (if startStateMonitor() has been called). The updates are throttled to a maximum update frequency however, which is set by setStateUpdateFrequency(). More... | |
virtual bool | waitForConnection (std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0 |
Wait for connection to upstream environment. More... | |
virtual bool | waitForCurrentState (std::chrono::duration< double > duration=std::chrono::seconds(1))=0 |
Wait for robot state to become more recent than time t. More... | |
virtual | ~EnvironmentMonitor ()=default |
Protected Attributes | |
std::shared_ptr< tesseract_environment::Environment > | env_ |
MonitoredEnvironmentMode | mode_ { MonitoredEnvironmentMode::DEFAULT } |
std::string | monitor_namespace_ |
Tesseract Environment Monitor Interface Class.
Definition at line 67 of file environment_monitor.h.
using tesseract_environment::EnvironmentMonitor::ConstPtr = std::shared_ptr<const EnvironmentMonitor> |
Definition at line 71 of file environment_monitor.h.
using tesseract_environment::EnvironmentMonitor::ConstUPtr = std::unique_ptr<const EnvironmentMonitor> |
Definition at line 73 of file environment_monitor.h.
using tesseract_environment::EnvironmentMonitor::Ptr = std::shared_ptr<EnvironmentMonitor> |
Definition at line 70 of file environment_monitor.h.
using tesseract_environment::EnvironmentMonitor::UPtr = std::unique_ptr<EnvironmentMonitor> |
Definition at line 72 of file environment_monitor.h.
tesseract_environment::EnvironmentMonitor::EnvironmentMonitor | ( | std::string | monitor_namespace | ) |
Constructor.
monitor_namespace | A name identifying this monitor, must be unique |
Definition at line 35 of file environment_monitor.cpp.
tesseract_environment::EnvironmentMonitor::EnvironmentMonitor | ( | std::shared_ptr< Environment > | env, |
std::string | monitor_namespace | ||
) |
Constructor.
env | The environment to use internal to the monitor |
monitor_namespace | A name identifying this monitor, must be unique |
Definition at line 39 of file environment_monitor.cpp.
|
virtualdefault |
|
default |
|
default |
|
virtual |
Returns an threadsafe reference to the current environment.
Modification should only be made if this monitor is the master. If this is monitoring another environment the local changes will get removed on the next update cycle. Recommend using the TesseractMonitorInterface to apply commands to the monitored environment until the todo below is implemented.
Definition at line 46 of file environment_monitor.cpp.
|
virtual |
Returns an threadsafe const reference to the current environment.
|
virtual |
Returns an threadsafe shared pointer to the current environment.
Modification should only be made if this monitor is the master. If this is monitoring another environment the local changes will get removed on the next update cycle. Recommend using the TesseractMonitorInterface to apply commands to the monitored environment until the todo below is implemented.
Definition at line 50 of file environment_monitor.cpp.
|
virtual |
Returns an threadsafe const shared point to the current environment.
|
pure virtual |
Get the maximum frequency at which environment are published (Hz)
|
virtual |
Get the namespace of this monitor.
Definition at line 44 of file environment_monitor.cpp.
|
pure virtual |
Get the maximum frequency (Hz) at which the current state of the planning scene is updated.
|
default |
|
default |
|
pure virtual |
Set the maximum frequency at which environment are being published.
|
pure virtual |
Update the scene using the monitored state at a specified frequency, in Hz. This function has an effect only when updates from the CurrentStateMonitor are received at a higher frequency. In that case, the updates are throttled down, so that they do not exceed a maximum update frequency specified here.
hz | the update frequency. By default this is 10Hz. |
|
pure virtual |
Shutdown advertised services.
|
pure virtual |
Start the monitoring of an environment topic.
monitored_namespace | The namespace of the environment to monitor |
|
pure virtual |
Start publishing the maintained environment.
|
pure virtual |
Start the current state monitor.
joint_states_topic | the topic to listen to for joint states |
publish_tf | If true, TFs will be published for each joint. Default: true |
|
pure virtual |
Stop monitoring the external environment.
|
pure virtual |
Stop publishing the maintained environment.
|
pure virtual |
Stop the state monitor.
|
pure virtual |
Update the scene using the monitored state. This function is automatically called when an update to the current state is received (if startStateMonitor() has been called). The updates are throttled to a maximum update frequency however, which is set by setStateUpdateFrequency().
|
pure virtual |
Wait for connection to upstream environment.
duration | The time to wait in seconds before returning, if zero it waits indefinitely |
|
pure virtual |
Wait for robot state to become more recent than time t.
duration | The time to wait in seconds |
If there is no state monitor active, there will be no scene updates. Hence, you can specify a timeout to wait for those updates. Default is 1s.
|
protected |
Definition at line 195 of file environment_monitor.h.
|
protected |
Definition at line 197 of file environment_monitor.h.
|
protected |
Definition at line 196 of file environment_monitor.h.