ControllerServerConfiguration.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2024 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
7 #include <mc_control/api.h>
8 
9 #include <mc_rtc/Configuration.h>
10 #include <mc_rtc/path.h>
11 
12 namespace mc_control
13 {
14 
15 namespace details
16 {
17 
18 // FIXME This could be inside ControllerServerConfiguration but it crashes clang-10
19 
26 template<uint16_t default_pub_port, uint16_t default_pull_port>
28 {
30  std::string host = "*";
32  uint16_t pub_port = default_pub_port;
34  uint16_t pull_port = default_pull_port;
35 };
36 
37 } // namespace details
38 
41 {
48  double timestep = 0.05;
49 
56  std::optional<std::string> ipc_socket = mc_rtc::temp_directory_path("mc_rtc");
57 
59 
64  std::optional<TCPConfiguration> tcp_config = TCPConfiguration{};
65 
67 
72  std::optional<WebSocketConfiguration> websocket_config = std::nullopt;
73 
75  void load(const mc_rtc::Configuration & config);
76 
78  std::vector<std::string> pub_uris() const noexcept;
79 
81  std::vector<std::string> pull_uris() const noexcept;
82 
84  void print_serving_information() const noexcept;
85 
86  static ControllerServerConfiguration fromConfiguration(const mc_rtc::Configuration & config);
87 };
88 
89 } // namespace mc_control
mc_rtc::Configuration
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
path.h
MC_CONTROL_DLLAPI
#define MC_CONTROL_DLLAPI
Definition: api.h:50
mc_rtc::temp_directory_path
MC_RTC_UTILS_DLLAPI std::string temp_directory_path(const std::string &suffix="")
mc_control::details::SocketConfiguration::host
std::string host
Definition: ControllerServerConfiguration.h:30
api.h
mc_control::details::SocketConfiguration
Definition: ControllerServerConfiguration.h:27
mc_control::details::SocketConfiguration::pub_port
uint16_t pub_port
Definition: ControllerServerConfiguration.h:32
Configuration.h
std
Definition: Contact.h:66
mc_control::ControllerServerConfiguration
Definition: ControllerServerConfiguration.h:40
mc_control
Definition: CompletionCriteria.h:10
mc_rtc
Definition: Contact.h:87
mc_control::details::SocketConfiguration::pull_port
uint16_t pull_port
Definition: ControllerServerConfiguration.h:34