Go to the documentation of this file.
30 ElementId(
const std::vector<std::string> & category,
const std::string & name,
int sid)
31 : category(category), name(name), sid(sid)
35 ElementId(
const std::vector<std::string> & category,
const std::string & name) :
ElementId(category, name, -1) {}
38 std::vector<std::string> category = {};
40 std::string name = {};
72 ControllerClient(
const std::string & sub_conn_uri,
const std::string & push_conn_uri,
double timeout = 0);
89 void connect(
const std::string & sub_conn_uri,
const std::string & push_conn_uri);
103 send_request(
id, c(
"data"));
121 raw_request(
id, c(
"data"), out);
125 void raw_request(
const ElementId &
id, std::string & out);
128 void timeout(
double t);
146 void run(std::vector<char> & buffer, std::chrono::system_clock::time_point & t_last_received);
154 void run(
const char * buffer,
size_t bufferSize);
168 void reconnect(
const std::string & sub_conn_uri,
const std::string & push_conn_uri);
175 void handle_category(
const std::vector<std::string> & parent,
176 const std::string & category,
188 virtual void category(
const std::vector<std::string> & parent,
const std::string & category) {};
191 inline virtual void label(
const ElementId &
id,
const std::string &) { default_impl(
"Label",
id); }
200 inline virtual void array_label(
const ElementId &
id,
const std::vector<std::string> &,
const Eigen::VectorXd &)
202 default_impl(
"ArrayLabel",
id);
222 default_impl(
"NumberSlider",
id);
227 const std::vector<std::string> & ,
228 const Eigen::VectorXd & )
230 default_impl(
"ArrayInput",
id);
235 const std::vector<std::string> & ,
236 const std::string & )
238 default_impl(
"ComboInput",
id);
244 const std::vector<std::string> & ,
245 const std::string & )
247 default_impl(
"DataComboInput",
id);
259 const Eigen::Vector3d & ,
262 default_impl(
"Point3D",
id);
270 const std::vector<Eigen::Vector3d> & ,
273 default_impl(
"Point3DTrajectory",
id);
281 const std::vector<sva::PTransformd> & ,
284 default_impl(
"PoseTrajectory",
id);
292 const Eigen::Vector3d & ,
295 default_impl(
"Point3DRealTimeTrajectory",
id);
303 const sva::PTransformd & ,
306 default_impl(
"PoseRealTimeTrajectory",
id);
321 const std::vector<std::vector<Eigen::Vector3d>> & ,
324 default_impl(
"PolygonArray",
id);
338 const std::vector<std::vector<Eigen::Vector3d>> & points,
341 polygon(
id, points, config.
color);
354 virtual void polyhedron(
const ElementId &
id,
355 const std::vector<std::array<Eigen::Vector3d, 3>> & triangles,
356 const std::vector<std::array<mc_rtc::gui::Color, 3>> & colors,
369 virtual void polyhedron(
const ElementId &
id,
370 const std::vector<Eigen::Vector3d> & vertices,
371 const std::vector<std::array<size_t, 3>> & triangles,
372 const std::vector<mc_rtc::gui::Color> & colors,
379 const sva::ForceVecd & ,
380 const sva::PTransformd & ,
384 default_impl(
"Force",
id);
391 const Eigen::Vector3d & ,
392 const Eigen::Vector3d & ,
396 default_impl(
"Arrow",
id);
408 const sva::PTransformd & )
410 default_impl(
"Rotation",
id);
422 const sva::PTransformd & )
424 default_impl(
"Transform",
id);
436 const Eigen::Vector3d & ,
439 default_impl(
"XYTheta",
id);
445 default_impl(
"Table",
id);
457 const std::vector<std::string> & ,
458 const std::vector<std::vector<double>> & ,
459 const sva::PTransformd & )
461 default_impl(
"Robot",
id);
466 default_impl(
"RobotMsg",
id);
472 [[maybe_unused]]
const sva::PTransformd & pose)
474 default_impl(
"Visual",
id);
481 virtual void schema(
const ElementId &
id,
const std::string & ) { default_impl(
"Schema",
id); }
491 const std::string & ,
499 const std::string & name,
504 form_checkbox(formId, name, required, default_);
512 const std::string & ,
520 const std::string & name,
525 form_integer_input(formId, name, required, default_);
533 const std::string & ,
541 const std::string & name,
546 form_number_input(formId, name, required, default_);
554 const std::string & ,
556 const std::string & )
562 const std::string & name,
564 const std::string & default_,
567 form_string_input(formId, name, required, default_);
575 const std::string & ,
577 const Eigen::VectorXd & ,
587 const std::string & name,
589 const Eigen::VectorXd & default_,
593 form_array_input(formId, name, required, default_, fixed_size);
598 const std::string & name,
600 const std::vector<std::string> & ,
601 const Eigen::VectorXd & default_,
603 bool default_from_user)
605 form_array_input(formId, name, required, default_, fixed_size, default_from_user);
613 const std::string & ,
615 const std::vector<std::string> & ,
634 const std::string & name,
636 const std::vector<std::string> & values,
640 form_combo_input(formId, name, required, values, send_index);
659 const std::string & ,
661 const std::vector<std::string> & ,
681 const std::string & ,
683 const Eigen::Vector3d & ,
707 const std::string & ,
709 const sva::PTransformd & ,
730 const std::string & ,
732 const sva::PTransformd & ,
767 std::optional<std::vector<Configuration>> )
791 const std::optional<std::pair<size_t, Configuration>> & )
824 const std::string & ,
839 const std::string & ,
854 const std::string & ,
879 const std::string & ,
883 mc_rtc::gui::plot::Style ,
884 mc_rtc::gui::plot::Side )
903 const std::string & ,
905 mc_rtc::gui::plot::Side )
924 const std::string & ,
925 const std::vector<mc_rtc::gui::plot::PolygonDescription> & ,
926 mc_rtc::gui::plot::Side )
939 int sub_socket_ = -1;
941 int push_socket_ = -1;
954 virtual void default_impl(
const std::string & type,
const ElementId &
id);
1000 const std::vector<std::string> & header,
1001 const std::vector<std::string> & format,
1002 const std::vector<mc_rtc::Configuration> & data);
1006 bool default_polyhedron_triangles_list_ =
false;
1007 bool default_polyhedron_vertices_triangles_ =
false;
Definition: ControllerClient.h:22
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
virtual void form_integer_input(const ElementId &, const std::string &, bool, int)
Definition: ControllerClient.h:511
virtual void polygon(const ElementId &id, const std::vector< std::vector< Eigen::Vector3d >> &points, const mc_rtc::gui::LineConfig &config)
Definition: ControllerClient.h:337
virtual void form_array_input(const ElementId &, const std::string &, bool, const Eigen::VectorXd &, bool)
Definition: ControllerClient.h:574
virtual void array_label(const ElementId &id, const std::vector< std::string > &, const Eigen::VectorXd &)
Definition: ControllerClient.h:200
virtual void robot(const ElementId &id, const std::vector< std::string > &, const std::vector< std::vector< double >> &, const sva::PTransformd &)
Definition: ControllerClient.h:456
Color color
Definition: types.h:137
virtual void form_combo_input(const ElementId &formId, const std::string &name, bool required, const std::vector< std::string > &values, bool send_index, int)
Definition: ControllerClient.h:633
virtual void form_array_input(const ElementId &formId, const std::string &name, bool required, const Eigen::VectorXd &default_, bool fixed_size, bool)
Definition: ControllerClient.h:586
virtual void form_data_combo_input(const ElementId &, const std::string &, bool, const std::vector< std::string > &, bool)
Definition: ControllerClient.h:658
virtual void start_form_generic_array_input(const std::string &, bool, std::optional< std::vector< Configuration >>)
Definition: ControllerClient.h:765
virtual void polygon(const ElementId &id, const std::vector< std::vector< Eigen::Vector3d >> &, const mc_rtc::gui::Color &)
Definition: ControllerClient.h:320
ElementId(const std::vector< std::string > &category, const std::string &name, int sid)
Definition: ControllerClient.h:30
#define MC_CONTROL_CLIENT_DLLAPI
Definition: client_api.h:50
virtual void form_combo_input(const ElementId &, const std::string &, bool, const std::vector< std::string > &, bool)
Definition: ControllerClient.h:612
virtual void trajectory(const ElementId &id, const sva::PTransformd &, const mc_rtc::gui::LineConfig &)
Definition: ControllerClient.h:302
virtual void start_form_one_of_input(const std::string &, bool, const std::optional< std::pair< size_t, Configuration >> &)
Definition: ControllerClient.h:789
virtual void started()
Definition: ControllerClient.h:182
virtual void combo_input(const ElementId &id, const std::vector< std::string > &, const std::string &)
Definition: ControllerClient.h:234
virtual void form_transform_input(const ElementId &, const std::string &, bool, const sva::PTransformd &, bool, bool)
Definition: ControllerClient.h:729
virtual void end_plot(uint64_t)
Definition: ControllerClient.h:935
virtual void table_row(const ElementId &, const std::vector< std::string > &)
Definition: ControllerClient.h:449
virtual void plot_setup_yaxis_left(uint64_t, const std::string &, const mc_rtc::gui::plot::Range &)
Definition: ControllerClient.h:838
virtual void data_combo_input(const ElementId &id, const std::vector< std::string > &, const std::string &)
Definition: ControllerClient.h:243
virtual void button(const ElementId &id)
Definition: ControllerClient.h:206
virtual void end_form_object_input()
Definition: ControllerClient.h:753
virtual void trajectory(const ElementId &id, const std::vector< Eigen::Vector3d > &, const mc_rtc::gui::LineConfig &)
Definition: ControllerClient.h:269
virtual void visual(const ElementId &id, [[maybe_unused]] const rbd::parsers::Visual &visual, [[maybe_unused]] const sva::PTransformd &pose)
Definition: ControllerClient.h:470
virtual void form_array_input(const ElementId &formId, const std::string &name, bool required, const std::vector< std::string > &, const Eigen::VectorXd &default_, bool fixed_size, bool default_from_user)
Definition: ControllerClient.h:597
virtual void form_checkbox(const ElementId &formId, const std::string &name, bool required, bool default_, bool)
Definition: ControllerClient.h:498
virtual void array_input(const ElementId &id, const std::vector< std::string > &, const Eigen::VectorXd &)
Definition: ControllerClient.h:226
void send_request(const ElementId &id, const T &data)
Definition: ControllerClient.h:99
virtual void start_form_object_input(const std::string &, bool)
Definition: ControllerClient.h:746
virtual void start_plot(uint64_t, const std::string &)
Definition: ControllerClient.h:812
virtual void string_input(const ElementId &id, const std::string &)
Definition: ControllerClient.h:212
virtual void rotation(const ElementId &id, const ElementId &, bool, const sva::PTransformd &)
Definition: ControllerClient.h:405
ElementId(const std::vector< std::string > &category, const std::string &name)
Definition: ControllerClient.h:35
virtual void robot_msg(const ElementId &id, const mc_rtc::gui::RobotMsgData &)
Definition: ControllerClient.h:464
virtual void stopped()
Definition: ControllerClient.h:185
void add(const std::string &key, bool value)
Add a bool element to the Configuration.
Definition: ControllerClient.h:51
virtual void end_form_generic_array_input()
Definition: ControllerClient.h:776
virtual void form_checkbox(const ElementId &, const std::string &, bool, bool)
Definition: ControllerClient.h:490
virtual void plot_polygon(uint64_t, uint64_t, const std::string &, const mc_rtc::gui::plot::PolygonDescription &, mc_rtc::gui::plot::Side)
Definition: ControllerClient.h:901
void raw_request(const ElementId &id, const T &data, std::string &out)
Definition: ControllerClient.h:117
Definition: StateBuilder.h:27
virtual void label(const ElementId &id, const std::string &)
Definition: ControllerClient.h:191
virtual void number_input(const ElementId &id, double)
Definition: ControllerClient.h:218
auto Visual(const std::string &name, GetVisual get_visual_fn, GetPos get_pos_fn)
Definition: Visual.h:64
virtual void form_rotation_input(const ElementId &, const std::string &, bool, const sva::PTransformd &, bool, bool)
Definition: ControllerClient.h:706
virtual void form_string_input(const ElementId &formId, const std::string &name, bool required, const std::string &default_, bool)
Definition: ControllerClient.h:561
virtual void form_number_input(const ElementId &, const std::string &, bool, double)
Definition: ControllerClient.h:532
virtual void table_start(const ElementId &id, const std::vector< std::string > &)
Definition: ControllerClient.h:443
std::thread sub_th_
Definition: ControllerClient.h:940
virtual void force(const ElementId &id, const ElementId &, const sva::ForceVecd &, const sva::PTransformd &, const mc_rtc::gui::ForceConfig &, bool)
Definition: ControllerClient.h:377
double timeout_
Definition: ControllerClient.h:942
virtual void trajectory(const ElementId &id, const std::vector< sva::PTransformd > &, const mc_rtc::gui::LineConfig &)
Definition: ControllerClient.h:280
virtual void form_number_input(const ElementId &formId, const std::string &name, bool required, double default_, bool)
Definition: ControllerClient.h:540
virtual void trajectory(const ElementId &id, const Eigen::Vector3d &, const mc_rtc::gui::LineConfig &)
Definition: ControllerClient.h:291
virtual void arrow(const ElementId &id, const ElementId &, const Eigen::Vector3d &, const Eigen::Vector3d &, const mc_rtc::gui::ArrowConfig &, bool)
Definition: ControllerClient.h:389
virtual void form(const ElementId &id)
Definition: ControllerClient.h:484
virtual void transform(const ElementId &id, const ElementId &, bool, const sva::PTransformd &)
Definition: ControllerClient.h:419
virtual void form_string_input(const ElementId &, const std::string &, bool, const std::string &)
Definition: ControllerClient.h:553
virtual void plot_setup_yaxis_right(uint64_t, const std::string &, const mc_rtc::gui::plot::Range &)
Definition: ControllerClient.h:853
Definition: CompletionCriteria.h:10
virtual void plot_setup_xaxis(uint64_t, const std::string &, const mc_rtc::gui::plot::Range &)
Definition: ControllerClient.h:823
virtual void xytheta(const ElementId &id, const ElementId &, bool, const Eigen::Vector3d &, double)
Definition: ControllerClient.h:433
virtual void integer_input(const ElementId &id, int)
Definition: ControllerClient.h:215
virtual void point3d(const ElementId &id, const ElementId &, bool, const Eigen::Vector3d &, const mc_rtc::gui::PointConfig &)
Definition: ControllerClient.h:256
virtual void schema(const ElementId &id, const std::string &)
Definition: ControllerClient.h:481
virtual void number_slider(const ElementId &id, double, double, double)
Definition: ControllerClient.h:220
mc_rtc::Configuration data_
Definition: ControllerClient.h:945
virtual void checkbox(const ElementId &id, bool)
Definition: ControllerClient.h:209
virtual void plot_point(uint64_t, uint64_t, const std::string &, double, double, mc_rtc::gui::Color, mc_rtc::gui::plot::Style, mc_rtc::gui::plot::Side)
Definition: ControllerClient.h:877
virtual void plot_polygons(uint64_t, uint64_t, const std::string &, const std::vector< mc_rtc::gui::plot::PolygonDescription > &, mc_rtc::gui::plot::Side)
Definition: ControllerClient.h:922
Definition: ControllerServer.h:25
virtual void end_form_one_of_input()
Definition: ControllerClient.h:800
virtual void form_point3d_input(const ElementId &, const std::string &, bool, const Eigen::Vector3d &, bool, bool)
Definition: ControllerClient.h:680
virtual void form_integer_input(const ElementId &formId, const std::string &name, bool required, int default_, bool)
Definition: ControllerClient.h:519
virtual void category(const std::vector< std::string > &parent, const std::string &category)
Definition: ControllerClient.h:188
virtual void table_end(const ElementId &)
Definition: ControllerClient.h:452