sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
sas::SimulatorClient Class Reference

Client for controlling a simulator via ROS services. More...

#include <sas_simulator_client.hpp>

Inheritance diagram for sas::SimulatorClient:
sas::Object

Public Member Functions

 SimulatorClient (const SimulatorClient &)=delete
 
 SimulatorClient (const std::shared_ptr< Node > &node, const std::string topic_prefix="GET_FROM_NODE")
 Construct a new SimulatorClient.
 
bool start_simulation ()
 Call the start simulation service.
 
bool stop_simulation ()
 Call the stop simulation service.
 
bool is_enabled () const
 Query whether the client is enabled.
 
std::string get_topic_prefix () const
 Get the configured topic/service prefix.
 

Detailed Description

Client for controlling a simulator via ROS services.

The SimulatorClient provides a lightweight interface to call start/stop simulation services (std_srvs::srv::Trigger) and to query configuration such as whether the client is enabled and the topic/service prefix.

Constructor & Destructor Documentation

◆ SimulatorClient()

sas::SimulatorClient::SimulatorClient ( const std::shared_ptr< Node > &  node,
const std::string  topic_prefix = "GET_FROM_NODE" 
)

Construct a new SimulatorClient.

Parameters
nodeShared pointer to the rclcpp::Node used for ROS communications.
topic_prefixTopic/service prefix used to build service names. Defaults to "GET_FROM_NODE".

Member Function Documentation

◆ get_topic_prefix()

std::string sas::SimulatorClient::get_topic_prefix ( ) const

Get the configured topic/service prefix.

Returns
std::string The topic/service prefix used by this client.

◆ is_enabled()

bool sas::SimulatorClient::is_enabled ( ) const

Query whether the client is enabled.

Returns
true if enabled, false otherwise.

◆ start_simulation()

bool sas::SimulatorClient::start_simulation ( )

Call the start simulation service.

Invokes the configured start service and returns true if the call succeeded and the service responded positively.

Returns
true on successful start, false otherwise.

◆ stop_simulation()

bool sas::SimulatorClient::stop_simulation ( )

Call the stop simulation service.

Invokes the configured stop service and returns true if the call succeeded and the service responded positively.

Returns
true on successful stop, false otherwise.

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