libfranka 0.15.0
FCI C++ API
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1// Copyright (c) 2023 Franka Robotics 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
15namespace franka {
16
20struct Exception : public std::runtime_error {
21 using std::runtime_error::runtime_error;
22};
23
27struct ModelException : public Exception {
28 using Exception::Exception;
29};
30
35struct NetworkException : public Exception {
36 using Exception::Exception;
37};
38
43 using Exception::Exception;
44};
45
56
60 const uint16_t server_version;
64 const uint16_t library_version;
65};
66
73struct 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
91struct CommandException : public Exception {
92 using Exception::Exception;
93};
94
99 using Exception::Exception;
100};
101
106 using Exception::Exception;
107};
108
109} // namespace franka
Contains helper types for logging sent commands and received robot states.
CommandException is thrown if an error occurs during command execution.
Definition exception.h:91
ControlException is thrown if an error occurs during motion generation or torque control.
Definition exception.h:73
ControlException(const std::string &what, std::vector< franka::Record > log={}) noexcept
Creates the exception with an explanatory string and a Log object.
const std::vector< franka::Record > log
Vector of states and commands logged just before the exception occurred.
Definition exception.h:85
Base class for all exceptions used by libfranka.
Definition exception.h:20
IncompatibleVersionException is thrown if the robot does not support this version of libfranka.
Definition exception.h:49
const uint16_t server_version
Control's protocol version.
Definition exception.h:60
IncompatibleVersionException(uint16_t server_version, uint16_t library_version) noexcept
Creates the exception using the two different protocol versions.
const uint16_t library_version
libfranka protocol version.
Definition exception.h:64
InvalidOperationException is thrown if an operation cannot be performed.
Definition exception.h:105
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
ProtocolException is thrown if the robot returns an incorrect message.
Definition exception.h:42
RealtimeException is thrown if realtime priority cannot be set.
Definition exception.h:98