Public Types | Public Member Functions | Protected Attributes | List of all members
tesseract_environment::EnvironmentMonitor Class Referenceabstract

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 Environmentenvironment ()
 Returns an threadsafe reference to the current environment. More...
 
virtual const Environmentenvironment () 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< EnvironmentgetEnvironment ()
 Returns an threadsafe shared pointer to the current environment. More...
 
virtual std::shared_ptr< const EnvironmentgetEnvironment () 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...
 
EnvironmentMonitoroperator= (const EnvironmentMonitor &)=default
 
EnvironmentMonitoroperator= (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::Environmentenv_
 
MonitoredEnvironmentMode mode_ { MonitoredEnvironmentMode::DEFAULT }
 
std::string monitor_namespace_
 

Detailed Description

Tesseract Environment Monitor Interface Class.

Definition at line 67 of file environment_monitor.h.

Member Typedef Documentation

◆ ConstPtr

Definition at line 71 of file environment_monitor.h.

◆ ConstUPtr

Definition at line 73 of file environment_monitor.h.

◆ Ptr

Definition at line 70 of file environment_monitor.h.

◆ UPtr

Definition at line 72 of file environment_monitor.h.

Constructor & Destructor Documentation

◆ EnvironmentMonitor() [1/4]

tesseract_environment::EnvironmentMonitor::EnvironmentMonitor ( std::string  monitor_namespace)

Constructor.

Parameters
monitor_namespaceA name identifying this monitor, must be unique

Definition at line 35 of file environment_monitor.cpp.

◆ EnvironmentMonitor() [2/4]

tesseract_environment::EnvironmentMonitor::EnvironmentMonitor ( std::shared_ptr< Environment env,
std::string  monitor_namespace 
)

Constructor.

Parameters
envThe environment to use internal to the monitor
monitor_namespaceA name identifying this monitor, must be unique

Definition at line 39 of file environment_monitor.cpp.

◆ ~EnvironmentMonitor()

virtual tesseract_environment::EnvironmentMonitor::~EnvironmentMonitor ( )
virtualdefault

◆ EnvironmentMonitor() [3/4]

tesseract_environment::EnvironmentMonitor::EnvironmentMonitor ( const EnvironmentMonitor )
default

◆ EnvironmentMonitor() [4/4]

tesseract_environment::EnvironmentMonitor::EnvironmentMonitor ( EnvironmentMonitor &&  )
default

Member Function Documentation

◆ environment() [1/2]

const Environment & tesseract_environment::EnvironmentMonitor::environment ( )
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.

Returns
The current environment.

Definition at line 46 of file environment_monitor.cpp.

◆ environment() [2/2]

virtual const Environment& tesseract_environment::EnvironmentMonitor::environment ( ) const
virtual

Returns an threadsafe const reference to the current environment.

Returns
The current environment.

◆ getEnvironment() [1/2]

std::shared_ptr< const Environment > tesseract_environment::EnvironmentMonitor::getEnvironment ( )
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.

Returns
The current environment.

Definition at line 50 of file environment_monitor.cpp.

◆ getEnvironment() [2/2]

virtual std::shared_ptr<const Environment> tesseract_environment::EnvironmentMonitor::getEnvironment ( ) const
virtual

Returns an threadsafe const shared point to the current environment.

Returns
The current environment.

◆ getEnvironmentPublishingFrequency()

virtual double tesseract_environment::EnvironmentMonitor::getEnvironmentPublishingFrequency ( ) const
pure virtual

Get the maximum frequency at which environment are published (Hz)

◆ getNamespace()

const std::string & tesseract_environment::EnvironmentMonitor::getNamespace ( ) const
virtual

Get the namespace of this monitor.

Definition at line 44 of file environment_monitor.cpp.

◆ getStateUpdateFrequency()

virtual double tesseract_environment::EnvironmentMonitor::getStateUpdateFrequency ( ) const
pure virtual

Get the maximum frequency (Hz) at which the current state of the planning scene is updated.

◆ operator=() [1/2]

EnvironmentMonitor& tesseract_environment::EnvironmentMonitor::operator= ( const EnvironmentMonitor )
default

◆ operator=() [2/2]

EnvironmentMonitor& tesseract_environment::EnvironmentMonitor::operator= ( EnvironmentMonitor &&  )
default

◆ setEnvironmentPublishingFrequency()

virtual void tesseract_environment::EnvironmentMonitor::setEnvironmentPublishingFrequency ( double  hz)
pure virtual

Set the maximum frequency at which environment are being published.

◆ setStateUpdateFrequency()

virtual void tesseract_environment::EnvironmentMonitor::setStateUpdateFrequency ( double  hz = 10)
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.

Parameters
hzthe update frequency. By default this is 10Hz.

◆ shutdown()

virtual void tesseract_environment::EnvironmentMonitor::shutdown ( )
pure virtual

Shutdown advertised services.

◆ startMonitoringEnvironment()

virtual void tesseract_environment::EnvironmentMonitor::startMonitoringEnvironment ( const std::string &  monitored_namespace,
MonitoredEnvironmentMode  mode = MonitoredEnvironmentMode::DEFAULT 
)
pure virtual

Start the monitoring of an environment topic.

Parameters
monitored_namespaceThe namespace of the environment to monitor

◆ startPublishingEnvironment()

virtual void tesseract_environment::EnvironmentMonitor::startPublishingEnvironment ( )
pure virtual

Start publishing the maintained environment.

◆ startStateMonitor()

virtual void tesseract_environment::EnvironmentMonitor::startStateMonitor ( const std::string &  joint_states_topic,
bool  publish_tf = true 
)
pure virtual

Start the current state monitor.

Parameters
joint_states_topicthe topic to listen to for joint states
publish_tfIf true, TFs will be published for each joint. Default: true

◆ stopMonitoringEnvironment()

virtual void tesseract_environment::EnvironmentMonitor::stopMonitoringEnvironment ( )
pure virtual

Stop monitoring the external environment.

◆ stopPublishingEnvironment()

virtual void tesseract_environment::EnvironmentMonitor::stopPublishingEnvironment ( )
pure virtual

Stop publishing the maintained environment.

◆ stopStateMonitor()

virtual void tesseract_environment::EnvironmentMonitor::stopStateMonitor ( )
pure virtual

Stop the state monitor.

◆ updateEnvironmentWithCurrentState()

virtual void tesseract_environment::EnvironmentMonitor::updateEnvironmentWithCurrentState ( )
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().

◆ waitForConnection()

virtual bool tesseract_environment::EnvironmentMonitor::waitForConnection ( std::chrono::duration< double >  duration = std::chrono::seconds(0)) const
pure virtual

Wait for connection to upstream environment.

Parameters
durationThe time to wait in seconds before returning, if zero it waits indefinitely
Returns
True if it has connected to upstream environment, otherwise false

◆ waitForCurrentState()

virtual bool tesseract_environment::EnvironmentMonitor::waitForCurrentState ( std::chrono::duration< double >  duration = std::chrono::seconds(1))
pure virtual

Wait for robot state to become more recent than time t.

Parameters
durationThe 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.

Member Data Documentation

◆ env_

std::shared_ptr<tesseract_environment::Environment> tesseract_environment::EnvironmentMonitor::env_
protected

Definition at line 195 of file environment_monitor.h.

◆ mode_

MonitoredEnvironmentMode tesseract_environment::EnvironmentMonitor::mode_ { MonitoredEnvironmentMode::DEFAULT }
protected

Definition at line 197 of file environment_monitor.h.

◆ monitor_namespace_

std::string tesseract_environment::EnvironmentMonitor::monitor_namespace_
protected

Definition at line 196 of file environment_monitor.h.


The documentation for this class was generated from the following files:


tesseract_environment
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:21