|
sas
Modularised monitoring, logging, and control of robots.
|
Server exposing simulator control services. More...
#include <sas_simulator_server.hpp>
Public Member Functions | |
| SimulatorServer (const SimulatorServer &)=delete | |
| SimulatorServer (const std::shared_ptr< Node > &node, const std::string topic_prefix="GET_FROM_NODE") | |
| Construct a new SimulatorServer. | |
| void | set_start_simulation_callback (const std::function< void()> &) |
| Register a callback executed when the start service is called. | |
| void | set_stop_simulation_callback (const std::function< void()> &) |
| Register a callback executed when the stop service is called. | |
| bool | is_enabled () const |
| Query whether the server is enabled. | |
| std::string | get_topic_prefix () const |
| Get the configured topic/service prefix. | |
Server exposing simulator control services.
SimulatorServer provides ROS service servers for starting and stopping a simulator (std_srvs::srv::Trigger). Callers can register callbacks that will be executed when the corresponding service is invoked. The class also exposes query methods for enabled state and topic/service prefix.
| sas::SimulatorServer::SimulatorServer | ( | const std::shared_ptr< Node > & | node, |
| const std::string | topic_prefix = "GET_FROM_NODE" |
||
| ) |
Construct a new SimulatorServer.
| node | Shared pointer to the rclcpp::Node used for ROS communications. |
| topic_prefix | Topic/service prefix used to build service names. Defaults to "GET_FROM_NODE". |
| std::string sas::SimulatorServer::get_topic_prefix | ( | ) | const |
Get the configured topic/service prefix.
| bool sas::SimulatorServer::is_enabled | ( | ) | const |
Query whether the server is enabled.
| void sas::SimulatorServer::set_start_simulation_callback | ( | const std::function< void()> & | start_simulation_callback | ) |
Register a callback executed when the start service is called.
| cb | Function invoked on start service requests. |
| void sas::SimulatorServer::set_stop_simulation_callback | ( | const std::function< void()> & | stop_simulation_callback | ) |
Register a callback executed when the stop service is called.
| cb | Function invoked on stop service requests. |