diff --git a/source/RobotAPI/applications/AronCodeGenerator/cxxopts.hpp b/source/RobotAPI/applications/AronCodeGenerator/cxxopts.hpp index a11201123e2b6c17939c960c9b7c8239fbdc80dc..11fe04078d717a88bb6808b8c25721c113e54085 100644 --- a/source/RobotAPI/applications/AronCodeGenerator/cxxopts.hpp +++ b/source/RobotAPI/applications/AronCodeGenerator/cxxopts.hpp @@ -25,8 +25,8 @@ THE SOFTWARE. #ifndef CXXOPTS_HPP_INCLUDED #define CXXOPTS_HPP_INCLUDED -#include <cstring> #include <cctype> +#include <cstring> #include <exception> #include <iostream> #include <map> @@ -52,13 +52,8 @@ namespace cxxopts static constexpr struct { uint8_t major, minor, patch; - } version = - { - CXXOPTS__VERSION_MAJOR, - CXXOPTS__VERSION_MINOR, - CXXOPTS__VERSION_PATCH - }; -} + } version = {CXXOPTS__VERSION_MAJOR, CXXOPTS__VERSION_MINOR, CXXOPTS__VERSION_PATCH}; +} // namespace cxxopts //when we ask cxxopts to use Unicode, help strings are processed using ICU, //which results in the correct lengths being computed for strings when they @@ -73,21 +68,16 @@ namespace cxxopts { typedef icu::UnicodeString String; - inline - String + inline String toLocalString(std::string s) { return icu::UnicodeString::fromUTF8(std::move(s)); } - class UnicodeStringIterator : public - std::iterator<std::forward_iterator_tag, int32_t> + class UnicodeStringIterator : public std::iterator<std::forward_iterator_tag, int32_t> { public: - - UnicodeStringIterator(const icu::UnicodeString* string, int32_t pos) - : s(string) - , i(pos) + UnicodeStringIterator(const icu::UnicodeString* string, int32_t pos) : s(string), i(pos) { } @@ -127,15 +117,13 @@ namespace cxxopts int32_t i; }; - inline - String& + inline String& stringAppend(String& s, String a) { return s.append(std::move(a)); } - inline - String& + inline String& stringAppend(String& s, int n, UChar32 c) { for (int i = 0; i != n; ++i) @@ -159,15 +147,13 @@ namespace cxxopts return s; } - inline - size_t + inline size_t stringLength(const String& s) { return s.length(); } - inline - std::string + inline std::string toUTF8String(const String& s) { std::string result; @@ -176,30 +162,27 @@ namespace cxxopts return result; } - inline - bool + inline bool empty(const String& s) { return s.isEmpty(); } -} +} // namespace cxxopts namespace std { - inline - cxxopts::UnicodeStringIterator + inline cxxopts::UnicodeStringIterator begin(const icu::UnicodeString& s) { return cxxopts::UnicodeStringIterator(&s, 0); } - inline - cxxopts::UnicodeStringIterator + inline cxxopts::UnicodeStringIterator end(const icu::UnicodeString& s) { return cxxopts::UnicodeStringIterator(&s, s.length()); } -} +} // namespace std //ifdef CXXOPTS_USE_UNICODE #else @@ -215,22 +198,19 @@ namespace cxxopts return std::forward<T>(t); } - inline - size_t + inline size_t stringLength(const String& s) { return s.length(); } - inline - String& + inline String& stringAppend(String& s, String a) { return s.append(std::move(a)); } - inline - String& + inline String& stringAppend(String& s, size_t n, char c) { return s.append(n, c); @@ -250,13 +230,12 @@ namespace cxxopts return std::forward<T>(t); } - inline - bool + inline bool empty(const std::string& s) { return s.empty(); } -} +} // namespace cxxopts //ifdef CXXOPTS_USE_UNICODE #endif @@ -272,54 +251,40 @@ namespace cxxopts const std::string LQUOTE("‘"); const std::string RQUOTE("’"); #endif - } + } // namespace class Value : public std::enable_shared_from_this<Value> { public: - virtual ~Value() = default; - virtual - std::shared_ptr<Value> - clone() const = 0; + virtual std::shared_ptr<Value> clone() const = 0; - virtual void - parse(const std::string& text) const = 0; + virtual void parse(const std::string& text) const = 0; - virtual void - parse() const = 0; + virtual void parse() const = 0; - virtual bool - has_default() const = 0; + virtual bool has_default() const = 0; - virtual bool - is_container() const = 0; + virtual bool is_container() const = 0; - virtual bool - has_implicit() const = 0; + virtual bool has_implicit() const = 0; - virtual std::string - get_default_value() const = 0; + virtual std::string get_default_value() const = 0; - virtual std::string - get_implicit_value() const = 0; + virtual std::string get_implicit_value() const = 0; - virtual std::shared_ptr<Value> - default_value(const std::string& value) = 0; + virtual std::shared_ptr<Value> default_value(const std::string& value) = 0; - virtual std::shared_ptr<Value> - implicit_value(const std::string& value) = 0; + virtual std::shared_ptr<Value> implicit_value(const std::string& value) = 0; - virtual bool - is_boolean() const = 0; + virtual bool is_boolean() const = 0; }; class OptionException : public std::exception { public: - OptionException(const std::string& message) - : m_message(message) + OptionException(const std::string& message) : m_message(message) { } @@ -336,9 +301,7 @@ namespace cxxopts class OptionSpecException : public OptionException { public: - - OptionSpecException(const std::string& message) - : OptionException(message) + OptionSpecException(const std::string& message) : OptionException(message) { } }; @@ -346,8 +309,7 @@ namespace cxxopts class OptionParseException : public OptionException { public: - OptionParseException(const std::string& message) - : OptionException(message) + OptionParseException(const std::string& message) : OptionException(message) { } }; @@ -355,8 +317,8 @@ namespace cxxopts class option_exists_error : public OptionSpecException { public: - option_exists_error(const std::string& option) - : OptionSpecException("Option " + LQUOTE + option + RQUOTE + " already exists") + option_exists_error(const std::string& option) : + OptionSpecException("Option " + LQUOTE + option + RQUOTE + " already exists") { } }; @@ -364,8 +326,8 @@ namespace cxxopts class invalid_option_format_error : public OptionSpecException { public: - invalid_option_format_error(const std::string& format) - : OptionSpecException("Invalid option format " + LQUOTE + format + RQUOTE) + invalid_option_format_error(const std::string& format) : + OptionSpecException("Invalid option format " + LQUOTE + format + RQUOTE) { } }; @@ -373,9 +335,9 @@ namespace cxxopts class option_syntax_exception : public OptionParseException { public: - option_syntax_exception(const std::string& text) - : OptionParseException("Argument " + LQUOTE + text + RQUOTE + - " starts with a - but has incorrect syntax") + option_syntax_exception(const std::string& text) : + OptionParseException("Argument " + LQUOTE + text + RQUOTE + + " starts with a - but has incorrect syntax") { } }; @@ -383,8 +345,8 @@ namespace cxxopts class option_not_exists_exception : public OptionParseException { public: - option_not_exists_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " does not exist") + option_not_exists_exception(const std::string& option) : + OptionParseException("Option " + LQUOTE + option + RQUOTE + " does not exist") { } }; @@ -392,10 +354,8 @@ namespace cxxopts class missing_argument_exception : public OptionParseException { public: - missing_argument_exception(const std::string& option) - : OptionParseException( - "Option " + LQUOTE + option + RQUOTE + " is missing an argument" - ) + missing_argument_exception(const std::string& option) : + OptionParseException("Option " + LQUOTE + option + RQUOTE + " is missing an argument") { } }; @@ -403,10 +363,8 @@ namespace cxxopts class option_requires_argument_exception : public OptionParseException { public: - option_requires_argument_exception(const std::string& option) - : OptionParseException( - "Option " + LQUOTE + option + RQUOTE + " requires an argument" - ) + option_requires_argument_exception(const std::string& option) : + OptionParseException("Option " + LQUOTE + option + RQUOTE + " requires an argument") { } }; @@ -414,16 +372,10 @@ namespace cxxopts class option_not_has_argument_exception : public OptionParseException { public: - option_not_has_argument_exception - ( - const std::string& option, - const std::string& arg - ) - : OptionParseException( - "Option " + LQUOTE + option + RQUOTE + - " does not take an argument, but argument " + - LQUOTE + arg + RQUOTE + " given" - ) + option_not_has_argument_exception(const std::string& option, const std::string& arg) : + OptionParseException("Option " + LQUOTE + option + RQUOTE + + " does not take an argument, but argument " + LQUOTE + arg + + RQUOTE + " given") { } }; @@ -431,8 +383,8 @@ namespace cxxopts class option_not_present_exception : public OptionParseException { public: - option_not_present_exception(const std::string& option) - : OptionParseException("Option " + LQUOTE + option + RQUOTE + " not present") + option_not_present_exception(const std::string& option) : + OptionParseException("Option " + LQUOTE + option + RQUOTE + " not present") { } }; @@ -440,13 +392,8 @@ namespace cxxopts class argument_incorrect_type : public OptionParseException { public: - argument_incorrect_type - ( - const std::string& arg - ) - : OptionParseException( - "Argument " + LQUOTE + arg + RQUOTE + " failed to parse" - ) + argument_incorrect_type(const std::string& arg) : + OptionParseException("Argument " + LQUOTE + arg + RQUOTE + " failed to parse") { } }; @@ -454,10 +401,9 @@ namespace cxxopts class option_required_exception : public OptionParseException { public: - option_required_exception(const std::string& option) - : OptionParseException( - "Option " + LQUOTE + option + RQUOTE + " is required but not present" - ) + option_required_exception(const std::string& option) : + OptionParseException("Option " + LQUOTE + option + RQUOTE + + " is required but not present") { } }; @@ -466,13 +412,10 @@ namespace cxxopts { namespace { - std::basic_regex<char> integer_pattern - ("(-)?(0x)?([0-9a-zA-Z]+)|((0x)?0)"); - std::basic_regex<char> truthy_pattern - ("(t|T)(rue)?"); - std::basic_regex<char> falsy_pattern - ("((f|F)(alse)?)?"); - } + std::basic_regex<char> integer_pattern("(-)?(0x)?([0-9a-zA-Z]+)|((0x)?0)"); + std::basic_regex<char> truthy_pattern("(t|T)(rue)?"); + std::basic_regex<char> falsy_pattern("((f|F)(alse)?)?"); + } // namespace namespace detail { @@ -508,7 +451,9 @@ namespace cxxopts { template <typename U> void - operator()(bool, U, const std::string&) {} + operator()(bool, U, const std::string&) + { + } }; template <typename T, typename U> @@ -517,7 +462,7 @@ namespace cxxopts { SignedCheck<T, std::numeric_limits<T>::is_signed>()(negative, value, text); } - } + } // namespace detail template <typename R, typename T> R @@ -598,9 +543,7 @@ namespace cxxopts if (negative) { - value = checked_negate<T>(result, - text, - std::integral_constant<bool, is_signed>()); + value = checked_negate<T>(result, text, std::integral_constant<bool, is_signed>()); } else { @@ -609,7 +552,8 @@ namespace cxxopts } template <typename T> - void stringstream_parser(const std::string& text, T& value) + void + stringstream_parser(const std::string& text, T& value) { std::stringstream in(text); in >> value; @@ -619,64 +563,55 @@ namespace cxxopts } } - inline - void + inline void parse_value(const std::string& text, uint8_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, int8_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, uint16_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, int16_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, uint32_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, int32_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, uint64_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, int64_t& value) { integer_parser(text, value); } - inline - void + inline void parse_value(const std::string& text, bool& value) { std::smatch result; @@ -698,8 +633,7 @@ namespace cxxopts throw argument_incorrect_type(text); } - inline - void + inline void parse_value(const std::string& text, std::string& value) { value = text; @@ -753,14 +687,11 @@ namespace cxxopts using Self = abstract_value<T>; public: - abstract_value() - : m_result(std::make_shared<T>()) - , m_store(m_result.get()) + abstract_value() : m_result(std::make_shared<T>()), m_store(m_result.get()) { } - abstract_value(T* t) - : m_store(t) + abstract_value(T* t) : m_store(t) { } @@ -896,8 +827,7 @@ namespace cxxopts set_default_and_implicit(); } - standard_value(bool* b) - : abstract_value(b) + standard_value(bool* b) : abstract_value(b) { set_default_and_implicit(); } @@ -909,7 +839,6 @@ namespace cxxopts } private: - void set_default_and_implicit() { @@ -919,7 +848,7 @@ namespace cxxopts m_implicit_value = "true"; } }; - } + } // namespace values template <typename T> std::shared_ptr<Value> @@ -940,24 +869,15 @@ namespace cxxopts class OptionDetails { public: - OptionDetails - ( - const std::string& short_, - const std::string& long_, - const String& desc, - std::shared_ptr<const Value> val - ) - : m_short(short_) - , m_long(long_) - , m_desc(desc) - , m_value(val) - , m_count(0) + OptionDetails(const std::string& short_, + const std::string& long_, + const String& desc, + std::shared_ptr<const Value> val) : + m_short(short_), m_long(long_), m_desc(desc), m_value(val), m_count(0) { } - OptionDetails(const OptionDetails& rhs) - : m_desc(rhs.m_desc) - , m_count(rhs.m_count) + OptionDetails(const OptionDetails& rhs) : m_desc(rhs.m_desc), m_count(rhs.m_count) { m_value = rhs.m_value->clone(); } @@ -970,7 +890,8 @@ namespace cxxopts return m_desc; } - const Value& value() const + const Value& + value() const { return *m_value; } @@ -1026,11 +947,7 @@ namespace cxxopts { public: void - parse - ( - std::shared_ptr<const OptionDetails> details, - const std::string& text - ) + parse(std::shared_ptr<const OptionDetails> details, const std::string& text) { ensure_value(details); ++m_count; @@ -1083,21 +1000,18 @@ namespace cxxopts class KeyValue { public: - KeyValue(std::string key_, std::string value_) - : m_key(std::move(key_)) - , m_value(std::move(value_)) + KeyValue(std::string key_, std::string value_) : + m_key(std::move(key_)), m_value(std::move(value_)) { } - const - std::string& + const std::string& key() const { return m_key; } - const - std::string& + const std::string& value() const { return m_value; @@ -1120,14 +1034,12 @@ namespace cxxopts class ParseResult { public: - ParseResult( - const std::shared_ptr < - std::unordered_map<std::string, std::shared_ptr<OptionDetails>> - >, + const std::shared_ptr<std::unordered_map<std::string, std::shared_ptr<OptionDetails>>>, std::vector<std::string>, bool allow_unrecognised, - int&, char**&); + int&, + char**&); size_t count(const std::string& o) const @@ -1165,40 +1077,26 @@ namespace cxxopts } private: + void parse(int& argc, char**& argv); - void - parse(int& argc, char**& argv); + void add_to_option(const std::string& option, const std::string& arg); - void - add_to_option(const std::string& option, const std::string& arg); + bool consume_positional(std::string a); - bool - consume_positional(std::string a); + void parse_option(std::shared_ptr<OptionDetails> value, + const std::string& name, + const std::string& arg = ""); - void - parse_option - ( - std::shared_ptr<OptionDetails> value, - const std::string& name, - const std::string& arg = "" - ); + void parse_default(std::shared_ptr<OptionDetails> details); - void - parse_default(std::shared_ptr<OptionDetails> details); + void checked_parse_arg(int argc, + char* argv[], + int& current, + std::shared_ptr<OptionDetails> value, + const std::string& name); - void - checked_parse_arg - ( - int argc, - char* argv[], - int& current, - std::shared_ptr<OptionDetails> value, - const std::string& name - ); - - const std::shared_ptr < - std::unordered_map<std::string, std::shared_ptr<OptionDetails>> - > m_options; + const std::shared_ptr<std::unordered_map<std::string, std::shared_ptr<OptionDetails>>> + m_options; std::vector<std::string> m_positional; std::vector<std::string>::iterator m_next_positional; std::unordered_set<std::string> m_positional_set; @@ -1211,19 +1109,18 @@ namespace cxxopts class Options { - typedef std::unordered_map<std::string, std::shared_ptr<OptionDetails>> - OptionMap; - public: + typedef std::unordered_map<std::string, std::shared_ptr<OptionDetails>> OptionMap; - Options(std::string program, std::string help_string = "") - : m_program(std::move(program)) - , m_help_string(toLocalString(std::move(help_string))) - , m_custom_help("[OPTION...]") - , m_positional_help("positional parameters") - , m_show_positional(false) - , m_allow_unrecognised(false) - , m_options(std::make_shared<OptionMap>()) - , m_next_positional(m_positional.end()) + public: + Options(std::string program, std::string help_string = "") : + m_program(std::move(program)), + m_help_string(toLocalString(std::move(help_string))), + m_custom_help("[OPTION...]"), + m_positional_help("positional parameters"), + m_show_positional(false), + m_allow_unrecognised(false), + m_options(std::make_shared<OptionMap>()), + m_next_positional(m_positional.end()) { } @@ -1255,70 +1152,45 @@ namespace cxxopts return *this; } - ParseResult - parse(int& argc, char**& argv); + ParseResult parse(int& argc, char**& argv); - OptionAdder - add_options(std::string group = ""); + OptionAdder add_options(std::string group = ""); - void - add_option - ( - const std::string& group, - const std::string& s, - const std::string& l, - std::string desc, - std::shared_ptr<const Value> value, - std::string arg_help - ); + void add_option(const std::string& group, + const std::string& s, + const std::string& l, + std::string desc, + std::shared_ptr<const Value> value, + std::string arg_help); //parse positional arguments into the given option - void - parse_positional(std::string option); + void parse_positional(std::string option); - void - parse_positional(std::vector<std::string> options); + void parse_positional(std::vector<std::string> options); - void - parse_positional(std::initializer_list<std::string> options); + void parse_positional(std::initializer_list<std::string> options); template <typename Iterator> void parse_positional(Iterator begin, Iterator end) { - parse_positional(std::vector<std::string> {begin, end}); + parse_positional(std::vector<std::string>{begin, end}); } - std::string - help(const std::vector<std::string>& groups = {}) const; + std::string help(const std::vector<std::string>& groups = {}) const; - const std::vector<std::string> - groups() const; + const std::vector<std::string> groups() const; - const HelpGroupDetails& - group_help(const std::string& group) const; + const HelpGroupDetails& group_help(const std::string& group) const; private: + void add_one_option(const std::string& option, std::shared_ptr<OptionDetails> details); - void - add_one_option - ( - const std::string& option, - std::shared_ptr<OptionDetails> details - ); - - String - help_one_group(const std::string& group) const; + String help_one_group(const std::string& group) const; - void - generate_group_help - ( - String& result, - const std::vector<std::string>& groups - ) const; + void generate_group_help(String& result, const std::vector<std::string>& groups) const; - void - generate_all_groups_help(String& result) const; + void generate_all_groups_help(String& result) const; std::string m_program; String m_help_string; @@ -1339,21 +1211,15 @@ namespace cxxopts class OptionAdder { public: - - OptionAdder(Options& options, std::string group) - : m_options(options), m_group(std::move(group)) + OptionAdder(Options& options, std::string group) : + m_options(options), m_group(std::move(group)) { } - OptionAdder& - operator() - ( - const std::string& opts, - const std::string& desc, - std::shared_ptr<const Value> value - = ::cxxopts::value<bool>(), - std::string arg_help = "" - ); + OptionAdder& operator()(const std::string& opts, + const std::string& desc, + std::shared_ptr<const Value> value = ::cxxopts::value<bool>(), + std::string arg_help = ""); private: Options& m_options; @@ -1365,17 +1231,14 @@ namespace cxxopts constexpr int OPTION_LONGEST = 30; constexpr int OPTION_DESC_GAP = 2; - std::basic_regex<char> option_matcher - ("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([[:alnum:]]+)"); + std::basic_regex<char> + option_matcher("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([[:alnum:]]+)"); - std::basic_regex<char> option_specifier - ("(([[:alnum:]]),)?[ ]*([[:alnum:]][-_[:alnum:]]*)?"); + std::basic_regex<char> + option_specifier("(([[:alnum:]]),)?[ ]*([[:alnum:]][-_[:alnum:]]*)?"); String - format_option - ( - const HelpOptionDetails& o - ) + format_option(const HelpOptionDetails& o) { auto& s = o.s; auto& l = o.l; @@ -1414,12 +1277,7 @@ namespace cxxopts } String - format_description - ( - const HelpOptionDetails& o, - size_t start, - size_t width - ) + format_description(const HelpOptionDetails& o, size_t start, size_t width) { auto desc = o.desc; @@ -1480,42 +1338,34 @@ namespace cxxopts return result; } - } + } // namespace - inline - ParseResult::ParseResult - ( - const std::shared_ptr < - std::unordered_map<std::string, std::shared_ptr<OptionDetails>> - > options, + inline ParseResult::ParseResult( + const std::shared_ptr<std::unordered_map<std::string, std::shared_ptr<OptionDetails>>> + options, std::vector<std::string> positional, bool allow_unrecognised, - int& argc, char**& argv - ) - : m_options(options) - , m_positional(std::move(positional)) - , m_next_positional(m_positional.begin()) - , m_allow_unrecognised(allow_unrecognised) + int& argc, + char**& argv) : + m_options(options), + m_positional(std::move(positional)), + m_next_positional(m_positional.begin()), + m_allow_unrecognised(allow_unrecognised) { parse(argc, argv); } - inline - OptionAdder + inline OptionAdder Options::add_options(std::string group) { return OptionAdder(*this, std::move(group)); } - inline - OptionAdder& - OptionAdder::operator() - ( - const std::string& opts, - const std::string& desc, - std::shared_ptr<const Value> value, - std::string arg_help - ) + inline OptionAdder& + OptionAdder::operator()(const std::string& opts, + const std::string& desc, + std::shared_ptr<const Value> value, + std::string arg_help) { std::match_results<const char*> result; std::regex_match(opts.c_str(), result, option_specifier); @@ -1537,11 +1387,8 @@ namespace cxxopts throw invalid_option_format_error(opts); } - auto option_names = [] - ( - const std::sub_match<const char*>& short_, - const std::sub_match<const char*>& long_ - ) + auto option_names = + [](const std::sub_match<const char*>& short_, const std::sub_match<const char*>& long_) { if (long_.length() == 1) { @@ -1551,37 +1398,28 @@ namespace cxxopts { return std::make_tuple(short_.str(), long_.str()); } - } - (short_match, long_match); + }(short_match, long_match); - m_options.add_option - ( - m_group, - std::get<0>(option_names), - std::get<1>(option_names), - desc, - value, - std::move(arg_help) - ); + m_options.add_option(m_group, + std::get<0>(option_names), + std::get<1>(option_names), + desc, + value, + std::move(arg_help)); return *this; } - inline - void + inline void ParseResult::parse_default(std::shared_ptr<OptionDetails> details) { m_results[details].parse_default(details); } - inline - void - ParseResult::parse_option - ( - std::shared_ptr<OptionDetails> value, - const std::string& /*name*/, - const std::string& arg - ) + inline void + ParseResult::parse_option(std::shared_ptr<OptionDetails> value, + const std::string& /*name*/, + const std::string& arg) { auto& result = m_results[value]; result.parse(value, arg); @@ -1589,16 +1427,12 @@ namespace cxxopts m_sequential.emplace_back(value->long_name(), arg); } - inline - void - ParseResult::checked_parse_arg - ( - int argc, - char* argv[], - int& current, - std::shared_ptr<OptionDetails> value, - const std::string& name - ) + inline void + ParseResult::checked_parse_arg(int argc, + char* argv[], + int& current, + std::shared_ptr<OptionDetails> value, + const std::string& name) { if (current + 1 >= argc) { @@ -1625,8 +1459,7 @@ namespace cxxopts } } - inline - void + inline void ParseResult::add_to_option(const std::string& option, const std::string& arg) { auto iter = m_options->find(option); @@ -1639,8 +1472,7 @@ namespace cxxopts parse_option(iter->second, option, arg); } - inline - bool + inline bool ParseResult::consume_positional(std::string a) { while (m_next_positional != m_positional.end()) @@ -1675,15 +1507,13 @@ namespace cxxopts return false; } - inline - void + inline void Options::parse_positional(std::string option) { - parse_positional(std::vector<std::string> {std::move(option)}); + parse_positional(std::vector<std::string>{std::move(option)}); } - inline - void + inline void Options::parse_positional(std::vector<std::string> options) { m_positional = std::move(options); @@ -1692,23 +1522,20 @@ namespace cxxopts m_positional_set.insert(m_positional.begin(), m_positional.end()); } - inline - void + inline void Options::parse_positional(std::initializer_list<std::string> options) { parse_positional(std::vector<std::string>(std::move(options))); } - inline - ParseResult + inline ParseResult Options::parse(int& argc, char**& argv) { ParseResult result(m_options, m_positional, m_allow_unrecognised, argc, argv); return result; } - inline - void + inline void ParseResult::parse(int& argc, char**& argv) { int current = 1; @@ -1832,7 +1659,6 @@ namespace cxxopts checked_parse_arg(argc, argv, current, opt, name); } } - } ++current; @@ -1872,20 +1698,15 @@ namespace cxxopts } argc = nextKeep; - } - inline - void - Options::add_option - ( - const std::string& group, - const std::string& s, - const std::string& l, - std::string desc, - std::shared_ptr<const Value> value, - std::string arg_help - ) + inline void + Options::add_option(const std::string& group, + const std::string& s, + const std::string& l, + std::string desc, + std::shared_ptr<const Value> value, + std::string arg_help) { auto stringDesc = toLocalString(std::move(desc)); auto option = std::make_shared<OptionDetails>(s, l, stringDesc, value); @@ -1903,21 +1724,20 @@ namespace cxxopts //add the help details auto& options = m_help[group]; - options.options.emplace_back(HelpOptionDetails{s, l, stringDesc, - value->has_default(), value->get_default_value(), - value->has_implicit(), value->get_implicit_value(), - std::move(arg_help), - value->is_container(), - value->is_boolean()}); + options.options.emplace_back(HelpOptionDetails{s, + l, + stringDesc, + value->has_default(), + value->get_default_value(), + value->has_implicit(), + value->get_implicit_value(), + std::move(arg_help), + value->is_container(), + value->is_boolean()}); } - inline - void - Options::add_one_option - ( - const std::string& option, - std::shared_ptr<OptionDetails> details - ) + inline void + Options::add_one_option(const std::string& option, std::shared_ptr<OptionDetails> details) { auto in = m_options->emplace(option, details); @@ -1927,8 +1747,7 @@ namespace cxxopts } } - inline - String + inline String Options::help_one_group(const std::string& g) const { typedef std::vector<std::pair<String, String>> OptionHelp; @@ -1952,8 +1771,7 @@ namespace cxxopts for (const auto& o : group->second.options) { - if (o.is_container && - m_positional_set.find(o.l) != m_positional_set.end() && + if (o.is_container && m_positional_set.find(o.l) != m_positional_set.end() && !m_show_positional) { continue; @@ -1972,8 +1790,7 @@ namespace cxxopts auto fiter = format.begin(); for (const auto& o : group->second.options) { - if (o.is_container && - m_positional_set.find(o.l) != m_positional_set.end() && + if (o.is_container && m_positional_set.find(o.l) != m_positional_set.end() && !m_show_positional) { continue; @@ -1989,9 +1806,8 @@ namespace cxxopts } else { - result += toLocalString(std::string(longest + OPTION_DESC_GAP - - stringLength(fiter->first), - ' ')); + result += toLocalString( + std::string(longest + OPTION_DESC_GAP - stringLength(fiter->first), ' ')); } result += d; result += '\n'; @@ -2002,13 +1818,8 @@ namespace cxxopts return result; } - inline - void - Options::generate_group_help - ( - String& result, - const std::vector<std::string>& print_groups - ) const + inline void + Options::generate_group_help(String& result, const std::vector<std::string>& print_groups) const { for (size_t i = 0; i != print_groups.size(); ++i) { @@ -2025,8 +1836,7 @@ namespace cxxopts } } - inline - void + inline void Options::generate_all_groups_help(String& result) const { std::vector<std::string> all_groups; @@ -2040,12 +1850,11 @@ namespace cxxopts generate_group_help(result, all_groups); } - inline - std::string + inline std::string Options::help(const std::vector<std::string>& help_groups) const { - String result = m_help_string + "\nUsage:\n " + - toLocalString(m_program) + " " + toLocalString(m_custom_help); + String result = m_help_string + "\nUsage:\n " + toLocalString(m_program) + " " + + toLocalString(m_custom_help); if (m_positional.size() > 0 && m_positional_help.size() > 0) { @@ -2066,32 +1875,26 @@ namespace cxxopts return toUTF8String(result); } - inline - const std::vector<std::string> + inline const std::vector<std::string> Options::groups() const { std::vector<std::string> g; - std::transform( - m_help.begin(), - m_help.end(), - std::back_inserter(g), - [](const std::map<std::string, HelpGroupDetails>::value_type & pair) - { - return pair.first; - } - ); + std::transform(m_help.begin(), + m_help.end(), + std::back_inserter(g), + [](const std::map<std::string, HelpGroupDetails>::value_type& pair) + { return pair.first; }); return g; } - inline - const HelpGroupDetails& + inline const HelpGroupDetails& Options::group_help(const std::string& group) const { return m_help.at(group); } -} +} // namespace cxxopts #endif //CXXOPTS_HPP_INCLUDED diff --git a/source/RobotAPI/components/ArViz/Client/elements/point_cloud_type_traits.hpp b/source/RobotAPI/components/ArViz/Client/elements/point_cloud_type_traits.hpp index c3d10f583b6a62c35c4ee66a12205f5f3fd51096..57bdfb84c160b6e5e7196508914d012ef02fe47c 100644 --- a/source/RobotAPI/components/ArViz/Client/elements/point_cloud_type_traits.hpp +++ b/source/RobotAPI/components/ArViz/Client/elements/point_cloud_type_traits.hpp @@ -3,7 +3,6 @@ #include <SimoxUtility/meta/has_member_macros/has_member.hpp> - namespace armarx::viz::detail { @@ -13,17 +12,13 @@ namespace armarx::viz::detail define_has_member(a); define_has_member(label); - template <typename PointT> class has_members_rgba { public: - static constexpr bool value = - has_member_r<PointT>::value && has_member_g<PointT>::value - && has_member_b<PointT>::value && has_member_a<PointT>::value; - + static constexpr bool value = has_member_r<PointT>::value && has_member_g<PointT>::value && + has_member_b<PointT>::value && has_member_a<PointT>::value; }; -} - +} // namespace armarx::viz::detail diff --git a/source/RobotAPI/components/armem/client/RobotStatePredictionClientExample/simox_alg.hpp b/source/RobotAPI/components/armem/client/RobotStatePredictionClientExample/simox_alg.hpp index 4a56a6ca012eb3b3180a757005f9a5d5633b1f82..85199992ae567657a51808fb1dd36c5be589158d 100644 --- a/source/RobotAPI/components/armem/client/RobotStatePredictionClientExample/simox_alg.hpp +++ b/source/RobotAPI/components/armem/client/RobotStatePredictionClientExample/simox_alg.hpp @@ -36,7 +36,6 @@ namespace simox::alg return conc; } - template <class KeyT, class ValueT> std::map<KeyT, ValueT> map_from_key_value_pairs(const std::vector<KeyT>& lhs, const std::vector<ValueT>& rhs) @@ -51,7 +50,6 @@ namespace simox::alg return map; } - template <class KeyT, class ValueT> std::vector<ValueT> multi_at(const std::map<KeyT, ValueT>& map, diff --git a/source/RobotAPI/components/ik_demo/ComponentInterface.ice b/source/RobotAPI/components/ik_demo/ComponentInterface.ice index edde6d507af83320f080fb20c61856a4036747b3..6114541b7a984664878b5636e85b588308ffa755 100644 --- a/source/RobotAPI/components/ik_demo/ComponentInterface.ice +++ b/source/RobotAPI/components/ik_demo/ComponentInterface.ice @@ -24,12 +24,19 @@ #pragma once -module armar6 { module skills { module components { module armar6_ik_demo +module armar6 { - - interface ComponentInterface + module skills { - // Define your interface here. - }; + module components + { + module armar6_ik_demo + { -};};};}; + interface ComponentInterface{ + // Define your interface here. + }; + }; + }; + }; +}; diff --git a/source/RobotAPI/drivers/CyberGloveUnit/CyberGloveInterface.ice b/source/RobotAPI/drivers/CyberGloveUnit/CyberGloveInterface.ice index 1e4dd648305747cc2ecedf395f0fa2e3d98aacdb..e9b3235ec2c2238755e7be9826ec96ce8b99d0fc 100644 --- a/source/RobotAPI/drivers/CyberGloveUnit/CyberGloveInterface.ice +++ b/source/RobotAPI/drivers/CyberGloveUnit/CyberGloveInterface.ice @@ -63,7 +63,7 @@ module armarx interface CyberGloveInterface { - string getTopicName(); + string getTopicName(); }; }; diff --git a/source/RobotAPI/drivers/ProsthesisObserver/ProsthesisInterface.ice b/source/RobotAPI/drivers/ProsthesisObserver/ProsthesisInterface.ice index 28219519e85357d13747a234352dd594d6f4c805..57fe20a784171867eb04b62829f37fd31d3d695f 100644 --- a/source/RobotAPI/drivers/ProsthesisObserver/ProsthesisInterface.ice +++ b/source/RobotAPI/drivers/ProsthesisObserver/ProsthesisInterface.ice @@ -44,7 +44,7 @@ module armarx interface ProsthesisInterface { - string getTopicName(); + string getTopicName(); }; }; diff --git a/source/RobotAPI/interface/ArViz.ice b/source/RobotAPI/interface/ArViz.ice index bfbc8715305165f7d8d74ff39a463e3727727105..e27fd71c9e1978c3f29d232548e3a7e5b80d6a83 100644 --- a/source/RobotAPI/interface/ArViz.ice +++ b/source/RobotAPI/interface/ArViz.ice @@ -1,5 +1,4 @@ #pragma once -#include <RobotAPI/interface/ArViz/Elements.ice> #include <RobotAPI/interface/ArViz/Component.ice> - +#include <RobotAPI/interface/ArViz/Elements.ice> diff --git a/source/RobotAPI/interface/ArViz/Component.ice b/source/RobotAPI/interface/ArViz/Component.ice index 6ba528b4f87fe2dab27c6d9511612b3ae01055ed..0af7862b659cfab7071e313813c79dbdefda645b 100644 --- a/source/RobotAPI/interface/ArViz/Component.ice +++ b/source/RobotAPI/interface/ArViz/Component.ice @@ -1,149 +1,145 @@ #pragma once -#include <RobotAPI/interface/ArViz/Elements.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -module armarx -{ -module viz -{ -module data -{ - -sequence <Element> ElementSeq; - -enum LayerAction -{ - // Create a new layer or update an existing layer - Layer_CREATE_OR_UPDATE, - - // Delete an existing layer - Layer_DELETE, -}; - -struct LayerUpdate -{ - string component; - string name; - LayerAction action = Layer_CREATE_OR_UPDATE; - - // Elements are only needed for Layer_CREATE_OR_UPDATE - ElementSeq elements; -}; - -sequence <LayerUpdate> LayerUpdateSeq; - -struct TimestampedLayerUpdate -{ - LayerUpdate update; - long revision = 0; - long timestampInMicroseconds = 0; -}; - -struct LayerUpdates -{ - LayerUpdateSeq updates; - long revision = 0; -}; - -struct CommitInput -{ - LayerUpdateSeq updates; - - string interactionComponent; - Ice::StringSeq interactionLayers; -}; - -struct CommitResult -{ - // The revision number corresponding to the applied commit - long revision = 0; - - // Interactions for the requested layers (see Layer_RECEIVE_INTERACTIONS) - InteractionFeedbackSeq interactions; -}; - -struct RecordingHeader -{ - string prefix; - string comment; - long firstTimestampInMicroSeconds = 0; - long lastTimestampInMicroSeconds = 0; - long firstRevision = 0; - long lastRevision = 0; -}; - -struct RecordingBatchHeader -{ - long index = 0; - long firstTimestampInMicroSeconds = 0; - long lastTimestampInMicroSeconds = 0; - long firstRevision = 0; - long lastRevision = 0; -}; - -sequence<RecordingBatchHeader> RecordingBatchHeaderSeq; - -struct Recording -{ - string id; - string comment; - long firstTimestampInMicroSeconds = 0; - long lastTimestampInMicroSeconds = 0; - long firstRevision = 0; - long lastRevision = 0; - RecordingBatchHeaderSeq batchHeaders; -}; - -sequence<TimestampedLayerUpdate> TimestampedLayerUpdateSeq; - -struct RecordingBatch -{ - RecordingBatchHeader header; - TimestampedLayerUpdateSeq initialState; // Keyframe with complete state - TimestampedLayerUpdateSeq updates; // Incremental updates on keyframe -}; - -sequence<Recording> RecordingSeq; - -struct RecordingsInfo -{ - data::RecordingSeq recordings; - // Equivalent to the property "HistoryPath" of ArVizStorage. - string recordingsPath; -}; - -}; +#include <RobotAPI/interface/ArViz/Elements.ice> -interface StorageInterface +module armarx { - data::CommitResult commitAndReceiveInteractions(data::CommitInput input); - - data::LayerUpdates pullUpdatesSince(long revision); - - data::LayerUpdates pullUpdatesSinceAndSendInteractions( + module viz + { + module data + { + + sequence<Element> ElementSeq; + + enum LayerAction + { + // Create a new layer or update an existing layer + Layer_CREATE_OR_UPDATE, + + // Delete an existing layer + Layer_DELETE, + }; + + struct LayerUpdate + { + string component; + string name; + LayerAction action = Layer_CREATE_OR_UPDATE; + + // Elements are only needed for Layer_CREATE_OR_UPDATE + ElementSeq elements; + }; + + sequence<LayerUpdate> LayerUpdateSeq; + + struct TimestampedLayerUpdate + { + LayerUpdate update; + long revision = 0; + long timestampInMicroseconds = 0; + }; + + struct LayerUpdates + { + LayerUpdateSeq updates; + long revision = 0; + }; + + struct CommitInput + { + LayerUpdateSeq updates; + + string interactionComponent; + Ice::StringSeq interactionLayers; + }; + + struct CommitResult + { + // The revision number corresponding to the applied commit + long revision = 0; + + // Interactions for the requested layers (see Layer_RECEIVE_INTERACTIONS) + InteractionFeedbackSeq interactions; + }; + + struct RecordingHeader + { + string prefix; + string comment; + long firstTimestampInMicroSeconds = 0; + long lastTimestampInMicroSeconds = 0; + long firstRevision = 0; + long lastRevision = 0; + }; + + struct RecordingBatchHeader + { + long index = 0; + long firstTimestampInMicroSeconds = 0; + long lastTimestampInMicroSeconds = 0; + long firstRevision = 0; + long lastRevision = 0; + }; + + sequence<RecordingBatchHeader> RecordingBatchHeaderSeq; + + struct Recording + { + string id; + string comment; + long firstTimestampInMicroSeconds = 0; + long lastTimestampInMicroSeconds = 0; + long firstRevision = 0; + long lastRevision = 0; + RecordingBatchHeaderSeq batchHeaders; + }; + + sequence<TimestampedLayerUpdate> TimestampedLayerUpdateSeq; + + struct RecordingBatch + { + RecordingBatchHeader header; + TimestampedLayerUpdateSeq initialState; // Keyframe with complete state + TimestampedLayerUpdateSeq updates; // Incremental updates on keyframe + }; + + sequence<Recording> RecordingSeq; + + struct RecordingsInfo + { + data::RecordingSeq recordings; + // Equivalent to the property "HistoryPath" of ArVizStorage. + string recordingsPath; + }; + }; + + interface StorageInterface + { + data::CommitResult commitAndReceiveInteractions(data::CommitInput input); + + data::LayerUpdates pullUpdatesSince(long revision); + + data::LayerUpdates pullUpdatesSinceAndSendInteractions( long revision, data::InteractionFeedbackSeq interactions); - string startRecording(string prefix); + string startRecording(string prefix); - void stopRecording(); + void stopRecording(); - data::RecordingsInfo getAllRecordings(); + data::RecordingsInfo getAllRecordings(); - data::RecordingBatch getRecordingBatch(string recordingID, long batchIndex); -}; + data::RecordingBatch getRecordingBatch(string recordingID, long batchIndex); + }; -interface Topic -{ - // FIXME: The old interface used this topic. - // But this call has been superceeded by commitAndReceiveInteractions - void updateLayers(data::LayerUpdateSeq updates); -}; + interface Topic + { + // FIXME: The old interface used this topic. + // But this call has been superceeded by commitAndReceiveInteractions + void updateLayers(data::LayerUpdateSeq updates); + }; -interface StorageAndTopicInterface extends StorageInterface, Topic -{ -}; - - -}; + interface StorageAndTopicInterface extends StorageInterface, Topic{}; + }; }; diff --git a/source/RobotAPI/interface/ArViz/Elements.ice b/source/RobotAPI/interface/ArViz/Elements.ice index 5833f259e501b2e47106bc1c9195158f30fccd83..007bc1278219ad78028a708ca95c4eae805df0e4 100644 --- a/source/RobotAPI/interface/ArViz/Elements.ice +++ b/source/RobotAPI/interface/ArViz/Elements.ice @@ -6,259 +6,258 @@ module armarx { -module viz -{ -module data -{ - struct GlobalPose - { - float x = 0.0f; - float y = 0.0f; - float z = 0.0f; - float qw = 1.0f; - float qx = 0.0f; - float qy = 0.0f; - float qz = 0.0f; - }; - - struct Color - { - byte a = 255; - byte r = 100; - byte g = 100; - byte b = 100; - }; - - module InteractionEnableFlags - { - const int NONE = 0; - - // Make an object selectable - const int SELECT = 1; - // Enable the context menu for an object - const int CONTEXT_MENU = 2; - - // Enable translation along the three axes - const int TRANSLATION_X = 4; - const int TRANSLATION_Y = 8; - const int TRANSLATION_Z = 16; - const int TRANSLATION_LOCAL = 32; - - // Enable rotation along the three axes - const int ROTATION_X = 64; - const int ROTATION_Y = 128; - const int ROTATION_Z = 256; - const int ROTATION_LOCAL = 512; - - // Enable scaling along the three axes - const int SCALING_X = 1024; - const int SCALING_Y = 2048; - const int SCALING_Z = 4096; - const int SCALING_LOCAL = 8192; - - // Hide the original object during the transformation - const int TRANSFORM_HIDE = 16384; - }; - - struct InteractionDescription - { - int enableFlags = 0; - Ice::StringSeq contextMenuOptions; - }; - - module InteractionFeedbackType - { - const int NONE = 0; - - const int SELECT = 1; - const int DESELECT = 2; - - const int CONTEXT_MENU_CHOSEN = 3; - - const int TRANSFORM = 4; - - // Flag to indicate state of the transformation - const int TRANSFORM_BEGIN_FLAG = 16; - const int TRANSFORM_DURING_FLAG = 32; - const int TRANSFORM_END_FLAG = 64; - }; - - struct InteractionFeedback - { - // The type of interaction that happened (in the lower 4 bits) - // The higher bits are used for flags specifying more details of the interaction - int type = 0; - - // The element with which the interaction took place - string component; - string layer; - string element; - // The revision in which the interaction took place - long revision = 0; - - // Chosen context menu entry is only relevant for type == CONTEXT_MENU_CHOSEN - int chosenContextMenuEntry = 0; - - // Applied transformation is only relevant for type == TRANSFORM - GlobalPose transformation; - Vector3f scale; - }; - - sequence<InteractionFeedback> InteractionFeedbackSeq; - - module ElementFlags - { - const int NONE = 0; - const int OVERRIDE_MATERIAL = 1; - const int HIDDEN = 2; - }; - - class Element - { - string id; - InteractionDescription interaction; - - GlobalPose pose; - Vector3f scale; - Color color; - int flags = 0; - }; - - class ElementPose extends Element - { - }; - - class ElementLine extends Element - { - Vector3f from; - Vector3f to; - - float lineWidth = 10.0f; - }; - - class ElementBox extends Element - { - Vector3f size; - }; - - class ElementSphere extends Element - { - float radius = 10.0f; - }; - - class ElementEllipsoid extends Element - { - Vector3f axisLengths; - Vector3f curvature; - }; - - class ElementCylinder extends Element + module viz { - float height = 10.0f; - float radius = 10.0f; + module data + { + struct GlobalPose + { + float x = 0.0f; + float y = 0.0f; + float z = 0.0f; + float qw = 1.0f; + float qx = 0.0f; + float qy = 0.0f; + float qz = 0.0f; + }; + + struct Color + { + byte a = 255; + byte r = 100; + byte g = 100; + byte b = 100; + }; + + module InteractionEnableFlags + { + const int NONE = 0; + + // Make an object selectable + const int SELECT = 1; + // Enable the context menu for an object + const int CONTEXT_MENU = 2; + + // Enable translation along the three axes + const int TRANSLATION_X = 4; + const int TRANSLATION_Y = 8; + const int TRANSLATION_Z = 16; + const int TRANSLATION_LOCAL = 32; + + // Enable rotation along the three axes + const int ROTATION_X = 64; + const int ROTATION_Y = 128; + const int ROTATION_Z = 256; + const int ROTATION_LOCAL = 512; + + // Enable scaling along the three axes + const int SCALING_X = 1024; + const int SCALING_Y = 2048; + const int SCALING_Z = 4096; + const int SCALING_LOCAL = 8192; + + // Hide the original object during the transformation + const int TRANSFORM_HIDE = 16384; + }; + + struct InteractionDescription + { + int enableFlags = 0; + Ice::StringSeq contextMenuOptions; + }; + + module InteractionFeedbackType + { + const int NONE = 0; + + const int SELECT = 1; + const int DESELECT = 2; + + const int CONTEXT_MENU_CHOSEN = 3; + + const int TRANSFORM = 4; + + // Flag to indicate state of the transformation + const int TRANSFORM_BEGIN_FLAG = 16; + const int TRANSFORM_DURING_FLAG = 32; + const int TRANSFORM_END_FLAG = 64; + }; + + struct InteractionFeedback + { + // The type of interaction that happened (in the lower 4 bits) + // The higher bits are used for flags specifying more details of the interaction + int type = 0; + + // The element with which the interaction took place + string component; + string layer; + string element; + // The revision in which the interaction took place + long revision = 0; + + // Chosen context menu entry is only relevant for type == CONTEXT_MENU_CHOSEN + int chosenContextMenuEntry = 0; + + // Applied transformation is only relevant for type == TRANSFORM + GlobalPose transformation; + Vector3f scale; + }; + + sequence<InteractionFeedback> InteractionFeedbackSeq; + + module ElementFlags + { + const int NONE = 0; + const int OVERRIDE_MATERIAL = 1; + const int HIDDEN = 2; + }; + + class Element + { + string id; + InteractionDescription interaction; + + GlobalPose pose; + Vector3f scale; + Color color; + int flags = 0; + }; + + class ElementPose extends Element + { + }; + + class ElementLine extends Element + { + Vector3f from; + Vector3f to; + + float lineWidth = 10.0f; + }; + + class ElementBox extends Element + { + Vector3f size; + }; + + class ElementSphere extends Element + { + float radius = 10.0f; + }; + + class ElementEllipsoid extends Element + { + Vector3f axisLengths; + Vector3f curvature; + }; + + class ElementCylinder extends Element + { + float height = 10.0f; + float radius = 10.0f; + }; + + class ElementCylindroid extends Element + { + Vector2f axisLengths; + Vector2f curvature; + float height; + }; + + class ElementText extends Element + { + string text; + }; + + class ElementPolygon extends Element + { + Vector3fSeq points; + + Color lineColor; + float lineWidth = 0.0f; + }; + + class ElementPath extends Element + { + Vector3fSeq points; + + float lineWidth = 10.0f; + }; + + class ElementArrow extends Element + { + float length = 100.0f; + float width = 10.0f; + }; + + class ElementArrowCircle extends Element + { + float radius = 100.0f; + float completion = 1.0f; + float width = 10.0f; + }; + + struct ColoredPoint + { + float x; + float y; + float z; + Color color; + }; + + sequence<ColoredPoint> ColoredPointList; + + class ElementPointCloud extends Element + { + Ice::ByteSeq points; + float transparency = 0.0f; + float pointSizeInPixels = 1.0f; + }; + + sequence<Color> ColorSeq; + + struct Face + { + int v0 = 0; + int v1 = 0; + int v2 = 0; + int c0 = 0; + int c1 = 0; + int c2 = 0; + }; + + sequence<Face> FaceSeq; + + class ElementMesh extends Element + { + Vector3fSeq vertices; + ColorSeq colors; + FaceSeq faces; + }; + + module ModelDrawStyle + { + const int ORIGINAL = 0; + const int COLLISION = 1; + const int OVERRIDE_COLOR = 2; + }; + + class ElementRobot extends Element + { + string project; + string filename; + int drawStyle = ModelDrawStyle::ORIGINAL; + + StringFloatDictionary jointValues; + }; + + class ElementObject extends Element + { + string project; + string filename; + int drawStyle = ModelDrawStyle::ORIGINAL; + }; + }; }; - - class ElementCylindroid extends Element - { - Vector2f axisLengths; - Vector2f curvature; - float height; - }; - - class ElementText extends Element - { - string text; - }; - - class ElementPolygon extends Element - { - Vector3fSeq points; - - Color lineColor; - float lineWidth = 0.0f; - }; - - class ElementPath extends Element - { - Vector3fSeq points; - - float lineWidth = 10.0f; - }; - - class ElementArrow extends Element - { - float length = 100.0f; - float width = 10.0f; - }; - - class ElementArrowCircle extends Element - { - float radius = 100.0f; - float completion = 1.0f; - float width = 10.0f; - }; - - struct ColoredPoint - { - float x; - float y; - float z; - Color color; - }; - - sequence<ColoredPoint> ColoredPointList; - - class ElementPointCloud extends Element - { - Ice::ByteSeq points; - float transparency = 0.0f; - float pointSizeInPixels = 1.0f; - }; - - sequence<Color> ColorSeq; - - struct Face - { - int v0 = 0; - int v1 = 0; - int v2 = 0; - int c0 = 0; - int c1 = 0; - int c2 = 0; - }; - - sequence<Face> FaceSeq; - - class ElementMesh extends Element - { - Vector3fSeq vertices; - ColorSeq colors; - FaceSeq faces; - }; - - module ModelDrawStyle - { - const int ORIGINAL = 0; - const int COLLISION = 1; - const int OVERRIDE_COLOR = 2; - }; - - class ElementRobot extends Element - { - string project; - string filename; - int drawStyle = ModelDrawStyle::ORIGINAL; - - StringFloatDictionary jointValues; - }; - - class ElementObject extends Element - { - string project; - string filename; - int drawStyle = ModelDrawStyle::ORIGINAL; - }; - -}; -}; }; diff --git a/source/RobotAPI/interface/ArmarXObjects/ArmarXObjectsTypes.ice b/source/RobotAPI/interface/ArmarXObjects/ArmarXObjectsTypes.ice index 779b25dd1902e49409fa9c23576192c7bc5f97ba..ffa1e8c6ea1a700d620d8aed08f4496610d5f106 100644 --- a/source/RobotAPI/interface/ArmarXObjects/ArmarXObjectsTypes.ice +++ b/source/RobotAPI/interface/ArmarXObjects/ArmarXObjectsTypes.ice @@ -36,7 +36,7 @@ module armarx /// An optional instance name, chosen by the provider. string instanceName; }; + sequence<ObjectID> ObjectIDSeq; }; }; - diff --git a/source/RobotAPI/interface/armem.ice b/source/RobotAPI/interface/armem.ice index f7621099de52b5a2f15b3f0f6367ec5c19471fb3..a7a5a6a086a2a5d5e1c97e12c22a6736d13e87c0 100644 --- a/source/RobotAPI/interface/armem.ice +++ b/source/RobotAPI/interface/armem.ice @@ -11,8 +11,7 @@ module armarx { - module armem - { + module armem{ }; }; diff --git a/source/RobotAPI/interface/armem/actions.ice b/source/RobotAPI/interface/armem/actions.ice index 5bb06fc4c9ec815dba87fef49a31bc13498b66fc..e3882145832b783fb25227236027cfd04e7c92ed 100644 --- a/source/RobotAPI/interface/armem/actions.ice +++ b/source/RobotAPI/interface/armem/actions.ice @@ -18,6 +18,7 @@ module armarx /// Human-readable text displayed to the user. string text; }; + sequence<MenuEntry> MenuEntrySeq; /** @@ -35,7 +36,6 @@ module armarx MenuEntrySeq entries; }; - class Menu { MenuEntrySeq entries; @@ -47,12 +47,14 @@ module armarx { armem::data::MemoryID id; }; + sequence<GetActionsInput> GetActionsInputSeq; struct GetActionsOutput { Menu menu; }; + sequence<GetActionsOutput> GetActionsOutputSeq; struct ExecuteActionInput @@ -60,6 +62,7 @@ module armarx armem::data::MemoryID id; ActionPath actionPath; }; + sequence<ExecuteActionInput> ExecuteActionInputSeq; struct ExecuteActionOutput @@ -67,6 +70,7 @@ module armarx bool success = false; string errorMessage; }; + sequence<ExecuteActionOutput> ExecuteActionOutputSeq; } } diff --git a/source/RobotAPI/interface/armem/addon/LegacyRobotStateMemoryAdapterInterface.ice b/source/RobotAPI/interface/armem/addon/LegacyRobotStateMemoryAdapterInterface.ice index baad0e798bc8a3762ec28ac4394b1a3556e3c576..0d1389987e79b1d95b9cb44ea237d2d53039d088 100644 --- a/source/RobotAPI/interface/armem/addon/LegacyRobotStateMemoryAdapterInterface.ice +++ b/source/RobotAPI/interface/armem/addon/LegacyRobotStateMemoryAdapterInterface.ice @@ -1,8 +1,8 @@ #pragma once +#include <RobotAPI/interface/core/RobotLocalization.ice> #include <RobotAPI/interface/units/KinematicUnitInterface.ice> #include <RobotAPI/interface/units/PlatformUnitInterface.ice> -#include <RobotAPI/interface/core/RobotLocalization.ice> module armarx { @@ -10,7 +10,8 @@ module armarx { module robot_state { - interface LegacyRobotStateMemoryAdapterInterface extends armarx::KinematicUnitListener, armarx::PlatformUnitListener, armarx::GlobalRobotPoseLocalizationListener + interface LegacyRobotStateMemoryAdapterInterface extends armarx::KinematicUnitListener, + armarx::PlatformUnitListener, armarx::GlobalRobotPoseLocalizationListener { } } diff --git a/source/RobotAPI/interface/armem/commit.ice b/source/RobotAPI/interface/armem/commit.ice index 4a7008293fbe1bd2080ebf808f1bd28621792303..6471c9034262424219e35996cb1cfc12b76627ba 100644 --- a/source/RobotAPI/interface/armem/commit.ice +++ b/source/RobotAPI/interface/armem/commit.ice @@ -18,6 +18,7 @@ module armarx bool clearWhenExists = false; }; + sequence<AddSegmentInput> AddSegmentsInput; struct AddSegmentResult @@ -27,8 +28,8 @@ module armarx string errorMessage; }; - sequence<AddSegmentResult> AddSegmentsResult; + sequence<AddSegmentResult> AddSegmentsResult; struct EntityUpdate { @@ -39,6 +40,7 @@ module armarx float confidence = 1.0; armarx::core::time::dto::DateTime timeSent; }; + sequence<EntityUpdate> EntityUpdateList; struct EntityUpdateResult @@ -50,12 +52,14 @@ module armarx string errorMessage; }; + sequence<EntityUpdateResult> EntityUpdateResultList; struct Commit { EntityUpdateList updates; }; + struct CommitResult { EntityUpdateResultList results; diff --git a/source/RobotAPI/interface/armem/memory.ice b/source/RobotAPI/interface/armem/memory.ice index 63801dd4da540ae46fef76e993a862e4979409c7..01577673ef0c6bb0e25bc2f5ae8f573939f96dc7 100644 --- a/source/RobotAPI/interface/armem/memory.ice +++ b/source/RobotAPI/interface/armem/memory.ice @@ -7,95 +7,92 @@ module armarx { - module armem + module armem{module data{struct MemoryID{string memoryName = ""; + string coreSegmentName = ""; + string providerSegmentName = ""; + string entityName = ""; + armarx::core::time::dto::DateTime timestamp; + int instanceIndex = -1; +} + +sequence<MemoryID> MemoryIDs; + +module detail +{ + class MemoryItem { - module data - { - struct MemoryID - { - string memoryName = ""; - string coreSegmentName = ""; - string providerSegmentName = ""; - string entityName = ""; - armarx::core::time::dto::DateTime timestamp; - int instanceIndex = -1; - } - - sequence<MemoryID> MemoryIDs; - - module detail - { - class MemoryItem - { - MemoryID id; - }; - class TypedMemoryContainer extends MemoryItem - { - aron::type::dto::GenericType aronType; - }; - } - - /// Ice Twin of `armarx::armem::EntityInstanceMetadata`. - class EntityInstanceMetadata - { - armarx::core::time::dto::DateTime referencedTime; - armarx::core::time::dto::DateTime sentTime; - armarx::core::time::dto::DateTime arrivedTime; - armarx::core::time::dto::DateTime lastAccessedTime; - long accessed = 0; - - float confidence = 1.0; - }; - /// Ice Twin of `armarx::armem::EntityInstance`. - class EntityInstance extends detail::MemoryItem - { - aron::data::dto::Dict data; - - EntityInstanceMetadata metadata; - }; - sequence<EntityInstance> EntityInstanceSeq; - - - /// Ice Twin of `armarx::armem::EntitySnapshot`. - class EntitySnapshot extends detail::MemoryItem - { - EntityInstanceSeq instances; - }; - dictionary<armarx::core::time::dto::DateTime, EntitySnapshot> EntityHistory; - - - /// Ice Twin of `armarx::armem::Entity`. - class Entity extends detail::MemoryItem - { - EntityHistory history; - }; - dictionary<string, Entity> EntityDict; - - - /// Ice Twin of `armarx::armem::ProviderSegment`. - class ProviderSegment extends detail::TypedMemoryContainer - { - EntityDict entities; - }; - dictionary<string, ProviderSegment> ProviderSegmentDict; - - - /// Ice Twin of `armarx::armem::CoreSegment`. - class CoreSegment extends detail::TypedMemoryContainer - { - ProviderSegmentDict providerSegments; - }; - dictionary<string, CoreSegment> CoreSegmentDict; - - - /// Ice Twin of `armarx::armem::Memory`. - class Memory extends detail::MemoryItem - { - CoreSegmentDict coreSegments; - }; - dictionary<string, Memory> MemoryDict; - - } + MemoryID id; + }; + class TypedMemoryContainer extends MemoryItem + { + aron::type::dto::GenericType aronType; }; +} + +/// Ice Twin of `armarx::armem::EntityInstanceMetadata`. +class EntityInstanceMetadata +{ + armarx::core::time::dto::DateTime referencedTime; + armarx::core::time::dto::DateTime sentTime; + armarx::core::time::dto::DateTime arrivedTime; + armarx::core::time::dto::DateTime lastAccessedTime; + long accessed = 0; + + float confidence = 1.0; }; + +/// Ice Twin of `armarx::armem::EntityInstance`. +class EntityInstance extends detail::MemoryItem +{ + aron::data::dto::Dict data; + + EntityInstanceMetadata metadata; +}; + +sequence<EntityInstance> EntityInstanceSeq; + +/// Ice Twin of `armarx::armem::EntitySnapshot`. +class EntitySnapshot extends detail::MemoryItem +{ + EntityInstanceSeq instances; +}; + +dictionary<armarx::core::time::dto::DateTime, EntitySnapshot> EntityHistory; + +/// Ice Twin of `armarx::armem::Entity`. +class Entity extends detail::MemoryItem +{ + EntityHistory history; +}; + +dictionary<string, Entity> EntityDict; + +/// Ice Twin of `armarx::armem::ProviderSegment`. +class ProviderSegment extends detail::TypedMemoryContainer +{ + EntityDict entities; +}; + +dictionary<string, ProviderSegment> ProviderSegmentDict; + +/// Ice Twin of `armarx::armem::CoreSegment`. +class CoreSegment extends detail::TypedMemoryContainer +{ + ProviderSegmentDict providerSegments; +}; + +dictionary<string, CoreSegment> CoreSegmentDict; + +/// Ice Twin of `armarx::armem::Memory`. +class Memory extends detail::MemoryItem +{ + CoreSegmentDict coreSegments; +}; + +dictionary<string, Memory> MemoryDict; +} +} +; +} +; diff --git a/source/RobotAPI/interface/armem/mns/MemoryNameSystemInterface.ice b/source/RobotAPI/interface/armem/mns/MemoryNameSystemInterface.ice index 73d27e0788c89f7d31b0c4f21c546ff276420fd6..099f12730e6f9471c0f3f91f9225fa03a1397233 100644 --- a/source/RobotAPI/interface/armem/mns/MemoryNameSystemInterface.ice +++ b/source/RobotAPI/interface/armem/mns/MemoryNameSystemInterface.ice @@ -8,117 +8,113 @@ module armarx { - module armem - { - module mns - { - module dto - { - /** + module armem{module mns{ + module dto{/** * A memory server can implement the reading and/or writing * memory interface. They should be handled individually. * Additionally, it can implement prediction or actions interfaces, * which is currently the case for all working memories. */ - struct MemoryServerInterfaces - { - server::ReadingMemoryInterface* reading; - server::WritingMemoryInterface* writing; - server::PredictingMemoryInterface* prediction; - server::actions::ActionsInterface* actions; - }; - dictionary<string, MemoryServerInterfaces> MemoryServerInterfacesMap; - + struct MemoryServerInterfaces{server::ReadingMemoryInterface * reading; + server::WritingMemoryInterface* writing; + server::PredictingMemoryInterface* prediction; + server::actions::ActionsInterface* actions; +}; +dictionary<string, MemoryServerInterfaces> MemoryServerInterfacesMap; - /** +/** * @brief Register a memory server. */ - struct RegisterServerInput - { - string name; - MemoryServerInterfaces server; +struct RegisterServerInput +{ + string name; + MemoryServerInterfaces server; - bool existOk = true; - }; - struct RegisterServerResult - { - bool success; - string errorMessage; - }; + bool existOk = true; +}; +struct RegisterServerResult +{ + bool success; + string errorMessage; +}; - /** +/** * @brief Remove a memory server. */ - struct RemoveServerInput - { - string name; - bool notExistOk = true; - }; - struct RemoveServerResult - { - bool success; - string errorMessage; - }; - - /** +struct RemoveServerInput +{ + string name; + bool notExistOk = true; +}; + +struct RemoveServerResult +{ + bool success; + string errorMessage; +}; + +/** * @brief Resolve a memory name. */ - struct ResolveServerInput - { - string name; - }; - struct ResolveServerResult - { - bool success; - string errorMessage; +struct ResolveServerInput +{ + string name; +}; - MemoryServerInterfaces server; - }; +struct ResolveServerResult +{ + bool success; + string errorMessage; + MemoryServerInterfaces server; +}; - /** +/** * @brief Get all registered entries. */ - struct GetAllRegisteredServersResult - { - bool success; - string errorMessage; - - MemoryServerInterfacesMap servers; - }; +struct GetAllRegisteredServersResult +{ + bool success; + string errorMessage; + MemoryServerInterfacesMap servers; +}; - /** +/** * @brief Wait until a server is registered. */ - struct WaitForServerInput - { - string name; - }; - struct WaitForServerResult - { - bool success; - string errorMessage; +struct WaitForServerInput +{ + string name; +}; - MemoryServerInterfaces server; - }; - }; +struct WaitForServerResult +{ + bool success; + string errorMessage; + MemoryServerInterfaces server; +}; +} +; - interface MemoryNameSystemInterface - { - dto::RegisterServerResult registerServer(dto::RegisterServerInput input); - dto::RemoveServerResult removeServer(dto::RemoveServerInput input); - dto::GetAllRegisteredServersResult getAllRegisteredServers(); +interface MemoryNameSystemInterface +{ + dto::RegisterServerResult registerServer(dto::RegisterServerInput input); + dto::RemoveServerResult removeServer(dto::RemoveServerInput input); - dto::ResolveServerResult resolveServer(dto::ResolveServerInput input); + dto::GetAllRegisteredServersResult getAllRegisteredServers(); - ["amd"] // Asynchronous Method Dispatch - dto::WaitForServerResult waitForServer(dto::WaitForServerInput input); - }; - } + dto::ResolveServerResult resolveServer(dto::ResolveServerInput input); - }; + ["amd"] // Asynchronous Method Dispatch + dto::WaitForServerResult + waitForServer(dto::WaitForServerInput input); }; +} +} +; +} +; diff --git a/source/RobotAPI/interface/armem/prediction.ice b/source/RobotAPI/interface/armem/prediction.ice index a2aae725e3ef5a399ccfacf819d07eb56693f8e4..2ede00d2b530dff200cec8a38cfa06ca6bd553d7 100644 --- a/source/RobotAPI/interface/armem/prediction.ice +++ b/source/RobotAPI/interface/armem/prediction.ice @@ -15,8 +15,8 @@ module armarx struct PredictionEngine { string engineID; - } - sequence<PredictionEngine> PredictionEngineSeq; + } sequence<PredictionEngine> PredictionEngineSeq; + dictionary<armem::data::MemoryID, PredictionEngineSeq> EngineSupportMap; // Settings to use for a given prediction (e.g. which engine to use) @@ -31,8 +31,7 @@ module armarx { armem::data::MemoryID snapshotID; PredictionSettings settings; - } - sequence<PredictionRequest> PredictionRequestSeq; + } sequence<PredictionRequest> PredictionRequestSeq; // The result of a single prediction. // If successful, it contains the predicted data. @@ -43,8 +42,7 @@ module armarx armem::data::MemoryID snapshotID; aron::data::dto::Dict prediction; - } - sequence<PredictionResult> PredictionResultSeq; + } sequence<PredictionResult> PredictionResultSeq; }; }; }; diff --git a/source/RobotAPI/interface/armem/query.ice b/source/RobotAPI/interface/armem/query.ice index c672e42ddf7b5444b37b4a78a7f813f67054f82a..20e6ff1064e14d179fe461899ab66c0876a74864 100644 --- a/source/RobotAPI/interface/armem/query.ice +++ b/source/RobotAPI/interface/armem/query.ice @@ -24,6 +24,7 @@ module armarx class EntityQuery { }; + sequence<EntityQuery> EntityQuerySeq; module entity @@ -32,17 +33,20 @@ module armarx class All extends EntityQuery { }; + /// Get a single snapshot (default for latest). class Single extends EntityQuery { - armarx::core::time::dto::DateTime timestamp; // -1 for latest + armarx::core::time::dto::DateTime timestamp; // -1 for latest }; + /// Get snapshots based on a time range (default for all). class TimeRange extends EntityQuery { - armarx::core::time::dto::DateTime minTimestamp; // -1 for oldest - armarx::core::time::dto::DateTime maxTimestamp; // -1 for latest + armarx::core::time::dto::DateTime minTimestamp; // -1 for oldest + armarx::core::time::dto::DateTime maxTimestamp; // -1 for latest }; + /** * @brief Get snapshots based on an index range (default for all). * @@ -55,11 +59,10 @@ module armarx */ class IndexRange extends EntityQuery { - long first = 0; ///< First index to get. - long last = -1; ///< Last index to get (inclusive). + long first = 0; ///< First index to get. + long last = -1; ///< Last index to get (inclusive). }; - /** * @brief Get snapshot(s) around timestamp. * @@ -104,41 +107,43 @@ module armarx * - #maxEntries < 0 => all elements before timestamp */ class BeforeTime extends EntityQuery + { armarx::core::time::dto::DateTime timestamp; long maxEntries = 1; } - } - /// Which entities to get from a provider segment? class ProviderSegmentQuery { EntityQuerySeq entityQueries; }; + sequence<ProviderSegmentQuery> ProviderSegmentQuerySeq; module provider { class All extends ProviderSegmentQuery { }; + class Single extends ProviderSegmentQuery { string entityName; }; + class Regex extends ProviderSegmentQuery { string entityNameRegex; }; } - /// Which provider segments to get from a core segment? class CoreSegmentQuery { ProviderSegmentQuerySeq providerSegmentQueries; }; + sequence<CoreSegmentQuery> CoreSegmentQuerySeq; module core @@ -146,23 +151,25 @@ module armarx class All extends CoreSegmentQuery { }; + class Single extends CoreSegmentQuery { string providerSegmentName; }; + class Regex extends CoreSegmentQuery { string providerSegmentNameRegex; }; } - /// Which core segments to get from a memory? class MemoryQuery { CoreSegmentQuerySeq coreSegmentQueries; QueryTarget::QueryTargetEnum target = QueryTarget::QueryTargetEnum::WM; }; + sequence<MemoryQuery> MemoryQuerySeq; dictionary<string, MemoryQuerySeq> MemoryQueriesDict; @@ -171,17 +178,18 @@ module armarx class All extends MemoryQuery { }; + class Single extends MemoryQuery { string coreSegmentName; }; + class Regex extends MemoryQuery { string coreSegmentNameRegex; }; } - /// Which memories to get from the distributed memory system? class DistributedMemoryQuery { @@ -196,6 +204,7 @@ module armarx /// If false, no AronData is transferred. bool withData = true; }; + struct Result { bool success = false; diff --git a/source/RobotAPI/interface/armem/server.ice b/source/RobotAPI/interface/armem/server.ice index 5c7a32c4734ede6124ba8c4e028ce3dcd98bb556..8d541ce6241a7651e65720ff4781e51f959f684a 100644 --- a/source/RobotAPI/interface/armem/server.ice +++ b/source/RobotAPI/interface/armem/server.ice @@ -1,6 +1,6 @@ #pragma once #include <RobotAPI/interface/armem/server/MemoryInterface.ice> +#include <RobotAPI/interface/armem/server/PredictingMemoryInterface.ice> #include <RobotAPI/interface/armem/server/ReadingMemoryInterface.ice> #include <RobotAPI/interface/armem/server/WritingMemoryInterface.ice> -#include <RobotAPI/interface/armem/server/PredictingMemoryInterface.ice> diff --git a/source/RobotAPI/interface/armem/server/ActionsInterface.ice b/source/RobotAPI/interface/armem/server/ActionsInterface.ice index 8fa6754f7e1e0c961c4a5ff9c9bb317dc9fc3aef..3ba13f1d545d09c12dd22ca24738f8e7d3ea9716 100644 --- a/source/RobotAPI/interface/armem/server/ActionsInterface.ice +++ b/source/RobotAPI/interface/armem/server/ActionsInterface.ice @@ -12,8 +12,10 @@ module armarx { interface ActionsInterface { - actions::data::GetActionsOutputSeq getActions(actions::data::GetActionsInputSeq inputs); - actions::data::ExecuteActionOutputSeq executeActions(actions::data::ExecuteActionInputSeq inputs); + actions::data::GetActionsOutputSeq getActions( + actions::data::GetActionsInputSeq inputs); + actions::data::ExecuteActionOutputSeq executeActions( + actions::data::ExecuteActionInputSeq inputs); }; } } diff --git a/source/RobotAPI/interface/armem/server/MemoryInterface.ice b/source/RobotAPI/interface/armem/server/MemoryInterface.ice index ddfcb5b2bdbcdfe8685ce6d4380d7fdbe283396a..e40a0ade92eed16521b43a0c9edb6fb65e452c13 100644 --- a/source/RobotAPI/interface/armem/server/MemoryInterface.ice +++ b/source/RobotAPI/interface/armem/server/MemoryInterface.ice @@ -1,15 +1,12 @@ #pragma once -#include <RobotAPI/interface/armem/server/ReplayingMemoryInterface.ice> -#include <RobotAPI/interface/armem/server/RecordingMemoryInterface.ice> - +#include <RobotAPI/interface/armem/client/MemoryListenerInterface.ice> +#include <RobotAPI/interface/armem/server/ActionsInterface.ice> +#include <RobotAPI/interface/armem/server/PredictingMemoryInterface.ice> #include <RobotAPI/interface/armem/server/ReadingMemoryInterface.ice> +#include <RobotAPI/interface/armem/server/RecordingMemoryInterface.ice> +#include <RobotAPI/interface/armem/server/ReplayingMemoryInterface.ice> #include <RobotAPI/interface/armem/server/WritingMemoryInterface.ice> -#include <RobotAPI/interface/armem/server/PredictingMemoryInterface.ice> - -#include <RobotAPI/interface/armem/server/ActionsInterface.ice> - -#include <RobotAPI/interface/armem/client/MemoryListenerInterface.ice> module armarx @@ -18,22 +15,15 @@ module armarx { module server { - interface LongTermMemoryInterface extends ReplayingMemoryInterface, RecordingMemoryInterface - { - }; + interface LongTermMemoryInterface extends ReplayingMemoryInterface, + RecordingMemoryInterface{}; - interface WorkingMemoryInterface extends ReadingMemoryInterface, WritingMemoryInterface - { - }; + interface WorkingMemoryInterface extends ReadingMemoryInterface, + WritingMemoryInterface{}; - interface MemoryInterface extends - WorkingMemoryInterface, - LongTermMemoryInterface, - PredictingMemoryInterface, - actions::ActionsInterface, - client::MemoryListenerInterface - { - }; + interface MemoryInterface extends WorkingMemoryInterface, LongTermMemoryInterface, + PredictingMemoryInterface, actions::ActionsInterface, + client::MemoryListenerInterface{}; }; }; }; diff --git a/source/RobotAPI/interface/armem/server/ObjectMemoryInterface.ice b/source/RobotAPI/interface/armem/server/ObjectMemoryInterface.ice index fa9d74f160dc12e05fd6b1395d03b85b36384bea..fe5eb0ecacd875e3478689baaeb30b3178fba7ec 100644 --- a/source/RobotAPI/interface/armem/server/ObjectMemoryInterface.ice +++ b/source/RobotAPI/interface/armem/server/ObjectMemoryInterface.ice @@ -24,9 +24,8 @@ #pragma once #include <RobotAPI/interface/armem/server/MemoryInterface.ice> - -#include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.ice> #include <RobotAPI/interface/objectpose/FamiliarObjectPoseStorageInterface.ice> +#include <RobotAPI/interface/objectpose/ObjectPoseStorageInterface.ice> module armarx @@ -37,26 +36,21 @@ module armarx { interface ObjectInstanceSegmentInterface extends - armarx::objpose::ObjectPoseStorageInterface - { + armarx::objpose::ObjectPoseStorageInterface{ - }; + }; interface FamiliarObjectInstanceSegmentInterface extends - armarx::objpose::FamiliarObjectPoseStorageInterface - { + armarx::objpose::FamiliarObjectPoseStorageInterface{ - }; + }; - interface ObjectMemoryInterface extends - MemoryInterface - , ObjectInstanceSegmentInterface - , FamiliarObjectInstanceSegmentInterface + interface ObjectMemoryInterface extends MemoryInterface, ObjectInstanceSegmentInterface, + FamiliarObjectInstanceSegmentInterface { void reloadKnownObjectClasses(); }; - }; }; }; diff --git a/source/RobotAPI/interface/armem/server/PredictingMemoryInterface.ice b/source/RobotAPI/interface/armem/server/PredictingMemoryInterface.ice index aeae3745854d595ba7799a399df43cf2e33922b7..a69676fa686bf82c31a1cf92c96bdfc8ed406813 100644 --- a/source/RobotAPI/interface/armem/server/PredictingMemoryInterface.ice +++ b/source/RobotAPI/interface/armem/server/PredictingMemoryInterface.ice @@ -5,24 +5,23 @@ module armarx { - module armem - { - module server + module armem { - interface PredictingMemoryInterface - { + module server{interface PredictingMemoryInterface{ /* Request multiple predictions from the memory. * The timestamp to requst a prediction for is encoded in the MemoryIDs. */ - prediction::data::PredictionResultSeq - predict(prediction::data::PredictionRequestSeq requests); + prediction::data::PredictionResultSeq predict( + prediction::data::PredictionRequestSeq requests); - /* Get a map from memory segments to the prediction engines they support. + /* Get a map from memory segments to the prediction engines they support. * Best used with the container_map operations to easily retrieve * the available engine selection for fully evaluated MemoryIDs. */ - prediction::data::EngineSupportMap getAvailableEngines(); - } - }; - }; + prediction::data::EngineSupportMap getAvailableEngines(); + } }; +} +; +} +; diff --git a/source/RobotAPI/interface/armem/server/ReadingMemoryInterface.ice b/source/RobotAPI/interface/armem/server/ReadingMemoryInterface.ice index 8a0d185d6092ada17170d652850633d52a5eb89d..c580aeb45efafc5325ee8d07d12e3e03f0603ea4 100644 --- a/source/RobotAPI/interface/armem/server/ReadingMemoryInterface.ice +++ b/source/RobotAPI/interface/armem/server/ReadingMemoryInterface.ice @@ -12,7 +12,6 @@ module armarx { module dto { - } interface ReadingMemoryInterface diff --git a/source/RobotAPI/interface/armem/server/RecordingMemoryInterface.ice b/source/RobotAPI/interface/armem/server/RecordingMemoryInterface.ice index bd831fe2294dd8476c6fb3b3a73fb776c2acf2d2..3217e3338a42d1224cc3b8b4ff8a945222bf2449 100644 --- a/source/RobotAPI/interface/armem/server/RecordingMemoryInterface.ice +++ b/source/RobotAPI/interface/armem/server/RecordingMemoryInterface.ice @@ -5,7 +5,7 @@ module armarx { module armem - { + { module server { module dto @@ -45,25 +45,30 @@ module armarx RecordingMode::RecordingModeEnum mode; float frequency; }; - dictionary <armarx::armem::data::MemoryID, RecordingModeConfiguration> Configuration; - struct StartRecordResult { + dictionary<armarx::armem::data::MemoryID, RecordingModeConfiguration> Configuration; + + struct StartRecordResult + { bool success; string errorMessage; }; - struct StopRecordResult { + struct StopRecordResult + { bool success; string errorMessage; }; - struct RecordStatusResult { + struct RecordStatusResult + { bool success; string errorMessage; RecordStatus status; }; - struct StartRecordInput { + struct StartRecordInput + { armarx::core::time::dto::DateTime executionTime; string recordingID; armarx::core::time::dto::DateTime startTime; diff --git a/source/RobotAPI/interface/armem/server/ReplayingMemoryInterface.ice b/source/RobotAPI/interface/armem/server/ReplayingMemoryInterface.ice index d0825d8385f07e35ba7aca6ac0c95a5a1a43a767..81e1204355f0c98bd71a0f4517d9707d35bda0a9 100644 --- a/source/RobotAPI/interface/armem/server/ReplayingMemoryInterface.ice +++ b/source/RobotAPI/interface/armem/server/ReplayingMemoryInterface.ice @@ -6,11 +6,10 @@ module armarx { module armem - { + { module server { - interface ReplayingMemoryInterface - { + interface ReplayingMemoryInterface{ }; }; diff --git a/source/RobotAPI/interface/armem/structure.ice b/source/RobotAPI/interface/armem/structure.ice index 2331a9e9be618c4c7c0b24c55fd34340a3f71eab..adfc9ce9ccfe5ce612d00261d52d083e63d0e693 100644 --- a/source/RobotAPI/interface/armem/structure.ice +++ b/source/RobotAPI/interface/armem/structure.ice @@ -10,10 +10,12 @@ module armarx { module data { - struct GetServerStructureResult { + struct GetServerStructureResult + { bool success; string errorMessage; - armarx::armem::data::Memory serverStructure; //structure of the Server without data (all Segments...) + armarx::armem::data::Memory + serverStructure; //structure of the Server without data (all Segments...) }; }; }; diff --git a/source/RobotAPI/interface/aron.ice b/source/RobotAPI/interface/aron.ice index 2bbcc667f3d5f065d7c10e3c94f7df32739fe8c4..704ed53fc6934c1dfda92ac0db34a7df88547e5c 100644 --- a/source/RobotAPI/interface/aron.ice +++ b/source/RobotAPI/interface/aron.ice @@ -4,8 +4,7 @@ module armarx { - module aron - { + module aron{ }; }; diff --git a/source/RobotAPI/interface/aron/test/AronConversionTestInterface.ice b/source/RobotAPI/interface/aron/test/AronConversionTestInterface.ice index 924f40c6d8664123c822eb9f7eb338d8d50b52d5..aad852c198ecf136ea0f0b100e1c63bf8c67b6b1 100644 --- a/source/RobotAPI/interface/aron/test/AronConversionTestInterface.ice +++ b/source/RobotAPI/interface/aron/test/AronConversionTestInterface.ice @@ -26,36 +26,41 @@ #include <RobotAPI/interface/aron/Aron.ice> -module armarx { module aron { module test +module armarx { + module aron + { + module test + { -module dto -{ + module dto + { - struct TestAronConversionRequest - { - string aronClassName; - ::armarx::aron::data::dto::Dict probe; - }; - struct TestAronConversionResponse - { - bool success; - string errorMessage; + struct TestAronConversionRequest + { + string aronClassName; + ::armarx::aron::data::dto::Dict probe; + }; - ::armarx::aron::data::dto::Dict probe; - }; + struct TestAronConversionResponse + { + bool success; + string errorMessage; -}; + ::armarx::aron::data::dto::Dict probe; + }; + }; -module dti -{ + module dti + { - interface AronConversionTestInterface - { - dto::TestAronConversionResponse testAronConversion(dto::TestAronConversionRequest req); + interface AronConversionTestInterface + { + dto::TestAronConversionResponse testAronConversion( + dto::TestAronConversionRequest req); + }; + }; + }; }; - }; - -};};}; diff --git a/source/RobotAPI/interface/components/CartesianPositionControlInterface.ice b/source/RobotAPI/interface/components/CartesianPositionControlInterface.ice index 13741869c90df9117d6f326036ae92b6e6a24ce0..053159c440c59eb73b0626783d39ab114c5fba35 100644 --- a/source/RobotAPI/interface/components/CartesianPositionControlInterface.ice +++ b/source/RobotAPI/interface/components/CartesianPositionControlInterface.ice @@ -37,6 +37,5 @@ module armarx void resetFTOffset(string side); int getFTTresholdExceededCounter(string side); void emulateFTTresholdExceeded(string side); - }; }; diff --git a/source/RobotAPI/interface/components/FrameTrackingInterface.ice b/source/RobotAPI/interface/components/FrameTrackingInterface.ice index ba04341101e0102c622216b9a35f0a77028ca333..5cf9f29f88888f9fbacf26d7da58593e7af23441 100644 --- a/source/RobotAPI/interface/components/FrameTrackingInterface.ice +++ b/source/RobotAPI/interface/components/FrameTrackingInterface.ice @@ -30,16 +30,15 @@ module armarx { void enableTracking(bool enable); void setFrame(string frameName); - ["cpp:const"] - idempotent - string getFrame(); + ["cpp:const"] idempotent string getFrame(); void lookAtFrame(string frameName); void lookAtPointInGlobalFrame(Vector3f point); bool isLookingAtPointInGlobalFrame(Vector3f point, float max_diff); void lookAtPointInRobotFrame(Vector3f point); - void scanInConfigurationSpace(float yawFrom, float yawTo, ::Ice::FloatSeq pitchValues, float velocity); + void scanInConfigurationSpace( + float yawFrom, float yawTo, ::Ice::FloatSeq pitchValues, float velocity); void scanInWorkspace(::armarx::Vector3fSeq points, float maxVelocity, float acceleration); void moveJointsTo(float yaw, float pitch); }; diff --git a/source/RobotAPI/interface/components/NaturalIKInterface.ice b/source/RobotAPI/interface/components/NaturalIKInterface.ice index 40a8d2fc22ccf48e92d9d43f056413d42d50ea03..57eddcc68b7c5566c1539610591947c42f064b54 100644 --- a/source/RobotAPI/interface/components/NaturalIKInterface.ice +++ b/source/RobotAPI/interface/components/NaturalIKInterface.ice @@ -24,6 +24,7 @@ #include <ArmarXCore/interface/core/BasicVectorTypes.ice> #include <ArmarXCore/interface/serialization/Eigen.ice> + #include <RobotAPI/interface/aron.ice> module armarx @@ -36,6 +37,7 @@ module armarx interface NaturalIKInterface { - NaturalIKResult solveIK(string side, Eigen::Matrix4f target, bool setOrientation, aron::data::dto::Dict args); + NaturalIKResult solveIK( + string side, Eigen::Matrix4f target, bool setOrientation, aron::data::dto::Dict args); }; }; diff --git a/source/RobotAPI/interface/components/ObstacleAvoidance/DSObstacleAvoidanceInterface.ice b/source/RobotAPI/interface/components/ObstacleAvoidance/DSObstacleAvoidanceInterface.ice index 42ed92db3ba81fe2a0255bab1e9a98c9f386991a..743747c2b5fc0b443c8f07e5d81f53feeb2068b4 100644 --- a/source/RobotAPI/interface/components/ObstacleAvoidance/DSObstacleAvoidanceInterface.ice +++ b/source/RobotAPI/interface/components/ObstacleAvoidance/DSObstacleAvoidanceInterface.ice @@ -48,19 +48,15 @@ module armarx double weight_power; double agent_safety_margin; }; - }; - interface DSObstacleAvoidanceInterface extends - ObstacleAvoidanceInterface, ObstacleDetectionInterface + interface DSObstacleAvoidanceInterface extends ObstacleAvoidanceInterface, + ObstacleDetectionInterface { - dsobstacleavoidance::Config getConfig(); - - void - writeDebugPlots(string filename); + dsobstacleavoidance::Config getConfig(); + void writeDebugPlots(string filename); }; - }; diff --git a/source/RobotAPI/interface/components/ObstacleAvoidance/DynamicObstacleManagerInterface.ice b/source/RobotAPI/interface/components/ObstacleAvoidance/DynamicObstacleManagerInterface.ice index df0f5596b78a783c94e6ae21fc1a0cfdf0e5a16e..10299e3e4cdf1c7cf7673bcde661f5bb313181fb 100644 --- a/source/RobotAPI/interface/components/ObstacleAvoidance/DynamicObstacleManagerInterface.ice +++ b/source/RobotAPI/interface/components/ObstacleAvoidance/DynamicObstacleManagerInterface.ice @@ -44,27 +44,22 @@ module armarx interface DynamicObstacleManagerInterface { - void - add_decayable_obstacle(Eigen::Vector2f e_origin, float e_rx, float e_ry, float e_yaw); + void add_decayable_obstacle(Eigen::Vector2f e_origin, float e_rx, float e_ry, float e_yaw); - void - add_decayable_line_segment(Eigen::Vector2f line_start, Eigen::Vector2f line_end); + void add_decayable_line_segment(Eigen::Vector2f line_start, Eigen::Vector2f line_end); - void - add_decayable_line_segments(dynamicobstaclemanager::LineSegments lines); + void add_decayable_line_segments(dynamicobstaclemanager::LineSegments lines); - void - remove_all_decayable_obstacles(); + void remove_all_decayable_obstacles(); - void - directly_update_obstacle(string name, Eigen::Vector2f e_origin, float e_rx, float e_ry, float e_yaw); + void directly_update_obstacle( + string name, Eigen::Vector2f e_origin, float e_rx, float e_ry, float e_yaw); - void - remove_obstacle(string name); + void remove_obstacle(string name); void wait_unitl_obstacles_are_ready(); - float distanceToObstacle(Eigen::Vector2f agentPosition, float safetyRadius, Eigen::Vector2f goal); + float distanceToObstacle( + Eigen::Vector2f agentPosition, float safetyRadius, Eigen::Vector2f goal); }; }; - diff --git a/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleAvoidanceInterface.ice b/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleAvoidanceInterface.ice index 529f4201fb92327ca9b26262e335b06036044441..872c812cf312c9c29df9112861bb713900794485 100644 --- a/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleAvoidanceInterface.ice +++ b/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleAvoidanceInterface.ice @@ -41,16 +41,12 @@ module armarx Eigen::Vector3f goal; float safety_margin; }; - }; interface ObstacleAvoidanceInterface { - Eigen::Vector3f - modulateVelocity(obstacleavoidance::Agent agent); - + Eigen::Vector3f modulateVelocity(obstacleavoidance::Agent agent); }; - }; diff --git a/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleDetectionInterface.ice b/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleDetectionInterface.ice index 0a0435b203c00767deeb7e52fc4af93244c3a080..0d53f21002358e210d6702306cb82d91c8bdb528 100644 --- a/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleDetectionInterface.ice +++ b/source/RobotAPI/interface/components/ObstacleAvoidance/ObstacleDetectionInterface.ice @@ -32,48 +32,41 @@ module armarx { module obstacledetection - { - - struct Obstacle - { - string name; - double posX = 0; - double posY = 0; - double posZ = 0; - double yaw = 0; - double axisLengthX = 0; - double axisLengthY = 0; - double axisLengthZ = 0; - double refPosX = 0; - double refPosY = 0; - double refPosZ = 0; - double safetyMarginX = 0; - double safetyMarginY = 0; - double safetyMarginZ = 0; - double curvatureX = 1; - double curvatureY = 1; - double curvatureZ = 1; - }; + { + + struct Obstacle + { + string name; + double posX = 0; + double posY = 0; + double posZ = 0; + double yaw = 0; + double axisLengthX = 0; + double axisLengthY = 0; + double axisLengthZ = 0; + double refPosX = 0; + double refPosY = 0; + double refPosZ = 0; + double safetyMarginX = 0; + double safetyMarginY = 0; + double safetyMarginZ = 0; + double curvatureX = 1; + double curvatureY = 1; + double curvatureZ = 1; + }; sequence<obstacledetection::Obstacle> ObstacleList; + }; - }; - - - interface ObstacleDetectionInterface - { - void - updateObstacle(obstacledetection::Obstacle obstacle); - - void - removeObstacle(string obstacle_name); - obstacledetection::ObstacleList - getObstacles(); + interface ObstacleDetectionInterface + { + void updateObstacle(obstacledetection::Obstacle obstacle); - void - updateEnvironment(); + void removeObstacle(string obstacle_name); - }; + obstacledetection::ObstacleList getObstacles(); + void updateEnvironment(); + }; }; diff --git a/source/RobotAPI/interface/components/RobotHealthInterface.ice b/source/RobotAPI/interface/components/RobotHealthInterface.ice index 0832146d934a45cf35dd2d42591a4b4949f8d15d..45c5660ae3f4c6082a522f52251e64a7cd1bad41 100644 --- a/source/RobotAPI/interface/components/RobotHealthInterface.ice +++ b/source/RobotAPI/interface/components/RobotHealthInterface.ice @@ -30,7 +30,9 @@ module armarx enum RobotHealthState { - HealthOK, HealthWarning, HealthError + HealthOK, + HealthWarning, + HealthError }; struct RobotHealthHeartbeatArgs @@ -54,7 +56,7 @@ module armarx void resetRequiredTags(); void heartbeat(string identifier, armarx::core::time::dto::DateTime referenceTime); - + string getTopicName(); }; @@ -75,7 +77,7 @@ module armarx armarx::core::time::dto::DateTime lastReferenceTimestamp; - //< Time delta to now() when arrived at heart beat component + //< Time delta to now() when arrived at heart beat component armarx::core::time::dto::Duration timeSinceLastArrival; //< Time delta to reference timestamp sent by component @@ -83,7 +85,7 @@ module armarx armarx::core::time::dto::Duration timeSyncDelayAndIce; - bool required; // + bool required; // bool enabled; armarx::core::time::dto::Duration maximumCycleTimeWarning; @@ -100,7 +102,6 @@ module armarx RobotHealthEntries entries; }; - interface RobotHealthComponentInterface extends RobotHealthInterface { RobotHealthInfo getSummary(); diff --git a/source/RobotAPI/interface/components/TrajectoryPlayerInterface.ice b/source/RobotAPI/interface/components/TrajectoryPlayerInterface.ice index 7807f84419960a8219f5a809feccf66e08d6f76a..e87849a93da2369ea5713121c8d50d2a5b4177dc 100644 --- a/source/RobotAPI/interface/components/TrajectoryPlayerInterface.ice +++ b/source/RobotAPI/interface/components/TrajectoryPlayerInterface.ice @@ -22,10 +22,11 @@ #pragma once -#include <RobotAPI/interface/core/Trajectory.ice> -#include <RobotAPI/interface/observers/KinematicUnitObserverInterface.ice> #include <ArmarXCore/interface/serialization/Eigen.ice> + #include <RobotAPI/interface/aron.ice> +#include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/observers/KinematicUnitObserverInterface.ice> module armarx { diff --git a/source/RobotAPI/interface/components/ViewSelectionInterface.ice b/source/RobotAPI/interface/components/ViewSelectionInterface.ice old mode 100755 new mode 100644 index 9ba19073af9c83d0a63fc9ea419afbf192cf4777..606bd193c5f32b66887d549aa62b3b98eded02e3 --- a/source/RobotAPI/interface/components/ViewSelectionInterface.ice +++ b/source/RobotAPI/interface/components/ViewSelectionInterface.ice @@ -23,19 +23,18 @@ #pragma once -#include <RobotAPI/interface/core/PoseBase.ice> -#include <RobotAPI/interface/core/FramedPoseBase.ice> - -#include <ArmarXCore/interface/observers/Timestamp.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> + +#include <RobotAPI/interface/core/FramedPoseBase.ice> +#include <RobotAPI/interface/core/PoseBase.ice> module armarx { const int DEFAULT_VIEWTARGET_PRIORITY = 50; - ["cpp:virtual"] - class ViewTargetBase + ["cpp:virtual"] class ViewTargetBase { armarx::FramedPositionBase target; @@ -50,8 +49,7 @@ module armarx string source; }; - ["cpp:virtual"] - class SaliencyMapBase + ["cpp:virtual"] class SaliencyMapBase { string name; @@ -83,16 +81,10 @@ module armarx }; - interface ViewSelectionObserver { void onActivateAutomaticViewSelection(); void onDeactivateAutomaticViewSelection(); void nextViewTarget(long timestamp); }; - }; - - - - diff --git a/source/RobotAPI/interface/core/BlackWhitelist.ice b/source/RobotAPI/interface/core/BlackWhitelist.ice index dc93760a9530067a1254b35770783e87559b5ff6..74f7df313de2e7146c123836ce3e56850c4c3ed0 100644 --- a/source/RobotAPI/interface/core/BlackWhitelist.ice +++ b/source/RobotAPI/interface/core/BlackWhitelist.ice @@ -41,7 +41,6 @@ module armarx StringListUpdate whitelist; }; - interface BlackWhitelistInterface { void updateBlackWhitelist(BlackWhitelistUpdate update); @@ -52,4 +51,3 @@ module armarx void updateBlackWhitelist(BlackWhitelistUpdate update); } }; - diff --git a/source/RobotAPI/interface/core/CartesianNaturalPositionControllerConfig.ice b/source/RobotAPI/interface/core/CartesianNaturalPositionControllerConfig.ice index a876489d1f7f4042817f61c8b2fe751b97f06690..9dfd12d610a6fc6e89758d8ca4c53fd650bb0312 100644 --- a/source/RobotAPI/interface/core/CartesianNaturalPositionControllerConfig.ice +++ b/source/RobotAPI/interface/core/CartesianNaturalPositionControllerConfig.ice @@ -29,30 +29,28 @@ module armarx { struct CartesianNaturalPositionControllerConfig { - float maxPositionAcceleration = 500; - float maxOrientationAcceleration = 1; - float maxNullspaceAcceleration = 2; + float maxPositionAcceleration = 500; + float maxOrientationAcceleration = 1; + float maxNullspaceAcceleration = 2; Ice::FloatSeq maxJointVelocity; Ice::FloatSeq maxNullspaceVelocity; Ice::FloatSeq jointCosts; - float jointLimitAvoidanceKp = 0.1; - float elbowKp = 1; - float nullspaceTargetKp = 1; + float jointLimitAvoidanceKp = 0.1; + float elbowKp = 1; + float nullspaceTargetKp = 1; - float thresholdOrientationNear = 0.1; - float thresholdOrientationReached = 0.05; - float thresholdPositionNear = 50; - float thresholdPositionReached = 5; + float thresholdOrientationNear = 0.1; + float thresholdOrientationReached = 0.05; + float thresholdPositionNear = 50; + float thresholdPositionReached = 5; float maxTcpPosVel = 80; float maxTcpOriVel = 1; float maxElbPosVel = 80; - float KpOri = 1; - float KpPos = 1; + float KpOri = 1; + float KpPos = 1; }; }; - - diff --git a/source/RobotAPI/interface/core/CartesianPositionControllerConfig.ice b/source/RobotAPI/interface/core/CartesianPositionControllerConfig.ice index 0c1418a257091bead62d86a0629967ba8bfde77b..f28cd8108ce083b5c35f2861c72e45bd1986155d 100644 --- a/source/RobotAPI/interface/core/CartesianPositionControllerConfig.ice +++ b/source/RobotAPI/interface/core/CartesianPositionControllerConfig.ice @@ -22,8 +22,8 @@ #pragma once -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/observers/Filters.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> module armarx { @@ -42,8 +42,4 @@ module armarx float thresholdPositionNear = -1; float thresholdPositionReached = -1; }; - - - }; - diff --git a/source/RobotAPI/interface/core/CartesianSelection.ice b/source/RobotAPI/interface/core/CartesianSelection.ice index 6fc3d9b0897a8195766ba58aca46fb2b781b6daa..444ca24f869d773654be1501226b87b167bab11b 100644 --- a/source/RobotAPI/interface/core/CartesianSelection.ice +++ b/source/RobotAPI/interface/core/CartesianSelection.ice @@ -33,6 +33,4 @@ module armarx eAll = 15 }; }; - }; - diff --git a/source/RobotAPI/interface/core/CartesianWaypointControllerConfig.ice b/source/RobotAPI/interface/core/CartesianWaypointControllerConfig.ice index 5a509ea7bb2b6cf16c5e71ab4928116ef278dbca..411649209d0ffd46623934bfa61f029e7c0fdd03 100644 --- a/source/RobotAPI/interface/core/CartesianWaypointControllerConfig.ice +++ b/source/RobotAPI/interface/core/CartesianWaypointControllerConfig.ice @@ -26,23 +26,21 @@ module armarx { struct CartesianWaypointControllerConfig { - float maxPositionAcceleration = 500; - float maxOrientationAcceleration = 1; - float maxNullspaceAcceleration = 2; + float maxPositionAcceleration = 500; + float maxOrientationAcceleration = 1; + float maxNullspaceAcceleration = 2; - float kpJointLimitAvoidance = 1; - float jointLimitAvoidanceScale = 2; + float kpJointLimitAvoidance = 1; + float jointLimitAvoidanceScale = 2; - float thresholdOrientationNear = 0.1; - float thresholdOrientationReached = 0.05; - float thresholdPositionNear = 50; - float thresholdPositionReached = 5; + float thresholdOrientationNear = 0.1; + float thresholdOrientationReached = 0.05; + float thresholdPositionNear = 50; + float thresholdPositionReached = 5; float maxOriVel = 1; float maxPosVel = 80; - float kpOri = 1; - float kpPos = 1; + float kpOri = 1; + float kpPos = 1; }; }; - - diff --git a/source/RobotAPI/interface/core/FTSensorValue.ice b/source/RobotAPI/interface/core/FTSensorValue.ice index ed93a5259aff4a2e22d801387a88032ae22e4eb7..d2d912c1254f7f6098209d6bb9a35017078134e0 100644 --- a/source/RobotAPI/interface/core/FTSensorValue.ice +++ b/source/RobotAPI/interface/core/FTSensorValue.ice @@ -33,5 +33,4 @@ module armarx Eigen::Vector3f force; Eigen::Vector3f torque; }; - }; diff --git a/source/RobotAPI/interface/core/FramedPoseBase.ice b/source/RobotAPI/interface/core/FramedPoseBase.ice index b4947429a1e360c808a896b6cf38bd8008259f87..5bea2ebc15a94a2c1ef6bd4a26f8c6f076a3f3e2 100644 --- a/source/RobotAPI/interface/core/FramedPoseBase.ice +++ b/source/RobotAPI/interface/core/FramedPoseBase.ice @@ -22,64 +22,61 @@ #pragma once -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/observers/Filters.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> + #include <RobotAPI/interface/core/PoseBase.ice> module armarx { - /** + /** * [FramedDirectionBase] defines a vector with regard to an agent and a frame within the agent. * If agent is empty and frame is set to armarx::GlobalFrame, vector is defined in global frame. * @param frame Name of frame. * @param frame Name of agent. */ - ["cpp:virtual"] - class FramedDirectionBase extends Vector3Base + ["cpp:virtual"] class FramedDirectionBase extends Vector3Base { string frame; string agent; }; - /** + /** * [FramedPoseBase] defines a pose with regard to an agent and a frame within the agent. * If agent is empty and frame is set to armarx::GlobalFrame, pose is defined in global frame. * @param frame Name of frame. * @param frame Name of agent. */ - ["cpp:virtual"] - class FramedPoseBase extends PoseBase + ["cpp:virtual"] class FramedPoseBase extends PoseBase { string frame; string agent; }; - - /** + + /** * [FramedPositionBase] defines a position with regard to an agent and a frame within the agent. * If agent is empty and frame is set to armarx::GlobalFrame, position is defined in global frame. * @param frame Name of frame. * @param frame Name of agent. */ - ["cpp:virtual"] - class FramedPositionBase extends Vector3Base + ["cpp:virtual"] class FramedPositionBase extends Vector3Base { string frame; string agent; }; - /** + /** * [FramedOrientationBase] defines an orientation in quaternion with regard to an agent and a frame within the agent. * If agent is empty and frame is set to armarx::GlobalFrame, orientation in quaternion is defined in global frame. * @param frame Name of frame. * @param frame Name of agent. */ - ["cpp:virtual"] - class FramedOrientationBase extends QuaternionBase + ["cpp:virtual"] class FramedOrientationBase extends QuaternionBase { string frame; string agent; }; - /** + /** * FramedDirectionMap is a map of FramedDirectionBases and corresponding agent nodes identified by name. * @see FramedDirectionBase */ @@ -89,41 +86,30 @@ module armarx * @see FramedPositionBase */ dictionary<string, FramedPositionBase> FramedPositionMap; - - /** + + /** * PoseMedianFilterBase filters poses with a median filter. */ - ["cpp:virtual"] - class PoseMedianFilterBase extends MedianFilterBase - { + ["cpp:virtual"] class PoseMedianFilterBase extends MedianFilterBase { }; /** * PoseMedianOffsetFilterBase filters poses with median filter and subsequent offset filter. */ - ["cpp:virtual"] - class PoseMedianOffsetFilterBase extends PoseMedianFilterBase - { + ["cpp:virtual"] class PoseMedianOffsetFilterBase extends PoseMedianFilterBase { }; - - - ["cpp:virtual"] - class MedianDerivativeFilterV3Base extends PoseMedianFilterBase - { - int offsetWindowSize; - }; + + + ["cpp:virtual"] class MedianDerivativeFilterV3Base extends PoseMedianFilterBase + { int offsetWindowSize; }; /** * PoseAverageFilterBase filters poses with an average filter. */ - ["cpp:virtual"] - class PoseAverageFilterBase extends AverageFilterBase - { + ["cpp:virtual"] class PoseAverageFilterBase extends AverageFilterBase { }; - }; - diff --git a/source/RobotAPI/interface/core/GeometryBase.ice b/source/RobotAPI/interface/core/GeometryBase.ice index 3a3208019ebb02754b3cc2061ea9aea1e92fe9f5..b2faa5f18f60381669be3c81cf6f8db4889edf96 100644 --- a/source/RobotAPI/interface/core/GeometryBase.ice +++ b/source/RobotAPI/interface/core/GeometryBase.ice @@ -1,46 +1,47 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/serialization/Eigen.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> + /** * Messages that can also be found in ROS package 'geometry_msgs' * http://docs.ros.org/en/jade/api/geometry_msgs/html/index-msg.html */ module armarx -{ - +{ + struct FrameHeader - { - string parentFrame; // base frame - string frame; // child frame + { + string parentFrame; // base frame + string frame; // child frame - string agent; // the robot + string agent; // the robot long timestampInMicroSeconds = 0; - } - - struct TransformStamped - { - FrameHeader header; - Eigen::Matrix4f transform; // [mm] - } - - struct Twist - { - // Linear (x,y,z) and angular (roll, pitch, yaw) velocities - Eigen::Vector3f linear; // [mm/s] - Eigen::Vector3f angular; // [rad/s] - } - - struct TwistStamped - { - FrameHeader header; - Twist twist; - } + } + + struct TransformStamped + + { + FrameHeader header; + Eigen::Matrix4f transform; // [mm] + } + + struct Twist + { + // Linear (x,y,z) and angular (roll, pitch, yaw) velocities + Eigen::Vector3f linear; // [mm/s] + Eigen::Vector3f angular; // [rad/s] + } + + struct TwistStamped + { + FrameHeader header; + Twist twist; + } } // module armarx \ No newline at end of file diff --git a/source/RobotAPI/interface/core/LinkedPoseBase.ice b/source/RobotAPI/interface/core/LinkedPoseBase.ice index 2aaa1b30c2f78337a74852141273f3e400bb89aa..985bceac1b1e7fc6104e8d83a3ed93e32c9509ec 100644 --- a/source/RobotAPI/interface/core/LinkedPoseBase.ice +++ b/source/RobotAPI/interface/core/LinkedPoseBase.ice @@ -27,11 +27,10 @@ module armarx { - /** + /** * [LinkedPoseBase] */ - ["cpp:virtual"] - class LinkedPoseBase extends FramedPoseBase + ["cpp:virtual"] class LinkedPoseBase extends FramedPoseBase { SharedRobotInterface* referenceRobot; /** @@ -40,12 +39,11 @@ module armarx */ void changeFrame(string newFrame); }; - - /** + + /** * [LinkedDirectionBase] */ - ["cpp:virtual"] - class LinkedDirectionBase extends FramedDirectionBase + ["cpp:virtual"] class LinkedDirectionBase extends FramedDirectionBase { SharedRobotInterface* referenceRobot; /** @@ -55,4 +53,3 @@ module armarx void changeFrame(string newFrame); }; }; - diff --git a/source/RobotAPI/interface/core/OrientedPoint.ice b/source/RobotAPI/interface/core/OrientedPoint.ice index 088d4deda1a6bcdb94b25cf37a947c6c3a6bd2b7..f965fadc5baa6be03e402d6dc0ef2f75696bb664 100644 --- a/source/RobotAPI/interface/core/OrientedPoint.ice +++ b/source/RobotAPI/interface/core/OrientedPoint.ice @@ -22,8 +22,8 @@ #pragma once -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/observers/Filters.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> module armarx { @@ -47,13 +47,9 @@ module armarx * @param frame Name of frame. * @param frame Name of agent. */ - ["cpp:virtual"] - class FramedOrientedPointBase extends OrientedPointBase + ["cpp:virtual"] class FramedOrientedPointBase extends OrientedPointBase { string frame; string agent; }; - - }; - diff --git a/source/RobotAPI/interface/core/PoseBase.ice b/source/RobotAPI/interface/core/PoseBase.ice index 81e24b0da8d56f11c0c1fcdcfd2ad016b7d50391..cfe93764d30141bf6224bd56da14fcb9be600056 100644 --- a/source/RobotAPI/interface/core/PoseBase.ice +++ b/source/RobotAPI/interface/core/PoseBase.ice @@ -22,12 +22,12 @@ #pragma once -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/observers/Filters.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> module armarx { - /** + /** * [Vector2Base] defines a 2D vector with x and y. */ class Vector2Base extends VariantDataClass @@ -35,6 +35,7 @@ module armarx float x = zeroInt; float y = zeroInt; }; + /** * List of [Vector3Base]. */ @@ -49,12 +50,13 @@ module armarx float y = zeroInt; float z = zeroInt; }; - /** + + /** * List of [Vector3Base]. */ sequence<Vector3Base> Vector3BaseList; - /** + /** * [QuaternionBase] defines a quaternion with * @param qw Rotation angle. * @param qx x-coordinate of normalized rotation axis. @@ -69,21 +71,18 @@ module armarx float qz = zeroInt; }; - /** + /** * [PoseBase] defines a pose with position in [Vector3Base] and orientation in [QuaternionBase]. * @param position Position as 3D vector in x, y, and z [Vector3Base]. * @param orientation Orientation as quaternion [QuaternionBase]. */ - ["cpp:virtual"] - class PoseBase extends VariantDataClass + ["cpp:virtual"] class PoseBase extends VariantDataClass { Vector3Base position; QuaternionBase orientation; }; - /** + /** * List of [PoseBase]. */ sequence<PoseBase> PoseBaseList; - }; - diff --git a/source/RobotAPI/interface/core/RobotLocalization.ice b/source/RobotAPI/interface/core/RobotLocalization.ice index 1d65d3a1102b1197713cf0d0d40834cfbd64b0e8..cefbd9d2c3560198b3166f21500a0c905b341e9a 100644 --- a/source/RobotAPI/interface/core/RobotLocalization.ice +++ b/source/RobotAPI/interface/core/RobotLocalization.ice @@ -28,8 +28,9 @@ #include <RobotAPI/interface/core/GeometryBase.ice> #include <RobotAPI/interface/core/PoseBase.ice> -module armarx{ - interface GlobalRobotPoseProvider extends armem::server::MemoryInterface +module armarx +{ + interface GlobalRobotPoseProvider extends armem::server::MemoryInterface { // timestamp in microseconds PoseBase getGlobalRobotPose(long timestamp, string robotName); @@ -44,7 +45,7 @@ module armarx{ { void reportGlobalRobotPoseCorrection(TransformStamped global_T_odom); } - + interface OdometryListener { void reportOdometryVelocity(TwistStamped platformVelocity); diff --git a/source/RobotAPI/interface/core/RobotState.ice b/source/RobotAPI/interface/core/RobotState.ice index 6b6ad3bd501a57603a8da4226cd92e7f59ba1796..d826cd08f3dc759b3a9b18b137b833d013df8bb2 100644 --- a/source/RobotAPI/interface/core/RobotState.ice +++ b/source/RobotAPI/interface/core/RobotState.ice @@ -23,16 +23,16 @@ */ #pragma once +#include <Ice/BuiltinSequences.ice> + +#include <ArmarXCore/interface/core/BasicTypes.ice> #include <ArmarXCore/interface/events/SimulatorResetEvent.ice> #include <ArmarXCore/interface/observers/Timestamp.ice> -#include <ArmarXCore/interface/core/BasicTypes.ice> #include <ArmarXCore/interface/serialization/Eigen.ice> -#include <RobotAPI/interface/units/KinematicUnitInterface.ice> #include <RobotAPI/interface/core/FramedPoseBase.ice> #include <RobotAPI/interface/core/RobotLocalization.ice> - -#include <Ice/BuiltinSequences.ice> +#include <RobotAPI/interface/units/KinematicUnitInterface.ice> module armarx { @@ -84,52 +84,33 @@ module armarx interface SharedRobotNodeInterface extends SharedObjectInterface { - ["cpp:const"] idempotent - float getJointValue(); - ["cpp:const"] idempotent - string getName(); - - ["cpp:const"] idempotent - PoseBase getLocalTransformation(); + ["cpp:const"] idempotent float getJointValue(); + ["cpp:const"] idempotent string getName(); - ["cpp:const"] idempotent - FramedPoseBase getGlobalPose(); + ["cpp:const"] idempotent PoseBase getLocalTransformation(); - ["cpp:const"] idempotent - FramedPoseBase getPoseInRootFrame(); + ["cpp:const"] idempotent FramedPoseBase getGlobalPose(); - ["cpp:const"] idempotent - JointType getType(); - ["cpp:const"] idempotent - Vector3Base getJointTranslationDirection(); - ["cpp:const"] idempotent - Vector3Base getJointRotationAxis(); + ["cpp:const"] idempotent FramedPoseBase getPoseInRootFrame(); - ["cpp:const"] idempotent - bool hasChild(string name, bool recursive); - ["cpp:const"] idempotent - string getParent(); - ["cpp:const"] idempotent - NameList getChildren(); - ["cpp:const"] idempotent - NameList getAllParents(string name); + ["cpp:const"] idempotent JointType getType(); + ["cpp:const"] idempotent Vector3Base getJointTranslationDirection(); + ["cpp:const"] idempotent Vector3Base getJointRotationAxis(); - ["cpp:const"] idempotent - float getJointValueOffest(); - ["cpp:const"] idempotent - float getJointLimitHigh(); - ["cpp:const"] idempotent - float getJointLimitLow(); + ["cpp:const"] idempotent bool hasChild(string name, bool recursive); + ["cpp:const"] idempotent string getParent(); + ["cpp:const"] idempotent NameList getChildren(); + ["cpp:const"] idempotent NameList getAllParents(string name); - ["cpp:const"] idempotent - Vector3Base getCoM(); + ["cpp:const"] idempotent float getJointValueOffest(); + ["cpp:const"] idempotent float getJointLimitHigh(); + ["cpp:const"] idempotent float getJointLimitLow(); - ["cpp:const"] idempotent - Ice::FloatSeq getInertia(); + ["cpp:const"] idempotent Vector3Base getCoM(); - ["cpp:const"] idempotent - float getMass(); + ["cpp:const"] idempotent Ice::FloatSeq getInertia(); + ["cpp:const"] idempotent float getMass(); }; @@ -144,8 +125,7 @@ module armarx /** * @return returns the RobotStateComponent this robot belongs to */ - ["cpp:const"] idempotent - RobotStateComponentInterface* getRobotStateComponent(); + ["cpp:const"] idempotent RobotStateComponentInterface* getRobotStateComponent(); SharedRobotNodeInterface* getRobotNode(string name); SharedRobotNodeInterface* getRootNode(); @@ -154,8 +134,7 @@ module armarx /** * @return The timestamp of the last joint value update (not the global pose update). */ - ["cpp:const"] idempotent - TimestampBase getTimestamp(); + ["cpp:const"] idempotent TimestampBase getTimestamp(); RobotNodeSetInfo getRobotNodeSet(string name); NameList getRobotNodeSets(); @@ -173,6 +152,7 @@ module armarx class RobotInfoNode; sequence<RobotInfoNode> RobotInfoNodeList; + class RobotInfoNode { string name; @@ -181,23 +161,19 @@ module armarx RobotInfoNodeList children; }; - /** * The interface used by the RobotStateComponent which allows creating * snapshots of a robot configuration or retrieving a proxy to a constantly * updating synchronized robot. */ - interface RobotStateComponentInterface extends - KinematicUnitListener, - GlobalRobotPoseLocalizationListener, - SimulatorResetEvent + interface RobotStateComponentInterface extends KinematicUnitListener, + GlobalRobotPoseLocalizationListener, SimulatorResetEvent { /** * @return proxy to the shared robot which constantly updates all joint values */ - ["cpp:const"] - idempotent - SharedRobotInterface* getSynchronizedRobot() throws NotInitializedException; + ["cpp:const"] idempotent SharedRobotInterface* getSynchronizedRobot() + throws NotInitializedException; /** * @return proxy to a copy of the shared robot with non updating joint values @@ -209,69 +185,58 @@ module armarx * @return Snapshot * * */ - SharedRobotInterface* getRobotSnapshotAtTimestamp(double time) throws NotInitializedException; + SharedRobotInterface* getRobotSnapshotAtTimestamp(double time) + throws NotInitializedException; /** * Return the joint values from past timestamp. The time that can be gone back depends on the robotstatecomponent configuration. * @return Jointname-jointvalue map * * */ - ["cpp:const"] - idempotent - NameValueMap getJointConfigAtTimestamp(double time) throws NotInitializedException; + ["cpp:const"] idempotent NameValueMap getJointConfigAtTimestamp(double time) + throws NotInitializedException; /** * Return the Robot configuration, including joint values and global pose of the root node, from past timestamp. The time that can be gone back depends on the robotstatecomponent configuration. * @return Robot configuration containing jointvalue map and globalpose * * */ - ["cpp:const"] - idempotent - RobotStateConfig getRobotStateAtTimestamp(double time) throws NotInitializedException; + ["cpp:const"] idempotent RobotStateConfig getRobotStateAtTimestamp(double time) + throws NotInitializedException; /** * @return the robot xml filename as specified in the configuration */ - ["cpp:const"] - idempotent - string getRobotFilename(); + ["cpp:const"] idempotent string getRobotFilename(); /** * @return All dependent packages, which might contain a robot file. */ - ["cpp:const"] - idempotent - Ice::StringSeq getArmarXPackages(); + ["cpp:const"] idempotent Ice::StringSeq getArmarXPackages(); /** * @return The name of the robot represented by this component. Same as * getSynchronizedRobot()->getName() * */ - ["cpp:const"] - idempotent string getRobotName() throws NotInitializedException; + ["cpp:const"] idempotent string getRobotName() throws NotInitializedException; - ["cpp:const"] - idempotent string getRobotStateTopicName() throws NotInitializedException; + ["cpp:const"] idempotent string getRobotStateTopicName() throws NotInitializedException; - /** + /** * @return The scaling of the robot model represented by this component. * */ - ["cpp:const"] - idempotent float getScaling(); + ["cpp:const"] idempotent float getScaling(); - /** + /** * @return The name of the robot node set that is represented by this component. * */ - ["cpp:const"] - idempotent string getRobotNodeSetName() throws NotInitializedException; - - ["cpp:const"] - idempotent RobotInfoNode getRobotInfo(); + ["cpp:const"] idempotent string getRobotNodeSetName() throws NotInitializedException; + ["cpp:const"] idempotent RobotInfoNode getRobotInfo(); }; interface RobotStateListenerInterface @@ -279,5 +244,4 @@ module armarx void reportGlobalRobotRootPose(FramedPoseBase globalPose, long timestamp, bool poseChanged); void reportJointValues(NameValueMap jointAngles, long timestamp, bool aValueChanged); }; - }; diff --git a/source/RobotAPI/interface/core/RobotStateObserverInterface.ice b/source/RobotAPI/interface/core/RobotStateObserverInterface.ice index 1a6115fbe83d4c534876f27d54113156ba2c8d8f..6b7c3ec01286835131a4c535c246cb199c7ef864 100644 --- a/source/RobotAPI/interface/core/RobotStateObserverInterface.ice +++ b/source/RobotAPI/interface/core/RobotStateObserverInterface.ice @@ -23,16 +23,12 @@ #pragma once -#include <RobotAPI/interface/units/KinematicUnitInterface.ice> - #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <RobotAPI/interface/units/KinematicUnitInterface.ice> + module armarx { ["amd"] interface RobotStateObserverInterface extends ObserverInterface - { - ["cpp:const"] - idempotent DatafieldRefBase getPoseDatafield(string nodeName); - }; + { ["cpp:const"] idempotent DatafieldRefBase getPoseDatafield(string nodeName); }; }; - diff --git a/source/RobotAPI/interface/core/TopicTimingTest.ice b/source/RobotAPI/interface/core/TopicTimingTest.ice index 3afe98c177d5736060810a4be03bf0111e04bca4..9f2d3acf908d390e58171f1f30082407d2d45309 100644 --- a/source/RobotAPI/interface/core/TopicTimingTest.ice +++ b/source/RobotAPI/interface/core/TopicTimingTest.ice @@ -4,28 +4,27 @@ module armarx { -module topic_timing -{ - struct SmallData + module topic_timing { - long sentTimestamp = 0; - }; + struct SmallData + { + long sentTimestamp = 0; + }; - sequence <float> FloatSeq; + sequence<float> FloatSeq; - struct BigData - { - long sentTimestamp = 0; + struct BigData + { + long sentTimestamp = 0; - Ice::FloatSeq data; - }; + Ice::FloatSeq data; + }; - interface Topic - { - void reportSmall(SmallData data); + interface Topic + { + void reportSmall(SmallData data); - void reportBig(BigData data); + void reportBig(BigData data); + }; }; - -}; }; diff --git a/source/RobotAPI/interface/core/Trajectory.ice b/source/RobotAPI/interface/core/Trajectory.ice index 3b0bc1cb621b4859604ae701ca3e88be727b020a..724da0698f6bcc0e597eb02b8a0af2c32c531756 100644 --- a/source/RobotAPI/interface/core/Trajectory.ice +++ b/source/RobotAPI/interface/core/Trajectory.ice @@ -22,8 +22,8 @@ #pragma once -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> module armarx { @@ -38,15 +38,13 @@ module armarx sequence<LimitlessState> LimitlessStateSeq; - /** + /** * [TrajectoryBase] defines a n-dimension trajectory with n deriviations. * */ - ["cpp:virtual"] - class TrajectoryBase extends VariantDataClass + ["cpp:virtual"] class TrajectoryBase extends VariantDataClass { - ["protected"] - Ice::StringSeq dimensionNames; + ["protected"] Ice::StringSeq dimensionNames; /** * first vector dimension is the frame of the trajectory * second vector dimension is dimension of trajectory (e.g. which joint). @@ -58,7 +56,4 @@ module armarx ["protected"] LimitlessStateSeq limitless; }; - - }; - diff --git a/source/RobotAPI/interface/mdb/MotionDatabase.ice b/source/RobotAPI/interface/mdb/MotionDatabase.ice index 2ca77b0b92f86b2945925949fd239678e35a78ba..de0a0427e3a9627a5361cf3df88d1d130f751007 100644 --- a/source/RobotAPI/interface/mdb/MotionDatabase.ice +++ b/source/RobotAPI/interface/mdb/MotionDatabase.ice @@ -1,146 +1,187 @@ #include <Glacier2/Session.ice> -module MotionDatabase { - exception InternalErrorException { - string errorMessage; - }; - - exception InvalidParameterException { - string parameterName; - }; - - exception NotAuthorizedException {}; - exception TooManyOpenFilesException {}; - - class Institution; - class MotionDescriptionTreeNode; - class File; - class Motion; - class Project; - class Subject; - class MoCapObject; - - sequence<byte> ByteSequence; - sequence<long> LongSequence; - sequence<string> StringSequence; - sequence<Institution> InstitutionList; - sequence<MotionDescriptionTreeNode> MotionDescriptionTreeNodeList; - sequence<File> FileList; - sequence<Motion> MotionList; - sequence<Project> ProjectList; - sequence<Subject> SubjectList; - sequence<MoCapObject> MoCapObjectList; - - dictionary<string, short> StringShortDictionary; - - enum VisibilityLevel { Public, Protected, Internal }; - - class Institution { - long id; - string acronym; - string name; - }; - - class MotionDescriptionTreeNode { - long id; - string label; - MotionDescriptionTreeNodeList children; - }; - - class DatabaseObject { - long id; - long createdDate; - string createdUser; - long modifiedDate; - string modifiedUser; - StringSequence writeGroups; - StringSequence readProtectedGroups; - StringShortDictionary fileTypeCounts; - }; - - class File { - long id; - long createdDate; - string createdUser; - string fileName; - string fileType; - long attachedToId; - string description; - VisibilityLevel visibility; - File originatedFrom; - }; - - class Motion extends DatabaseObject { - Institution associatedInstitution; - MotionDescriptionTreeNodeList motionDescriptions; - Project associatedProject; - SubjectList associatedSubjects; - MoCapObjectList associatedObjects; - string date; - string comment; - }; - - class Project extends DatabaseObject { - string name; - string comment; - }; - - class Subject extends DatabaseObject { - string firstName; - string lastName; - string comment; - byte gender; - short age; - short weight; - short height; - StringShortDictionary anthropometricsTable; - }; - - class MoCapObject extends DatabaseObject { - string label; - string comment; - string modelSettingsJSON; - }; - - interface FileReader { - void destroy(); - - idempotent long getSize() throws InternalErrorException; - ByteSequence readChunk(long length) throws InternalErrorException, InvalidParameterException; - idempotent void seek(long pos) throws InternalErrorException, InvalidParameterException; - }; - - interface FileWriter { - void destroy(); - - void writeChunk(ByteSequence data) throws InternalErrorException; - }; - - interface MotionDatabaseSession extends Glacier2::Session { - idempotent string pingServer(string echoString); - - idempotent InstitutionList listInstitutions() throws InternalErrorException; - idempotent MotionDescriptionTreeNodeList getMotionDescriptionTree() throws InternalErrorException; - - idempotent Motion getMotion(long motionId) throws InternalErrorException, InvalidParameterException; - idempotent long countMotions(LongSequence filterMotionDescription, LongSequence filterProject, LongSequence filterInstitution, - LongSequence filterSubject, LongSequence filterObject, string motionDescriptionSearchTerm) throws InternalErrorException, - InvalidParameterException; - idempotent MotionList listMotions(LongSequence filterMotionDescription, LongSequence filterProject, LongSequence filterInstitution, - LongSequence filterSubject, LongSequence filterObject, string motionDescriptionSearchTerm, string sortField, long limit, - long offset) throws InternalErrorException, InvalidParameterException; - idempotent ProjectList listProjects() throws InternalErrorException; - idempotent SubjectList listSubjects() throws InternalErrorException; - idempotent MoCapObjectList listObjects() throws InternalErrorException; - - idempotent File getFile(long fileId) throws InternalErrorException, InvalidParameterException; - idempotent FileList listFiles(long databaseObjectId) throws InternalErrorException, InvalidParameterException; - idempotent FileReader* getFileReader(long fileId) throws InternalErrorException, InvalidParameterException, NotAuthorizedException, - TooManyOpenFilesException; - - FileWriter* getFileWriter(long databaseObjectId, string fileName, string fileType, string description, VisibilityLevel visibility, - optional(1) long originatedFromId) throws InternalErrorException, InvalidParameterException, NotAuthorizedException, - TooManyOpenFilesException; - void deleteFile(long fileId) throws InternalErrorException, InvalidParameterException, NotAuthorizedException; - }; +module MotionDatabase +{ + exception InternalErrorException + { + string errorMessage; + }; + + exception InvalidParameterException + { + string parameterName; + }; + + exception NotAuthorizedException{}; + exception TooManyOpenFilesException{}; + + class Institution; + class MotionDescriptionTreeNode; + class File; + class Motion; + class Project; + class Subject; + class MoCapObject; + + sequence<byte> ByteSequence; + sequence<long> LongSequence; + sequence<string> StringSequence; + sequence<Institution> InstitutionList; + sequence<MotionDescriptionTreeNode> MotionDescriptionTreeNodeList; + sequence<File> FileList; + sequence<Motion> MotionList; + sequence<Project> ProjectList; + sequence<Subject> SubjectList; + sequence<MoCapObject> MoCapObjectList; + + dictionary<string, short> StringShortDictionary; + + enum VisibilityLevel + { + Public, + Protected, + Internal + }; + + class Institution + { + long id; + string acronym; + string name; + }; + + class MotionDescriptionTreeNode + { + long id; + string label; + MotionDescriptionTreeNodeList children; + }; + + class DatabaseObject + { + long id; + long createdDate; + string createdUser; + long modifiedDate; + string modifiedUser; + StringSequence writeGroups; + StringSequence readProtectedGroups; + StringShortDictionary fileTypeCounts; + }; + + class File + { + long id; + long createdDate; + string createdUser; + string fileName; + string fileType; + long attachedToId; + string description; + VisibilityLevel visibility; + File originatedFrom; + }; + + class Motion extends DatabaseObject + { + Institution associatedInstitution; + MotionDescriptionTreeNodeList motionDescriptions; + Project associatedProject; + SubjectList associatedSubjects; + MoCapObjectList associatedObjects; + string date; + string comment; + }; + + class Project extends DatabaseObject + { + string name; + string comment; + }; + + class Subject extends DatabaseObject + { + string firstName; + string lastName; + string comment; + byte gender; + short age; + short weight; + short height; + StringShortDictionary anthropometricsTable; + }; + + class MoCapObject extends DatabaseObject + { + string label; + string comment; + string modelSettingsJSON; + }; + + interface FileReader + { + void destroy(); + + idempotent long getSize() throws InternalErrorException; + ByteSequence readChunk(long length) throws InternalErrorException, + InvalidParameterException; + idempotent void seek(long pos) throws InternalErrorException, InvalidParameterException; + }; + + interface FileWriter + { + void destroy(); + + void writeChunk(ByteSequence data) throws InternalErrorException; + }; + + interface MotionDatabaseSession extends Glacier2::Session + { + idempotent string pingServer(string echoString); + + idempotent InstitutionList listInstitutions() throws InternalErrorException; + idempotent MotionDescriptionTreeNodeList getMotionDescriptionTree() + throws InternalErrorException; + + idempotent Motion getMotion(long motionId) throws InternalErrorException, + InvalidParameterException; + idempotent long countMotions(LongSequence filterMotionDescription, + LongSequence filterProject, + LongSequence filterInstitution, + LongSequence filterSubject, + LongSequence filterObject, + string motionDescriptionSearchTerm) + throws InternalErrorException, + InvalidParameterException; + idempotent MotionList listMotions(LongSequence filterMotionDescription, + LongSequence filterProject, + LongSequence filterInstitution, + LongSequence filterSubject, + LongSequence filterObject, + string motionDescriptionSearchTerm, + string sortField, + long limit, + long offset) throws InternalErrorException, + InvalidParameterException; + idempotent ProjectList listProjects() throws InternalErrorException; + idempotent SubjectList listSubjects() throws InternalErrorException; + idempotent MoCapObjectList listObjects() throws InternalErrorException; + + idempotent File getFile(long fileId) throws InternalErrorException, + InvalidParameterException; + idempotent FileList listFiles(long databaseObjectId) throws InternalErrorException, + InvalidParameterException; + idempotent FileReader *getFileReader(long fileId) throws InternalErrorException, + InvalidParameterException, NotAuthorizedException, TooManyOpenFilesException; + + FileWriter *getFileWriter(long databaseObjectId, + string fileName, + string fileType, + string description, + VisibilityLevel visibility, + optional(1) long originatedFromId) throws InternalErrorException, + InvalidParameterException, NotAuthorizedException, TooManyOpenFilesException; + void deleteFile(long fileId) throws InternalErrorException, InvalidParameterException, + NotAuthorizedException; + }; }; diff --git a/source/RobotAPI/interface/objectpose/FamiliarObjectPoseStorageInterface.ice b/source/RobotAPI/interface/objectpose/FamiliarObjectPoseStorageInterface.ice index b7c819ec05d886d40f51723451411070f3930022..4c05c1bd09d9959375be0a95c6bde0c57f6b726b 100644 --- a/source/RobotAPI/interface/objectpose/FamiliarObjectPoseStorageInterface.ice +++ b/source/RobotAPI/interface/objectpose/FamiliarObjectPoseStorageInterface.ice @@ -27,17 +27,13 @@ #include <RobotAPI/interface/aron/Aron.ice> -module armarx -{ - module objpose - { - sequence<::armarx::aron::data::dto::Dict> ProvidedFamiliarObjectPoseSeq; - - interface FamiliarObjectPoseStorageInterface - { - void reportFamiliarObjectPoses(string providerName, ProvidedFamiliarObjectPoseSeq data); - }; - - } +module armarx{ + module objpose{sequence<::armarx::aron::data::dto::Dict> ProvidedFamiliarObjectPoseSeq; +interface FamiliarObjectPoseStorageInterface +{ + void reportFamiliarObjectPoses(string providerName, ProvidedFamiliarObjectPoseSeq data); }; +} +} +; diff --git a/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice b/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice index 7eef5984e466173433e340cf45711be4fd187c95..2016d076bc29a049ad37ca4fe95eb1481bde89bf 100644 --- a/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice +++ b/source/RobotAPI/interface/objectpose/ObjectPoseProvider.ice @@ -34,12 +34,14 @@ module armarx module objpose { interface ObjectPoseProvider; + struct ProviderInfo { ObjectPoseProvider* proxy; ObjectType objectType = AnyObject; armarx::data::ObjectIDSeq supportedObjects; }; + dictionary<string, ProviderInfo> ProviderInfoMap; @@ -57,7 +59,9 @@ module armarx { bool success; }; + dictionary<armarx::data::ObjectID, ObjectRequestResult> ObjectRequestResultMap; + struct RequestObjectsOutput { ObjectRequestResultMap results; @@ -85,6 +89,4 @@ module armarx void reportObjectPoses(string providerName, data::ProvidedObjectPoseSeq candidates); }; }; - }; - diff --git a/source/RobotAPI/interface/objectpose/ObjectPoseStorageInterface.ice b/source/RobotAPI/interface/objectpose/ObjectPoseStorageInterface.ice index a069da9078a11beeb140d5477dd847beb85cf2c3..063ff205910ed11e9d5046606d140ea80bdd5490 100644 --- a/source/RobotAPI/interface/objectpose/ObjectPoseStorageInterface.ice +++ b/source/RobotAPI/interface/objectpose/ObjectPoseStorageInterface.ice @@ -28,9 +28,8 @@ #include <ArmarXCore/interface/observers/ObserverInterface.ice> #include <RobotAPI/interface/armem/server/MemoryInterface.ice> - -#include <RobotAPI/interface/objectpose/object_pose_types.ice> #include <RobotAPI/interface/objectpose/ObjectPoseProvider.ice> +#include <RobotAPI/interface/objectpose/object_pose_types.ice> module armarx @@ -46,6 +45,7 @@ module armarx string provider; provider::RequestObjectsInput request; }; + struct ObjectRequestResult { /// Name of the provider who was requested. @@ -53,7 +53,9 @@ module armarx string providerName; provider::ObjectRequestResult result; }; + dictionary<armarx::data::ObjectID, ObjectRequestResult> ObjectRequestResultMap; + struct RequestObjectsOutput { /// The results per objectID. @@ -79,6 +81,7 @@ module armarx */ PoseBase poseInFrame; }; + struct AttachObjectToRobotNodeOutput { bool success = false; @@ -96,6 +99,7 @@ module armarx */ bool commitAttachedPose = true; }; + struct DetachObjectFromRobotNodeOutput { /// Whether the object was attached before. @@ -109,8 +113,8 @@ module armarx * detaching until they are provided again. */ bool commitAttachedPose = true; - } - struct DetachAllObjectsFromRobotNodesOutput + } struct DetachAllObjectsFromRobotNodesOutput + { /// Number of objects that have been detached. int numDetached = 0; @@ -121,8 +125,8 @@ module armarx string agent; Ice::StringSeq frames; }; - sequence<AgentFrames> AgentFramesSeq; + sequence<AgentFrames> AgentFramesSeq; enum HeadMovementAction { @@ -131,6 +135,7 @@ module armarx /// Head movement is stopping. HeadMovementAction_Stopping }; + struct SignalHeadMovementInput { HeadMovementAction action; @@ -146,6 +151,7 @@ module armarx */ long discardUpdatesIntervalMilliSeconds = -1; }; + struct SignalHeadMovementOutput { /// The time until new updates will be discarded. @@ -159,7 +165,9 @@ module armarx armarx::core::time::dto::Duration timeWindow; armem::prediction::data::PredictionSettings settings; }; + sequence<ObjectPosePredictionRequest> ObjectPosePredictionRequestSeq; + struct ObjectPosePredictionResult { bool success = false; @@ -167,10 +175,10 @@ module armarx data::ObjectPose prediction; }; + sequence<ObjectPosePredictionResult> ObjectPosePredictionResultSeq; - interface ObjectPoseStorageInterface extends - ObjectPoseTopic + interface ObjectPoseStorageInterface extends ObjectPoseTopic { // Object poses @@ -191,11 +199,14 @@ module armarx // Attaching /// Attach an object to a robot node. - AttachObjectToRobotNodeOutput attachObjectToRobotNode(AttachObjectToRobotNodeInput input); + AttachObjectToRobotNodeOutput attachObjectToRobotNode( + AttachObjectToRobotNodeInput input); /// Detach an attached object from a robot node. - DetachObjectFromRobotNodeOutput detachObjectFromRobotNode(DetachObjectFromRobotNodeInput input); + DetachObjectFromRobotNodeOutput detachObjectFromRobotNode( + DetachObjectFromRobotNodeInput input); /// Detach all objects from robot nodes. - DetachAllObjectsFromRobotNodesOutput detachAllObjectsFromRobotNodes(DetachAllObjectsFromRobotNodesInput input); + DetachAllObjectsFromRobotNodesOutput detachAllObjectsFromRobotNodes( + DetachAllObjectsFromRobotNodesInput input); AgentFramesSeq getAttachableFrames(); @@ -211,14 +222,11 @@ module armarx // Predicting // Request predictions for the poses of the given objects at the given timestamps. - ObjectPosePredictionResultSeq - predictObjectPoses(ObjectPosePredictionRequestSeq requests); + ObjectPosePredictionResultSeq predictObjectPoses( + ObjectPosePredictionRequestSeq requests); // Get the prediction engines available for use with this storage interface. armem::prediction::data::PredictionEngineSeq getAvailableObjectPoseEngines(); - }; }; - }; - diff --git a/source/RobotAPI/interface/objectpose/object_pose_types.ice b/source/RobotAPI/interface/objectpose/object_pose_types.ice index 6f6d5cfc83adab6023212dc3996bb5745efd89e2..c39d283ce3c90394f68aa00f9e5cdb8f16235c1d 100644 --- a/source/RobotAPI/interface/objectpose/object_pose_types.ice +++ b/source/RobotAPI/interface/objectpose/object_pose_types.ice @@ -26,9 +26,9 @@ #include <ArmarXCore/interface/core/BasicVectorTypes.ice> #include <ArmarXCore/interface/core/time.ice> -#include <RobotAPI/interface/core/PoseBase.ice> -#include <RobotAPI/interface/core/NameValueMap.ice> #include <RobotAPI/interface/ArmarXObjects/ArmarXObjectsTypes.ice> +#include <RobotAPI/interface/core/NameValueMap.ice> +#include <RobotAPI/interface/core/PoseBase.ice> module armarx @@ -39,11 +39,11 @@ module armarx // ObjectTypeEnum is now renamed to ObjectType enum ObjectType { - AnyObject, KnownObject, UnknownObject + AnyObject, + KnownObject, + UnknownObject }; - - class AABB { Vector3Base center; @@ -61,7 +61,6 @@ module armarx Vector3Base extents; }; - module data { /** @@ -69,13 +68,12 @@ module armarx * * @see `armarx::objpose::PoseManifoldGaussian` */ - class PoseManifoldGaussian // class => optional + class PoseManifoldGaussian // class => optional { PoseBase mean; Ice::FloatSeq covariance6x6; }; - /// An object pose provided by an ObjectPoseProvider. struct ProvidedObjectPose { @@ -110,6 +108,7 @@ module armarx /// [Optional] Object bounding box in object's local coordinate frame. Box localOOBB; }; + sequence<ProvidedObjectPose> ProvidedObjectPoseSeq; @@ -156,8 +155,8 @@ module armarx /// Object bounding box in object's local coordinate frame. May be null. Box localOOBB; }; - sequence<ObjectPose> ObjectPoseSeq; + sequence<ObjectPose> ObjectPoseSeq; class ObjectAttachmentInfo { @@ -167,7 +166,5 @@ module armarx PoseBase poseInFrame; }; } - }; }; - diff --git a/source/RobotAPI/interface/observers/GraspCandidateObserverInterface.ice b/source/RobotAPI/interface/observers/GraspCandidateObserverInterface.ice index b60aa19c3db3bd5d7f1a68937758e401745f3ef0..d44be89966a647439b27715ae02f97a2c35179c5 100644 --- a/source/RobotAPI/interface/observers/GraspCandidateObserverInterface.ice +++ b/source/RobotAPI/interface/observers/GraspCandidateObserverInterface.ice @@ -25,6 +25,7 @@ #include <ArmarXCore/interface/observers/ObserverInterface.ice> + #include <RobotAPI/interface/units/GraspCandidateProviderInterface.ice> module armarx @@ -38,13 +39,13 @@ module armarx armarx::objpose::ObjectType objectType = AnyObject; ApertureType preshape = AnyAperture; ApproachType approach = AnyApproach; - }; sequence<string> StringSeq; dictionary<string, int> IntMap; - interface GraspCandidateObserverInterface extends ObserverInterface, GraspCandidatesTopicInterface + interface GraspCandidateObserverInterface extends ObserverInterface, + GraspCandidatesTopicInterface { InfoMap getAvailableProvidersWithInfo(); StringSeq getAvailableProviderNames(); @@ -68,9 +69,6 @@ module armarx BimanualGraspCandidateSeq getSelectedBimanualCandidates(); void clearCandidatesByProvider(string providerName); - }; }; - }; - diff --git a/source/RobotAPI/interface/observers/KinematicUnitObserverInterface.ice b/source/RobotAPI/interface/observers/KinematicUnitObserverInterface.ice index 71f5598e0ed0bed5df5099579b4d08738d436091..c737524a0b828653b8e011cc692ffb0d16fc5a7a 100644 --- a/source/RobotAPI/interface/observers/KinematicUnitObserverInterface.ice +++ b/source/RobotAPI/interface/observers/KinematicUnitObserverInterface.ice @@ -1,4 +1,4 @@ - /* +/* * This file is part of ArmarX. * * ArmarX is free software; you can redistribute it and/or modify @@ -22,14 +22,11 @@ #pragma once -#include <RobotAPI/interface/units/KinematicUnitInterface.ice> - #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <RobotAPI/interface/units/KinematicUnitInterface.ice> + module armarx { - interface KinematicUnitObserverInterface extends ObserverInterface, KinematicUnitListener - { - }; + interface KinematicUnitObserverInterface extends ObserverInterface, KinematicUnitListener{}; }; - diff --git a/source/RobotAPI/interface/observers/ObserverFilters.ice b/source/RobotAPI/interface/observers/ObserverFilters.ice index ad2df8e05f197f8e773b168d40bff82acc014d8c..ec636f0de9e6b3c9497d7bfb273c69600ac85e04 100644 --- a/source/RobotAPI/interface/observers/ObserverFilters.ice +++ b/source/RobotAPI/interface/observers/ObserverFilters.ice @@ -22,8 +22,8 @@ #pragma once -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/observers/Filters.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> module armarx { @@ -34,73 +34,56 @@ module armarx const string magnitudeinrange = "magnitudeinrange"; }; - /** + /** * OffsetFilterBase implements a filter which stores the measurement in the first run as an offset. * This offset is subtracted from subsequent measurements. */ - ["cpp:virtual"] - class OffsetFilterBase extends DatafieldFilterBase - { + ["cpp:virtual"] class OffsetFilterBase extends DatafieldFilterBase { }; - /** + /** * MatrixMaxFilterBase implements a filter which returns the maximum coefficient of a matrix. */ - ["cpp:virtual"] - class MatrixMaxFilterBase extends DatafieldFilterBase - { + ["cpp:virtual"] class MatrixMaxFilterBase extends DatafieldFilterBase { }; - /** + /** * MatrixMinFilterBase implements a filter which returns the minimum coefficient of a matrix. */ - ["cpp:virtual"] - class MatrixMinFilterBase extends DatafieldFilterBase - { + ["cpp:virtual"] class MatrixMinFilterBase extends DatafieldFilterBase { }; - - /** + + /** * MatrixMinFilterBase implements a filter which returns the mean value of all coefficients of a matrix. */ - ["cpp:virtual"] - class MatrixAvgFilterBase extends DatafieldFilterBase - { + ["cpp:virtual"] class MatrixAvgFilterBase extends DatafieldFilterBase { }; - /** + /** * MatrixPercentileFilterBase implements a filter which returns a subset of the smallest coefficients of a matrix. * The matrix is transformed int a vector which is sorted in a ascending order. The subset consists of the first entries * of the sorted vector. The size of the subset is defined by parameter percentile which ranges from 0.0 to 1.0. */ - ["cpp:virtual"] - class MatrixPercentileFilterBase extends DatafieldFilterBase - { - float percentile; - }; + ["cpp:virtual"] class MatrixPercentileFilterBase extends DatafieldFilterBase + { float percentile; }; - /** + /** * MatrixPercentilesFilterBase implements a filter which returns a subset of the smallest coefficients of a matrix. * The matrix is transformed int a vector which is sorted in a ascending order. The subset consists of the first entries * of the sorted vector. The size of the subset is defined by parameter percentiles. */ - ["cpp:virtual"] - class MatrixPercentilesFilterBase extends DatafieldFilterBase - { - int percentiles; - }; - - /** + ["cpp:virtual"] class MatrixPercentilesFilterBase extends DatafieldFilterBase + { int percentiles; }; + + /** * MatrixCumulativeFrequencyFilterBase implements a filter which returns a matrix filtered by Cumulative Frequency filter. * The entries of the filtered matrix range between the provided min and max values. */ - ["cpp:virtual"] - class MatrixCumulativeFrequencyFilterBase extends DatafieldFilterBase + ["cpp:virtual"] class MatrixCumulativeFrequencyFilterBase extends DatafieldFilterBase { float min; float max; int bins; }; - }; - diff --git a/source/RobotAPI/interface/observers/PlatformUnitObserverInterface.ice b/source/RobotAPI/interface/observers/PlatformUnitObserverInterface.ice index 20709f1fedeb65bb3766d2008607ee750a74965a..780704954d6a6f77f5bc8ed7a56a939fe1b992b4 100644 --- a/source/RobotAPI/interface/observers/PlatformUnitObserverInterface.ice +++ b/source/RobotAPI/interface/observers/PlatformUnitObserverInterface.ice @@ -1,4 +1,4 @@ - /* +/* * This file is part of ArmarX. * * ArmarX is free software; you can redistribute it and/or modify @@ -22,15 +22,13 @@ #pragma once -#include <RobotAPI/interface/units/PlatformUnitInterface.ice> - #include <ArmarXCore/interface/observers/ObserverInterface.ice> #include <RobotAPI/interface/core/RobotLocalization.ice> +#include <RobotAPI/interface/units/PlatformUnitInterface.ice> module armarx { - interface PlatformUnitObserverInterface extends ObserverInterface, PlatformUnitListener, GlobalRobotPoseLocalizationListener - { - }; + interface PlatformUnitObserverInterface extends ObserverInterface, PlatformUnitListener, + GlobalRobotPoseLocalizationListener{}; }; diff --git a/source/RobotAPI/interface/observers/SpeechObserverInterface.ice b/source/RobotAPI/interface/observers/SpeechObserverInterface.ice index 33d6c1758ac04b0235812e8bbf5e6537eda9e830..81e123a465bc32b54870d9ad868a779aefe74426 100644 --- a/source/RobotAPI/interface/observers/SpeechObserverInterface.ice +++ b/source/RobotAPI/interface/observers/SpeechObserverInterface.ice @@ -24,14 +24,12 @@ #include <ArmarXCore/interface/observers/ObserverInterface.ice> + #include <RobotAPI/interface/speech/SpeechInterface.ice> module armarx { - interface SpeechObserverInterface extends ObserverInterface, TextToSpeechStateInterface, TextListenerInterface - { - }; - + interface SpeechObserverInterface extends ObserverInterface, TextToSpeechStateInterface, + TextListenerInterface{}; }; - diff --git a/source/RobotAPI/interface/selflocalisation/SelfLocalisationProcess.ice b/source/RobotAPI/interface/selflocalisation/SelfLocalisationProcess.ice index 0a352add1aee10b6fa2642e70b479513cb2f32d9..9bdd6b17e60707ff0e5084537929b88f4dce2e7a 100644 --- a/source/RobotAPI/interface/selflocalisation/SelfLocalisationProcess.ice +++ b/source/RobotAPI/interface/selflocalisation/SelfLocalisationProcess.ice @@ -32,4 +32,3 @@ module armarx void stopSelfLocalisationProcess(); }; }; - diff --git a/source/RobotAPI/interface/skills/SkillManagerInterface.ice b/source/RobotAPI/interface/skills/SkillManagerInterface.ice index f22738bda8b71cac09faf71620e226135ac93532..04ed44b5411d5268760165e85e0091940b42e35e 100644 --- a/source/RobotAPI/interface/skills/SkillManagerInterface.ice +++ b/source/RobotAPI/interface/skills/SkillManagerInterface.ice @@ -107,15 +107,15 @@ module armarx dto::SkillDescriptionMap getSkillDescriptions(); // get all skilldescriptions from all providers - optional(2) dto::SkillStatusUpdate - getSkillExecutionStatus(dto::SkillExecutionID executionId); + optional(2) dto::SkillStatusUpdate getSkillExecutionStatus( + dto::SkillExecutionID executionId); dto::SkillStatusUpdateMap getSkillExecutionStatuses(); // returns the current executions from all providers - dto::SkillStatusUpdate - executeSkill(dto::SkillExecutionRequest - skillExecutionRequest); // blocks until skill is finished. + dto::SkillStatusUpdate executeSkill( + dto::SkillExecutionRequest + skillExecutionRequest); // blocks until skill is finished. dto::SkillExecutionID executeSkillAsync( dto::SkillExecutionRequest @@ -127,8 +127,8 @@ module armarx // notify a skill to stop ASAP. provider::dto::AbortSkillResult abortSkill(dto::SkillExecutionID executionId); - provider::dto::AbortSkillResult - abortSkillAsync(dto::SkillExecutionID executionId); + provider::dto::AbortSkillResult abortSkillAsync( + dto::SkillExecutionID executionId); }; } } diff --git a/source/RobotAPI/interface/skills/SkillProviderInterface.ice b/source/RobotAPI/interface/skills/SkillProviderInterface.ice index 3066c962e45326fecfdf8f08c6985bb89bf6c3d7..5f327376c7c59196be8129a2bd4a7c0a3baaf0bf 100644 --- a/source/RobotAPI/interface/skills/SkillProviderInterface.ice +++ b/source/RobotAPI/interface/skills/SkillProviderInterface.ice @@ -173,8 +173,8 @@ module armarx dto::SkillDescriptionMap getSkillDescriptions(); - optional(2) dto::SkillStatusUpdate - getSkillExecutionStatus(dto::SkillExecutionID executionId); + optional(2) dto::SkillStatusUpdate getSkillExecutionStatus( + dto::SkillExecutionID executionId); dto::SkillStatusUpdateMap getSkillExecutionStatuses(); // returns all current skill executions @@ -184,12 +184,12 @@ module armarx // This method returns a status update where the status is ALWAYS one of the terminating values dto::SkillStatusUpdate executeSkill(dto::SkillExecutionRequest executionInfo); - dto::SkillExecutionID - executeSkillAsync(dto::SkillExecutionRequest executionInfo); + dto::SkillExecutionID executeSkillAsync( + dto::SkillExecutionRequest executionInfo); - dto::ParameterUpdateResult - updateSkillParameters(dto::SkillExecutionID executionId, - aron::data::dto::Dict params); // add params to a skill + dto::ParameterUpdateResult updateSkillParameters( + dto::SkillExecutionID executionId, + aron::data::dto::Dict params); // add params to a skill // try to kill a skill as soon as possible. When the skill is stopped depends on the implementation. dto::AbortSkillResult abortSkill(dto::SkillExecutionID skill); diff --git a/source/RobotAPI/interface/skills/StatechartListenerInterface.ice b/source/RobotAPI/interface/skills/StatechartListenerInterface.ice index 084633cdcdc1772c7f8f960b3119707dc612373f..2c53130fd7d62d47b11540fe696eb22b2e2d860d 100644 --- a/source/RobotAPI/interface/skills/StatechartListenerInterface.ice +++ b/source/RobotAPI/interface/skills/StatechartListenerInterface.ice @@ -28,8 +28,6 @@ module armarx { module dti { - interface StatechartListenerInterface extends armarx::ProfilerListener - { - }; + interface StatechartListenerInterface extends armarx::ProfilerListener{}; } } diff --git a/source/RobotAPI/interface/speech/SpeechInterface.ice b/source/RobotAPI/interface/speech/SpeechInterface.ice index 8356ea1652d93a496cc0f811bdf4c9bb22496f0f..b8bc3e14761262d630d4e4d3bc02ef4b5367dc3f 100644 --- a/source/RobotAPI/interface/speech/SpeechInterface.ice +++ b/source/RobotAPI/interface/speech/SpeechInterface.ice @@ -32,7 +32,7 @@ module armarx */ enum AudioEncoding { - PCM /*!< digitized PCM audio data (uncompressed) */ + PCM /*!< digitized PCM audio data (uncompressed) */ }; sequence<byte> AudioChunk; @@ -81,8 +81,7 @@ module armarx * \param string vector params. */ - void reportTextWithParams(string text,Ice::StringSeq params); - + void reportTextWithParams(string text, Ice::StringSeq params); }; enum TextToSpeechStateType @@ -107,6 +106,4 @@ module armarx { void publishFeedback(FeedbackType type, bool sign); }; - }; - diff --git a/source/RobotAPI/interface/units/ATINetFTUnit.ice b/source/RobotAPI/interface/units/ATINetFTUnit.ice index 8339b68f57dc76ea7847068dff53ea88f2c2c350..40a7d036017ae87f104be012daa053cc7aa8e766 100644 --- a/source/RobotAPI/interface/units/ATINetFTUnit.ice +++ b/source/RobotAPI/interface/units/ATINetFTUnit.ice @@ -24,9 +24,10 @@ #pragma once +#include <ArmarXCore/interface/core/UserException.ice> + #include <RobotAPI/interface/core/PoseBase.ice> #include <RobotAPI/interface/units/UnitInterface.ice> -#include <ArmarXCore/interface/core/UserException.ice> module armarx { @@ -54,4 +55,3 @@ module armarx bool isComponentOnline(); }; }; - diff --git a/source/RobotAPI/interface/units/CyberGloveInterface.ice b/source/RobotAPI/interface/units/CyberGloveInterface.ice index de433915cb5ed25bf064c0c2408718c0914fd458..166ee83da203e90df47a4fa70e8d385e38f187de 100644 --- a/source/RobotAPI/interface/units/CyberGloveInterface.ice +++ b/source/RobotAPI/interface/units/CyberGloveInterface.ice @@ -60,7 +60,6 @@ module armarx void reportGloveValues(CyberGloveValues gloveValues); /*void reportMotorValues(string name, float position1, float pwm1, float position2, float pwm2);*/ }; - }; #endif diff --git a/source/RobotAPI/interface/units/CyberGloveObserverInterface.ice b/source/RobotAPI/interface/units/CyberGloveObserverInterface.ice index f2482bec8564029ae9775909f9e681d428e39b1d..b89bd9fe1091ef2c98a07a481902c1a1dcb7215c 100644 --- a/source/RobotAPI/interface/units/CyberGloveObserverInterface.ice +++ b/source/RobotAPI/interface/units/CyberGloveObserverInterface.ice @@ -25,15 +25,14 @@ #pragma once #include <ArmarXCore/interface/observers/ObserverInterface.ice> + #include <RobotAPI/interface/units/CyberGloveInterface.ice> module armarx -{ +{ interface CyberGloveObserverInterface extends ObserverInterface, CyberGloveListenerInterface { CyberGloveValues getLatestValues(); }; }; - - diff --git a/source/RobotAPI/interface/units/ForceTorqueUnit.ice b/source/RobotAPI/interface/units/ForceTorqueUnit.ice index 8d0c2985c273e46a7343ea1ff77a344c2bd200de..5737239bcea41235ba6300ddf280cd90feb3fcfd 100644 --- a/source/RobotAPI/interface/units/ForceTorqueUnit.ice +++ b/source/RobotAPI/interface/units/ForceTorqueUnit.ice @@ -24,52 +24,53 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> -#include <RobotAPI/interface/core/FramedPoseBase.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> + +#include <RobotAPI/interface/core/FramedPoseBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx -{ - /** +{ + /** * Implements an interface to a ForceTorqueUnit. **/ interface ForceTorqueUnitInterface extends armarx::SensorActorUnitInterface { - /** + /** * setOffset allows to define offset forces and torques which are subtracted from the measured values. * @param forceOffsets Offset forces in x, y, and z. * @param torqueOffsets Offset torques in x, y, and z. **/ void setOffset(FramedDirectionBase forceOffsets, FramedDirectionBase torqueOffsets); - /** + /** * setToNull allows to reset the ForceTorqueUnit by setting the measured values to zero. **/ void setToNull(); }; - /** + /** * Implements an interface to a ForceTorqueUnitListener **/ interface ForceTorqueUnitListener { - /** + /** * reportSensorValues reports measured forces and torques from the ForceTorqueUnit to ForceTorqueObserver. * @param sensorNodeName Name of force/torque sensor. * @param forces Measured forces. * @param torques Measured torques. **/ - void reportSensorValues(string sensorNodeName, FramedDirectionBase forces, FramedDirectionBase torques); + void reportSensorValues( + string sensorNodeName, FramedDirectionBase forces, FramedDirectionBase torques); }; - /** + /** * Implements an interface to a ForceTorqueUnitObserver. Provides topics on measured forces and torques which can be subscribed. **/ interface ForceTorqueUnitObserverInterface extends ObserverInterface, ForceTorqueUnitListener { - /** + /** * getForceDatafield returns a reference on the force topic. * @param nodeName Name of force sensor topic. **/ @@ -79,11 +80,10 @@ module armarx * @param nodeName Name of torque sensor topic. **/ DatafieldRefBase getTorqueDatafield(string nodeName) throws UserException; - /** + /** * createNulledDatafield resets the force/torque topic. * @param forceTorqueDatafieldRef Reference of torque/torque sensor topic. **/ DatafieldRefBase createNulledDatafield(DatafieldRefBase forceTorqueDatafieldRef); }; }; - diff --git a/source/RobotAPI/interface/units/GamepadUnit.ice b/source/RobotAPI/interface/units/GamepadUnit.ice index c63ddcfdad36942cfcca6c65155c8e96c6847f79..ab61426270944c830a6f3f9fe0f2a0b71e6963f8 100644 --- a/source/RobotAPI/interface/units/GamepadUnit.ice +++ b/source/RobotAPI/interface/units/GamepadUnit.ice @@ -25,21 +25,21 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/Matrix.ice> -#include <ArmarXCore/interface/observers/Timestamp.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - struct GamepadData { + struct GamepadData + { float leftStickX; float leftStickY; float rightStickX; @@ -60,22 +60,20 @@ module armarx bool theMiddleButton; bool leftStickButton; bool rightStickButton; - }; + interface GamepadUnitInterface // extends armarx::SensorActorUnitInterface { void vibrate(); }; interface GamepadUnitListener - { - void reportGamepadState(string device, string name, GamepadData values, TimestampBase timestamp); + { + void reportGamepadState( + string device, string name, GamepadData values, TimestampBase timestamp); }; - /** + /** * Implements an interface to an GamepadUnitObserver. **/ - interface GamepadUnitObserverInterface extends ObserverInterface, GamepadUnitListener - { - }; - + interface GamepadUnitObserverInterface extends ObserverInterface, GamepadUnitListener{}; }; diff --git a/source/RobotAPI/interface/units/GraspCandidateProviderInterface.ice b/source/RobotAPI/interface/units/GraspCandidateProviderInterface.ice index 6ae5638174ec0293a4a3ab73fea68e869a397cf9..12504b02be49535c2d99f4fce438066be3414626 100644 --- a/source/RobotAPI/interface/units/GraspCandidateProviderInterface.ice +++ b/source/RobotAPI/interface/units/GraspCandidateProviderInterface.ice @@ -24,9 +24,10 @@ #pragma once #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <RobotAPI/interface/core/FramedPoseBase.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> #include <ArmarXCore/interface/observers/RequestableService.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> + +#include <RobotAPI/interface/core/FramedPoseBase.ice> #include <RobotAPI/interface/objectpose/object_pose_types.ice> module armarx @@ -38,11 +39,18 @@ module armarx AnyObject, KnownObject, UnknownObject };*/ - enum ApproachType { - AnyApproach, TopApproach, SideApproach + enum ApproachType + { + AnyApproach, + TopApproach, + SideApproach }; - enum ApertureType { - AnyAperture, OpenAperture, PreshapedAperture + + enum ApertureType + { + AnyAperture, + OpenAperture, + PreshapedAperture }; class BoundingBox @@ -60,6 +68,7 @@ module armarx int segmentationLabelID = -1; BoundingBox bbox; }; + class GraspCandidateExecutionHints { ApertureType preshape = AnyAperture; @@ -67,6 +76,7 @@ module armarx string graspTrajectoryName; //string graspTrajectoryPackage; }; + class GraspCandidateReachabilityInfo { bool reachable = false; @@ -76,8 +86,6 @@ module armarx float maxOriError = 0; }; - - class GraspCandidate { PoseBase graspPose; @@ -85,14 +93,15 @@ module armarx PoseBase tcpPoseInHandRoot; Vector3Base approachVector; - string sourceFrame; // frame where graspPose is located - string targetFrame; // frame which should be moved to graspPose + string sourceFrame; // frame where graspPose is located + string targetFrame; // frame which should be moved to graspPose string side; float graspSuccessProbability; armarx::objpose::ObjectType objectType = AnyObject; - int groupNr = -1; // used to match candidates that belog together, e.g. from the same object or point cloud segment + int groupNr = + -1; // used to match candidates that belog together, e.g. from the same object or point cloud segment string providerName; GraspCandidateSourceInfo sourceInfo; // (optional) @@ -114,13 +123,14 @@ module armarx Vector3Base inwardsVectorRight; Vector3Base inwardsVectorLeft; - string sourceFrame; // frame where graspPose is located - string targetFrame; // frame which should be moved to graspPose + string sourceFrame; // frame where graspPose is located + string targetFrame; // frame which should be moved to graspPose //float graspSuccessProbability; armarx::objpose::ObjectType objectType = AnyObject; - int groupNr = -1; // used to match candidates that belog together, e.g. from the same object or point cloud segment + int groupNr = + -1; // used to match candidates that belog together, e.g. from the same object or point cloud segment string providerName; GraspCandidateSourceInfo sourceInfo; // (optional) @@ -137,7 +147,6 @@ module armarx dictionary<string, GraspCandidate> GraspCandidateDict; sequence<BimanualGraspCandidate> BimanualGraspCandidateSeq; - class ProviderInfo { armarx::objpose::ObjectType objectType = AnyObject; @@ -151,14 +160,10 @@ module armarx { void reportProviderInfo(string providerName, ProviderInfo info); void reportGraspCandidates(string providerName, GraspCandidateSeq candidates); - void reportBimanualGraspCandidates(string providerName, BimanualGraspCandidateSeq candidates); - + void reportBimanualGraspCandidates(string providerName, + BimanualGraspCandidateSeq candidates); }; - interface GraspCandidateProviderInterface extends RequestableServiceListenerInterface - { - }; + interface GraspCandidateProviderInterface extends RequestableServiceListenerInterface{}; }; - }; - diff --git a/source/RobotAPI/interface/units/HapticUnit.ice b/source/RobotAPI/interface/units/HapticUnit.ice index dcaec0c5c534e1455bb28692837f93e30276f654..3d9b8771c773ab08d491b1f06691662e48532d76 100644 --- a/source/RobotAPI/interface/units/HapticUnit.ice +++ b/source/RobotAPI/interface/units/HapticUnit.ice @@ -24,43 +24,38 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/Matrix.ice> -#include <ArmarXCore/interface/observers/Timestamp.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> + +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Implements an interface to a HapitcUnit. */ - interface HapticUnitInterface extends armarx::SensorActorUnitInterface - { - }; - /** + interface HapticUnitInterface extends armarx::SensorActorUnitInterface{}; + /** * Implements an interface to a HapitcUnitListener. */ interface HapticUnitListener { - /** + /** * reportSensorValues reports the tactile sensor values from a given sensor device. * @param device Name of tactile sensor device. * @param values Matrix of taxels. * @param timestamp Timestamp of the measurement. **/ - void reportSensorValues(string device, string name, MatrixFloatBase values, TimestampBase timestamp); + void reportSensorValues( + string device, string name, MatrixFloatBase values, TimestampBase timestamp); }; - /** + /** * Implements an interface to a HapitcUnitObserver. */ - interface HapticUnitObserverInterface extends ObserverInterface, HapticUnitListener - { - }; - + interface HapticUnitObserverInterface extends ObserverInterface, HapticUnitListener{}; }; - diff --git a/source/RobotAPI/interface/units/HeadIKUnit.ice b/source/RobotAPI/interface/units/HeadIKUnit.ice index d053a371f82b53fadc12c47e543dec8acd23d244..604f2574489e01e993558cb663ebc338eceb5114 100644 --- a/source/RobotAPI/interface/units/HeadIKUnit.ice +++ b/source/RobotAPI/interface/units/HeadIKUnit.ice @@ -24,23 +24,23 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> -#include <RobotAPI/interface/core/FramedPoseBase.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> + +#include <RobotAPI/interface/core/FramedPoseBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Implements an interface to a HeadIKUnit. **/ interface HeadIKUnitInterface extends armarx::SensorActorUnitInterface { - /** + /** * setCycleTime allows to set the cycle time with which the head IK is solved and the head is controlled within a periodic task. * @param milliseconds Cycle time in milliseconds. **/ @@ -51,15 +51,12 @@ module armarx * @param targetPosition in x, y, and z. **/ void setHeadTarget(string robotNodeSetName, FramedPositionBase targetPosition); - }; - interface HeadIKUnitListener { - void reportHeadTargetChanged(NameValueMap targetJointAngles, FramedPositionBase targetPosition); + void reportHeadTargetChanged(NameValueMap targetJointAngles, + FramedPositionBase targetPosition); }; - }; - diff --git a/source/RobotAPI/interface/units/InertialMeasurementUnit.ice b/source/RobotAPI/interface/units/InertialMeasurementUnit.ice index 9acedc051830e4389af38d9e63a951b772a5d271..510a0509ea8ea15f4744ba77fefc8db5367b78e5 100644 --- a/source/RobotAPI/interface/units/InertialMeasurementUnit.ice +++ b/source/RobotAPI/interface/units/InertialMeasurementUnit.ice @@ -25,58 +25,55 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/Matrix.ice> -#include <ArmarXCore/interface/observers/Timestamp.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Struct IMUData with which IMU sensor data is represented. It incorporates following entries: * @param orientationQuaternion Orientation in quaternion. * @param magneticRotation Magnetic rotation. * @param gyroscopeRotation Rotation of gyroscope. * @param acceleration Acceleration of IMU sensor device. **/ - struct IMUData { + struct IMUData + { Ice::FloatSeq orientationQuaternion; Ice::FloatSeq magneticRotation; - Ice::FloatSeq gyroscopeRotation; + Ice::FloatSeq gyroscopeRotation; Ice::FloatSeq acceleration; }; - /** + + /** * Implements an interface to an InertialMeasurementUnit. **/ - interface InertialMeasurementUnitInterface extends armarx::SensorActorUnitInterface - { - }; - /** + interface InertialMeasurementUnitInterface extends armarx::SensorActorUnitInterface{}; + /** * Implements an interface to an InertialMeasurementUnitListener. **/ interface InertialMeasurementUnitListener - { - /** + { + /** * reportSensorValues reports the IMU sensor values from a given sensor device. * @param device Name of IMU sensor device. * @param values IMU sensor data. * @param timestamp Timestamp of the measurement. **/ - void reportSensorValues(string device, string name, IMUData values, TimestampBase timestamp); + void reportSensorValues( + string device, string name, IMUData values, TimestampBase timestamp); }; - /** + /** * Implements an interface to an InertialMeasurementUnitObserver. **/ - interface InertialMeasurementUnitObserverInterface extends ObserverInterface, InertialMeasurementUnitListener - { - }; - + interface InertialMeasurementUnitObserverInterface extends ObserverInterface, + InertialMeasurementUnitListener{}; }; - diff --git a/source/RobotAPI/interface/units/KinematicUnitInterface.ice b/source/RobotAPI/interface/units/KinematicUnitInterface.ice index 3cc99f54cb8aa8785c3bfc7de09df8f5d7cf885e..be470e01ed1bad33aca7f0c56d42688bd12fde8f 100644 --- a/source/RobotAPI/interface/units/KinematicUnitInterface.ice +++ b/source/RobotAPI/interface/units/KinematicUnitInterface.ice @@ -24,21 +24,20 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <RobotAPI/interface/core/NameValueMap.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Struct RangeViolation for checking whether a given value is in given bounds: **/ struct RangeViolation { - /** + /** * @param rangeFrom Lower bound. * @param rangeTo Upper bound. * @param actualValue Actual value to be checked. @@ -48,18 +47,19 @@ module armarx float actualValue; }; - /** + /** * @param RangeViolationSequence Sequence of values and corresponding bounds to be checked. **/ sequence<RangeViolation> RangeViolationSequence; - /** + /** * @throws OutOfRangeException Raised if value is violating the bounds. **/ exception OutOfRangeException extends UserException { RangeViolationSequence violation; }; - /** + + /** * [ControlMode] defines the different modes which a KinematicUnit can be controlled. **/ enum ControlMode @@ -71,7 +71,8 @@ module armarx eTorqueControl, ePositionVelocityControl }; - /** + + /** * [OperationStatus] defines whether a KinematicUnit is online, offline, or initialized. **/ enum OperationStatus @@ -80,6 +81,7 @@ module armarx eOnline, eInitialized }; + /** * [ErrorStatus] defines the error status of a KinematicUnit. **/ @@ -89,6 +91,7 @@ module armarx eWarning, eError }; + /** * JointStatus combines OperationStatus and ErrorStatus to describe the status of a joint. * @see OperationStatus @@ -98,11 +101,12 @@ module armarx { OperationStatus operation; ErrorStatus error; - + bool enabled; bool emergencyStop; }; - /** + + /** * ControlModeNotSupportedException Raised if a mode is requested which is not supported * @see ControlMode **/ @@ -110,14 +114,14 @@ module armarx { ControlMode mode; }; - /** + /** * KinematicUnitUnavailable Raised if the resource KinematicUnit is not available. **/ exception KinematicUnitUnavailable extends ResourceUnavailableException { StringStringDictionary nodeOwners; }; - /** + /** * KinematicUnitNotOwnedException Raised if the resource KinematicUnit is not owned. **/ exception KinematicUnitNotOwnedException extends ResourceNotOwnedException @@ -137,7 +141,8 @@ module armarx * [NameStatusMap] defined. This data container is mostly used to a status to e.g. a joint which is identified by name. **/ dictionary<string, JointStatus> NameStatusMap; - /** + + /** * Implements an interface to an KinematicUnit. **/ @@ -172,14 +177,15 @@ module armarx * After usage joints should be released so that another component can get access to these joints. */ void releaseJoints(Ice::StringSeq joints) throws KinematicUnitNotOwnedException; - + /** * * switchControlMode allows switching control modes of joints specified in targetJointModes. * @param targetJointModes defines target control modes and corresponding joints. */ - void switchControlMode(NameControlModeMap targetJointModes) throws ControlModeNotSupportedException; - + void switchControlMode(NameControlModeMap targetJointModes) + throws ControlModeNotSupportedException; + /* * Depending on the chosen control mode, one or more of the following functions need to be called * to set all necessary parameters. @@ -189,13 +195,15 @@ module armarx void setJointAngles(NameValueMap targetJointAngles) throws OutOfRangeException; void setJointVelocities(NameValueMap targetJointVelocities) throws OutOfRangeException; void setJointTorques(NameValueMap targetJointTorques) throws OutOfRangeException; - void setJointAccelerations(NameValueMap targetJointAccelerations) throws OutOfRangeException; - void setJointDecelerations(NameValueMap targetJointDecelerations) throws OutOfRangeException; - - ["cpp:const"] NameValueMap getJointAngles(); - ["cpp:const"] NameValueMap getJointVelocities(); + void setJointAccelerations(NameValueMap targetJointAccelerations) + throws OutOfRangeException; + void setJointDecelerations(NameValueMap targetJointDecelerations) + throws OutOfRangeException; + + ["cpp:const"] NameValueMap getJointAngles(); + ["cpp:const"] NameValueMap getJointVelocities(); ["cpp:const"] Ice::StringSeq getJoints(); - + /*! * Returns the current control mode setup of all joints. * @return List with current control modes @@ -205,39 +213,32 @@ module armarx /** * @return the robot xml filename as specified in the configuration */ - ["cpp:const"] - idempotent - string getRobotFilename(); + ["cpp:const"] idempotent string getRobotFilename(); /** * @return All dependent packages, which might contain a robot file. */ - ["cpp:const"] - idempotent - Ice::StringSeq getArmarXPackages(); + ["cpp:const"] idempotent Ice::StringSeq getArmarXPackages(); /** * @return The name of the robot used by this component. * */ - ["cpp:const"] - idempotent string getRobotName() throws NotInitializedException; + ["cpp:const"] idempotent string getRobotName() throws NotInitializedException; /** * @return The name of the robot node set that is used by this component. * */ - ["cpp:const"] - idempotent string getRobotNodeSetName() throws NotInitializedException; + ["cpp:const"] idempotent string getRobotNodeSetName() throws NotInitializedException; /** * @return The name of the report topic that is offered by this unit. * */ - ["cpp:const"] - idempotent string getReportTopicName() throws NotInitializedException; + ["cpp:const"] idempotent string getReportTopicName() throws NotInitializedException; - /* + /* * NYI */ //void set Trajectory(...); @@ -251,74 +252,78 @@ module armarx * @return * */ - ["cpp:const"] - DebugInfo getDebugInfo(); + ["cpp:const"] DebugInfo getDebugInfo(); }; - - - /** + /** * Implements an interface to an KinematicUnitListener. **/ interface KinematicUnitListener { - /** + /** * reportControlModeChanged reports if a ControlMode has changed. * @param actualJointModes Map of control modes and corresponding joint names. * @param aValueChanged Is set to true if a mode has changed. **/ - void reportControlModeChanged(NameControlModeMap actualJointModes, long timestamp, bool aValueChanged); - /** + void reportControlModeChanged( + NameControlModeMap actualJointModes, long timestamp, bool aValueChanged); + /** * reportJointAngles reports joint angle values. * @param actualJointAngles Map of joint angle values and corresponding joint names. * @param aValueChanged Is set to true if a joint angle value has changed. **/ void reportJointAngles(NameValueMap actualJointAngles, long timestamp, bool aValueChanged); - - /** + + /** * reportJointVelocities reports joint angle velocities. * @param actualJointVelocities Map of joint angle velocities and corresponding joint names. * @param aValueChanged Is set to true if a joint angle velocity has changed. **/ - void reportJointVelocities(NameValueMap actualJointVelocities, long timestamp, bool aValueChanged); - - /** + void reportJointVelocities( + NameValueMap actualJointVelocities, long timestamp, bool aValueChanged); + + /** * reportJointTorques reports joint torques. * @param actualJointTorques Map of joint torques and corresponding joint names. * @param aValueChanged Is set to true if a joint torque has changed. **/ - void reportJointTorques(NameValueMap actualJointTorques, long timestamp, bool aValueChanged); - - /** + void reportJointTorques( + NameValueMap actualJointTorques, long timestamp, bool aValueChanged); + + /** * reportJointAccelerations reports joint accelerations. * @param actualJointAccelerations Map of joint accelerations and corresponding joint names. * @param aValueChanged Is set to true if a joint acceleration has changed. **/ - void reportJointAccelerations(NameValueMap actualJointAccelerations, long timestamp, bool aValueChanged); - - /** + void reportJointAccelerations( + NameValueMap actualJointAccelerations, long timestamp, bool aValueChanged); + + /** * reportJointCurrents reports joint currents. * @param actualJointCurrents Map of joint currents and corresponding joint names. * @param aValueChanged Is set to true if a joint current has changed. **/ - void reportJointCurrents(NameValueMap actualJointCurrents, long timestamp, bool aValueChanged); - - /** + void reportJointCurrents( + NameValueMap actualJointCurrents, long timestamp, bool aValueChanged); + + /** * reportJointMotorTemperatures reports joint motor temperatures. * @param actualJointMotorTemperatures Map of joint motor temperatures and corresponding joint names. * @param aValueChanged Is set to true if a joint motor temperature has changed. **/ - void reportJointMotorTemperatures(NameValueMap actualJointMotorTemperatures, long timestamp, bool aValueChanged); - - /** + void reportJointMotorTemperatures( + NameValueMap actualJointMotorTemperatures, long timestamp, bool aValueChanged); + + /** * reportJointStatuses reports current joint statuses. * @param actualJointStatuses Map of joint statuses and corresponding joint names. * @param aValueChanged Is set to true if a joint status has changed. **/ - void reportJointStatuses(NameStatusMap actualJointStatuses, long timestamp, bool aValueChanged); + void reportJointStatuses( + NameStatusMap actualJointStatuses, long timestamp, bool aValueChanged); }; - + /*interface KinematicUnitHandInterface extends KinematicUnitInterface { void open(); @@ -335,5 +340,4 @@ module armarx void reportTactileSensorRawData(NameValueMap actualTactileSensorRawData); void reportTactileSensorContactData(NameValueMap actualTactileSensorContactData); };*/ - }; diff --git a/source/RobotAPI/interface/units/LaserScannerUnit.ice b/source/RobotAPI/interface/units/LaserScannerUnit.ice index cf3a48562253065449dcdceb30030573f1a85e87..98477fc262a32fac283a863459378f8ee0db7d5e 100644 --- a/source/RobotAPI/interface/units/LaserScannerUnit.ice +++ b/source/RobotAPI/interface/units/LaserScannerUnit.ice @@ -25,21 +25,20 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/Matrix.ice> -#include <ArmarXCore/interface/observers/Timestamp.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Struct LaserScanStep with which a single scan step is represented. It incorporates following entries: * @param angle Angle in which direction a distance was measured [rad]. * @param distance The measured distance [mm]. @@ -65,20 +64,17 @@ module armarx interface LaserScannerUnitInterface extends armarx::SensorActorUnitInterface { - ["cpp:const"] - idempotent string getReportTopicName() throws NotInitializedException; + ["cpp:const"] idempotent string getReportTopicName() throws NotInitializedException; - ["cpp:const"] - LaserScannerInfoSeq getConnectedDevices(); + ["cpp:const"] LaserScannerInfoSeq getConnectedDevices(); }; interface LaserScannerUnitListener { - void reportSensorValues(string device, string name, LaserScan values, TimestampBase timestamp); - }; - - interface LaserScannerUnitObserverInterface extends ObserverInterface, LaserScannerUnitListener - { + void reportSensorValues( + string device, string name, LaserScan values, TimestampBase timestamp); }; + interface LaserScannerUnitObserverInterface extends ObserverInterface, + LaserScannerUnitListener{}; }; diff --git a/source/RobotAPI/interface/units/LocalizationUnitInterface.ice b/source/RobotAPI/interface/units/LocalizationUnitInterface.ice index 8799ee4f0e75822c2c6d59dfb77212213ec1f7bf..bbb188591db956d71b96c9ead006a83f5c4e9b6e 100644 --- a/source/RobotAPI/interface/units/LocalizationUnitInterface.ice +++ b/source/RobotAPI/interface/units/LocalizationUnitInterface.ice @@ -24,30 +24,26 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <RobotAPI/interface/core/RobotLocalization.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <RobotAPI/interface/core/GeometryBase.ice> +#include <RobotAPI/interface/core/RobotLocalization.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx -{ - +{ + interface LocalizationUnitInterface extends SensorActorUnitInterface { void reportGlobalRobotPoseCorrection(TransformStamped global_T_odom); }; - interface LocalizationUnitListener - { - + interface LocalizationUnitListener{ + }; - interface LocalizationSubUnitInterface extends LocalizationUnitInterface - { + interface LocalizationSubUnitInterface extends LocalizationUnitInterface{ }; - }; diff --git a/source/RobotAPI/interface/units/MetaWearIMU.ice b/source/RobotAPI/interface/units/MetaWearIMU.ice index 7cd97f8e43df797e4915242fbd8e3db59f09bec7..2701487c516ebac76c7e4dc3cb752979d0212993 100644 --- a/source/RobotAPI/interface/units/MetaWearIMU.ice +++ b/source/RobotAPI/interface/units/MetaWearIMU.ice @@ -24,14 +24,16 @@ #pragma once -#include <RobotAPI/interface/core/PoseBase.ice> -#include <RobotAPI/interface/units/UnitInterface.ice> #include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/Timestamp.ice> +#include <RobotAPI/interface/core/PoseBase.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> + module armarx { - struct MetaWearIMUData { + struct MetaWearIMUData + { Ice::FloatSeq orientationQuaternion; Ice::FloatSeq magnetic; Ice::FloatSeq gyro; @@ -42,8 +44,5 @@ module armarx { void reportIMUValues(string name, MetaWearIMUData data, TimestampBase timestamp); }; - interface MetaWearIMUObserverInterface extends ObserverInterface, MetaWearIMUListener - { - }; + interface MetaWearIMUObserverInterface extends ObserverInterface, MetaWearIMUListener{}; }; - diff --git a/source/RobotAPI/interface/units/MetaWearIMUInterface.ice b/source/RobotAPI/interface/units/MetaWearIMUInterface.ice index c360a1e100cc6a124ed93a376af76c2e7b46a457..13f79c71378539e39ddd6a67e68b188e9c13148d 100644 --- a/source/RobotAPI/interface/units/MetaWearIMUInterface.ice +++ b/source/RobotAPI/interface/units/MetaWearIMUInterface.ice @@ -29,7 +29,8 @@ module armarx { sequence<float> FloatSeq; - struct MetaWearIMUDataExt { + struct MetaWearIMUDataExt + { FloatSeq orientationQuaternion; FloatSeq magnetic; FloatSeq gyro; @@ -41,4 +42,3 @@ module armarx void reportIMUValues(string name, MetaWearIMUDataExt data); }; }; - diff --git a/source/RobotAPI/interface/units/MultiHandUnitInterface.ice b/source/RobotAPI/interface/units/MultiHandUnitInterface.ice index 4f107495c73a0fab746b6ef5d3607f0e6c430b5b..1308c97206b46a15b7b7ec6e2aaf955041bc2489 100644 --- a/source/RobotAPI/interface/units/MultiHandUnitInterface.ice +++ b/source/RobotAPI/interface/units/MultiHandUnitInterface.ice @@ -37,6 +37,7 @@ module armarx string handName; //Ice::StringSeq jointNames; }; + sequence<HandInfo> HandInfoSeq; interface MultiHandUnitInterface @@ -46,4 +47,3 @@ module armarx NameValueMap getJointValues(string handName); }; }; - diff --git a/source/RobotAPI/interface/units/OptoForceUnit.ice b/source/RobotAPI/interface/units/OptoForceUnit.ice index 8b893b11bb1fe323ee69f5498af434584d993cfc..acd5a4f1d3232785c9714f776c945e33173d62e0 100644 --- a/source/RobotAPI/interface/units/OptoForceUnit.ice +++ b/source/RobotAPI/interface/units/OptoForceUnit.ice @@ -25,21 +25,20 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/Matrix.ice> -#include <ArmarXCore/interface/observers/Timestamp.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Implements an interface to an OptoForceUnit. **/ interface OptoForceUnitInterface //extends armarx::SensorActorUnitInterface @@ -47,25 +46,22 @@ module armarx void startRecording(string filepath); void stopRecording(); }; - /** + /** * Implements an interface to an OptoForceUnitListener. **/ interface OptoForceUnitListener - { - /** + { + /** * reportSensorValues reports the IMU sensor values from a given sensor device. * @param device Name of IMU sensor device. * @param values IMU sensor data. * @param timestamp Timestamp of the measurement. **/ - void reportSensorValues(string device, string name, float fx, float fy, float fz, TimestampBase timestamp); + void reportSensorValues( + string device, string name, float fx, float fy, float fz, TimestampBase timestamp); }; - /** + /** * Implements an interface to an OptoForceUnitObserver. **/ - interface OptoForceUnitObserverInterface extends ObserverInterface, OptoForceUnitListener - { - }; - + interface OptoForceUnitObserverInterface extends ObserverInterface, OptoForceUnitListener{}; }; - diff --git a/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice b/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice index 7d14330d295e1aab314d66842ba2f5cedefba8e6..3ec6fcde73fe339238f81d65447c39fa8e83c87d 100644 --- a/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice +++ b/source/RobotAPI/interface/units/OrientedTactileSensorUnit.ice @@ -22,10 +22,11 @@ #pragma once +#include <ArmarXCore/interface/core/UserException.ice> +#include <ArmarXCore/interface/observers/Timestamp.ice> + #include <RobotAPI/interface/core/PoseBase.ice> #include <RobotAPI/interface/units/UnitInterface.ice> -#include <ArmarXCore/interface/observers/Timestamp.ice> -#include <ArmarXCore/interface/core/UserException.ice> module armarx { @@ -38,20 +39,30 @@ module armarx }; - interface OrientedTactileSensorUnitInterface extends armarx::SensorActorUnitInterface - { + interface OrientedTactileSensorUnitInterface extends armarx::SensorActorUnitInterface{ //bool loadCalibration(int accel_offset_x, int accel_offset_y, int accel_offset_z, int gyro_offset_x, int gyro_offset_y, int gyro_offset_z, int mag_offset_x, int mag_offset_y, int mag_offset_z, int accel_radius, int mag_radius ); }; - interface OrientedTactileSensorUnitListener + interface OrientedTactileSensorUnitListener { - void reportSensorValues(int id, float pressure, float qw, float qx, float qy, float qz, float pressureRate, float rotationRate, float accelerationRate, float accelx, float accely, float accelz, TimestampBase timestamp); + void reportSensorValues(int id, + float pressure, + float qw, + float qx, + float qy, + float qz, + float pressureRate, + float rotationRate, + float accelerationRate, + float accelx, + float accely, + float accelz, + TimestampBase timestamp); }; - interface OrientedTactileSensorUnitObserverInterface extends ObserverInterface, OrientedTactileSensorUnitListener - { + interface OrientedTactileSensorUnitObserverInterface extends ObserverInterface, + OrientedTactileSensorUnitListener{ - }; + }; }; - diff --git a/source/RobotAPI/interface/units/PlatformUnitInterface.ice b/source/RobotAPI/interface/units/PlatformUnitInterface.ice index f83ad97cf10f83c8975a8c79f1b44deecd594d4e..88bfe4ebf08d261bbd5326c8d365577ff7333604 100644 --- a/source/RobotAPI/interface/units/PlatformUnitInterface.ice +++ b/source/RobotAPI/interface/units/PlatformUnitInterface.ice @@ -115,7 +115,5 @@ module armarx reportPlatformOdometryPose(float x, float y, float angle); }; - interface PlatformSubUnitInterface extends PlatformUnitInterface - { - }; + interface PlatformSubUnitInterface extends PlatformUnitInterface{}; }; diff --git a/source/RobotAPI/interface/units/RobotPoseUnitInterface.ice b/source/RobotAPI/interface/units/RobotPoseUnitInterface.ice index 7864ce45e391d73cc63b1e9a8875fc8527bd2b18..b98482721d34f3c7a7fbe109ee7ca517353096e1 100644 --- a/source/RobotAPI/interface/units/RobotPoseUnitInterface.ice +++ b/source/RobotAPI/interface/units/RobotPoseUnitInterface.ice @@ -24,11 +24,11 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/PoseBase.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/core/UserException.ice> + +#include <RobotAPI/interface/core/PoseBase.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { @@ -57,7 +57,8 @@ module armarx * @param postionalAccuracy Platform stops translating if distance to target position gets lower than this threshhold. * @param orientationalAccuracy Platform stops rotating if distance from current to target orientation gets lower than this threshhold. **/ - void moveRelative(PoseBase relativeTarget, float positionalAccuracy, float orientationalAccuracy); + void moveRelative( + PoseBase relativeTarget, float positionalAccuracy, float orientationalAccuracy); /** * setMaxVelocities allows to specify max velocities in translation and orientation. * @param positionalVelocity Max translation velocity. @@ -90,6 +91,4 @@ module armarx **/ void reportRobotVelocity(PoseBase currentRobotvelocity); }; - }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/DSControllerBase.ice b/source/RobotAPI/interface/units/RobotUnit/DSControllerBase.ice index 4b68726211fb66a76d68a5253f7b667d6cd39691..e3f9912aa1ddace166a1538469c71cbd221db673 100644 --- a/source/RobotAPI/interface/units/RobotUnit/DSControllerBase.ice +++ b/source/RobotAPI/interface/units/RobotUnit/DSControllerBase.ice @@ -55,11 +55,9 @@ module armarx float positionErrorTolerance; float dsAdaptorEpsilon; - }; - interface DSControllerInterface extends NJointControllerInterface - { + interface DSControllerInterface extends NJointControllerInterface{ }; @@ -80,9 +78,9 @@ module armarx float torqueLimit = 1; float NullTorqueLimit = 0.2; -// string tcpName = ""; + // string tcpName = ""; -// Ice::FloatSeq desiredPosition; + // Ice::FloatSeq desiredPosition; Ice::FloatSeq left_desiredQuaternion; Ice::FloatSeq right_desiredQuaternion; @@ -94,7 +92,6 @@ module armarx float nullspaceDamping; - string gmmParamsFile = ""; float positionErrorTolerance; @@ -127,11 +124,9 @@ module armarx Ice::FloatSeq forceRightOffset; }; - interface DSBimanualControllerInterface extends NJointControllerInterface { void setToDefaultTarget(); - }; class DSJointCarryControllerConfig extends NJointControllerConfig @@ -166,7 +161,6 @@ module armarx Ice::FloatSeq defaultRotationStiffness; }; - interface DSJointCarryControllerInterface extends NJointControllerInterface { void setGuardInHandPosition(Ice::FloatSeq guardCenterToHandsCenter); @@ -176,5 +170,4 @@ module armarx void setGuardObsAvoidVel(Ice::FloatSeq guardZVel); float getGMMVel(); }; - }; diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointActiveImpedanceController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointActiveImpedanceController.ice index da687c5d0dd5770d34be1ed680d81f2711543606..d076e749285b9857af73da62eee58db1e107e52d 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointActiveImpedanceController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointActiveImpedanceController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -41,7 +41,6 @@ module armarx string deviceName; }; - interface NJointActiveImpedanceControllerInterface extends NJointControllerInterface { void setControllerTarget(float position, float kp, float kd); diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualCartesianAdmittanceController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualCartesianAdmittanceController.ice index 044d9f64fae26fc6a4f842ca2e82bea5eab8fca9..4f1cdd3083586ea9674b1b8954979aa09a163a43 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualCartesianAdmittanceController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualCartesianAdmittanceController.ice @@ -24,8 +24,8 @@ #include <ArmarXCore/interface/serialization/Eigen.ice> -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -48,6 +48,7 @@ module armarx float k; float d; }; + struct Impedance { Eigen::Vector3f KpXYZ; @@ -55,6 +56,7 @@ module armarx Eigen::Vector3f KdXYZ; Eigen::Vector3f KdRPY; }; + struct Admittance { Eigen::Vector3f KpXYZ; @@ -64,6 +66,7 @@ module armarx Eigen::Vector3f KmXYZ; Eigen::Vector3f KmRPY; }; + struct Force { Eigen::Vector3f wrenchXYZ; @@ -116,16 +119,17 @@ module armarx void setDesiredJointValuesRight(Ice::FloatSeq cfg); void setNullspaceConfig(detail::NJBmanCartAdmCtrl::Nullspace nullspace); void setAdmittanceConfig(detail::NJBmanCartAdmCtrl::Admittance admittanceObject); - void setForceConfig(detail::NJBmanCartAdmCtrl::Force left, detail::NJBmanCartAdmCtrl::Force right); - void setImpedanceConfig(detail::NJBmanCartAdmCtrl::Impedance left, detail::NJBmanCartAdmCtrl::Impedance right); + void setForceConfig(detail::NJBmanCartAdmCtrl::Force left, + detail::NJBmanCartAdmCtrl::Force right); + void setImpedanceConfig(detail::NJBmanCartAdmCtrl::Impedance left, + detail::NJBmanCartAdmCtrl::Impedance right); ["cpp:const"] Eigen::Matrix4f getBoxPose(); void setBoxPose(Eigen::Matrix4f pose); void setBoxWidth(float w); void setBoxVelocity(Eigen::Vector3f velXYZ, Eigen::Vector3f velRPY); - void setBoxPoseAndVelocity(Eigen::Matrix4f pose, - Eigen::Vector3f velXYZ, - Eigen::Vector3f velRPY); + void setBoxPoseAndVelocity( + Eigen::Matrix4f pose, Eigen::Vector3f velXYZ, Eigen::Vector3f velRPY); void moveBoxPose(Eigen::Matrix4f pose); void moveBoxPosition(Eigen::Vector3f pos); @@ -135,8 +139,4 @@ module armarx // Eigen::Vector3f velRPY; */ }; - - - }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceController.ice index a173e758341b325de617a2775404ff1de982cb8b..5c27307a9a1c9d4ffa8ce19a147fb2340503a53b 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -59,8 +59,8 @@ module armarx Ice::FloatSeq KdAdmittance; Ice::FloatSeq KmAdmittance; Ice::FloatSeq KmPID; -// Ice::FloatSeq objectKp; -// Ice::FloatSeq objectKd; + // Ice::FloatSeq objectKp; + // Ice::FloatSeq objectKd; // pid force controller parameters Ice::FloatSeq targetWrench; @@ -74,20 +74,20 @@ module armarx float massLeft; Ice::FloatSeq CoMVecLeft; - Ice::FloatSeq forceOffsetLeft; + Ice::FloatSeq forceOffsetLeft; Ice::FloatSeq torqueOffsetLeft; float massRight; Ice::FloatSeq CoMVecRight; - Ice::FloatSeq forceOffsetRight; + Ice::FloatSeq forceOffsetRight; Ice::FloatSeq torqueOffsetRight; -// // flags for testing variants -// int dmpFeedType; // 0: no dmp, 1: frame, 2: vel, 3: acc, 4: force -// int method; // 1,2,3,4 four diffrent method w.r.t inertia trick; default (0): normal method -// int jcMethod; // 0: lin's paper, default: Jc = J -// int pdotMethod; // 0: numerical differential, 1: paper, Tau - Tau.Transpose, 2 test, default: zero matrix -// int graspingType; // 0: fixed to obj, 1, fixed to hand, 2, dynamically from hand pose, defualt: identity + // // flags for testing variants + // int dmpFeedType; // 0: no dmp, 1: frame, 2: vel, 3: acc, 4: force + // int method; // 1,2,3,4 four diffrent method w.r.t inertia trick; default (0): normal method + // int jcMethod; // 0: lin's paper, default: Jc = J + // int pdotMethod; // 0: numerical differential, 1: paper, Tau - Tau.Transpose, 2 test, default: zero matrix + // int graspingType; // 0: fixed to obj, 1, fixed to hand, 2, dynamically from hand pose, defualt: identity float knull; float dnull; @@ -95,7 +95,6 @@ module armarx float torqueLimit; float forceThreshold; - }; interface NJointBimanualForceControllerInterface extends NJointControllerInterface @@ -104,15 +103,9 @@ module armarx bool isFinished(); void runDMP(Ice::DoubleSeq goals); -// void setViaPoints(double canVal, Ice::DoubleSeq point); + // void setViaPoints(double canVal, Ice::DoubleSeq point); void setGoals(Ice::DoubleSeq goals); void setViaPoints(double u, Ice::DoubleSeq viapoint); double getVirtualTime(); - - }; - - - }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceMPController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceMPController.ice index 49acfeefb9fec34ea497c6209d8a0b1c3c846c9b..66f0f3b61783f779e7759cc468ec32afa26dcdf9 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceMPController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualForceMPController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -67,10 +67,8 @@ module armarx Ice::FloatSeq rightForceOffset; string debugName; - }; - interface NJointBimanualForceMPControllerInterface extends NJointControllerInterface { void learnDMPFromFiles(string whichMP, Ice::StringSeq trajfiles); @@ -81,4 +79,3 @@ module armarx void setViaPoints(string whichDMP, double canVal, Ice::DoubleSeq viaPoint); }; }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualObjLevelController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualObjLevelController.ice index 7488ad443518fc4fbce80b247a2a0070acafd5e5..a03826f6b1c33d2a611d6c06a42a3e599194f7b3 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointBimanualObjLevelController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointBimanualObjLevelController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -59,8 +59,8 @@ module armarx Ice::FloatSeq KdAdmittance; Ice::FloatSeq KmAdmittance; Ice::FloatSeq KmPID; -// Ice::FloatSeq objectKp; -// Ice::FloatSeq objectKd; + // Ice::FloatSeq objectKp; + // Ice::FloatSeq objectKd; // pid force controller parameters Ice::FloatSeq targetWrench; @@ -74,20 +74,20 @@ module armarx float massLeft; Ice::FloatSeq CoMVecLeft; - Ice::FloatSeq forceOffsetLeft; + Ice::FloatSeq forceOffsetLeft; Ice::FloatSeq torqueOffsetLeft; float massRight; Ice::FloatSeq CoMVecRight; - Ice::FloatSeq forceOffsetRight; + Ice::FloatSeq forceOffsetRight; Ice::FloatSeq torqueOffsetRight; -// // flags for testing variants -// int dmpFeedType; // 0: no dmp, 1: frame, 2: vel, 3: acc, 4: force -// int method; // 1,2,3,4 four diffrent method w.r.t inertia trick; default (0): normal method -// int jcMethod; // 0: lin's paper, default: Jc = J -// int pdotMethod; // 0: numerical differential, 1: paper, Tau - Tau.Transpose, 2 test, default: zero matrix -// int graspingType; // 0: fixed to obj, 1, fixed to hand, 2, dynamically from hand pose, defualt: identity + // // flags for testing variants + // int dmpFeedType; // 0: no dmp, 1: frame, 2: vel, 3: acc, 4: force + // int method; // 1,2,3,4 four diffrent method w.r.t inertia trick; default (0): normal method + // int jcMethod; // 0: lin's paper, default: Jc = J + // int pdotMethod; // 0: numerical differential, 1: paper, Tau - Tau.Transpose, 2 test, default: zero matrix + // int graspingType; // 0: fixed to obj, 1, fixed to hand, 2, dynamically from hand pose, defualt: identity float knull; float dnull; @@ -97,7 +97,6 @@ module armarx Ice::FloatSeq forceThreshold; double ftCalibrationTime; - }; interface NJointBimanualObjLevelControllerInterface extends NJointControllerInterface @@ -105,9 +104,10 @@ module armarx void learnDMPFromFiles(Ice::StringSeq trajfiles); bool isFinished(); void runDMP(Ice::DoubleSeq goals, double timeDuration); - void runDMPWithVirtualStart(Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration); + void runDMPWithVirtualStart( + Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration); -// void setViaPoints(double canVal, Ice::DoubleSeq point); + // void setViaPoints(double canVal, Ice::DoubleSeq point); void setGoals(Ice::DoubleSeq goals); void setViaPoints(double u, Ice::DoubleSeq viapoint); void removeAllViaPoints(); @@ -148,7 +148,6 @@ module armarx float jointVelLimit; float jointLimitAvoidanceKp; - }; interface NJointBimanualObjLevelVelControllerInterface extends NJointControllerInterface @@ -156,7 +155,8 @@ module armarx void learnDMPFromFiles(Ice::StringSeq trajfiles); bool isFinished(); void runDMP(Ice::DoubleSeq goals, double timeDuration); - void runDMPWithVirtualStart(Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration); + void runDMPWithVirtualStart( + Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration); void setGoals(Ice::DoubleSeq goals); void setViaPoints(double u, Ice::DoubleSeq viapoint); @@ -235,21 +235,27 @@ module armarx Ice::FloatSeq forceThreshold; double ftCalibrationTime; - }; interface NJointBimanualObjLevelMultiMPControllerInterface extends NJointControllerInterface { void learnDMPFromFiles(Ice::StringSeq trajfiles); - void learnMultiDMPFromFiles(Ice::StringSeq objFileNames, Ice::StringSeq leftFileNames, Ice::StringSeq rightFileNames); + void learnMultiDMPFromFiles(Ice::StringSeq objFileNames, + Ice::StringSeq leftFileNames, + Ice::StringSeq rightFileNames); bool isFinished(); - void runDMP(Ice::DoubleSeq goalObj, Ice::DoubleSeq goalLeft, Ice::DoubleSeq goalRight, double timeDuration); - void runDMPWithVirtualStart(Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration); - -// void setViaPoints(double canVal, Ice::DoubleSeq point); + void runDMP(Ice::DoubleSeq goalObj, + Ice::DoubleSeq goalLeft, + Ice::DoubleSeq goalRight, + double timeDuration); + void runDMPWithVirtualStart( + Ice::DoubleSeq starts, Ice::DoubleSeq goals, double timeDuration); + + // void setViaPoints(double canVal, Ice::DoubleSeq point); void setGoals(Ice::DoubleSeq goals); - void setMultiMPGoals(Ice::DoubleSeq goalObj, Ice::DoubleSeq goalLeft, Ice::DoubleSeq goalRight); + void setMultiMPGoals( + Ice::DoubleSeq goalObj, Ice::DoubleSeq goalLeft, Ice::DoubleSeq goalRight); void setViaPoints(double u, Ice::DoubleSeq viapoint); void removeAllViaPoints(); @@ -266,6 +272,4 @@ module armarx Ice::FloatSeq getCurrentObjVel(); Ice::FloatSeq getCurrentObjForce(); }; - }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianNaturalPositionController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianNaturalPositionController.ice index 7516fa77cb26ca6355da211e1db459d640337eee..19d376df5f2f07fdf41007adeb010b5b5526dc66 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianNaturalPositionController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianNaturalPositionController.ice @@ -22,12 +22,12 @@ #pragma once +#include <ArmarXCore/interface/core/BasicVectorTypes.ice> #include <ArmarXCore/interface/serialization/Eigen.ice> -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> -#include <RobotAPI/interface/core/FTSensorValue.ice> #include <RobotAPI/interface/core/CartesianNaturalPositionControllerConfig.ice> -#include <ArmarXCore/interface/core/BasicVectorTypes.ice> +#include <RobotAPI/interface/core/FTSensorValue.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -49,7 +49,10 @@ module armarx void setConfig(CartesianNaturalPositionControllerConfig cfg); void setTarget(Eigen::Matrix4f tcpTarget, Eigen::Vector3f elbowTarget, bool setOrientation); - void setTargetFeedForward(Eigen::Matrix4f tcpTarget, Eigen::Vector3f elbowTarget, bool setOrientation, Eigen::Vector6f ffVel); + void setTargetFeedForward(Eigen::Matrix4f tcpTarget, + Eigen::Vector3f elbowTarget, + bool setOrientation, + Eigen::Vector6f ffVel); void setFeedForwardVelocity(Eigen::Vector6f vel); void clearFeedForwardVelocity(); void setNullspaceTarget(Ice::FloatSeq nullspaceTarget); diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianTorqueController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianTorqueController.ice index d53e0347f931497b77b67474d813570edcacc70f..dc76b734dc079139a45963b37273cf8a703340ac 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianTorqueController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianTorqueController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -34,10 +34,9 @@ module armarx string tcpName = ""; }; - - interface NJointCartesianTorqueControllerInterface extends NJointControllerInterface { - void setControllerTarget(float forceX, float forceY, float forceZ, float torqueX, float torqueY, float torqueZ); + void setControllerTarget( + float forceX, float forceY, float forceZ, float torqueX, float torqueY, float torqueZ); }; }; diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityController.ice index d9bf18450de19a2a01959f46f17e40b6fedd5bac..d1c8cf9990fdc8a960053d34ee3c396bd53071a9 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -41,14 +41,20 @@ module armarx { string nodeSetName = ""; string tcpName = ""; - NJointCartesianVelocityControllerMode::CartesianSelection mode = NJointCartesianVelocityControllerMode::eAll; + NJointCartesianVelocityControllerMode::CartesianSelection mode = + NJointCartesianVelocityControllerMode::eAll; }; - - interface NJointCartesianVelocityControllerInterface extends NJointControllerInterface { - void setControllerTarget(float x, float y, float z, float roll, float pitch, float yaw, float avoidJointLimitsKp, NJointCartesianVelocityControllerMode::CartesianSelection mode); + void setControllerTarget(float x, + float y, + float z, + float roll, + float pitch, + float yaw, + float avoidJointLimitsKp, + NJointCartesianVelocityControllerMode::CartesianSelection mode); void setTorqueKp(StringFloatDictionary torqueKp); void setNullspaceJointVelocities(StringFloatDictionary nullspaceJointVelocities); }; diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityControllerWithRamp.ice b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityControllerWithRamp.ice index a8d12ab7a089772dd546bce271ccd345e05916b8..b823c143b7f30ba65b89ed09ba9b88a055ce5f34 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityControllerWithRamp.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianVelocityControllerWithRamp.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/CartesianSelection.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -42,7 +42,9 @@ module armarx interface NJointCartesianVelocityControllerWithRampInterface extends NJointControllerInterface { - void setMaxAccelerations(float maxPositionAcceleration, float maxOrientationAcceleration, float maxNullspaceAcceleration); + void setMaxAccelerations(float maxPositionAcceleration, + float maxOrientationAcceleration, + float maxNullspaceAcceleration); void setTargetVelocity(float vx, float vy, float vz, float vrx, float vry, float vrz); void immediateHardStop(); void setJointLimitAvoidanceScale(float scale); diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianWaypointController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianWaypointController.ice index f02c8e8ee8720f7a45fb730f155986016cdb0331..04754194d28cbec7eba1ad299b3266995ea36aca 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointCartesianWaypointController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointCartesianWaypointController.ice @@ -24,9 +24,9 @@ #include <ArmarXCore/interface/serialization/Eigen.ice> -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> -#include <RobotAPI/interface/core/FTSensorValue.ice> #include <RobotAPI/interface/core/CartesianWaypointControllerConfig.ice> +#include <RobotAPI/interface/core/FTSensorValue.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -57,9 +57,11 @@ module armarx void setWaypoints(Eigen::Matrix4fSeq wps); void setWaypoint(Eigen::Matrix4f wp); void setWaypointAx(Ice::FloatSeq wp); - void setConfigAndWaypoints(NJointCartesianWaypointControllerRuntimeConfig cfg, Eigen::Matrix4fSeq wps); - void setConfigAndWaypoint(NJointCartesianWaypointControllerRuntimeConfig cfg, Eigen::Matrix4f wp); - + void setConfigAndWaypoints(NJointCartesianWaypointControllerRuntimeConfig cfg, + Eigen::Matrix4fSeq wps); + void setConfigAndWaypoint(NJointCartesianWaypointControllerRuntimeConfig cfg, + Eigen::Matrix4f wp); + FTSensorValue getFTSensorValue(); void setCurrentFTAsOffset(); void stopMovement(); diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointController.ice index f1056467092843c4928f63ba9dcba119ac8c0ebd..f528d6e2b26011956c2e03d2eda47f956cf646b7 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointController.ice @@ -22,10 +22,10 @@ #pragma once -#include <ArmarXGui/interface/WidgetDescription.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/core/UserException.ice> + +#include <ArmarXGui/interface/WidgetDescription.ice> module armarx { @@ -35,13 +35,15 @@ module armarx module RobotUnitControllerNames { const string NJointTrajectoryController = "NJointTrajectoryController"; - const string NJointGlobalTCPController = "NJointGlobalTCPController"; /*@@@TODO: move NJointGlobalTCPController to RobotAPI */ + const string NJointGlobalTCPController = + "NJointGlobalTCPController"; /*@@@TODO: move NJointGlobalTCPController to RobotAPI */ const string NJointTCPController = "NJointTCPController"; const string NJointCartesianVelocityController = "NJointCartesianVelocityController"; }; - - class NJointControllerConfig {}; + class NJointControllerConfig + { + }; struct NJointControllerDescription { @@ -52,6 +54,7 @@ module armarx bool deletable; bool internal; }; + sequence<NJointControllerDescription> NJointControllerDescriptionSeq; struct NJointControllerStatus @@ -62,6 +65,7 @@ module armarx bool error = false; long timestampUSec = 0; }; + sequence<NJointControllerStatus> NJointControllerStatusSeq; struct NJointControllerDescriptionWithStatus @@ -69,6 +73,7 @@ module armarx NJointControllerStatus status; NJointControllerDescription description; }; + sequence<NJointControllerDescriptionWithStatus> NJointControllerDescriptionWithStatusSeq; interface NJointControllerInterface @@ -82,7 +87,8 @@ module armarx ["cpp:const"] idempotent bool hasControllerError(); ["cpp:const"] idempotent NJointControllerStatus getControllerStatus(); ["cpp:const"] idempotent NJointControllerDescription getControllerDescription(); - ["cpp:const"] idempotent NJointControllerDescriptionWithStatus getControllerDescriptionWithStatus(); + ["cpp:const"] idempotent NJointControllerDescriptionWithStatus + getControllerDescriptionWithStatus(); // This method is not used by anybody and just produces cyclic dependencies // If you were able to create/get an NJointController, you know the RobotUnit already. //["cpp:const"] idempotent RobotUnitInterface* getRobotUnit(); @@ -92,10 +98,11 @@ module armarx void deleteController() throws LogicError; void deactivateAndDeleteController() throws LogicError; - ["cpp:const"] idempotent WidgetDescription::StringWidgetDictionary getFunctionDescriptions(); - void callDescribedFunction(string fuinctionName, StringVariantBaseMap values) throws InvalidArgumentException; + ["cpp:const"] idempotent WidgetDescription::StringWidgetDictionary + getFunctionDescriptions(); + void callDescribedFunction(string fuinctionName, StringVariantBaseMap values) + throws InvalidArgumentException; }; dictionary<string, NJointControllerInterface*> StringNJointControllerPrxDictionary; }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointCurrentController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointCurrentController.ice index 06e648137cca85c6cd913cc5377e247188d196a5..d6731c9e3e15119dca1191a6c49b0e9628122afd 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointCurrentController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointCurrentController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -39,7 +39,6 @@ module armarx string deviceName; }; - interface NJointCurrentControllerInterface extends NJointControllerInterface { void setControllerTarget(float current); diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointJointSpaceDMPController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointJointSpaceDMPController.ice index dd31d78e4e848fc8cf9d3b3bcbe99423a2215777..4ac7375a53079e17e0573a96c925b5cc2dc9c962 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointJointSpaceDMPController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointJointSpaceDMPController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -58,5 +58,4 @@ module armarx void setMPWeights(DoubleSeqSeq weights); DoubleSeqSeq getMPWeights(); }; - }; diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice index 178edf202298befc0236ca0e048cc65456601e44..deebf2e38ba0df7fcbc14b7c1816403dc24c6096 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointTaskSpaceDMPController.ice @@ -22,11 +22,11 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> -#include <RobotAPI/interface/core/Trajectory.ice> - #include <ArmarXCore/interface/serialization/Eigen.ice> +#include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> + module armarx { module NJointTaskSpaceDMPControllerMode @@ -63,7 +63,8 @@ module armarx string nodeSetName = ""; string tcpName = ""; string frameName = ""; - NJointTaskSpaceDMPControllerMode::CartesianSelection mode = NJointTaskSpaceDMPControllerMode::eAll; + NJointTaskSpaceDMPControllerMode::CartesianSelection mode = + NJointTaskSpaceDMPControllerMode::eAll; double maxLinearVel; double maxAngularVel; @@ -79,7 +80,6 @@ module armarx float vel_filter; }; - interface NJointTaskSpaceDMPControllerInterface extends NJointControllerInterface { void learnDMPFromFiles(Ice::StringSeq trajfiles); @@ -98,7 +98,8 @@ module armarx void pauseDMP(); void resumeDMP(); - void setControllerTarget(float avoidJointLimitsKp, NJointTaskSpaceDMPControllerMode::CartesianSelection mode); + void setControllerTarget(float avoidJointLimitsKp, + NJointTaskSpaceDMPControllerMode::CartesianSelection mode); void setTorqueKp(StringFloatDictionary torqueKp); void setNullspaceJointVelocities(StringFloatDictionary nullspaceJointVelocities); string getDMPAsString(); @@ -111,7 +112,6 @@ module armarx void setLinearVelocityKp(float kp); void setAngularVelocityKd(float kd); void setAngularVelocityKp(float kp); - }; class NJointCCDMPControllerConfig extends NJointControllerConfig @@ -144,8 +144,8 @@ module armarx // velocity controller configuration string nodeSetName = ""; string tcpName = ""; - NJointTaskSpaceDMPControllerMode::CartesianSelection mode = NJointTaskSpaceDMPControllerMode::eAll; - + NJointTaskSpaceDMPControllerMode::CartesianSelection mode = + NJointTaskSpaceDMPControllerMode::eAll; }; interface NJointCCDMPControllerInterface extends NJointControllerInterface @@ -158,7 +158,8 @@ module armarx void setViaPoints(int dmpId, double canVal, Ice::DoubleSeq point); void setGoals(int dmpId, Ice::DoubleSeq goals); - void setControllerTarget(float avoidJointLimitsKp, NJointTaskSpaceDMPControllerMode::CartesianSelection mode); + void setControllerTarget(float avoidJointLimitsKp, + NJointTaskSpaceDMPControllerMode::CartesianSelection mode); void setTorqueKp(StringFloatDictionary torqueKp); void setNullspaceJointVelocities(StringFloatDictionary nullspaceJointVelocities); }; @@ -186,8 +187,8 @@ module armarx Ice::FloatSeq leftDesiredJointValues; Ice::FloatSeq rightDesiredJointValues; -// float KoriFollower = 1; -// float KposFollower = 1; + // float KoriFollower = 1; + // float KposFollower = 1; double maxLinearVel; double maxAngularVel; @@ -209,15 +210,13 @@ module armarx float startReduceTorque; -// Ice::FloatSeq Kpf; -// Ice::FloatSeq Kif; -// Ice::FloatSeq DesiredForce; - -// float BoxWidth; - -// float FilterTimeConstant; + // Ice::FloatSeq Kpf; + // Ice::FloatSeq Kif; + // Ice::FloatSeq DesiredForce; + // float BoxWidth; + // float FilterTimeConstant; }; interface NJointBimanualCCDMPControllerInterface extends NJointControllerInterface @@ -233,10 +232,8 @@ module armarx double getVirtualTime(); string getLeaderName(); - }; - class NJointBimanualCCDMPVelocityControllerConfig extends NJointControllerConfig { @@ -289,8 +286,6 @@ module armarx string getLeaderName(); }; - - class NJointTaskSpaceImpedanceDMPControllerConfig extends NJointControllerConfig { @@ -424,7 +419,6 @@ module armarx void setDefaultJointValues(Ice::FloatSeq desiredJointVals); }; - class NJointPeriodicTSDMPControllerConfig extends NJointControllerConfig { @@ -462,7 +456,6 @@ module armarx float minimumReactForce = 0; }; - interface NJointPeriodicTSDMPControllerInterface extends NJointControllerInterface { void learnDMPFromFiles(Ice::StringSeq trajfiles); @@ -477,7 +470,6 @@ module armarx double getCanVal(); }; - class NJointPeriodicTSDMPCompliantControllerConfig extends NJointControllerConfig { @@ -539,10 +531,8 @@ module armarx Ice::DoubleSeq kmani; Ice::DoubleSeq positionManipulability; Ice::DoubleSeq maniWeight; - }; - interface NJointPeriodicTSDMPCompliantControllerInterface extends NJointControllerInterface { void learnDMPFromFiles(Ice::StringSeq trajfiles); @@ -621,7 +611,6 @@ module armarx float frictionCone; }; - interface NJointAdaptiveWipingControllerInterface extends NJointControllerInterface { void learnDMPFromFiles(Ice::StringSeq trajfiles); @@ -739,8 +728,8 @@ module armarx bool useDMPInGlobalFrame; }; - - interface NJointAnomalyDetectionAdaptiveWipingControllerInterface extends NJointControllerInterface + interface NJointAnomalyDetectionAdaptiveWipingControllerInterface extends + NJointControllerInterface { void learnDMPFromFiles(Ice::StringSeq trajfiles); void learnDMPFromTrajectory(TrajectoryBase trajectory); @@ -764,4 +753,3 @@ module armarx void resumeDMP(); }; }; - diff --git a/source/RobotAPI/interface/units/RobotUnit/NJointTrajectoryController.ice b/source/RobotAPI/interface/units/RobotUnit/NJointTrajectoryController.ice index 388ed7b14a1daa034b9144c158185fa9772e7b90..dde6c7cf89c4535f53e31a876af06df73865d629 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NJointTrajectoryController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NJointTrajectoryController.ice @@ -22,8 +22,8 @@ #pragma once -#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> #include <RobotAPI/interface/core/Trajectory.ice> +#include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx { @@ -41,7 +41,6 @@ module armarx bool isPreview = false; }; - interface NJointTrajectoryControllerInterface extends NJointControllerInterface { void setTrajectory(TrajectoryBase traj); diff --git a/source/RobotAPI/interface/units/RobotUnit/NjointZeroTorqueController.ice b/source/RobotAPI/interface/units/RobotUnit/NjointZeroTorqueController.ice index ed1c98692abf97bfc03e73ac9e75fc02639b4c8a..a10efe6d4386c69b984c10add58b43e890e1e55a 100644 --- a/source/RobotAPI/interface/units/RobotUnit/NjointZeroTorqueController.ice +++ b/source/RobotAPI/interface/units/RobotUnit/NjointZeroTorqueController.ice @@ -38,7 +38,6 @@ module armarx float maxTorque = 10.0f; }; - interface NJointZeroTorqueControllerInterface extends NJointControllerInterface { void setControllerTarget(Ice::FloatSeq targetTorques); diff --git a/source/RobotAPI/interface/units/RobotUnit/TaskSpaceActiveImpedanceControl.ice b/source/RobotAPI/interface/units/RobotUnit/TaskSpaceActiveImpedanceControl.ice index 74314446ca7f274d37148c49a54b59e0bbd715b2..854b7e38051a846343ed00a25a15198da2cc8de6 100644 --- a/source/RobotAPI/interface/units/RobotUnit/TaskSpaceActiveImpedanceControl.ice +++ b/source/RobotAPI/interface/units/RobotUnit/TaskSpaceActiveImpedanceControl.ice @@ -23,6 +23,7 @@ #pragma once #include <ArmarXCore/interface/serialization/Eigen.ice> + #include <RobotAPI/interface/units/RobotUnit/NJointController.ice> module armarx @@ -45,6 +46,7 @@ module armarx float torqueLimit; }; + struct NJointTaskSpaceImpedanceControlRuntimeConfig { Eigen::Vector3f Kpos; @@ -65,10 +67,10 @@ module armarx void setOrientation(Eigen::Quaternionf orientation); void setPositionOrientation(Eigen::Vector3f target, Eigen::Quaternionf orientation); void setPose(Eigen::Matrix4f mat); - + void setImpedanceParameters(string paraName, Ice::FloatSeq vals); - void setNullspaceConfig(Eigen::VectorXf desiredJointPositions, Eigen::VectorXf Knull, Eigen::VectorXf Dnull); + void setNullspaceConfig( + Eigen::VectorXf desiredJointPositions, Eigen::VectorXf Knull, Eigen::VectorXf Dnull); void setConfig(NJointTaskSpaceImpedanceControlRuntimeConfig cfg); }; - }; diff --git a/source/RobotAPI/interface/units/TCPControlUnit.ice b/source/RobotAPI/interface/units/TCPControlUnit.ice index 36d0bdf75b3ddde0c8b5a7535a785ed31810aca2..ea90ea29961bd9144b2b6d5c88410fb69a0ab114 100644 --- a/source/RobotAPI/interface/units/TCPControlUnit.ice +++ b/source/RobotAPI/interface/units/TCPControlUnit.ice @@ -24,23 +24,24 @@ #pragma once -#include <RobotAPI/interface/units/UnitInterface.ice> -#include <RobotAPI/interface/core/RobotState.ice> -#include <RobotAPI/interface/core/FramedPoseBase.ice> - -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> -#include <ArmarXCore/interface/observers/VariantBase.ice> +#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/observers/ObserverInterface.ice> +#include <ArmarXCore/interface/observers/VariantBase.ice> + +#include <RobotAPI/interface/core/FramedPoseBase.ice> +#include <RobotAPI/interface/core/RobotState.ice> +#include <RobotAPI/interface/units/UnitInterface.ice> module armarx { - /** + /** * Implements an interface to an TCPControlUnit. The TCPControlUnit uses differential IK in order to move the TCP a target pose. **/ - interface TCPControlUnitInterface extends armarx::SensorActorUnitInterface, armarx::KinematicUnitListener + interface TCPControlUnitInterface extends armarx::SensorActorUnitInterface, + armarx::KinematicUnitListener { - /** + /** * setCycleTime allows to set the cycle time with which the TCPControlUnit solves the IK and moves the TCP within a periodic task. * @param milliseconds Cycle time in milliseconds. **/ @@ -52,7 +53,10 @@ module armarx * @param translationVelocity Translational velocity in task space in x, y, and z. * @param orientationVelocityRPY Orientational velocity in task space in roll, pitch, yaw. **/ - void setTCPVelocity(string robotNodeSetName, string tcpNodeName, FramedDirectionBase translationVelocity, FramedDirectionBase orientationVelocityRPY); + void setTCPVelocity(string robotNodeSetName, + string tcpNodeName, + FramedDirectionBase translationVelocity, + FramedDirectionBase orientationVelocityRPY); /** * @brief returns if the TCPControlUnit is requested. @@ -61,7 +65,7 @@ module armarx bool isRequested(); }; - /** + /** * [FramedPoseBaseMap] defines a data container which contains nodes, identified by name, and corresponding FramedPoses. **/ dictionary<string, FramedPoseBase> FramedPoseBaseMap; @@ -70,7 +74,7 @@ module armarx **/ interface TCPControlUnitListener { - /** + /** * reportTCPPose reports TCPs and corresponding current FramedPoses. * @param tcpPoses Map of TCP node names and corresponding current FramedPoses. **/ @@ -80,15 +84,13 @@ module armarx * @param tcpTranslationVelocities Map of TCP node names and corresponding current translational velocities. * @param tcpOrienationVelocities Map of TCP node names and corresponding current orientational velocities. **/ - void reportTCPVelocities(FramedDirectionMap tcpTranslationVelocities, FramedDirectionMap tcpOrienationVelocities); - + void reportTCPVelocities(FramedDirectionMap tcpTranslationVelocities, + FramedDirectionMap tcpOrienationVelocities); }; - /** + /** * Implements an interface to an TCPControlUnitObserver. **/ - interface TCPControlUnitObserverInterface extends ObserverInterface, TCPControlUnitListener - { - - }; + interface TCPControlUnitObserverInterface extends ObserverInterface, TCPControlUnitListener{ + }; }; diff --git a/source/RobotAPI/interface/units/TCPMoverUnitInterface.ice b/source/RobotAPI/interface/units/TCPMoverUnitInterface.ice index 71f7f1777f011efdcd05e3e5c9c67814c50437e4..b77bf56455a17984a571575acefa322d4dd2825c 100644 --- a/source/RobotAPI/interface/units/TCPMoverUnitInterface.ice +++ b/source/RobotAPI/interface/units/TCPMoverUnitInterface.ice @@ -24,13 +24,14 @@ #pragma once -#include <RobotAPI/interface/units/KinematicUnitInterface.ice> - #include <ArmarXCore/interface/core/UserException.ice> +#include <RobotAPI/interface/units/KinematicUnitInterface.ice> + module armarx { - enum HandSelection{ + enum HandSelection + { eNone, eLeftHand, eRightHand @@ -38,7 +39,7 @@ module armarx interface TCPMoverUnitInterface { -// void moveTCPRelative(bool leftHand, float x, float y, float z, float speedFactor); + // void moveTCPRelative(bool leftHand, float x, float y, float z, float speedFactor); /** * Resets the joint angles of the arm to the home position. * NO MOVEMENT! Just sets the angles, so not suitable for a real robot. @@ -64,7 +65,8 @@ module armarx * @param z The velocity on the z-axis. * @param speedFactor A factor by which the x,y,z values should be multiplied. */ - void setCartesianTCPVelocity(HandSelection selectedHand, float x, float y, float z, float speedFactor); + void setCartesianTCPVelocity( + HandSelection selectedHand, float x, float y, float z, float speedFactor); //! angles in radiant /** @@ -109,4 +111,3 @@ module armarx void stopPlatform(); }; }; - diff --git a/source/RobotAPI/interface/units/UnitInterface.ice b/source/RobotAPI/interface/units/UnitInterface.ice index cb3e572e4b4755b69451ea64a78cb711689ee6e1..82d104ce25220127bedd135730c06518550c4cfe 100644 --- a/source/RobotAPI/interface/units/UnitInterface.ice +++ b/source/RobotAPI/interface/units/UnitInterface.ice @@ -26,20 +26,17 @@ module armarx { - /** + /** * @throws ResourceUnavailableException Raised if the unit resource is not available. **/ - exception ResourceUnavailableException extends UserException - { - }; + exception ResourceUnavailableException extends UserException{}; - /** + /** * @throws ResourceNotOwnedException Raised if the unit resource is not owned. **/ - exception ResourceNotOwnedException extends UserException - { - }; - /** + exception ResourceNotOwnedException extends UserException{}; + + /** * [UnitExecutionState] defines whether a Unit is constructed, initialized, started or stopped. **/ enum UnitExecutionState @@ -50,13 +47,13 @@ module armarx eUnitStarted, eUnitStopped }; - - /** + + /** * Implements an interface to a UnitExecutionManagement. **/ interface UnitExecutionManagementInterface { - /** + /** * init is called to initialize the unit before starting it. Virtual method which has to implemented by components inheriting from this interface. **/ void init(); @@ -68,7 +65,7 @@ module armarx * stop is called to stopthe unit. Virtual method which has to implemented by components inheriting from this interface. **/ void stop(); - + /** * getExecutionState returns the execution state of the unit. Virtual method which has to implemented by components inheriting from this interface. * @return UnitExecutionState @@ -76,13 +73,13 @@ module armarx **/ UnitExecutionState getExecutionState(); }; - - /** + + /** * Implements an interface to a UnitResourceManagement. **/ interface UnitResourceManagementInterface { - /** + /** * request is called to grant another component exclusive access to this unit. **/ void request() throws ResourceUnavailableException; @@ -91,11 +88,9 @@ module armarx **/ void release() throws ResourceNotOwnedException; }; - /** + /** * Implements an interface to a SensorActorUnit. The SensorActorUnit is the the base component for subsequent actuation and sensor components. **/ - interface SensorActorUnitInterface extends UnitExecutionManagementInterface, UnitResourceManagementInterface - { - }; + interface SensorActorUnitInterface extends UnitExecutionManagementInterface, + UnitResourceManagementInterface{}; }; - diff --git a/source/RobotAPI/interface/units/WeissHapticUnit.ice b/source/RobotAPI/interface/units/WeissHapticUnit.ice index 413bc81299648cf573c955f195c29b6b8d0ebe32..1688367baff27474809b19b3e6083c6bc5106e1e 100644 --- a/source/RobotAPI/interface/units/WeissHapticUnit.ice +++ b/source/RobotAPI/interface/units/WeissHapticUnit.ice @@ -28,12 +28,12 @@ module armarx { - /** + /** * Implements an interface to a HapticUnit for the tactile sensors from Weiss Robotics. **/ interface WeissHapticUnitInterface extends armarx::HapticUnitInterface { - /** + /** * setDeviceTag allows to rename device. * @param deviceName Original name of tactile sensor device. * @param tag New name of tactile sensor device. @@ -48,6 +48,4 @@ module armarx **/ void stopLogging(); }; - }; - diff --git a/source/RobotAPI/interface/visualization/ArViz.ice b/source/RobotAPI/interface/visualization/ArViz.ice index 8cf53a50f7ca47c82d61e38d4ae649c61d1b55bf..7e98ca8b362cca3357fdb0306a7c180021292dcd 100644 --- a/source/RobotAPI/interface/visualization/ArViz.ice +++ b/source/RobotAPI/interface/visualization/ArViz.ice @@ -4,62 +4,61 @@ module armarx { -module viz -{ + module viz + { -struct Header -{ - string frame_id; - int stamp = 0; -}; + struct Header + { + string frame_id; + int stamp = 0; + }; -struct Vec3 -{ - float x = 0.0f; - float y = 0.0f; - float z = 0.0f; -}; + struct Vec3 + { + float x = 0.0f; + float y = 0.0f; + float z = 0.0f; + }; -struct Orientation -{ - float qw = 1.0f; - float qx = 0.0f; - float qy = 0.0f; - float qz = 0.0f; -}; + struct Orientation + { + float qw = 1.0f; + float qx = 0.0f; + float qy = 0.0f; + float qz = 0.0f; + }; -struct Color -{ - float a = 1.0f; - float r = 0.0f; - float g = 0.0f; - float b = 0.0f; -}; + struct Color + { + float a = 1.0f; + float r = 0.0f; + float g = 0.0f; + float b = 0.0f; + }; -sequence<Vec3> Vec3List; -sequence<Color> ColorList; + sequence<Vec3> Vec3List; + sequence<Color> ColorList; -struct Marker -{ - Header header; - string ns; - int id = 0; - int type = 0; - Vec3 position; - Orientation orientation; - Vec3 scale; - Color color; - Vec3List points; - ColorList colors; - float lifetime_in_seconds = 0.0f; -}; - -sequence<Marker> MarkerList; + struct Marker + { + Header header; + string ns; + int id = 0; + int type = 0; + Vec3 position; + Orientation orientation; + Vec3 scale; + Color color; + Vec3List points; + ColorList colors; + float lifetime_in_seconds = 0.0f; + }; -interface Topic -{ - void draw(MarkerList markers); -}; + sequence<Marker> MarkerList; -} + interface Topic + { + void draw(MarkerList markers); + }; + } } diff --git a/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice b/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice index d07c6eb97eeb1dd8624823d36cea7065451a868f..9e9ed0a5e964a76cb0259464b4c9d660de8f4112 100644 --- a/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice +++ b/source/RobotAPI/interface/visualization/DebugDrawerInterface.ice @@ -24,8 +24,9 @@ #pragma once -#include <ArmarXCore/interface/core/UserException.ice> #include <ArmarXCore/interface/core/BasicTypes.ice> +#include <ArmarXCore/interface/core/UserException.ice> + #include <RobotAPI/interface/core/PoseBase.ice> #include <RobotAPI/interface/units/KinematicUnitInterface.ice> @@ -38,21 +39,21 @@ module armarx */ struct DrawColor { - float r; - float g; - float b; - float a; + float r; + float g; + float b; + float a; }; + sequence<DrawColor> DrawColorSequence; struct DrawColor24Bit { - byte r; - byte g; - byte b; + byte r; + byte g; + byte b; }; - struct HsvColor { //! 0-360 @@ -63,7 +64,6 @@ module armarx float v; }; - /*! * \brief Contains information about a layer. (name, visibility and number of elements) */ @@ -85,6 +85,7 @@ module armarx float y; float z; }; + sequence<DebugDrawerVertex> DebugDrawerVertexSequence; /*! @@ -96,6 +97,7 @@ module armarx DebugDrawerVertex vertex2; DebugDrawerVertex vertex3; }; + sequence<DebugDrawerSimpleFace> DebugDrawerSimpleFaceSequence; struct DebugDrawerSimpleTriMesh @@ -113,7 +115,7 @@ module armarx int normalID; int colorID; }; - + struct DebugDrawerNormal { float x; @@ -131,6 +133,7 @@ module armarx DebugDrawerVertexID vertex3; DebugDrawerNormal normal; }; + sequence<DebugDrawerFace> DebugDrawerFaceSequence; struct DebugDrawerTriMesh @@ -140,7 +143,6 @@ module armarx DrawColorSequence colors; }; - const int three = 3; const float zero = 0; @@ -150,6 +152,7 @@ module armarx float y; float z; }; + sequence<DebugDrawerPointCloudElement> DebugDrawerPointCloudElementList; struct DebugDrawerPointCloud @@ -165,6 +168,7 @@ module armarx float z; DrawColor color; }; + sequence<DebugDrawerColoredPointCloudElement> DebugDrawerColoredPointCloudElementList; struct DebugDrawerColoredPointCloud @@ -180,6 +184,7 @@ module armarx float z; DrawColor24Bit color; }; + sequence<DebugDrawer24BitColoredPointCloudElement> DebugDrawer24BitColoredPointCloudElementList; struct DebugDrawer24BitColoredPointCloud @@ -204,9 +209,13 @@ module armarx bool useHeatMap = false; }; - sequence< Vector3Base > PolygonPointList; + sequence<Vector3Base> PolygonPointList; - enum DrawStyle { FullModel, CollisionModel }; + enum DrawStyle + { + FullModel, + CollisionModel + }; struct DebugDrawerSelectionElement { @@ -234,19 +243,64 @@ module armarx */ void setPoseVisu(string layerName, string poseName, PoseBase globalPose); void setScaledPoseVisu(string layerName, string poseName, PoseBase globalPose, float scale); - void setLineVisu(string layerName, string lineName, Vector3Base globalPosition1, Vector3Base globalPosition2, float lineWidth, DrawColor color); + void setLineVisu(string layerName, + string lineName, + Vector3Base globalPosition1, + Vector3Base globalPosition2, + float lineWidth, + DrawColor color); void setLineSetVisu(string layerName, string lineSetName, DebugDrawerLineSet lineSet); - void setBoxVisu(string layerName, string boxName, PoseBase globalPose, Vector3Base dimensions, DrawColor color); - void setTextVisu(string layerName, string textName, string text, Vector3Base globalPosition, DrawColor color, int size); - void setSphereVisu(string layerName, string sphereName, Vector3Base globalPosition, DrawColor color, float radius); - void setPointCloudVisu(string layerName, string pointCloudName, DebugDrawerPointCloud pointCloud); - void setColoredPointCloudVisu(string layerName, string pointCloudName, DebugDrawerColoredPointCloud pointCloud); - void set24BitColoredPointCloudVisu(string layerName, string pointCloudName, DebugDrawer24BitColoredPointCloud pointCloud); - void setPolygonVisu(string layerName, string polygonName, PolygonPointList polygonPoints, DrawColor colorInner, DrawColor colorBorder, float lineWidth); + void setBoxVisu(string layerName, + string boxName, + PoseBase globalPose, + Vector3Base dimensions, + DrawColor color); + void setTextVisu(string layerName, + string textName, + string text, + Vector3Base globalPosition, + DrawColor color, + int size); + void setSphereVisu(string layerName, + string sphereName, + Vector3Base globalPosition, + DrawColor color, + float radius); + void setPointCloudVisu( + string layerName, string pointCloudName, DebugDrawerPointCloud pointCloud); + void setColoredPointCloudVisu( + string layerName, string pointCloudName, DebugDrawerColoredPointCloud pointCloud); + void set24BitColoredPointCloudVisu( + string layerName, string pointCloudName, DebugDrawer24BitColoredPointCloud pointCloud); + void setPolygonVisu(string layerName, + string polygonName, + PolygonPointList polygonPoints, + DrawColor colorInner, + DrawColor colorBorder, + float lineWidth); void setTriMeshVisu(string layerName, string triMeshName, DebugDrawerTriMesh triMesh); - void setArrowVisu(string layerName, string arrowName, Vector3Base position, Vector3Base direction, DrawColor color, float length, float width); - void setCylinderVisu(string layerName, string cylinderName, Vector3Base globalPosition, Vector3Base direction, float length, float radius, DrawColor color); - void setCircleArrowVisu(string layerName, string circleName, Vector3Base globalPosition, Vector3Base directionVec, float radius, float circleCompletion, float width, DrawColor color); + void setArrowVisu(string layerName, + string arrowName, + Vector3Base position, + Vector3Base direction, + DrawColor color, + float length, + float width); + void setCylinderVisu(string layerName, + string cylinderName, + Vector3Base globalPosition, + Vector3Base direction, + float length, + float radius, + DrawColor color); + void setCircleArrowVisu(string layerName, + string circleName, + Vector3Base globalPosition, + Vector3Base directionVec, + float radius, + float circleCompletion, + float width, + DrawColor color); /*! @@ -258,7 +312,11 @@ module armarx * \param armarxProject Additional armarx project that should be used to search the robot. Must be locally available and accessible through the armarx cmake search procedure. */ - void setRobotVisu(string layerName, string robotName, string robotFile, string armarxProject, DrawStyle drawStyleType); + void setRobotVisu(string layerName, + string robotName, + string robotFile, + string armarxProject, + DrawStyle drawStyleType); void updateRobotPose(string layerName, string robotName, PoseBase globalPose); void updateRobotConfig(string layerName, string robotName, NameValueMap configuration); /*! @@ -268,7 +326,8 @@ module armarx * \param c The draw color, if all is set to 0, the colorization is disabled (i.e. the original vizualization shows up) */ void updateRobotColor(string layerName, string robotName, DrawColor c); - void updateRobotNodeColor(string layerName, string robotName, string robotNodeName, DrawColor c); + void updateRobotNodeColor( + string layerName, string robotName, string robotNodeName, DrawColor c); void removeRobotVisu(string layerName, string robotName); /*! @@ -278,17 +337,39 @@ module armarx */ void setPoseDebugLayerVisu(string poseName, PoseBase globalPose); void setScaledPoseDebugLayerVisu(string poseName, PoseBase globalPose, float scale); - void setLineDebugLayerVisu(string lineName, Vector3Base globalPosition1, Vector3Base globalPosition2, float lineWidth, DrawColor color); + void setLineDebugLayerVisu(string lineName, + Vector3Base globalPosition1, + Vector3Base globalPosition2, + float lineWidth, + DrawColor color); void setLineSetDebugLayerVisu(string lineSetName, DebugDrawerLineSet lineSet); - void setBoxDebugLayerVisu(string boxName, PoseBase globalPose, Vector3Base dimensions, DrawColor color); - void setTextDebugLayerVisu(string textName, string text, Vector3Base globalPosition, DrawColor color, int size); - void setSphereDebugLayerVisu(string sphereName, Vector3Base globalPosition, DrawColor color, float radius); + void setBoxDebugLayerVisu( + string boxName, PoseBase globalPose, Vector3Base dimensions, DrawColor color); + void setTextDebugLayerVisu( + string textName, string text, Vector3Base globalPosition, DrawColor color, int size); + void setSphereDebugLayerVisu( + string sphereName, Vector3Base globalPosition, DrawColor color, float radius); void setPointCloudDebugLayerVisu(string pointCloudName, DebugDrawerPointCloud pointCloud); - void set24BitColoredPointCloudDebugLayerVisu(string pointCloudName, DebugDrawer24BitColoredPointCloud pointCloud); - void setPolygonDebugLayerVisu(string polygonName, PolygonPointList polygonPoints, DrawColor colorInner, DrawColor colorBorder, float lineWidth); + void set24BitColoredPointCloudDebugLayerVisu(string pointCloudName, + DebugDrawer24BitColoredPointCloud pointCloud); + void setPolygonDebugLayerVisu(string polygonName, + PolygonPointList polygonPoints, + DrawColor colorInner, + DrawColor colorBorder, + float lineWidth); void setTriMeshDebugLayerVisu(string triMeshName, DebugDrawerTriMesh triMesh); - void setArrowDebugLayerVisu(string arrowName, Vector3Base position, Vector3Base direction, DrawColor color, float length, float width); - void setCylinderDebugLayerVisu(string cylinderName, Vector3Base globalPosition, Vector3Base direction, float length, float radius, DrawColor color); + void setArrowDebugLayerVisu(string arrowName, + Vector3Base position, + Vector3Base direction, + DrawColor color, + float length, + float width); + void setCylinderDebugLayerVisu(string cylinderName, + Vector3Base globalPosition, + Vector3Base direction, + float length, + float radius, + DrawColor color); /*! * \brief Draws a circle into the debug drawer. * \param circleName @@ -300,7 +381,13 @@ module armarx * \param color * \param circleDrawingDirection in which direction the circle is started to draw. Has only effect if the circle is not complete (circleCompletion parameter). */ - void setCircleDebugLayerVisu(string circleName, Vector3Base globalPosition, Vector3Base directionVec, float radius, float circleCompletion, float width, DrawColor color); + void setCircleDebugLayerVisu(string circleName, + Vector3Base globalPosition, + Vector3Base directionVec, + float radius, + float circleCompletion, + float width, + DrawColor color); /*! * \brief Remove visualization of coordinate system. @@ -438,8 +525,5 @@ module armarx void reportSelectionChanged(DebugDrawerSelectionList selectedObjects); }; - interface DebugDrawerInterfaceAndListener extends DebugDrawerInterface, DebugDrawerListener - { - }; + interface DebugDrawerInterfaceAndListener extends DebugDrawerInterface, DebugDrawerListener{}; }; - diff --git a/source/RobotAPI/interface/visualization/DebugDrawerToArViz.ice b/source/RobotAPI/interface/visualization/DebugDrawerToArViz.ice index 79f15cfd506da5ea1dc05222ff54c00290514745..2213bdd649a9c63965c600ea901441eb0195922e 100644 --- a/source/RobotAPI/interface/visualization/DebugDrawerToArViz.ice +++ b/source/RobotAPI/interface/visualization/DebugDrawerToArViz.ice @@ -31,9 +31,5 @@ module armarx { - interface DebugDrawerToArvizInterface extends DebugDrawerInterface, BlackWhitelistTopic - { - }; - + interface DebugDrawerToArvizInterface extends DebugDrawerInterface, BlackWhitelistTopic{}; }; - diff --git a/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h b/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h index 2fdb3c1481caf47596d1be1959bada2cd41bbc8a..039aaefd930a5c9ce439f38ca07a39f3601d0c64 100644 --- a/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h +++ b/source/RobotAPI/libraries/armem/server/ltm/detail/MemoryBase.h @@ -413,9 +413,9 @@ namespace armarx::armem::server::ltm::detail std::string coreSegmentsToLoad = ""; // Other configuration - std::string - configuration_on_startup = "{ \"SnapshotFrequencyFilter\": " - "{\"WaitingTimeInMsForFilter\" : 50}}"; //record with 20 fps as standard + std::string configuration_on_startup = + "{ \"SnapshotFrequencyFilter\": " + "{\"WaitingTimeInMsForFilter\" : 50}}"; //record with 20 fps as standard } p; diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_cpuload.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_cpuload.hpp index c6075c0b60d851abdf13faf71b95b91aaadd202c..1877898171de2194688f505b055ca224df14d566 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_cpuload.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_cpuload.hpp @@ -8,14 +8,15 @@ */ #pragma once -#include <vector> +#include <chrono> +#include <map> #include <string> #include <tuple> -#include <map> #include <unordered_map> -#include <chrono> +#include <vector> -class cpuLoad { +class cpuLoad +{ public: cpuLoad() = delete; @@ -23,8 +24,8 @@ public: * @brief constructor * @param procFileName */ - explicit cpuLoad(std::string procFileName = "/proc/stat"): - procFile(std::move(procFileName)), cpuName("") {}; + explicit cpuLoad(std::string procFileName = "/proc/stat") : + procFile(std::move(procFileName)), cpuName(""){}; /** * @brief initialize the parsing algo @@ -40,7 +41,9 @@ public: * @brief get Cpu user / nice / system /idle time. used for cpu usage per process * @return tuple<user,nice,system,idle> */ - std::tuple<uint64_t , uint64_t, uint64_t, uint64_t> getCpuTimes() { + std::tuple<uint64_t, uint64_t, uint64_t, uint64_t> + getCpuTimes() + { auto cpuLoad_ = this->parseStatFile(this->procFile); return std::make_tuple(cpuLoad_.at("cpu").at("user"), cpuLoad_.at("cpu").at("nice"), @@ -62,7 +65,8 @@ public: private: void calculateCpuUsage(); - std::map<std::string, std::unordered_map<std::string, uint64_t>> parseStatFile(const std::string& fileName); + std::map<std::string, std::unordered_map<std::string, uint64_t>> + parseStatFile(const std::string& fileName); void upDateCPUUsage(); std::chrono::system_clock::time_point currentTime; std::string procFile; @@ -71,5 +75,3 @@ private: std::map<std::string, std::unordered_map<std::string, uint64_t>> cpuLoadMap; std::map<std::string, std::unordered_map<std::string, uint64_t>> oldCpuLoadMap; }; - - diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_memoryload.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_memoryload.hpp index 5b40f9baf50242127b2c96fcc28da1008c011249..b5ef50cb16edbd2e01ad77b9411ab0d38f8e17ec 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_memoryload.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_memoryload.hpp @@ -8,20 +8,20 @@ */ #pragma once -#include <string> #include <chrono> +#include <string> -class memoryLoad { +class memoryLoad +{ public: explicit memoryLoad(std::string memInfo = "/proc/meminfo", std::string memInfoOfProcess = "/proc/self/status", - std::string memInfoOfProcessPrefix = "/proc/self/"): - totalMemoryInKB(0), - currentMemoryUsageInKB(0), - memInfoFile(std::move(memInfo)), - memInfoOfProcessFile(std::move(memInfoOfProcess)), - memInfoOfProcessPrefixFile(std::move(memInfoOfProcessPrefix)) - {}; + std::string memInfoOfProcessPrefix = "/proc/self/") : + totalMemoryInKB(0), + currentMemoryUsageInKB(0), + memInfoFile(std::move(memInfo)), + memInfoOfProcessFile(std::move(memInfoOfProcess)), + memInfoOfProcessPrefixFile(std::move(memInfoOfProcessPrefix)){}; /** * @brief get total memory of the system in KB * @return total memory in KB diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_networkload.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_networkload.hpp index 95dcbde9b85a08cb5e4dac638a3eaf7606e0baaf..c4ed753c571223f8b97d921e704698abcb030aaa 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_networkload.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_networkload.hpp @@ -9,28 +9,34 @@ #pragma once +#include <chrono> +#include <list> #include <map> #include <memory> #include <string> -#include <list> -#include <vector> -#include <chrono> #include <unordered_map> +#include <vector> - -class networkLoad { +class networkLoad +{ public: - static std::list<std::string> scanNetworkDevices(const std::string& ethernetDataFile= "/proc/net/dev"); - static std::vector<std::shared_ptr<networkLoad>> createLinuxEthernetScanList(const std::string& ethernetDataFileName = "/proc/net/dev") { + static std::list<std::string> + scanNetworkDevices(const std::string& ethernetDataFile = "/proc/net/dev"); + + static std::vector<std::shared_ptr<networkLoad>> + createLinuxEthernetScanList(const std::string& ethernetDataFileName = "/proc/net/dev") + { std::vector<std::shared_ptr<networkLoad>> v; - for (const auto& elem: networkLoad::scanNetworkDevices(ethernetDataFileName)) { - v.push_back(std::make_shared<networkLoad>(ethernetDataFileName,elem)); + for (const auto& elem : networkLoad::scanNetworkDevices(ethernetDataFileName)) + { + v.push_back(std::make_shared<networkLoad>(ethernetDataFileName, elem)); } return v; } - explicit networkLoad(std::string ethernetDataFileName = "/proc/net/dev", std::string ethName = "eth0"); + explicit networkLoad(std::string ethernetDataFileName = "/proc/net/dev", + std::string ethName = "eth0"); uint64_t getParamPerSecond(std::string designator); uint64_t getParamSinceStartup(std::string designator); @@ -42,9 +48,8 @@ public: bool isDeviceUp() const; std::string getDeviceName(); - - - enum networkParam { + enum networkParam + { RXbytes = 0, RXpackets, RXerrs, @@ -62,15 +67,16 @@ public: TXcarrier, TXcompressed }; + static std::string mapEnumToString(networkLoad::networkParam param); -private: +private: std::string ethernetDataFile; std::string ethDev; bool isDeviceAvailable = false; - - class networkParser { + class networkParser + { private: std::chrono::system_clock::time_point currentTime; std::chrono::system_clock::time_point timeBefore; @@ -82,15 +88,14 @@ private: static std::shared_ptr<networkParser> getNetworkParser(); networkParser(); void parse(const std::string& netFile = "/proc/net/dev"); - const std::unordered_map<std::string, uint64_t> &getEthObj(const std::string& ethDevice) const; + const std::unordered_map<std::string, uint64_t>& + getEthObj(const std::string& ethDevice) const; std::list<std::string> getNetworkDevices(std::string netFile = "/proc/net/dev"); const std::chrono::system_clock::time_point getTimeStamp() const; - const std::unordered_map<std::string, uint64_t> &getEthObjOld(const std::string& ethDevice) const; + const std::unordered_map<std::string, uint64_t>& + getEthObjOld(const std::string& ethDevice) const; const std::chrono::system_clock::time_point getTimeBefore() const; static std::shared_ptr<networkParser> inst; }; - - }; - diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_process_load.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_process_load.hpp index ab76f86ff23c9b47c402bc7797c7a6d72b99a640..9a0cd6ebfc3eb72963fd790c0d9930c7001237b7 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_process_load.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_process_load.hpp @@ -15,7 +15,8 @@ #include <tuple> #include <unordered_map> -class linuxProcessLoad { +class linuxProcessLoad +{ public: /** @@ -26,7 +27,6 @@ public: std::map<std::string, double> getProcessCpuLoad(); - private: void parseProcess(const std::string& pid); void findProcesses(); @@ -34,8 +34,6 @@ private: std::map<std::string, double> procCPUUsage; std::tuple<uint64_t, uint64_t, uint64_t, uint64_t> oldCpuTimes; std::tuple<uint64_t, uint64_t, uint64_t, uint64_t> CpuTimes; - std::map<std::string,std::unordered_map<std::string, std::string>> processStat; - std::map<std::string,std::unordered_map<std::string, std::string>> oldProcessStat; + std::map<std::string, std::unordered_map<std::string, std::string>> processStat; + std::map<std::string, std::unordered_map<std::string, std::string>> oldProcessStat; }; - - diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_systemutil.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_systemutil.hpp index fe2c1a2e710134735c057b0e69ba24c7927f102b..e70cc7c679e7a92ef5ab8dcac132b851c3706c57 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_systemutil.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/linux_systemutil.hpp @@ -11,12 +11,10 @@ #include <iostream> #include <string> - - -class linuxUtil { +class linuxUtil +{ public: - static bool isDeviceOnline(std::string address); static std::string getOSVersion_Signature(void); static std::string getOsVersionString(void); @@ -25,10 +23,9 @@ public: static int getProcIdByName(const std::string& procName); static bool startAppAsDaemon(); static uint64_t userAvailableFreeSpace(); - static int64_t getTemperature(const std::string& thermalZone= "thermal_zone0"); + static int64_t getTemperature(const std::string& thermalZone = "thermal_zone0"); static uint64_t getFreeDiskSpace(std::string absoluteFilePath); static uint64_t getSysUpTime(); static uint32_t getNumOfThreadsByThisProcess(); static uint32_t getNumOfThreadsByPID(int Pid); }; - diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/ip_iterator.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/ip_iterator.hpp index b095e561e680961ae1c98f6ef2e7cf0d54203e0a..fc1fb6180bbdfebbb3806e037df50577841caca6 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/ip_iterator.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/ip_iterator.hpp @@ -10,50 +10,59 @@ #include <algorithm> - -class ipv4_Range { +class ipv4_Range +{ public: - class ipv4_Address { + class ipv4_Address + { public: - - ipv4_Address() { - + ipv4_Address() + { } ipv4_Address(uint8_t p1, uint8_t p2, uint8_t p3, uint8_t p4) : - ipv4_part1(p1), ipv4_part2(p2), ipv4_part3(p3), ipv4_part4(p4) { + ipv4_part1(p1), ipv4_part2(p2), ipv4_part3(p3), ipv4_part4(p4) + { convertU8toU32(); } - std::string toString() const { + std::string + toString() const + { return std::to_string(static_cast<int>(ipv4_part1)) + "." + std::to_string(static_cast<int>(ipv4_part2)) + "." + std::to_string(static_cast<int>(ipv4_part3)) + "." + std::to_string(static_cast<int>(ipv4_part4)); } - bool operator==(const ipv4_Address &rhs) const { + bool + operator==(const ipv4_Address& rhs) const + { return ipv4 == rhs.ipv4; } - bool operator>(const ipv4_Address &rhs) const { + bool + operator>(const ipv4_Address& rhs) const + { return ipv4 > rhs.ipv4; } - bool operator<(const ipv4_Address &rhs) const { + bool + operator<(const ipv4_Address& rhs) const + { return ipv4 < rhs.ipv4; } - ipv4_Address operator=(ipv4_Address &adr) { - ipv4_Address newAdr(adr.ipv4_part1, - adr.ipv4_part2, - adr.ipv4_part3, - adr.ipv4_part4 - ); + ipv4_Address + operator=(ipv4_Address& adr) + { + ipv4_Address newAdr(adr.ipv4_part1, adr.ipv4_part2, adr.ipv4_part3, adr.ipv4_part4); return newAdr; } - ipv4_Address operator++(int) { + ipv4_Address + operator++(int) + { ipv4_Address i = *this; ipv4 += 1; convertU32toU8(); @@ -67,72 +76,96 @@ public: uint8_t ipv4_part4; uint32_t ipv4; - void convertU32toU8() { + void + convertU32toU8() + { ipv4_part1 = static_cast<uint8_t>(ipv4 >> 24); ipv4_part2 = static_cast<uint8_t>(ipv4 >> 16); ipv4_part3 = static_cast<uint8_t>(ipv4 >> 8); ipv4_part4 = static_cast<uint8_t>(ipv4); - } - void convertU8toU32() { + void + convertU8toU32() + { ipv4 = (static_cast<uint32_t>(ipv4_part1) << 24) + (static_cast<uint32_t>(ipv4_part2) << 16) + - (static_cast<uint32_t>(ipv4_part3) << 8) + - static_cast<uint32_t>(ipv4_part4); + (static_cast<uint32_t>(ipv4_part3) << 8) + static_cast<uint32_t>(ipv4_part4); } - }; - - class iterator : public std::iterator< - std::input_iterator_tag, - ipv4_Address, - ipv4_Address, - const ipv4_Address *, - ipv4_Address> { + class iterator : + public std::iterator<std::input_iterator_tag, + ipv4_Address, + ipv4_Address, + const ipv4_Address*, + ipv4_Address> + { ipv4_Address start; + public: - explicit iterator(ipv4_Address startAdr) : start(startAdr) {} + explicit iterator(ipv4_Address startAdr) : start(startAdr) + { + } - iterator &operator++() { + iterator& + operator++() + { start++; return *this; } - bool operator!=(iterator other) const { + bool + operator!=(iterator other) const + { return !(start == other.start); } - bool operator==(iterator other) const { + bool + operator==(iterator other) const + { return start == other.start; } - reference operator*() const { return start; } + reference + operator*() const + { + return start; + } }; - - ipv4_Range(ipv4_Address start, ipv4_Address end) : startAddress(start), endAddress(end) { + ipv4_Range(ipv4_Address start, ipv4_Address end) : startAddress(start), endAddress(end) + { validate(); } - iterator begin() { + iterator + begin() + { return iterator(startAddress); } - iterator end() { + iterator + end() + { return iterator(endAddress++); } private: - void validate() { - if (startAddress == endAddress) { + void + validate() + { + if (startAddress == endAddress) + { throw std::invalid_argument("start and end are equal"); } - if (startAddress > endAddress) { + if (startAddress > endAddress) + { // ok - } else { + } + else + { // switch ipv4_Address temp = startAddress; startAddress = endAddress; @@ -140,9 +173,6 @@ private: } } - ipv4_Address startAddress; ipv4_Address endAddress; - - }; \ No newline at end of file diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/record_value.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/record_value.hpp index 6612be090af1f479eaa102ebbb3c4843f90875c6..128a5a691afb4104e86f781f59c64853679c935e 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/record_value.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/record_value.hpp @@ -8,31 +8,34 @@ */ #pragma once -#include <chrono> -#include <vector> #include <algorithm> -#include <numeric> +#include <chrono> #include <iostream> +#include <numeric> +#include <vector> - -template<typename T> -class recordValue { +template <typename T> +class recordValue +{ public: - recordValue(std::chrono::system_clock::duration observTime, std::chrono::system_clock::duration upDateTime) - : stepSize( - static_cast<uint64_t>(observTime / upDateTime)), firstTime(true) { - if(stepSize == 0) { - throw std::runtime_error("stepsize is 0 -- not allowed: observTime: " - + std::to_string(observTime.count()) - + " upDateTime: " - + std::to_string(upDateTime.count())); + recordValue(std::chrono::system_clock::duration observTime, + std::chrono::system_clock::duration upDateTime) : + stepSize(static_cast<uint64_t>(observTime / upDateTime)), firstTime(true) + { + if (stepSize == 0) + { + throw std::runtime_error( + "stepsize is 0 -- not allowed: observTime: " + std::to_string(observTime.count()) + + " upDateTime: " + std::to_string(upDateTime.count())); } this->recordContainer.resize(stepSize); }; - explicit recordValue(uint64_t stepSize_) : stepSize(stepSize_), firstTime(true) { - if(stepSize_ == 0) { + explicit recordValue(uint64_t stepSize_) : stepSize(stepSize_), firstTime(true) + { + if (stepSize_ == 0) + { throw std::runtime_error("stepsize is 0 -- not allowed!"); } this->recordContainer.resize(stepSize); @@ -40,41 +43,53 @@ public: recordValue() = delete; - void addRecord(const T &rec) { + void + addRecord(const T& rec) + { this->recordContainer.push_back(rec); - if (this->firstTime) { + if (this->firstTime) + { std::fill(this->recordContainer.begin(), this->recordContainer.end(), rec); this->firstTime = false; } - if (this->recordContainer.size() >= this->stepSize) { + if (this->recordContainer.size() >= this->stepSize) + { this->recordContainer.erase(this->recordContainer.begin()); } } - T getMinRecord() const { - return static_cast<T>(*std::min_element(this->recordContainer.begin(), this->recordContainer.end())); + T + getMinRecord() const + { + return static_cast<T>( + *std::min_element(this->recordContainer.begin(), this->recordContainer.end())); } - T getMaxRecord() const { - return static_cast<T>(*std::max_element(this->recordContainer.begin(), this->recordContainer.end())); + T + getMaxRecord() const + { + return static_cast<T>( + *std::max_element(this->recordContainer.begin(), this->recordContainer.end())); } - T getAverageRecord() const { - return static_cast<T>(std::accumulate(this->recordContainer.begin(), this->recordContainer.end(), 0.0) / - this->stepSize); + T + getAverageRecord() const + { + return static_cast<T>( + std::accumulate(this->recordContainer.begin(), this->recordContainer.end(), 0.0) / + this->stepSize); } - std::vector<T> getRecordContainer() const { + std::vector<T> + getRecordContainer() const + { return recordContainer; } ~recordValue() = default; private: - std::vector<T> recordContainer; uint64_t stepSize; bool firstTime; }; - - diff --git a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/timer.hpp b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/timer.hpp index a7a276f0c01def6d62ce7c3f5af2911ed672c142..f3a1ec3310996bd49a8c7a84fa07f71c693e582a 100644 --- a/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/timer.hpp +++ b/source/RobotAPI/libraries/armem_system_state/server/LightweightSystemMonitor/util/timer.hpp @@ -8,24 +8,25 @@ */ #pragma once -#include <iostream> +#include <atomic> #include <chrono> -#include <thread> +#include <condition_variable> #include <functional> +#include <future> +#include <iostream> #include <mutex> -#include <condition_variable> -#include <atomic> +#include <thread> #include <tuple> -#include <future> #include <utility> -enum timer_mode { +enum timer_mode +{ singleshot, continuous }; - -class ITimerObserver { +class ITimerObserver +{ public: virtual ~ITimerObserver() = default; @@ -34,114 +35,141 @@ public: using slot = std::function<void()>; -class ITimerSubject { +class ITimerSubject +{ public: virtual ~ITimerSubject() = default; - virtual void Attach(ITimerObserver *observer, timer_mode mode, std::chrono::milliseconds ms) = 0; + virtual void + Attach(ITimerObserver* observer, timer_mode mode, std::chrono::milliseconds ms) = 0; virtual void Attach(slot functionPtr, timer_mode mode, std::chrono::milliseconds ms) = 0; - virtual void Detach(ITimerObserver *observer) = 0; + virtual void Detach(ITimerObserver* observer) = 0; }; -class IObservable { +class IObservable +{ public: - virtual ~IObservable() = default; + virtual ~IObservable() = default; virtual void notify() = 0; virtual bool toDestroy() = 0; - }; +class Timer : ITimerSubject +{ -class Timer : ITimerSubject { - - class TimerObservable : public IObservable { + class TimerObservable : public IObservable + { public: - ~TimerObservable() override { - }; - - TimerObservable(ITimerObserver *observer, timer_mode mode, std::chrono::milliseconds ms) : - timerMode(mode), - m_observable(observer), - interval(ms), - isFinish(false) { + ~TimerObservable() override{}; + + TimerObservable(ITimerObserver* observer, timer_mode mode, std::chrono::milliseconds ms) : + timerMode(mode), m_observable(observer), interval(ms), isFinish(false) + { this->nextExecution = std::chrono::system_clock::now() + ms; } - - void notify() override { - if (std::chrono::system_clock::now() >= this->nextExecution) { - this->isFinished = std::async(std::launch::async, [this] { - if (this->m_observable != nullptr) { - this->m_observable->Update(); - } - }); - if (this->timerMode == continuous) { + void + notify() override + { + if (std::chrono::system_clock::now() >= this->nextExecution) + { + this->isFinished = std::async(std::launch::async, + [this] + { + if (this->m_observable != nullptr) + { + this->m_observable->Update(); + } + }); + if (this->timerMode == continuous) + { this->nextExecution = std::chrono::system_clock::now() + interval; - } else { + } + else + { // destroy object this->isFinish = true; } } } - bool toDestroy() override { + bool + toDestroy() override + { return isFinish && this->timerMode == singleshot; } private: timer_mode timerMode; - ITimerObserver *m_observable; + ITimerObserver* m_observable; std::chrono::milliseconds interval; std::chrono::time_point<std::chrono::system_clock> nextExecution; std::future<void> isFinished; bool isFinish; }; - class SlotObservable : public IObservable { + class SlotObservable : public IObservable + { public: - ~SlotObservable() override { + ~SlotObservable() override + { } SlotObservable(slot fPointer, timer_mode mode, std::chrono::milliseconds ms) : - timerMode(mode), - interval(ms), - functionPointer(std::move(fPointer)), - isFinish(false) { + timerMode(mode), interval(ms), functionPointer(std::move(fPointer)), isFinish(false) + { this->nextExecution = std::chrono::system_clock::now() + ms; } - void notify() override { - if (std::chrono::system_clock::now() >= this->nextExecution) { + void + notify() override + { + if (std::chrono::system_clock::now() >= this->nextExecution) + { //this->isFinished = this->promise.get_future(); - auto p = std::async(std::launch::async, [this] { - try { - if (this->functionPointer != nullptr) { - this->functionPointer(); - this->promise.set_value(true); - } - this->promise.set_value(false); - } catch(std::future_error &e) { - std::cout << "future already satisfied" << e.what() << std::endl; - } - }); - if (this->timerMode == continuous) { + auto p = std::async(std::launch::async, + [this] + { + try + { + if (this->functionPointer != nullptr) + { + this->functionPointer(); + this->promise.set_value(true); + } + this->promise.set_value(false); + } + catch (std::future_error& e) + { + std::cout << "future already satisfied" << e.what() + << std::endl; + } + }); + if (this->timerMode == continuous) + { this->nextExecution = std::chrono::system_clock::now() + interval; - } else { + } + else + { // destroy object this->isFinish = true; } } } - bool toDestroy() override { + bool + toDestroy() override + { return isFinish && this->timerMode == singleshot; } - std::future<bool>& getFut() { + std::future<bool>& + getFut() + { return this->isFinished; } @@ -153,41 +181,52 @@ class Timer : ITimerSubject { std::promise<bool> promise; slot functionPointer; bool isFinish; - }; - class FutureObservable : public IObservable { + class FutureObservable : public IObservable + { public: - ~FutureObservable() override { + ~FutureObservable() override + { } - FutureObservable(slot fPointer, std::shared_future<bool> sfuture) : sfut(std::move(sfuture)), - functionPointer(std::move(fPointer)), - isFinish(false) { + FutureObservable(slot fPointer, std::shared_future<bool> sfuture) : + sfut(std::move(sfuture)), functionPointer(std::move(fPointer)), isFinish(false) + { } - void notify() override { - if (this->sfut.valid()) { - if(this->sfut.get()) { + void + notify() override + { + if (this->sfut.valid()) + { + if (this->sfut.get()) + { this->isFinished = this->isFinishedPromise.get_future(); - auto promise = std::async(std::launch::async, [this] { - if (this->functionPointer != nullptr) { - this->functionPointer(); - this->isFinish = true; - this->isFinishedPromise.set_value(true); - } - this->isFinishedPromise.set_value(false); - }); + auto promise = std::async(std::launch::async, + [this] + { + if (this->functionPointer != nullptr) + { + this->functionPointer(); + this->isFinish = true; + this->isFinishedPromise.set_value(true); + } + this->isFinishedPromise.set_value(false); + }); } } - } - bool toDestroy() override { + bool + toDestroy() override + { return this->isFinish; } - std::future<bool>& getFut() { + std::future<bool>& + getFut() + { return this->isFinished; } @@ -201,104 +240,139 @@ class Timer : ITimerSubject { public: - - - static std::shared_ptr<Timer> createTimer() { - if (instance == nullptr) { + static std::shared_ptr<Timer> + createTimer() + { + if (instance == nullptr) + { instance = std::make_shared<Timer>(); } return instance; } - static std::future<bool>& singleShot(const slot &functionPointer, std::chrono::milliseconds ms) { + static std::future<bool>& + singleShot(const slot& functionPointer, std::chrono::milliseconds ms) + { return Timer::createTimer()->AttachSingleshot(functionPointer, ms); } - static void periodicShot(slot functionPointer, std::chrono::milliseconds ms) { + static void + periodicShot(slot functionPointer, std::chrono::milliseconds ms) + { Timer::createTimer()->Attach(std::move(functionPointer), continuous, ms); } - static std::future<bool>& futureWatch(const slot &functionPointer, const std::shared_future<bool>& fut) { + static std::future<bool>& + futureWatch(const slot& functionPointer, const std::shared_future<bool>& fut) + { return Timer::createTimer()->AttachFutureWatcher(functionPointer, fut); } - ~Timer() override { - for (auto it = this->v_observables.begin(); it != this->v_observables.end(); it++) { + ~Timer() override + { + for (auto it = this->v_observables.begin(); it != this->v_observables.end(); it++) + { this->v_observables.erase(it--); } this->b_isRunning = false; } - static void stop() { + static void + stop() + { Timer::instance->b_isRunning = false; } - static bool isRunning() { + static bool + isRunning() + { return Timer::instance->b_isRunning; } - void start() { - if (!b_isRunning) { + void + start() + { + if (!b_isRunning) + { b_isRunning = true; this->wait_thread->detach(); } } - void Attach(ITimerObserver *observer, timer_mode mode, std::chrono::milliseconds ms) override { + void + Attach(ITimerObserver* observer, timer_mode mode, std::chrono::milliseconds ms) override + { this->start(); - if (this->time > ms) { + if (this->time > ms) + { this->time = ms; } this->v_observables.push_back(std::make_unique<TimerObservable>(observer, mode, ms)); } - - void Detach(ITimerObserver *observer) override { - (void) observer; + void + Detach(ITimerObserver* observer) override + { + (void)observer; } - explicit Timer() { + explicit Timer() + { this->wait_thread = std::make_unique<std::thread>(&Timer::dispatcher, this); this->time = std::chrono::milliseconds(1000); } private: - std::future<bool>& AttachFutureWatcher(const slot &functionPointer, const std::shared_future<bool>& sfut) { + std::future<bool>& + AttachFutureWatcher(const slot& functionPointer, const std::shared_future<bool>& sfut) + { this->start(); auto o = std::make_unique<FutureObservable>(functionPointer, sfut); - std::future<bool> &fut{o->getFut()}; + std::future<bool>& fut{o->getFut()}; this->v_observables.push_back(std::move(o)); return fut; } - std::future<bool>& AttachSingleshot(const slot &functionPointer, std::chrono::milliseconds ms) { + std::future<bool>& + AttachSingleshot(const slot& functionPointer, std::chrono::milliseconds ms) + { this->start(); - if (this->time > ms) { + if (this->time > ms) + { this->time = ms; } auto o = std::make_unique<SlotObservable>(functionPointer, singleshot, ms); - auto &fut = o->getFut(); + auto& fut = o->getFut(); this->v_observables.push_back(std::move(o)); return fut; } - void Attach(slot functionPointer, timer_mode mode, std::chrono::milliseconds ms) override { + void + Attach(slot functionPointer, timer_mode mode, std::chrono::milliseconds ms) override + { this->start(); - if (this->time > ms) { + if (this->time > ms) + { this->time = ms; } this->v_observables.push_back(std::make_unique<SlotObservable>(functionPointer, mode, ms)); } - void dispatcher() { - do { + void + dispatcher() + { + do + { std::unique_lock<std::mutex> lck{mtx}; - for (int i{10}; i > 0 && b_isRunning; --i) { + for (int i{10}; i > 0 && b_isRunning; --i) + { cv.wait_for(lck, time / 10); - for (auto it = this->v_observables.begin(); it != this->v_observables.end(); it++) { + for (auto it = this->v_observables.begin(); it != this->v_observables.end(); it++) + { (*it)->notify(); - if ((*it)->toDestroy()) { + if ((*it)->toDestroy()) + { (*it).reset(nullptr); this->v_observables.erase(it--); } @@ -307,10 +381,10 @@ private: } while (this->b_isRunning); - for (auto it = this->v_observables.begin(); it != this->v_observables.end(); it++) { + for (auto it = this->v_observables.begin(); it != this->v_observables.end(); it++) + { this->v_observables.erase(it--); } - } std::mutex mtx; @@ -322,5 +396,4 @@ private: std::chrono::milliseconds time{}; static std::shared_ptr<Timer> instance; - }; \ No newline at end of file