Cheetah Software  1.0
ControlParameterInterface.h
Go to the documentation of this file.
1 
10 #ifndef PROJECT_CONTROLPARAMETERINTERFACE_H
11 #define PROJECT_CONTROLPARAMETERINTERFACE_H
12 
13 #include <map>
14 #include "ControlParameters.h"
15 
21 };
22 
25 
28  ""; // name of the parameter to set/get
29  u64 requestNumber = UINT64_MAX;
33 
34  std::string toString() {
35  std::string result = "Request(" + std::to_string(requestNumber) + ") " +
37  " " +
38  controlParameterValueKindToString(parameterKind) +
39  " " + std::string(name) + " ";
40  switch (requestKind) {
42  result += "user is: ";
43  result += controlParameterValueToString(value, parameterKind);
44  return result;
46  result += "user to: ";
47  result += controlParameterValueToString(value, parameterKind);
48  return result;
50  result += "robot is: ";
51  result += controlParameterValueToString(value, parameterKind);
52  return result;
54  result += "robot to: ";
55  result += controlParameterValueToString(value, parameterKind);
56  return result;
57  default:
58  return result + " unknown request type!";
59  }
60  }
61 };
62 
65  u64 requestNumber = UINT64_MAX;
66  u64 nParameters = 0;
70 
72  return requestNumber == request.requestNumber &&
73  requestKind == request.requestKind &&
74  std::string(name) == std::string(request.name);
75  }
76 
77  std::string toString() {
78  std::string result = "Response(" + std::to_string(requestNumber) + ") " +
80  " " +
81  controlParameterValueKindToString(parameterKind) +
82  " " + std::string(name) + " ";
83 
84  switch (requestKind) {
86  result += "user to: ";
87  result += controlParameterValueToString(value, parameterKind);
88  return result;
90  result += "user is: ";
91  result += controlParameterValueToString(value, parameterKind);
92  return result;
94  result += "robot to: ";
95  result += controlParameterValueToString(value, parameterKind);
96  return result;
98  result += "robot is: ";
99  result += controlParameterValueToString(value, parameterKind);
100  return result;
101  default:
102  return result + " unknown request type!";
103  }
104  }
105 };
106 
107 #endif // PROJECT_CONTROLPARAMETERINTERFACE_H
ControlParameterRequestKind requestKind
ControlParameterValueKind parameterKind
ControlParameterValueKind
std::string controlParameterValueKindToString(ControlParameterValueKind valueKind)
ControlParameterRequestKind requestKind
bool isResponseTo(ControlParameterRequest &request)
char name[CONTROL_PARAMETER_MAXIMUM_NAME_LENGTH]
ControlParameterValueKind parameterKind
#define CONTROL_PARAMETER_MAXIMUM_NAME_LENGTH
std::string controlParameterRequestKindToString(ControlParameterRequestKind request)
ControlParameterRequestKind
std::string controlParameterValueToString(ControlParameterValue v, ControlParameterValueKind kind)
uint64_t u64
Definition: cTypes.h:17
Interface to set gains/control parameters for simulator and robot These are designed to be updated in...