Tesseract
Motion Planning Environment
|
Tesseract Environment Monitor Interface Class. More...
#include <environment_monitor.h>
Public Types | |
using | Ptr = std::shared_ptr< EnvironmentMonitor > |
using | ConstPtr = std::shared_ptr< const EnvironmentMonitor > |
using | UPtr = std::unique_ptr< EnvironmentMonitor > |
using | ConstUPtr = std::unique_ptr< const EnvironmentMonitor > |
Public Member Functions | |
EnvironmentMonitor (std::string monitor_namespace) | |
Constructor. More... | |
EnvironmentMonitor (tesseract_environment::Environment::Ptr env, std::string monitor_namespace) | |
Constructor. More... | |
virtual | ~EnvironmentMonitor ()=default |
virtual const std::string & | getNamespace () const |
Get the namespace of this monitor. More... | |
virtual tesseract_environment::Environment & | environment () |
Returns an threadsafe reference to the current environment. More... | |
virtual const tesseract_environment::Environment & | environment () const |
Returns an threadsafe const reference to the current environment. More... | |
virtual tesseract_environment::Environment::Ptr | getEnvironment () |
Returns an threadsafe shared pointer to the current environment. More... | |
virtual tesseract_environment::Environment::ConstPtr | getEnvironment () const |
Returns an threadsafe const shared point to the current environment. More... | |
virtual bool | waitForConnection (std::chrono::duration< double > duration=std::chrono::seconds(0)) const =0 |
Wait for connection to upstream environment. More... | |
virtual void | startPublishingEnvironment ()=0 |
Start publishing the maintained environment. More... | |
virtual void | stopPublishingEnvironment ()=0 |
Stop publishing the maintained environment. More... | |
virtual void | setEnvironmentPublishingFrequency (double hz)=0 |
Set the maximum frequency at which environment are being published. More... | |
virtual double | getEnvironmentPublishingFrequency () const =0 |
Get the maximum frequency at which environment are published (Hz) More... | |
virtual void | startStateMonitor (const std::string &joint_states_topic, bool publish_tf=true)=0 |
Start the current state monitor. More... | |
virtual void | stopStateMonitor ()=0 |
Stop the state monitor. 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 double | getStateUpdateFrequency () const =0 |
Get the maximum frequency (Hz) at which the current state of the planning scene is updated. 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 void | startMonitoringEnvironment (const std::string &monitored_namespace, MonitoredEnvironmentMode mode=MonitoredEnvironmentMode::DEFAULT)=0 |
Start the monitoring of an environment topic. More... | |
virtual void | stopMonitoringEnvironment ()=0 |
Stop monitoring the external 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 void | shutdown ()=0 |
Shutdown advertised services. More... | |
Protected Attributes | |
tesseract_environment::Environment::Ptr | env_ |
std::string | monitor_namespace_ |
MonitoredEnvironmentMode | mode_ { MonitoredEnvironmentMode::DEFAULT } |
Tesseract Environment Monitor Interface Class.
using tesseract_environment::EnvironmentMonitor::ConstPtr = std::shared_ptr<const EnvironmentMonitor> |
using tesseract_environment::EnvironmentMonitor::ConstUPtr = std::unique_ptr<const EnvironmentMonitor> |
using tesseract_environment::EnvironmentMonitor::Ptr = std::shared_ptr<EnvironmentMonitor> |
using tesseract_environment::EnvironmentMonitor::UPtr = std::unique_ptr<EnvironmentMonitor> |
|
inline |
Constructor.
monitor_namespace | A name identifying this monitor, must be unique |
|
inline |
Constructor.
env | The environment to use internal to the monitor |
monitor_namespace | A name identifying this monitor, must be unique |
|
virtualdefault |
|
inlinevirtual |
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.
|
inlinevirtual |
Returns an threadsafe const reference to the current environment.
|
inlinevirtual |
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.
|
inlinevirtual |
Returns an threadsafe const shared point to the current environment.
|
pure virtual |
Get the maximum frequency at which environment are published (Hz)
|
inlinevirtual |
Get the namespace of this monitor.
|
pure virtual |
Get the maximum frequency (Hz) at which the current state of the planning scene is updated.
|
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 |
|
protected |
|
protected |