mc_control::ControllerServer Struct Reference

#include <mc_control/ControllerServer.h>

Public Member Functions

 ControllerServer (double dt, double server_dt, const std::vector< std::string > &pub_bind_uri, const std::vector< std::string > &pull_bind_uri)
 
 ControllerServer (double dt, const ControllerServerConfiguration &config)
 
 ~ControllerServer ()
 
void handle_requests (mc_rtc::gui::StateBuilder &gui_builder)
 
void handle_requests (mc_rtc::gui::StateBuilder &gui, const char *data)
 
void publish (mc_rtc::gui::StateBuilder &gui_builder)
 
std::pair< const char *, size_t > data () const
 
void set_logger (std::shared_ptr< mc_rtc::Logger > logger) noexcept
 
void push_requests (const std::vector< mc_rtc::Logger::GUIEvent > &requests)
 
void update_rate (double dt, double server_dt)
 

Detailed Description

Serves data and allow interaction with the controllers

  • Uses a PUB socket to send the data stream
  • Uses a PULL socket to handle requests

Constructor & Destructor Documentation

◆ ControllerServer() [1/2]

mc_control::ControllerServer::ControllerServer ( double  dt,
double  server_dt,
const std::vector< std::string > &  pub_bind_uri,
const std::vector< std::string > &  pull_bind_uri 
)

Constructor

Parameters
dtController timestep
server_dtPublication timestep
pub_bind_uriList of URI the PUB socket should bind to
pull_bind_uriList of URI the PULL socket should bind to

Check nanomsg documentation for supported protocols

◆ ControllerServer() [2/2]

mc_control::ControllerServer::ControllerServer ( double  dt,
const ControllerServerConfiguration config 
)

Construct from the provided configuration

Parameters
dtController timestep
configServer configuration ControllerServerConfiguration for details

◆ ~ControllerServer()

mc_control::ControllerServer::~ControllerServer ( )

Member Function Documentation

◆ data()

std::pair<const char *, size_t> mc_control::ControllerServer::data ( ) const

Get latest published data

◆ handle_requests() [1/2]

void mc_control::ControllerServer::handle_requests ( mc_rtc::gui::StateBuilder gui,
const char *  data 
)

Handle requests from raw data

◆ handle_requests() [2/2]

void mc_control::ControllerServer::handle_requests ( mc_rtc::gui::StateBuilder gui_builder)

Handle requests made by the GUI users

◆ publish()

void mc_control::ControllerServer::publish ( mc_rtc::gui::StateBuilder gui_builder)

Publish the current GUI state

◆ push_requests()

void mc_control::ControllerServer::push_requests ( const std::vector< mc_rtc::Logger::GUIEvent > &  requests)
inline

Set requests to handle on the next iteration

◆ set_logger()

void mc_control::ControllerServer::set_logger ( std::shared_ptr< mc_rtc::Logger logger)
inlinenoexcept

Attach a logger to the server

◆ update_rate()

void mc_control::ControllerServer::update_rate ( double  dt,
double  server_dt 
)

Update the rate of the server


The documentation for this struct was generated from the following file: