libfranka  0.8.0
FCI C++ API
exception.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Franka Emika GmbH
2 // Use of this source code is governed by the Apache-2.0 license, see LICENSE
3 #pragma once
4 
5 #include <stdexcept>
6 #include <string>
7 
8 #include <franka/log.h>
9 
15 namespace franka {
16 
20 struct Exception : public std::runtime_error {
21  using std::runtime_error::runtime_error;
22 };
23 
27 struct ModelException : public Exception {
28  using Exception::Exception;
29 };
30 
35 struct NetworkException : public Exception {
36  using Exception::Exception;
37 };
38 
42 struct ProtocolException : public Exception {
43  using Exception::Exception;
44 };
45 
55  IncompatibleVersionException(uint16_t server_version, uint16_t library_version) noexcept;
56 
60  const uint16_t server_version;
64  const uint16_t library_version;
65 };
66 
73 struct ControlException : public Exception {
80  explicit ControlException(const std::string& what, std::vector<franka::Record> log = {}) noexcept;
81 
85  const std::vector<franka::Record> log;
86 };
87 
91 struct CommandException : public Exception {
92  using Exception::Exception;
93 };
94 
98 struct RealtimeException : public Exception {
99  using Exception::Exception;
100 };
101 
106  using Exception::Exception;
107 };
108 
109 } // namespace franka
IncompatibleVersionException is thrown if the robot does not support this version of libfranka...
Definition: exception.h:49
InvalidOperationException is thrown if an operation cannot be performed.
Definition: exception.h:105
RealtimeException is thrown if realtime priority cannot be set.
Definition: exception.h:98
ProtocolException is thrown if the robot returns an incorrect message.
Definition: exception.h:42
ModelException is thrown if an error occurs when loading the model library.
Definition: exception.h:27
NetworkException is thrown if a connection to the robot cannot be established, or when a timeout occu...
Definition: exception.h:35
Definition: command_types.h:13
Base class for all exceptions used by libfranka.
Definition: exception.h:20
ControlException is thrown if an error occurs during motion generation or torque control.
Definition: exception.h:73
const uint16_t library_version
libfranka protocol version.
Definition: exception.h:64
const uint16_t server_version
Control&#39;s protocol version.
Definition: exception.h:60
Contains helper types for logging sent commands and received robot states.
const std::vector< franka::Record > log
Vector of states and commands logged just before the exception occured.
Definition: exception.h:85
CommandException is thrown if an error occurs during command execution.
Definition: exception.h:91