Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: true
AlwaysBreakBeforeMultilineStrings: true
BreakBeforeBinaryOperators: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 60
PenaltyBreakString: 1
PenaltyBreakFirstLessLess: 1000
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 90
SpacesBeforeTrailingComments: 2
Cpp11BracedListStyle: false
Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
17 changes: 8 additions & 9 deletions include/abb_librws/common/rw/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
#include <variant>
#include <string>


namespace abb :: rws :: rw :: io
namespace abb ::rws ::rw ::io
{
/**
* \brief Mapping from IO signal name to a value.
*
* The value of a digital signal is a \a bool, the value of an analog signal is a \a float.
*/
using IOSignalInfo = std::map<std::string, std::variant<bool, float>>;
}
/**
* \brief Mapping from IO signal name to a value.
*
* The value of a digital signal is a \a bool, the value of an analog signal is a \a float.
*/
using IOSignalInfo = std::map<std::string, std::variant<bool, float>>;
} // namespace abb::rws::rw::io
147 changes: 72 additions & 75 deletions include/abb_librws/common/rw/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,84 +4,81 @@

#include <string>


namespace abb :: rws :: rw
namespace abb ::rws ::rw
{
/**
* \brief Robot controller state.
*
* The documentation strings are taken from https://developercenter.robotstudio.com/api/RWS?urls.primaryName=Panel%20Service
*/
enum class ControllerState
{
// The robot is starting up. It will shift to state motors off when it has started.
init,
// The robot is in a standby state where there is no power to the robot's motors.
// The state has to be shifted to motors on before the robot can move.
motorOff,
// The robot is ready to move, either by jogging or by running programs.
motorOn,
// The robot is stopped because the safety runchain is opened. For instance, a door to the robot's cell might be open.
guardStop,
// The robot is stopped because emergency stop was activated.
emergencyStop,
// The robot is ready to leave emergency stop state. The emergency stop is no longer activated, but the state transition isn't yet confirmed.
emergencyStopReset,
// The robot is in a system failure state. Restart required.
sysFail
};


std::ostream& operator<<(std::ostream& os, ControllerState state);


/**
* \brief Create \a ControllerState from string.
*
* \param str source string
*
* \return \a ControllerState matching the value of \a str
*
* \throw \a std::invalid_argument if \a str is not from the set of valid strings.
*/
ControllerState makeControllerState(std::string const& str);

/**
* \brief Robot controller state.
*
* The documentation strings are taken from
* https://developercenter.robotstudio.com/api/RWS?urls.primaryName=Panel%20Service
*/
enum class ControllerState
{
// The robot is starting up. It will shift to state motors off when it has started.
init,
// The robot is in a standby state where there is no power to the robot's motors.
// The state has to be shifted to motors on before the robot can move.
motorOff,
// The robot is ready to move, either by jogging or by running programs.
motorOn,
// The robot is stopped because the safety runchain is opened. For instance, a door to the robot's cell might be open.
guardStop,
// The robot is stopped because emergency stop was activated.
emergencyStop,
// The robot is ready to leave emergency stop state. The emergency stop is no longer activated, but the state
// transition isn't yet confirmed.
emergencyStopReset,
// The robot is in a system failure state. Restart required.
sysFail
};

/**
* @brief Robot operation mode.
*
* The documentation strings are taken from https://developercenter.robotstudio.com/api/rwsApi/panel_opmode_get_page.html
*/
enum class OperationMode
{
// State init
init,
// State change request for automatic mode
autoCh,
// State change request for manual mode & full speed
manFCh,
// State manual mode & reduced speed
manR,
// State manual mode & full speed
manF,
// State automatic mode
automatic,
// Undefined
undef
};
std::ostream& operator<<(std::ostream& os, ControllerState state);

/**
* \brief Create \a ControllerState from string.
*
* \param str source string
*
* \return \a ControllerState matching the value of \a str
*
* \throw \a std::invalid_argument if \a str is not from the set of valid strings.
*/
ControllerState makeControllerState(std::string const& str);

std::ostream& operator<<(std::ostream& os, OperationMode mode);
/**
* @brief Robot operation mode.
*
* The documentation strings are taken from
* https://developercenter.robotstudio.com/api/rwsApi/panel_opmode_get_page.html
*/
enum class OperationMode
{
// State init
init,
// State change request for automatic mode
autoCh,
// State change request for manual mode & full speed
manFCh,
// State manual mode & reduced speed
manR,
// State manual mode & full speed
manF,
// State automatic mode
automatic,
// Undefined
undef
};

std::ostream& operator<<(std::ostream& os, OperationMode mode);

/**
* \brief Create \a OperationMode from string.
*
* \param str source string
*
* \return \a OperationMode matching the value of \a str
*
* \throw \a std::invalid_argument if \a str is not from the set of valid strings.
*/
OperationMode makeOperationMode(std::string const& str);
}
/**
* \brief Create \a OperationMode from string.
*
* \param str source string
*
* \return \a OperationMode matching the value of \a str
*
* \throw \a std::invalid_argument if \a str is not from the set of valid strings.
*/
OperationMode makeOperationMode(std::string const& str);
} // namespace abb::rws::rw
Loading