File status.hpp¶
Defines the Status struct.
-
namespace robot_interfaces
-
struct Status : public robot_interfaces::Loggable¶
- #include <status.hpp>
Status information from the backend.
Used to report status information that is not directly robot-related from the backend to the frontend.
Public Types
-
enum class ErrorStatus¶
Different types of errors that can occur in the backend.
Values:
-
enumerator NO_ERROR¶
Indicates that there is no error.
-
enumerator DRIVER_ERROR¶
Error reported from the RobotDriver.
An error reported by the low level robot driver (see RobotDriver). This is depending on the driver implementation. It can, for example, be used to report some hardware failure).
-
enumerator BACKEND_ERROR¶
Error from the RobotBackend.
An error which is issued by the back end itself, for example if no new action is provided and the allowed number of repetitions is exceeded.
-
enumerator NO_ERROR¶
Public Functions
-
inline void set_error(ErrorStatus error_type, const std::string &message)¶
Set error.
If another error was set before, the old one is kept and the new one ignored.
- Parameters
error_type – The type of the error.
message – Error message.
-
inline bool has_error() const¶
Check if an error is set.
See error_status and error_message for more details on the error.
Note
If there is an error reported in the status, the robot is not in an operational state anymore. Trying to append another action in the RobotFrontend will result in an exception in this case.
-
inline std::string get_error_message() const¶
Get the error message as std::string.
-
inline virtual std::vector<std::string> get_name() override¶
-
inline virtual std::vector<std::vector<double>> get_data() override¶
Public Members
-
uint32_t action_repetitions = 0¶
Number of times the current action has been repeated.
If the back end wants to apply the next action but no new action was provided by the user in time, it may (depending on configuration) repeat the previous action. Each time this happens,
action_repetitions
is increased by one. Once a new action is provided, it will be reset to zero.See also next-action-not-in-time.
-
ErrorStatus error_status = ErrorStatus::NO_ERROR¶
Indicates if there is an error and, if yes, in which component.
See also
error_message for more information on the error.
See also
Note
If there is an error reported in the status, the robot is not in an operational state anymore. Trying to append another action in the RobotFrontend will result in an exception in this case.
Public Static Attributes
-
static constexpr unsigned int ERROR_MESSAGE_LENGTH = 64¶
Private Members
-
char error_message[ERROR_MESSAGE_LENGTH] = ""¶
Human-readable message describing the error.
Value is undefined if
error_status == NO_ERROR
.
-
enum class ErrorStatus¶
-
struct Status : public robot_interfaces::Loggable¶