diff --git a/README.md b/README.md index d5c3862..24e6136 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ -# mutphy -mutation testing for physical computing +# MutPhy: Mutation testing for physical computing +Sharing self-developed tools in mutation testing research + +Qianqian Zhu, Andy Zaidman. Mutation Testing for Physical Computing. proceedings of the IEEE 18th International Conference on Software Quality, Reliability and Security (QRS 2018), IEEE, Lisbon, Portugal, 2018. diff --git a/case_study/RPLCD-1.0.0/.gitignore b/case_study/RPLCD-1.0.0/.gitignore new file mode 100755 index 0000000..f319764 --- /dev/null +++ b/case_study/RPLCD-1.0.0/.gitignore @@ -0,0 +1,45 @@ +*.py[cod] + +# C extensions +*.so + +# Packages +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg +lib +lib64 + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox +nosetests.xml + +# Translations +*.mo + +# Mr Developer +.mr.developer.cfg +.project +.pydevproject +*.sw[op] + +# TeX +*.log +*.aux +docs/*.pdf + +# Python +VIRTUAL/ +.cache/ diff --git a/case_study/RPLCD-1.0.0/.travis.yml b/case_study/RPLCD-1.0.0/.travis.yml new file mode 100755 index 0000000..d11a3c5 --- /dev/null +++ b/case_study/RPLCD-1.0.0/.travis.yml @@ -0,0 +1,11 @@ +language: python +python: + - 2.7 + - 3.3 + - 3.4 + - 3.5 + - 3.6 +install: + - pip install -r requirements-dev.txt +script: + - py.test -v diff --git a/case_study/RPLCD-1.0.0/CHANGELOG.md b/case_study/RPLCD-1.0.0/CHANGELOG.md new file mode 100755 index 0000000..3633693 --- /dev/null +++ b/case_study/RPLCD-1.0.0/CHANGELOG.md @@ -0,0 +1,78 @@ +# Changelog + +This project follows semantic versioning. + +Possible log types: + +- `[add]` for new features. +- `[chg]` for changes in existing functionality. +- `[dep]` for once-stable features removed in upcoming releases. +- `[rem]` for deprecated features removed in this release. +- `[fix]` for any bug fixes. +- `[sec]` to invite users to upgrade in case of vulnerabilities. + +### v1.0.0 (2017-07-30) + +This is the first release that can be considered stable. It involves some API +changes, so you might need to adapt your scripts (mainly because some default +arguments to `CharLCD` were removed). + +If you notice any documentation that hasn't been updated yet to the newer API, +please let us know! + +- [add] Support for `MCP23008` and `MCP23014^ I²C port expanders (#43, #59) +- [add] Add `RPLCD.__version__` attribute +- [fix] Fix bug in auto linebreak algorithm (#53) +- [fix] Fix bugs in show_charmap script (#52) +- [fix] Fix error in A02 character map +- [chg] Remove default args for `gpio.CharLCD`, pins and numbering mode always + need to be specified explicitly from now on +- [chg] Remove default for `i2c.CharLCD` i2c_expander parameter, + always needs to be specified explicitly from now on +- [chg] Remove all enums (`Alignment`, `CursorMode`, `ShiftMode`, + `BacklightMode`), replace them with string based API (#67) +- [chg] Rewrite test scripts, expose them all through a single entry point + script: `lcdtest.py` (#58, #59) + +### v0.9.0 (2017-05-09) + +This version can be considered the release candidate for the 1.0 release. + +- [add] Support for i2c port expanders (#20) +- [add] Implement proper automatic encoding of unicode strings, + add encoding tables for A00 and A02 character maps (#40) +- [add] Implement convenience functions for CR/LF (#45) +- [add] Add documentation (#37) +- [dep] Deprecate context managers (#18) +- [rem] Drop support for Python 3.2 + +### v0.4.0 (2016-09-12) + +- [fix] Fix problem when auto-linebreaks clash with manual linebreaks (#14) +- [fix] Fix wiring pin for GND (#25) +- [add] Add option to disable auto linebreaks (#14) +- [add] Add backlight GPIO control (#21) + +### v0.3.0 (2014-07-03) + +- [add] Implemented support for custom characters (#4) +- [fix] Fixed a bug that caused offsets on 16x4 displays (#16) + +### v0.2.0 (2014-04-20) + +- [add] Removed all external dependencies +- [add] New ``show_charmap.py`` helper script + +### v0.1.3 (2013-06-26) + +- [fix] Bugfix (#13) + +### v0.1.2 (2013-06-17) + +- [add] Added character caching +- [add] Added support for 16x2 LCD +- [fix] Bugfixes + +### v0.1.1 (2013-05-12) + +- Initial release diff --git a/case_study/RPLCD-1.0.0/CONTRIBUTING.md b/case_study/RPLCD-1.0.0/CONTRIBUTING.md new file mode 100755 index 0000000..8a75e90 --- /dev/null +++ b/case_study/RPLCD-1.0.0/CONTRIBUTING.md @@ -0,0 +1,32 @@ +# Contributing + +Thanks a lot for any contribution! + +To keep code quality high and maintenance work low, please adhere to the +following guidelines when creating a pull request: + +- Please follow the [coding + guidelines](https://github.com/dbrgn/RPLCD#coding-guidelines). +- Use meaningful commit messages: Please follow the advice in [this + blogpost](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). + First line of your commit message should be a very short summary (ideally 50 + characters or less) in the imperative mood. After the first line of the commit + message, add a blank line and then a more detailed explanation (when relevant). + +The following items make my life easier, but are optional: + +- If you know how to use `git rebase`, please rebase/sqash your commits so that + unnecessary noise in the commit history is avoided. +- If you have have previously filed a GitHub issue and want to contribute code + that addresses that issue, I prefer it if you use + [hub](https://github.com/github/hub) to convert your existing issue to a pull + request. To do that, first push the changes to a separate branch in your fork + and then issue the following command: + + hub pull-request -b dbrgn:master -i -h : + + This is no strict requirement though, if you don't have hub installed or + prefer to use the web interface, then feel free to post a traditional pull + request. + +Thanks for your contribution! diff --git a/case_study/RPLCD-1.0.0/CONTRIBUTORS b/case_study/RPLCD-1.0.0/CONTRIBUTORS new file mode 100755 index 0000000..5d7ea3d --- /dev/null +++ b/case_study/RPLCD-1.0.0/CONTRIBUTORS @@ -0,0 +1,11 @@ +Main Developers + +- Danilo Bargen / @dbrgn + +Contributors + +- @beargun (bugfix) +- @stripwax (backlight circuit support) +- @rameshg87 (wiring docs) +- @thijstriemstra (fixes to README and setup.py) +- @GoranLundberg (support for MCP23008 and MCP23017 I²C port expander) diff --git a/case_study/RPLCD-1.0.0/LICENSE b/case_study/RPLCD-1.0.0/LICENSE new file mode 100755 index 0000000..f76f27f --- /dev/null +++ b/case_study/RPLCD-1.0.0/LICENSE @@ -0,0 +1,18 @@ +Copyright (C) 2013-2017 Danilo Bargen and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/case_study/RPLCD-1.0.0/MANIFEST.in b/case_study/RPLCD-1.0.0/MANIFEST.in new file mode 100755 index 0000000..549fa35 --- /dev/null +++ b/case_study/RPLCD-1.0.0/MANIFEST.in @@ -0,0 +1,4 @@ +include README.rst LICENSE CHANGELOG.md CONTRIBUTORS +include lcdtest.py +include lcdtests/*.py +recursive-exclude * *.pyc diff --git a/case_study/RPLCD-1.0.0/README.rst b/case_study/RPLCD-1.0.0/README.rst new file mode 100755 index 0000000..3e4e339 --- /dev/null +++ b/case_study/RPLCD-1.0.0/README.rst @@ -0,0 +1,144 @@ +RPLCD +##### + +.. image:: https://badges.gitter.im/RPLCD/Lobby.svg + :alt: Join the chat at https://gitter.im/RPLCD/Lobby + :target: https://gitter.im/RPLCD/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +.. image:: https://img.shields.io/travis/dbrgn/RPLCD/master.svg + :target: https://travis-ci.org/dbrgn/RPLCD + :alt: Build Status +.. image:: https://img.shields.io/pypi/v/RPLCD.svg + :target: https://pypi.python.org/pypi/RPLCD/ + :alt: PyPI Version +.. image:: https://img.shields.io/pypi/wheel/RPLCD.svg + :target: https://pypi.python.org/pypi/RPLCD/ + :alt: PyPI Wheel +.. image:: https://img.shields.io/pypi/pyversions/RPLCD.svg + :target: https://pypi.python.org/pypi/RPLCD/ + :alt: PyPI Python Versions +.. image:: https://img.shields.io/badge/dependencies-0-blue.svg + :target: https://pypi.python.org/pypi/RPLCD/ + :alt: Dependencies +.. image:: https://img.shields.io/pypi/l/RPLCD.svg + :target: https://pypi.python.org/pypi/RPLCD/ + :alt: License + +A Python 3/2 Raspberry PI Character LCD library for the Hitachi HD44780 +controller. It supports both GPIO (parallel) mode as well as boards with an I2C +port expander (e.g. the PCF8574 or the MCP23008). + +This library is inspired by Adafruit Industries' CharLCD_ library as well as by +Arduino's LiquidCrystal_ library. + +No external dependencies (except the ``RPi.GPIO`` library, which comes +preinstalled on Raspbian) are needed to use this library. + +.. image:: https://raw.github.com/dbrgn/RPLCD/master/photo-i2c.jpg + :alt: Photo of 20x4 LCD in action + + +Setup +===== + +You can install RPLCD directly from `PyPI +`_ using pip:: + + $ sudo pip install RPLCD + +If you want to use I2C, you also need smbus:: + + $ sudo apt install python-smbus + +You can also install the library manually without pip. Either just copy the +scripts to your working directory and import them, or download the repository +and run ``python setup.py install`` to install it into your Python package +directory. + + +Features +======== + +Implemented +----------- + +- Simple to use API +- Support for both 4 bit and 8 bit modes +- Support for both parallel (GPIO) and I²C connection +- Support for custom characters +- Support for backlight control circuits +- Built-in support for `A00` and `A02` character tables +- Python 2/3 compatible +- Caching: Only write characters if they changed +- No external dependencies (except `RPi.GPIO`, and `python-smbus` if you need + I²C support) + +Wishlist +-------- + +These things may get implemented in the future, depending on my free time and +motivation: + +- MicroPython port + +Supported I²C Port Expanders +---------------------------- + +- PCF8574 (used by a lot of I²C LCD adapters on Ali Express) +- MCP23008 (used in Adafruit I²C LCD backpack) +- MCP23017 + + +Documentation +============= + +You can find the documentation here: https://readthedocs.org/projects/rplcd/ + + +Testing +======= + +Interactive Test Script +----------------------- + +To test your LCD, please run the ``lcdtest.py`` script with the ``testsuite`` +target. + +Unit Tests +---------- + +There are also unit tests. First, install dependencies: + + pip install -U -r requirements-dev.txt + +Then run the tests: + + py.test -v + + +Coding Guidelines +================= + +`PEP8 `__ via `flake8 +`_ with ``max-line-width`` set to 99 and +``E126-E128,C901`` ignored:: + + flake8 --max-line-length=99 --ignore=E126,E127,E128,C901 RPLCD/lcd.py + + +Resources +========= + +- TC2004A-01 Data Sheet: http://www.adafruit.com/datasheets/TC2004A-01.pdf +- HD44780U Data Sheet: http://www.adafruit.com/datasheets/HD44780.pdf + + +License +======= + +This code is licensed under the MIT license, see the `LICENSE file +`_ or `tldrlegal +`_ for more information. + + +.. _charlcd: https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_CharLCD +.. _liquidcrystal: http://arduino.cc/en/Reference/LiquidCrystal diff --git a/case_study/RPLCD-1.0.0/RELEASING.md b/case_study/RPLCD-1.0.0/RELEASING.md new file mode 100755 index 0000000..0593845 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RELEASING.md @@ -0,0 +1,34 @@ +# Release process + +Signing key: 3578F667F2F3A5FA (https://keybase.io/dbrgn) + +Used variables: + + export VERSION={VERSION} + export GPG=3578F667F2F3A5FA + +Update version numbers: + + vim -p setup.py CHANGELOG.md RPLCD/__init__.py docs/conf.py + +Do a signed commit and signed tag of the release: + + git add setup.py CHANGELOG.md RPLCD/__init__.py docs/conf.py + git commit -S${GPG} -m "Release v${VERSION}" + git tag -u ${GPG} -m "Release v${VERSION}" v${VERSION} + +Build source and binary distributions: + + python3 setup.py sdist + python3 setup.py bdist_wheel + +Sign files: + + gpg --detach-sign -u ${GPG} -a dist/RPLCD-${VERSION}.tar.gz + gpg --detach-sign -u ${GPG} -a dist/RPLCD-${VERSION}-py2.py3-none-any.whl + +Upload package to PyPI: + + twine3 upload dist/RPLCD-${VERSION}* + git push + git push --tags diff --git a/case_study/RPLCD-1.0.0/RPLCD/__init__.py b/case_study/RPLCD-1.0.0/RPLCD/__init__.py new file mode 100755 index 0000000..242c484 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/__init__.py @@ -0,0 +1,14 @@ +import warnings + +from .contextmanagers import cursor, cleared +from .gpio import CharLCD as GpioCharLCD + + +__version__ = '1.0.0' + + +class CharLCD(GpioCharLCD): + def __init__(self, *args, **kwargs): + warnings.warn("Using RPLCD.CharLCD directly is deprecated. " + + "Use RPLCD.gpio.CharLCD instead!", DeprecationWarning) + super(CharLCD, self).__init__(*args, **kwargs) diff --git a/case_study/RPLCD-1.0.0/RPLCD/codecs/__init__.py b/case_study/RPLCD-1.0.0/RPLCD/codecs/__init__.py new file mode 100755 index 0000000..08857a9 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/codecs/__init__.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +from ..common import sliding_window +from . import hd44780_a00, hd44780_a02 + + +# Constants used to encode special characters. +# Negative to avoid conflict with regular bytes. +CR = -1 +LF = -2 + + +class FoundMultiCharMapping(Exception): + """ + Exception to escape nested loops. + """ + pass + + +class Codec(object): + def __init__(self, codec): + assert hasattr(codec, 'replacement_char') + assert hasattr(codec, 'encoding_table') + assert hasattr(codec, 'combined_chars_lookahead') + assert hasattr(codec, 'combined_chars') + self.codec = codec + + def encode(self, input_): # type: (str) -> List[int] + result = [] + window_iter = sliding_window(input_, self.codec.combined_chars_lookahead) + while True: + try: + window = next(window_iter) + except StopIteration: + break + char = window[0] + lookahead = window[1:] + + # First, test for newlines and carriage returns + if char == '\r': + result.append(CR) + continue + elif char == '\n': + result.append(LF) + continue + + # Then, test whether the character starts a multi-char mapping + try: + if char in self.codec.combined_chars: + mappings = self.codec.combined_chars[char] + for mapping in mappings: + length = len(mapping[0]) + if mapping[0] == ''.join(lookahead[:length]): + # We got a match! Add the mapping... + result.append(mapping[1]) + # ...and advance iterator to consume the used up lookahead. + for _ in range(length): + next(window_iter) + raise FoundMultiCharMapping() + except FoundMultiCharMapping: + continue + + # Otherwise, do a regular lookup in the encoding table + result.append(self.codec.encoding_table.get(char, self.codec.replacement_char)) + + return result + + +class A00Codec(Codec): + def __init__(self): + super(A00Codec, self).__init__(hd44780_a00) + + +class A02Codec(Codec): + def __init__(self): + super(A02Codec, self).__init__(hd44780_a02) diff --git a/case_study/RPLCD-1.0.0/RPLCD/codecs/hd44780_a00.py b/case_study/RPLCD-1.0.0/RPLCD/codecs/hd44780_a00.py new file mode 100755 index 0000000..8e61f74 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/codecs/hd44780_a00.py @@ -0,0 +1,246 @@ +# -*- coding: utf-8 -*- +""" +The HD4480-A00 character table is a slightly altered form +of the JIS X 0201 codec. +""" +# flake8: noqa +from __future__ import print_function, division, absolute_import, unicode_literals + +# Character shown if no mapping was found +replacement_char = 0x20 # SPACE + +# Table with 1:1 mapping +encoding_table = { + + '\u0000': 0x00, # User defined (CGRAM) + '\u0001': 0x01, # User defined (CGRAM) + '\u0002': 0x02, # User defined (CGRAM) + '\u0003': 0x03, # User defined (CGRAM) + '\u0004': 0x04, # User defined (CGRAM) + '\u0005': 0x05, # User defined (CGRAM) + '\u0006': 0x06, # User defined (CGRAM) + '\u0007': 0x07, # User defined (CGRAM) + + '\u0020': 0x20, # SPACE + '\u00A0': 0x20, # NO-BREAK SPACE + '!': 0x21, # EXCLAMATION MARK + '"': 0x22, # QUOTATION MARK + '#': 0x23, # NUMBER SIGN + '$': 0x24, # DOLLAR SIGN + '%': 0x25, # PERCENT SIGN + '&': 0x26, # AMPERSAND + "'": 0x27, # APOSTROPHE + '(': 0x28, # LEFT PARENTHESES + ')': 0x29, # RIGHT PARENTHESES + '*': 0x2A, # ASTERISK + '+': 0x2B, # PLUS SIGN + ',': 0x2C, # COMMA + '\u002d': 0x2d, # HYPHEN-MINUS + '\u2010': 0x2d, # HYPHEN + '\u2011': 0x2d, # NON-BREAKING HYPHEN + '\u2012': 0x2d, # FIGURE DASH + '\u2013': 0x2d, # EN DASH + '\u2014': 0x2d, # EM DASH + '\u2015': 0x2d, # HORIZONTAL BAR + '.': 0x2E, # FULL STOP + '/': 0x2F, # SOLIDUS + + '0': 0x30, # DIGIT ZERO + '1': 0x31, # DIGIT ONE + '2': 0x32, # DIGIT TWO + '3': 0x33, # DIGIT THREE + '4': 0x34, # DIGIT FOUR + '5': 0x35, # DIGIT FIVE + '6': 0x36, # DIGIT SIX + '7': 0x37, # DIGIT SEVEN + '8': 0x38, # DIGIT EIGHT + '9': 0x39, # DIGIT NINE + ':': 0x3A, # COLON + ';': 0x3B, # SEMICOLON + '<': 0x3C, # LESS-THAN SIGN + '=': 0x3D, # EQUALS SIGN + '>': 0x3E, # GREATER-THAN SIGN + '?': 0x3F, # QUESTION MARK + + '@': 0x40, # COMMERCIAL AT + 'A': 0x41, # LATIN CAPITAL LETTER A + 'B': 0x42, # LATIN CAPITAL LETTER B + 'C': 0x43, # LATIN CAPITAL LETTER C + 'D': 0x44, # LATIN CAPITAL LETTER D + 'E': 0x45, # LATIN CAPITAL LETTER E + 'F': 0x46, # LATIN CAPITAL LETTER F + 'G': 0x47, # LATIN CAPITAL LETTER G + 'H': 0x48, # LATIN CAPITAL LETTER H + 'I': 0x49, # LATIN CAPITAL LETTER I + 'J': 0x4A, # LATIN CAPITAL LETTER J + 'K': 0x4B, # LATIN CAPITAL LETTER K + 'L': 0x4C, # LATIN CAPITAL LETTER L + 'M': 0x4D, # LATIN CAPITAL LETTER M + 'N': 0x4E, # LATIN CAPITAL LETTER N + 'O': 0x4F, # LATIN CAPITAL LETTER O + + 'P': 0x50, # LATIN CAPITAL LETTER P + 'Q': 0x51, # LATIN CAPITAL LETTER Q + 'R': 0x52, # LATIN CAPITAL LETTER R + 'S': 0x53, # LATIN CAPITAL LETTER S + 'T': 0x54, # LATIN CAPITAL LETTER T + 'U': 0x55, # LATIN CAPITAL LETTER U + 'V': 0x56, # LATIN CAPITAL LETTER V + 'W': 0x57, # LATIN CAPITAL LETTER W + 'X': 0x58, # LATIN CAPITAL LETTER X + 'Y': 0x59, # LATIN CAPITAL LETTER Y + 'Z': 0x5A, # LATIN CAPITAL LETTER Z + '[': 0x5B, # LEFT SQUARE BRACKET + '¥': 0x5C, # YEN SIGN + ']': 0x5D, # RIGHT SQUARE BRACKET + '^': 0x5E, # CIRCUMFLEX ACCENT + '_': 0x5F, # LOW LINE + + '`': 0x60, # GRAVE ACCENT + 'a': 0x61, # LATIN SMALL LETTER A + 'b': 0x62, # LATIN SMALL LETTER B + 'c': 0x63, # LATIN SMALL LETTER C + 'd': 0x64, # LATIN SMALL LETTER D + 'e': 0x65, # LATIN SMALL LETTER E + 'f': 0x66, # LATIN SMALL LETTER F + 'g': 0x67, # LATIN SMALL LETTER G + 'h': 0x68, # LATIN SMALL LETTER H + 'i': 0x69, # LATIN SMALL LETTER I + 'j': 0x6A, # LATIN SMALL LETTER J + 'k': 0x6B, # LATIN SMALL LETTER K + 'l': 0x6C, # LATIN SMALL LETTER L + 'm': 0x6D, # LATIN SMALL LETTER M + 'n': 0x6E, # LATIN SMALL LETTER N + 'o': 0x6F, # LATIN SMALL LETTER O + + 'p': 0x70, # LATIN SMALL LETTER P + 'q': 0x71, # LATIN SMALL LETTER Q + 'r': 0x72, # LATIN SMALL LETTER R + 's': 0x73, # LATIN SMALL LETTER S + 't': 0x74, # LATIN SMALL LETTER T + 'u': 0x75, # LATIN SMALL LETTER U + 'v': 0x76, # LATIN SMALL LETTER V + 'w': 0x77, # LATIN SMALL LETTER W + 'x': 0x78, # LATIN SMALL LETTER X + 'y': 0x79, # LATIN SMALL LETTER Y + 'z': 0x7A, # LATIN SMALL LETTER Z + '{': 0x7B, # LEFT CURLY BRACKET + '|': 0x7C, # VERTICAL LINE + '}': 0x7D, # RIGHT CURLY BRACKET + '→': 0x7E, # RIGHTWARDS ARROW + '←': 0x7F, # LEFTWARDS ARROW + + '\u3000': 0xA0, # IDEOGRAPHIC SPACE + '\uFF61': 0xA1, # HALFWIDTH IDEOGRAPHIC FULL STOP + '\uFF62': 0xA2, # HALFWIDTH LEFT CORNER BRACKET + '\uFF63': 0xA3, # HALFWIDTH RIGHT CORNER BRACKET + '\uFF64': 0xA4, # HALFWIDTH IDEOGRAPHIC COMMA + '\uFF65': 0xA5, # HALFWIDTH KATAKANA MIDDLE DOT + '\uFF66': 0xA6, # HALFWIDTH KATAKANA LETTER WO + '\uFF67': 0xA7, # HALFWIDTH KATAKANA LETTER SMALL A + '\uFF68': 0xA8, # HALFWIDTH KATAKANA LETTER SMALL I + '\uFF69': 0xA9, # HALFWIDTH KATAKANA LETTER SMALL U + '\uFF6A': 0xAA, # HALFWIDTH KATAKANA LETTER SMALL E + '\uFF6B': 0xAB, # HALFWIDTH KATAKANA LETTER SMALL O + '\uFF6C': 0xAC, # HALFWIDTH KATAKANA LETTER SMALL YA + '\uFF6D': 0xAD, # HALFWIDTH KATAKANA LETTER SMALL YU + '\uFF6E': 0xAE, # HALFWIDTH KATAKANA LETTER SMALL YO + '\uFF6F': 0xAF, # HALFWIDTH KATAKANA LETTER SMALL TU + + '\uFF70': 0xB0, # HALFWIDTH KATAKANA-HIRAGANA PROLONGED SOUND MARK + '\uFF71': 0xB1, # HALFWIDTH KATAKANA LETTER A + '\uFF72': 0xB2, # HALFWIDTH KATAKANA LETTER I + '\uFF73': 0xB3, # HALFWIDTH KATAKANA LETTER U + '\uFF74': 0xB4, # HALFWIDTH KATAKANA LETTER E + '\uFF75': 0xB5, # HALFWIDTH KATAKANA LETTER O + '\uFF76': 0xB6, # HALFWIDTH KATAKANA LETTER KA + '\uFF77': 0xB7, # HALFWIDTH KATAKANA LETTER KI + '\uFF78': 0xB8, # HALFWIDTH KATAKANA LETTER KU + '\uFF79': 0xB9, # HALFWIDTH KATAKANA LETTER KE + '\uFF7A': 0xBA, # HALFWIDTH KATAKANA LETTER KO + '\uFF7B': 0xBB, # HALFWIDTH KATAKANA LETTER SA + '\uFF7C': 0xBC, # HALFWIDTH KATAKANA LETTER SI + '\uFF7D': 0xBD, # HALFWIDTH KATAKANA LETTER SU + '\uFF7E': 0xBE, # HALFWIDTH KATAKANA LETTER SE + '\uFF7F': 0xBF, # HALFWIDTH KATAKANA LETTER SO + + '\uFF80': 0xC0, # HALFWIDTH KATAKANA LETTER TA + '\uFF81': 0xC1, # HALFWIDTH KATAKANA LETTER TI + '\uFF82': 0xC2, # HALFWIDTH KATAKANA LETTER TU + '\uFF83': 0xC3, # HALFWIDTH KATAKANA LETTER TE + '\uFF84': 0xC4, # HALFWIDTH KATAKANA LETTER TO + '\uFF85': 0xC5, # HALFWIDTH KATAKANA LETTER NA + '\uFF86': 0xC6, # HALFWIDTH KATAKANA LETTER NI + '\uFF87': 0xC7, # HALFWIDTH KATAKANA LETTER NU + '\uFF88': 0xC8, # HALFWIDTH KATAKANA LETTER NE + '\uFF89': 0xC9, # HALFWIDTH KATAKANA LETTER NO + '\uFF8A': 0xCA, # HALFWIDTH KATAKANA LETTER HA + '\uFF8B': 0xCB, # HALFWIDTH KATAKANA LETTER HI + '\uFF8C': 0xCC, # HALFWIDTH KATAKANA LETTER HU + '\uFF8D': 0xCD, # HALFWIDTH KATAKANA LETTER HE + '\uFF8E': 0xCE, # HALFWIDTH KATAKANA LETTER HO + '\uFF8F': 0xCF, # HALFWIDTH KATAKANA LETTER MA + + '\uFF90': 0xD0, # HALFWIDTH KATAKANA LETTER MI + '\uFF91': 0xD1, # HALFWIDTH KATAKANA LETTER MU + '\uFF92': 0xD2, # HALFWIDTH KATAKANA LETTER ME + '\uFF93': 0xD3, # HALFWIDTH KATAKANA LETTER MO + '\uFF94': 0xD4, # HALFWIDTH KATAKANA LETTER YA + '\uFF95': 0xD5, # HALFWIDTH KATAKANA LETTER YU + '\uFF96': 0xD6, # HALFWIDTH KATAKANA LETTER YO + '\uFF97': 0xD7, # HALFWIDTH KATAKANA LETTER RA + '\uFF98': 0xD8, # HALFWIDTH KATAKANA LETTER RI + '\uFF99': 0xD9, # HALFWIDTH KATAKANA LETTER RU + '\uFF9A': 0xDA, # HALFWIDTH KATAKANA LETTER RE + '\uFF9B': 0xDB, # HALFWIDTH KATAKANA LETTER RO + '\uFF9C': 0xDC, # HALFWIDTH KATAKANA LETTER WA + '\uFF9D': 0xDD, # HALFWIDTH KATAKANA LETTER N + '\uFF9E': 0xDE, # HALFWIDTH KATAKANA VOICED SOUND MARK + '\u309B': 0xDE, # KATAKANA-HIRAGANA VOICED SOUND MARK + '\uFF9F': 0xDF, # HALFWIDTH KATAKANA SEMI-VOICED SOUND MARK + '\u309C': 0xDF, # KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK + '\u00B0': 0xDF, # DEGREE SIGN + + 'α': 0xE0, # GREEK SMALL LETTER ALPHA + 'ä': 0xE1, # LATIN SMALL LETTER A WITH DIAERESIS + 'β': 0xE2, # GREEK SMALL LETTER BETA + 'ε': 0xE3, # GREEK SMALL LETTER EPSILON + 'μ': 0xE4, # GREEK SMALL LETTER MU + 'σ': 0xE5, # GREEK SMALL LETTER SIGMA + 'ρ': 0xE6, # GREEK SMALL LETTER RHO + '√': 0xE8, # SQUARE ROOT + '¤': 0xEB, # CURRENCY SIGN + 'ˣ': 0xEB, # MODIFIER LETTER SMALL X + '¢': 0xEC, # CENT SIGN + '\u2C60': 0xED, # LATIN CAPITAL LETTER L WITH DOUBLE Bar + '£': 0xED, # POUND SIGN + 'ñ': 0xEE, # LATIN SMALL LETTER N WITH TILDE + 'ö': 0xEF, # LATIN SMALL LETTER O WITH DIAERESIS + + 'ϴ': 0xF2, # GREEK SMALL LETTER THETA + '∞': 0xF3, # INFINITY + '\u03A9': 0xF4, # GREEK CAPITAL LETTER OMEGA + '\u2126': 0xF4, # OHM SIGN + 'ü': 0xF5, # LATIN SMALL LETTER U WITH DIAERESIS + 'Σ': 0xF6, # GREEK CAPITAL LETTER SIGMA + '\u2211': 0xF6, # N-ARY SUMMATION + 'π': 0xF7, # GREEK SMALL LETTER PI + '\u5343': 0xFA, # CJK UNIFIED IDEOGRAPH 5343 + '\u4E07': 0xFB, # CJK UNIFIED IDEOGRAPH 4E07 + '\u5186': 0xFC, # CJK UNIFIED IDEOGRAPH 5186 + '÷': 0xFD, # DIVISION SIGN + '\u25A0': 0xFF, # BLACK SQUARE + '\u2588': 0xFF, # FULL BLOCK + +} + +# Table with combined mappings +combined_chars_lookahead = 1 +combined_chars = { + '\u207B': [ + ('\u00B9', 0xE9), # SUPERSCRIPT MINUS + SUPERSCRIPT ONE + ], + '\u0078': [ + ('\u0304', 0xF8), # LATIN SMALL LETTER X + COMBINING MACRON + ], +} diff --git a/case_study/RPLCD-1.0.0/RPLCD/codecs/hd44780_a02.py b/case_study/RPLCD-1.0.0/RPLCD/codecs/hd44780_a02.py new file mode 100755 index 0000000..e3456d2 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/codecs/hd44780_a02.py @@ -0,0 +1,292 @@ +# -*- coding: utf-8 -*- +""" +The HD4480-A02 character table. +""" +# flake8: noqa +from __future__ import print_function, division, absolute_import, unicode_literals + +# Character shown if no mapping was found +replacement_char = 0x20 # SPACE + +# Table with 1:1 mapping +encoding_table = { + + '\u0000': 0x00, # User defined (CGRAM) + '\u0001': 0x01, # User defined (CGRAM) + '\u0002': 0x02, # User defined (CGRAM) + '\u0003': 0x03, # User defined (CGRAM) + '\u0004': 0x04, # User defined (CGRAM) + '\u0005': 0x05, # User defined (CGRAM) + '\u0006': 0x06, # User defined (CGRAM) + '\u0007': 0x07, # User defined (CGRAM) + + '▶': 0x10, # BLACK RIGHT-POINTING TRIANGLE + '◀': 0x11, # BLACK LEFT-POINTING TRIANGLE + '“': 0x12, # LEFT DOUBLE QUOTATION MARK + '”': 0x13, # RIGHT DOUBLE QUOTATION MARK + '\u23EB': 0x14, # BLACK UP-POINTING DOUBLE TRIANGLE + '\u23EC': 0x15, # BLACK DOWN-POINTING DOUBLE TRIANGLE + '●': 0x16, # BLACK CIRCLE + '↲': 0x17, # DOWNWARDS ARROW WITH TIP LEFTWARDS + '↑': 0x18, # UPWARDS ARROW + '↓': 0x19, # DOWNWARDS ARROW + '→': 0x1a, # RIGHTWARDS ARROW + '←': 0x1b, # LEFTWARDS ARROW + '≤': 0x1c, # LESS-THAN OR EQUAL TO + '≥': 0x1d, # GREATER-THAN OR EQUAL TO + '▲': 0x1e, # BLACK UP-POINTING TRIANGLE + '▼': 0x1f, # BLACK DOWN-POINTING TRIANGLE + + '\u0020': 0x20, # SPACE + '\u00A0': 0x20, # NO-BREAK SPACE + '!': 0x21, # EXCLAMATION MARK + '"': 0x22, # QUOTATION MARK + '#': 0x23, # NUMBER SIGN + '$': 0x24, # DOLLAR SIGN + '%': 0x25, # PERCENT SIGN + '&': 0x26, # AMPERSAND + "'": 0x27, # APOSTROPHE + '(': 0x28, # LEFT PARENTHESES + ')': 0x29, # RIGHT PARENTHESES + '*': 0x2a, # ASTERISK + '+': 0x2b, # PLUS SIGN + ',': 0x2c, # COMMA + '\u002d': 0x2d, # HYPHEN-MINUS + '\u2010': 0x2d, # HYPHEN + '\u2011': 0x2d, # NON-BREAKING HYPHEN + '\u2012': 0x2d, # FIGURE DASH + '\u2013': 0x2d, # EN DASH + '\u2014': 0x2d, # EM DASH + '\u2015': 0x2d, # HORIZONTAL BAR + '.': 0x2e, # FULL STOP + '/': 0x2f, # SOLIDUS + + '0': 0x30, # DIGIT ZERO + '1': 0x31, # DIGIT ONE + '2': 0x32, # DIGIT TWO + '3': 0x33, # DIGIT THREE + '4': 0x34, # DIGIT FOUR + '5': 0x35, # DIGIT FIVE + '6': 0x36, # DIGIT SIX + '7': 0x37, # DIGIT SEVEN + '8': 0x38, # DIGIT EIGHT + '9': 0x39, # DIGIT NINE + ':': 0x3a, # COLON + ';': 0x3b, # SEMICOLON + '<': 0x3c, # LESS-THAN SIGN + '=': 0x3d, # EQUALS SIGN + '>': 0x3e, # GREATER-THAN SIGN + '?': 0x3f, # QUESTION MARK + + '@': 0x40, # COMMERCIAL AT + 'A': 0x41, # LATIN CAPITAL LETTER A + 'B': 0x42, # LATIN CAPITAL LETTER B + 'C': 0x43, # LATIN CAPITAL LETTER C + 'D': 0x44, # LATIN CAPITAL LETTER D + 'E': 0x45, # LATIN CAPITAL LETTER E + 'F': 0x46, # LATIN CAPITAL LETTER F + 'G': 0x47, # LATIN CAPITAL LETTER G + 'H': 0x48, # LATIN CAPITAL LETTER H + 'I': 0x49, # LATIN CAPITAL LETTER I + 'J': 0x4a, # LATIN CAPITAL LETTER J + 'K': 0x4b, # LATIN CAPITAL LETTER K + 'L': 0x4c, # LATIN CAPITAL LETTER L + 'M': 0x4d, # LATIN CAPITAL LETTER M + 'N': 0x4e, # LATIN CAPITAL LETTER N + 'O': 0x4f, # LATIN CAPITAL LETTER O + + 'P': 0x50, # LATIN CAPITAL LETTER P + 'Q': 0x51, # LATIN CAPITAL LETTER Q + 'R': 0x52, # LATIN CAPITAL LETTER R + 'S': 0x53, # LATIN CAPITAL LETTER S + 'T': 0x54, # LATIN CAPITAL LETTER T + 'U': 0x55, # LATIN CAPITAL LETTER U + 'V': 0x56, # LATIN CAPITAL LETTER V + 'W': 0x57, # LATIN CAPITAL LETTER W + 'X': 0x58, # LATIN CAPITAL LETTER X + 'Y': 0x59, # LATIN CAPITAL LETTER Y + 'Z': 0x5a, # LATIN CAPITAL LETTER Z + '[': 0x5b, # LEFT SQUARE BRACKET + '\\': 0x5c, # REVERSE SOLIDUS + ']': 0x5d, # RIGHT SQUARE BRACKET + '^': 0x5e, # CIRCUMFLEX ACCENT + '_': 0x5f, # LOW LINE + + '`': 0x60, # GRAVE ACCENT + 'a': 0x61, # LATIN SMALL LETTER A + 'b': 0x62, # LATIN SMALL LETTER B + 'c': 0x63, # LATIN SMALL LETTER C + 'd': 0x64, # LATIN SMALL LETTER D + 'e': 0x65, # LATIN SMALL LETTER E + 'f': 0x66, # LATIN SMALL LETTER F + 'g': 0x67, # LATIN SMALL LETTER G + 'h': 0x68, # LATIN SMALL LETTER H + 'i': 0x69, # LATIN SMALL LETTER I + 'j': 0x6a, # LATIN SMALL LETTER J + 'k': 0x6b, # LATIN SMALL LETTER K + 'l': 0x6c, # LATIN SMALL LETTER L + 'm': 0x6d, # LATIN SMALL LETTER M + 'n': 0x6e, # LATIN SMALL LETTER N + 'o': 0x6f, # LATIN SMALL LETTER O + + 'p': 0x70, # LATIN SMALL LETTER P + 'q': 0x71, # LATIN SMALL LETTER Q + 'r': 0x72, # LATIN SMALL LETTER R + 's': 0x73, # LATIN SMALL LETTER S + 't': 0x74, # LATIN SMALL LETTER T + 'u': 0x75, # LATIN SMALL LETTER U + 'v': 0x76, # LATIN SMALL LETTER V + 'w': 0x77, # LATIN SMALL LETTER W + 'x': 0x78, # LATIN SMALL LETTER X + 'y': 0x79, # LATIN SMALL LETTER Y + 'z': 0x7a, # LATIN SMALL LETTER Z + '{': 0x7b, # LEFT CURLY BRACKET + '|': 0x7c, # VERTICAL LINE + '}': 0x7d, # RIGHT CURLY BRACKET + '~': 0x7e, # TILDE + '⌂': 0x7f, # HOUSE + + 'Б': 0x80, # CYRILLIC CAPITAL LETTER BE + 'Д': 0x81, # CYRILLIC CAPITAL LETTER DE + 'Ж': 0x82, # CYRILLIC CAPITAL LETTER ZHE + 'З': 0x83, # CYRILLIC CAPITAL LETTER ZE + 'И': 0x84, # CYRILLIC CAPITAL LETTER I + 'Й': 0x85, # CYRILLIC CAPITAL LETTER SHORT I + 'Л': 0x86, # CYRILLIC CAPITAL LETTER EL + 'П': 0x87, # CYRILLIC CAPITAL LETTER PE + 'У': 0x88, # CYRILLIC CAPITAL LETTER U + 'Ц': 0x89, # CYRILLIC CAPITAL LETTER TSE + 'Ч': 0x8a, # CYRILLIC CAPITAL LETTER CHE + 'Ш': 0x8b, # CYRILLIC CAPITAL LETTER SHA + 'Щ': 0x8c, # CYRILLIC CAPITAL LETTER SHCHA + 'Ъ': 0x8d, # CYRILLIC CAPITAL LETTER HARD SIGN + 'Ы': 0x8e, # CYRILLIC CAPITAL LETTER YERU + 'Э': 0x8f, # CYRILLIC CAPITAL LETTER E + + 'α': 0x90, # GREEK SMALL LETTER ALPHA + '♪': 0x91, # EIGHTH NOTE + 'Γ': 0x92, # GREEK CAPITAL LETTER GAMMA + 'π': 0x93, # GREEK SMALL LETTER PI + 'Σ': 0x94, # GREEK CAPITAL LETTER SIGMA + '\u2211': 0x94, # N-ARY SUMMATION + 'σ': 0x95, # GREEK SMALL LETTER SIGMA + '♬': 0x96, # BEAMED SIXTEENTH NOTES + 'τ': 0x97, # GREEK SMALL LETTER TAU + '\U0001F514': 0x98, # BELL + 'θ': 0x99, # GREEK SMALL LETTER THETA + '\u03A9': 0x9a, # GREEK CAPITAL LETTER OMEGA + '\u2126': 0x9a, # OHM SIGN + 'δ': 0x9b, # GREEK SMALL LETTER DELTA + '∞': 0x9c, # INFINITY + '\u2661': 0x9d, # WHITE HEART SUIT + '\u2665': 0x9d, # BLACK HEART SUIT + '\u2764': 0x9d, # HEAVY BLACK HEART + 'ε': 0x9e, # GREEK SMALL LETTER EPSILON + '\u2229': 0x9f, # INTERSECTION + + '\u2016': 0xa0, # DOUBLE VERTICAL LINE + '¡': 0xa1, # INVERTED EXCLAMATION MARK + '¢': 0xa2, # CENT SIGN + '£': 0xa3, # POUND SIGN + '¤': 0xa4, # CURRENCY SIGN + '¥': 0xa5, # YEN SIGN + '¦': 0xa6, # BROKEN BAR + '§': 0xa7, # SECTION SIGN + 'ƒ': 0xa8, # LATIN SMALL LETTER F WITH HOOK + '©': 0xa9, # COPYRIGHT SIGN + 'ª': 0xaa, # FEMININE ORDINAL INDICATOR + '«': 0xab, # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK + 'Ю': 0xac, # CYRILLIC CAPITAL LETTER YU + 'Я': 0xad, # CYRILLIC CAPITAL LETTER YA + '®': 0xae, # REGISTERED SIGN + '´': 0xaf, # ACUTE ACCENT + + 'ᴼ': 0xb0, # MODIFIER LETTER CAPITAL O + '±': 0xb1, # PLUS-MINUS SIGN + '²': 0xb2, # SUPERSCRIPT TWO + '³': 0xb3, # SUPERSCRIPT THREE + 'μ': 0xb5, # GREEK SMALL LETTER MU + '¶': 0xb6, # PILCROW SIGN + '·': 0xb7, # MIDDLE DOT + 'ω': 0xb8, # GREEK SMALL LETTER OMEGA + '¹': 0xb9, # SUPERSCRIPT ONE + 'º': 0xba, # MASCULINE ORDINAL INDICATOR + '»': 0xbb, # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK + '¼': 0xbc, # VULGAR FRACTION ONE QUARTER + '½': 0xbd, # VULGAR FRACTION ONE HALF + '¾': 0xbe, # VULGAR FRACTION THREE QUARTERS + '¿': 0xbf, # INVERTED QUESTION MARK + + 'À': 0xc0, # LATIN CAPITAL LETTER A WITH GRAVE + 'Á': 0xc1, # LATIN CAPITAL LETTER A WITH ACUTE + 'Â': 0xc2, # LATIN CAPITAL LETTER A WITH CIRCUMFLEX + 'Ã': 0xc3, # LATIN CAPITAL LETTER A WITH TILDE + 'Ä': 0xc4, # LATIN CAPITAL LETTER A WITH DIAERESIS + 'Å': 0xc5, # LATIN CAPITAL LETTER A WITH RING ABOVE + 'Æ': 0xc6, # LATIN CAPITAL LETTER AE + 'Ç': 0xc7, # LATIN CAPITAL LETTER C WITH CEDILLA + 'È': 0xc8, # LATIN CAPITAL LETTER E WITH GRAVE + 'É': 0xc9, # LATIN CAPITAL LETTER E WITH ACUTE + 'Ê': 0xca, # LATIN CAPITAL LETTER E WITH CIRCUMFLEX + 'Ë': 0xcb, # LATIN CAPITAL LETTER E WITH DIAERESIS + 'Ì': 0xcc, # LATIN CAPITAL LETTER I WITH GRAVE + 'Í': 0xcd, # LATIN CAPITAL LETTER I WITH ACUTE + 'Î': 0xce, # LATIN CAPITAL LETTER I WITH CIRCUMFLEX + 'Ï': 0xcf, # LATIN CAPITAL LETTER I WITH DIAERESIS + + 'Ð': 0xd0, # LATIN CAPITAL LETTER ETH + 'Ñ': 0xd1, # LATIN CAPITAL LETTER N WITH TILDE + 'Ò': 0xd2, # LATIN CAPITAL LETTER O WITH GRAVE + 'Ó': 0xd3, # LATIN CAPITAL LETTER O WITH ACUTE + 'Ô': 0xd4, # LATIN CAPITAL LETTER O WITH CIRCUMFLEX + 'Õ': 0xd5, # LATIN CAPITAL LETTER O WITH TILDE + 'Ö': 0xd6, # LATIN CAPITAL LETTER O WITH DIAERESIS + '×': 0xd7, # MULTIPLICATION SIGN + 'Φ': 0xd8, # GREEK CAPITAL LETTER PHI + 'Ù': 0xd9, # LATIN CAPITAL LETTER U WITH GRAVE + 'Ú': 0xda, # LATIN CAPITAL LETTER U WITH ACUTE + 'Û': 0xdb, # LATIN CAPITAL LETTER U WITH CIRCUMFLEX + 'Ü': 0xdc, # LATIN CAPITAL LETTER U WITH DIAERESIS + 'Ý': 0xdd, # LATIN CAPITAL LETTER Y WITH ACUTE + 'Þ': 0xde, # LATIN CAPITAL LETTER THORN + 'ß': 0xdf, # LATIN SMALL LETTER SHARP S + + 'à': 0xe0, # LATIN SMALL LETTER A WITH GRAVE + 'á': 0xe1, # LATIN SMALL LETTER A WITH ACUTE + 'â': 0xe2, # LATIN SMALL LETTER A WITH CIRCUMFLEX + 'ã': 0xe3, # LATIN SMALL LETTER A WITH TILDE + 'ä': 0xe4, # LATIN SMALL LETTER A WITH DIAERESIS + 'å': 0xe5, # LATIN SMALL LETTER A WITH RING ABOVE + 'æ': 0xe6, # LATIN SMALL LETTER AE + 'ç': 0xe7, # LATIN SMALL LETTER C WITH CEDILLA + 'è': 0xe8, # LATIN SMALL LETTER E WITH GRAVE + 'é': 0xe9, # LATIN SMALL LETTER E WITH ACUTE + 'ê': 0xea, # LATIN SMALL LETTER E WITH CIRCUMFLEX + 'ë': 0xeb, # LATIN SMALL LETTER E WITH DIAERESIS + 'ì': 0xec, # LATIN SMALL LETTER I WITH GRAVE + 'í': 0xed, # LATIN SMALL LETTER I WITH ACUTE + 'î': 0xee, # LATIN SMALL LETTER I WITH CIRCUMFLEX + 'ï': 0xef, # LATIN SMALL LETTER I WITH DIAERESIS + + 'ð': 0xf0, # LATIN SMALL LETTER ETH + 'ñ': 0xf1, # LATIN SMALL LETTER N WITH TILDE + 'ò': 0xf2, # LATIN SMALL LETTER O WITH GRAVE + 'ó': 0xf3, # LATIN SMALL LETTER O WITH ACUTE + 'ô': 0xf4, # LATIN SMALL LETTER O WITH CIRCUMFLEX + 'õ': 0xf5, # LATIN SMALL LETTER O WITH TILDE + 'ö': 0xf6, # LATIN SMALL LETTER O WITH DIAERESIS + '÷': 0xf7, # DIVISION SIGN + 'ø': 0xf8, # LATIN SMALL LETTER O WITH STROKE + 'ù': 0xf9, # LATIN SMALL LETTER U WITH GRAVE + 'ú': 0xfa, # LATIN SMALL LETTER U WITH ACUTE + 'û': 0xfb, # LATIN SMALL LETTER U WITH CIRCUMFLEX + 'ü': 0xfc, # LATIN SMALL LETTER U WITH DIAERESIS + 'ý': 0xfd, # LATIN SMALL LETTER Y WITH ACUTE + 'þ': 0xfe, # LATIN SMALL LETTER THORN + 'ÿ': 0xff, # LATIN SMALL LETTER Y WITH DIAERESIS + +} + +# Table with combined mappings +combined_chars_lookahead = 0 +combined_chars = {} diff --git a/case_study/RPLCD-1.0.0/RPLCD/common.py b/case_study/RPLCD-1.0.0/RPLCD/common.py new file mode 100755 index 0000000..bf94fb3 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/common.py @@ -0,0 +1,119 @@ +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +import itertools +import time + + +# # # BIT PATTERNS # # # + +# Commands +LCD_CLEARDISPLAY = 0x01 +LCD_RETURNHOME = 0x02 +LCD_ENTRYMODESET = 0x04 +LCD_DISPLAYCONTROL = 0x08 +LCD_CURSORSHIFT = 0x10 +LCD_FUNCTIONSET = 0x20 +LCD_SETCGRAMADDR = 0x40 +LCD_SETDDRAMADDR = 0x80 + +# Flags for display entry mode +LCD_ENTRYRIGHT = 0x00 +LCD_ENTRYLEFT = 0x02 +LCD_ENTRYSHIFTINCREMENT = 0x01 +LCD_ENTRYSHIFTDECREMENT = 0x00 + +# Flags for display on/off control +LCD_DISPLAYON = 0x04 +LCD_DISPLAYOFF = 0x00 +LCD_CURSORON = 0x02 +LCD_CURSOROFF = 0x00 +LCD_BLINKON = 0x01 +LCD_BLINKOFF = 0x00 + +# Flags for display/cursor shift +LCD_DISPLAYMOVE = 0x08 +LCD_CURSORMOVE = 0x00 + +# Flags for display/cursor shift +LCD_DISPLAYMOVE = 0x08 +LCD_CURSORMOVE = 0x00 +LCD_MOVERIGHT = 0x04 +LCD_MOVELEFT = 0x00 + +# Flags for function set +LCD_8BITMODE = 0x10 +LCD_4BITMODE = 0x00 +LCD_2LINE = 0x08 +LCD_1LINE = 0x00 +LCD_5x10DOTS = 0x04 +LCD_5x8DOTS = 0x00 + +# Flags for RS pin modes +RS_INSTRUCTION = 0x00 +RS_DATA = 0x01 + + +# # # Helper classes # # # + +class Alignment(object): + left = LCD_ENTRYLEFT + right = LCD_ENTRYRIGHT + + +class ShiftMode(object): + cursor = LCD_ENTRYSHIFTDECREMENT + display = LCD_ENTRYSHIFTINCREMENT + + +class CursorMode(object): + hide = LCD_CURSOROFF | LCD_BLINKOFF + line = LCD_CURSORON | LCD_BLINKOFF + blink = LCD_CURSOROFF | LCD_BLINKON + + +# # # HELPER FUNCTIONS # # # + +def msleep(milliseconds): + """Sleep the specified amount of milliseconds.""" + time.sleep(milliseconds / 1000.0) + + +def usleep(microseconds): + """Sleep the specified amount of microseconds.""" + time.sleep(microseconds / 1000000.0) + + +def sliding_window(seq, lookahead): + """ + Create a sliding window with the specified number of lookahead characters. + """ + it = itertools.chain(iter(seq), ' ' * lookahead) # Padded iterator + window_size = lookahead + 1 + result = tuple(itertools.islice(it, window_size)) + if len(result) == window_size: + yield result + for elem in it: + result = result[1:] + (elem,) + yield result diff --git a/case_study/RPLCD-1.0.0/RPLCD/compat.py b/case_study/RPLCD-1.0.0/RPLCD/compat.py new file mode 100755 index 0000000..f899603 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/compat.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + + +# # # PYTHON 3 COMPAT # # # + +try: + range = xrange +except NameError: + range = range diff --git a/case_study/RPLCD-1.0.0/RPLCD/contextmanagers.py b/case_study/RPLCD-1.0.0/RPLCD/contextmanagers.py new file mode 100755 index 0000000..7d5556c --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/contextmanagers.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +import warnings +from contextlib import contextmanager + + +@contextmanager +def cursor(lcd, row, col): + """ + Context manager to control cursor position. DEPRECATED. + """ + warnings.warn('The `cursor` context manager is deprecated', DeprecationWarning) + lcd.cursor_pos = (row, col) + yield + + +@contextmanager +def cleared(lcd): + """ + Context manager to clear display before writing. DEPRECATED. + """ + warnings.warn('The `cursor` context manager is deprecated', DeprecationWarning) + lcd.clear() + yield diff --git a/case_study/RPLCD-1.0.0/RPLCD/gpio.py b/case_study/RPLCD-1.0.0/RPLCD/gpio.py new file mode 100755 index 0000000..0ee4beb --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/gpio.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +from collections import namedtuple + +import RPi.GPIO as GPIO + +from . import common as c +from .lcd import BaseCharLCD +from .compat import range + + +PinConfig = namedtuple('PinConfig', 'rs rw e d0 d1 d2 d3 d4 d5 d6 d7 backlight mode') + + +class CharLCD(BaseCharLCD): + def __init__(self, numbering_mode=None, pin_rs=None, pin_rw=None, pin_e=None, pins_data=None, + pin_backlight=None, backlight_mode='active_low', + backlight_enabled=True, + cols=20, rows=4, dotsize=8, + charmap='A02', + auto_linebreaks=True): + """ + Character LCD controller. + + The default pin numbers are based on the BOARD numbering scheme (1-26). + + You can save 1 pin by not using RW. Set ``pin_rw`` to ``None`` if you + want this. + + :param pin_rs: Pin for register select (RS). Default: ``15``. + :type pin_rs: int + :param pin_rw: Pin for selecting read or write mode (R/W). Set this to + ``None`` for read only mode. Default: ``18``. + :type pin_rw: int + :param pin_e: Pin to start data read or write (E). Default: ``16``. + :type pin_e: int + :param pins_data: List of data bus pins in 8 bit mode (DB0-DB7) or in 4 + bit mode (DB4-DB7) in ascending order. Default: ``[21, 22, 23, 24]``. + :type pins_data: list of int + :param pin_backlight: Pin for controlling backlight on/off. Set this to + ``None`` for no backlight control. Default: ``None``. + :type pin_backlight: int + :param backlight_mode: Set this to either ``active_high`` or ``active_low`` + to configure the operating control for the backlight. Has no effect if + pin_backlight is ``None`` + :type backlight_mode: str + :param backlight_enabled: Whether the backlight is enabled initially. + Default: ``True``. Has no effect if pin_backlight is ``None`` + :type backlight_enabled: bool + :param numbering_mode: Which scheme to use for numbering of the GPIO pins, + either ``GPIO.BOARD`` or ``GPIO.BCM``. Default: ``GPIO.BOARD`` (1-26). + :type numbering_mode: int + :param rows: Number of display rows (usually 1, 2 or 4). Default: ``4``. + :type rows: int + :param cols: Number of columns per row (usually 16 or 20). Default ``20``. + :type cols: int + :param dotsize: Some 1 line displays allow a font height of 10px. + Allowed: ``8`` or ``10``. Default: ``8``. + :type dotsize: int + :param charmap: The character map used. Depends on your LCD. This must + be either ``A00`` or ``A02``. Default: ``A02``. + :type charmap: str + :param auto_linebreaks: Whether or not to automatically insert line + breaks. Default: ``True``. + :type auto_linebreaks: bool + + """ + # Set attributes + if numbering_mode == GPIO.BCM or numbering_mode == GPIO.BOARD: + self.numbering_mode = numbering_mode + else: + raise ValueError('Invalid GPIO numbering mode: numbering_mode=%s, ' + 'must be either GPIO.BOARD or GPIO.BCM' % numbering_mode) + if pin_rs is None: + raise ValueError('pin_rs is not defined.') + if pin_e is None: + raise ValueError('pin_e is not defined.') + + if len(pins_data) == 4: # 4 bit mode + self.data_bus_mode = c.LCD_4BITMODE + block1 = [None] * 4 + elif len(pins_data) == 8: # 8 bit mode + self.data_bus_mode = c.LCD_8BITMODE + block1 = pins_data[:4] + else: + raise ValueError('There should be exactly 4 or 8 data pins.') + block2 = pins_data[-4:] + self.pins = PinConfig(rs=pin_rs, rw=pin_rw, e=pin_e, + d0=block1[0], d1=block1[1], d2=block1[2], d3=block1[3], + d4=block2[0], d5=block2[1], d6=block2[2], d7=block2[3], + backlight=pin_backlight, + mode=numbering_mode) + self.backlight_mode = backlight_mode + + # Call superclass + super(CharLCD, self).__init__(cols, rows, dotsize, + charmap=charmap, + auto_linebreaks=auto_linebreaks) + + # Set backlight status + if pin_backlight is not None: + self.backlight_enabled = backlight_enabled + + def _init_connection(self): + # Setup GPIO + GPIO.setmode(self.numbering_mode) + for pin in list(filter(None, self.pins))[:-1]: + GPIO.setup(pin, GPIO.OUT) + if self.pins.backlight is not None: + GPIO.setup(self.pins.backlight, GPIO.OUT) + + # Initialization + c.msleep(50) + GPIO.output(self.pins.rs, 0) + GPIO.output(self.pins.e, 0) + if self.pins.rw is not None: + GPIO.output(self.pins.rw, 0) + + def _close_connection(self): + GPIO.cleanup() + + # Properties + + def _get_backlight_enabled(self): + # We could probably read the current GPIO output state via sysfs, but + # for now let's just store the state in the class + if self.pins.backlight is None: + raise ValueError('You did not configure a GPIO pin for backlight control!') + return bool(self._backlight_enabled) + + def _set_backlight_enabled(self, value): + if self.pins.backlight is None: + raise ValueError('You did not configure a GPIO pin for backlight control!') + if not isinstance(value, bool): + raise ValueError('backlight_enabled must be set to ``True`` or ``False``.') + self._backlight_enabled = value + GPIO.output(self.pins.backlight,value ^ (self.backlight_mode == 'active_low')) + + backlight_enabled = property(_get_backlight_enabled, _set_backlight_enabled, + doc='Whether or not to turn on the backlight.') + + # Low level commands + + def _send(self, value, mode): + """Send the specified value to the display with automatic 4bit / 8bit + selection. The rs_mode is either ``RS_DATA`` or ``RS_INSTRUCTION``.""" + + # Choose instruction or data mode + GPIO.output(self.pins.rs, mode) + + # If the RW pin is used, set it to low in order to write. + if self.pins.rw is not None: + GPIO.output(self.pins.rw, 0) + + # Write data out in chunks of 4 or 8 bit + if self.data_bus_mode == c.LCD_8BITMODE: + self._write8bits(value) + else: + self._write4bits(value >> 4) + self._write4bits(value) + + def _send_data(self, value): + """Send data to the display. """ + self._send(value, c.RS_DATA) + + def _send_instruction(self, value): + """Send instruction to the display. """ + self._send(value, c.RS_INSTRUCTION) + + def _write4bits(self, value): + """Write 4 bits of data into the data bus.""" + for i in range(4): + bit = (value >> i) & 0x01 + GPIO.output(self.pins[i + 7], bit) + self._pulse_enable() + + def _write8bits(self, value): + """Write 8 bits of data into the data bus.""" + for i in range(8): + bit = (value >> i) & 0x01 + GPIO.output(self.pins[i + 3], bit) + self._pulse_enable() + + def _pulse_enable(self): + """Pulse the `enable` flag to process data.""" + GPIO.output(self.pins.e, 0) + c.usleep(1) + GPIO.output(self.pins.e, 1) + c.usleep(1) + GPIO.output(self.pins.e, 0) + c.usleep(100) # commands need > 37us to settle diff --git a/case_study/RPLCD-1.0.0/RPLCD/i2c.py b/case_study/RPLCD-1.0.0/RPLCD/i2c.py new file mode 100755 index 0000000..1c447cc --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/i2c.py @@ -0,0 +1,267 @@ +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +from smbus import SMBus + +from . import common as c +from .lcd import BaseCharLCD + +# PCF8574 backlight control +PCF8574_BACKLIGHT = 0x08 +PCF8574_NOBACKLIGHT = 0x00 + +# PCF8574 Pin bitmasks +PCF8574_E = 0x4 +PIN_READ_WRITE = 0x2 # Not used? +PIN_REGISTER_SELECT = 0x1 # Not used? + +# MCP230XX backlight control +MCP230XX_BACKLIGHT = 0x80 +MCP230XX_NOBACKLIGHT = 0x7f + +# MCP230XX pin bitmasks and datamask +MCP230XX_RS = 0x02 +MCP230XX_E = 0x4 +MCP230XX_DATAMASK = 0x78 +MCP230XX_DATASHIFT = 3 + +# MCP23008 Register addresses +MCP23008_IODIR = 0x00 +MCP23008_GPIO = 0x09 + +# MCP23017 Register addresses +MCP23017_IODIRA = 0x00 +MCP23017_IODIRB = 0x01 +MCP23017_GPIOA = 0x12 +MCP23017_GPIOB = 0x13 + + +class CharLCD(BaseCharLCD): + def __init__(self, i2c_expander, address, expander_params=None, port=1, + cols=20, rows=4, dotsize=8, + charmap='A02', + auto_linebreaks=True, + backlight_enabled=True): + """ + CharLCD via PCF8574 I2C port expander: + + Pin mapping:: + + 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 + D7 | D6 | D5 | D4 | BL | EN | RW | RS + + + CharLCD via MCP23008 and MCP23017 I2C port expanders: + + Adafruit I2C/SPI LCD Backback is supported. + + Warning: You might need a level shifter (that supports i2c) + between the SCL/SDA connections on the MCP chip / backpack and the Raspberry Pi. + Or you might damage the Pi and possibly any other 3.3V i2c devices + connected on the i2c bus. Or cause reliability issues. The SCL/SDA are rated 0.7*VDD + on the MCP23008, so it needs 3.5V on the SCL/SDA when 5V is applied to drive the LCD. + + The MCP23008 and MCP23017 needs to be connected exactly the same way as the backpack. + + For complete schematics see the adafruit page at: + https://learn.adafruit.com/i2c-spi-lcd-backpack/ + + 4-bit operation. I2C only supported. + + Pin mapping:: + + 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 + BL | D7 | D6 | D5 | D4 | E | RS | - + + + :param address: The I2C address of your LCD. + :type address: int + :param i2c_expander: Set your I²C chip type. Supported: "PCF8574", "MCP23008", "MCP23017". + :type i2c_expander: string + :param expander_params: Parameters for expanders, in a dictionary. Only needed for MCP23017 + gpio_bank - This must be either ``A`` or ``B`` + If you have a HAT, A is usually marked 1 and B is 2 + Example: expander_params={'gpio_bank': 'A'} + :type expander_params: dictionary + :param port: The I2C port number. Default: ``1``. + :type port: int + :param cols: Number of columns per row (usually 16 or 20). Default: ``20``. + :type cols: int + :param rows: Number of display rows (usually 1, 2 or 4). Default: ``4``. + :type rows: int + :param dotsize: Some 1 line displays allow a font height of 10px. + Allowed: 8 or 10. Default: ``8``. + :type dotsize: int + :param charmap: The character map used. Depends on your LCD. This must + be either ``A00`` or ``A02``. Default: ``A02``. + :type charmap: str + :param auto_linebreaks: Whether or not to automatically insert line breaks. + Default: ``True``. + :type auto_linebreaks: bool + :param backlight_enabled: Whether the backlight is enabled initially. Default: ``True``. + :type backlight_enabled: bool + + """ + # Set own address and port. + self._address = address + self._port = port + + # Set i2c expander, 'PCF8574', 'MCP23008' and 'MCP23017' are supported. + if i2c_expander in ['PCF8574', 'MCP23008', 'MCP23017']: + self._i2c_expander = i2c_expander + else: + raise NotImplementedError('I2C expander "%s" is not supported.' % i2c_expander) + + # Errorchecking for expander parameters + if expander_params is None: + if self._i2c_expander == 'MCP23017': + raise ValueError('MCP23017: expander_params[\'gpio_bank\'] is not defined, ' + 'must be either \'A\' or \'B\'') + else: + self._expander_params = {} + else: + if self._i2c_expander == 'MCP23017': + if expander_params['gpio_bank'] in ['A', 'B']: + self._expander_params = {} + self._expander_params['gpio_bank'] = expander_params['gpio_bank'] + else: + raise ValueError('MCP23017: expander_params[\'gpio_bank\'] is \'%s\', ' + 'must be either \'A\' or \'B\'' % expander_params['gpio_bank']) + + # Currently the I2C mode only supports 4 bit communication + self.data_bus_mode = c.LCD_4BITMODE + + # Set backlight status + if self._i2c_expander == 'PCF8574': + self._backlight = PCF8574_BACKLIGHT if backlight_enabled else PCF8574_NOBACKLIGHT + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + self._backlight = MCP230XX_BACKLIGHT if backlight_enabled else MCP230XX_NOBACKLIGHT + + # Call superclass + super(CharLCD, self).__init__(cols, rows, dotsize, + charmap=charmap, + auto_linebreaks=auto_linebreaks) + # Refresh backlight status + self.backlight_enabled = backlight_enabled + + def _init_connection(self): + self.bus = SMBus(self._port) + + if self._i2c_expander == 'PCF8574': + c.msleep(50) + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + # Variable for storing data and applying bitmasks and shifting. + self._mcp_data = 0 + + # Set iodir register value according to expander + # If using MCP23017 set which gpio bank to use, A or B + if self._i2c_expander == 'MCP23008': + IODIR = MCP23008_IODIR + self._mcp_gpio = MCP23008_GPIO + elif self._i2c_expander == 'MCP23017': + # Set gpio bank A or B + if self._expander_params['gpio_bank'] == 'A': + IODIR = MCP23017_IODIRA + self._mcp_gpio = MCP23017_GPIOA + elif self._expander_params['gpio_bank'] == 'B': + IODIR = MCP23017_IODIRB + self._mcp_gpio = MCP23017_GPIOB + + # Set IO DIRection to output on all GPIOs (GP0-GP7) + self.bus.write_byte_data(self._address, IODIR, 0x00) + + def _close_connection(self): + # Nothing to do here? + pass + + # Properties + + def _get_backlight_enabled(self): + if self._i2c_expander == 'PCF8574': + return self._backlight == PCF8574_BACKLIGHT + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + return self._backlight == MCP230XX_BACKLIGHT + + def _set_backlight_enabled(self, value): + if self._i2c_expander == 'PCF8574': + self._backlight = PCF8574_BACKLIGHT if value else PCF8574_NOBACKLIGHT + self.bus.write_byte(self._address, self._backlight) + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + if value is True: + self._mcp_data |= MCP230XX_BACKLIGHT + else: + self._mcp_data &= MCP230XX_NOBACKLIGHT + self.bus.write_byte_data(self._address, self._mcp_gpio, self._mcp_data) + + backlight_enabled = property(_get_backlight_enabled, _set_backlight_enabled, + doc='Whether or not to enable the backlight. Either ``True`` or ``False``.') + + # Low level commands + + def _send_data(self, value): + if self._i2c_expander == 'PCF8574': + self.bus.write_byte(self._address, (c.RS_DATA | (value & 0xF0)) | self._backlight) + self._pulse_data(c.RS_DATA | (value & 0xF0)) + self.bus.write_byte(self._address, (c.RS_DATA | + ((value << 4) & 0xF0)) | self._backlight) + self._pulse_data(c.RS_DATA | ((value << 4) & 0xF0)) + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + self._mcp_data |= MCP230XX_RS + self._pulse_data(value >> 4) + self._pulse_data(value & 0x0F) + + def _send_instruction(self, value): + if self._i2c_expander == 'PCF8574': + self.bus.write_byte(self._address, (c.RS_INSTRUCTION | + (value & 0xF0)) | self._backlight) + self._pulse_data(c.RS_INSTRUCTION | (value & 0xF0)) + self.bus.write_byte(self._address, (c.RS_INSTRUCTION | + ((value << 4) & 0xF0)) | self._backlight) + self._pulse_data(c.RS_INSTRUCTION | ((value << 4) & 0xF0)) + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + self._mcp_data &= ~MCP230XX_RS + self._pulse_data(value >> 4) + self._pulse_data(value & 0x0F) + + def _pulse_data(self, value): + """Pulse the `enable` flag to process value.""" + if self._i2c_expander == 'PCF8574': + self.bus.write_byte(self._address, ((value & ~PCF8574_E) | self._backlight)) + c.usleep(1) + self.bus.write_byte(self._address, value | PCF8574_E | self._backlight) + c.usleep(1) + self.bus.write_byte(self._address, ((value & ~PCF8574_E) | self._backlight)) + c.usleep(100) + elif self._i2c_expander in ['MCP23008', 'MCP23017']: + self._mcp_data &= ~MCP230XX_DATAMASK + self._mcp_data |= value << MCP230XX_DATASHIFT + self._mcp_data &= ~MCP230XX_E + self.bus.write_byte_data(self._address, self._mcp_gpio, self._mcp_data) + c.usleep(1) + self._mcp_data |= MCP230XX_E + self.bus.write_byte_data(self._address, self._mcp_gpio, self._mcp_data) + c.usleep(1) + self._mcp_data &= ~MCP230XX_E + self.bus.write_byte_data(self._address, self._mcp_gpio, self._mcp_data) + c.usleep(100) diff --git a/case_study/RPLCD-1.0.0/RPLCD/lcd.py b/case_study/RPLCD-1.0.0/RPLCD/lcd.py new file mode 100755 index 0000000..0c34784 --- /dev/null +++ b/case_study/RPLCD-1.0.0/RPLCD/lcd.py @@ -0,0 +1,444 @@ +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +from collections import namedtuple + +from . import codecs +from . import common as c +from .compat import range + + +LCDConfig = namedtuple('LCDConfig', 'rows cols dotsize') + + +# # # MAIN # # # + +class BaseCharLCD(object): + + # Init, setup, teardown + + def __init__(self, cols=20, rows=4, dotsize=8, charmap='A02', auto_linebreaks=True): + """ + Character LCD controller. Base class only, you should use a subclass. + + Args: + cols: + Number of columns per row (usually 16 or 20). Default 20. + rows: + Number of display rows (usually 1, 2 or 4). Default: 4. + dotsize: + Some 1 line displays allow a font height of 10px. + Allowed: 8 or 10. Default: 8. + charmap: + The character map used. Depends on your LCD. This must be + either ``A00`` or ``A02``. Default: ``A02``. + auto_linebreaks: + Whether or not to automatically insert line breaks. + Default: True. + + """ + assert dotsize in [8, 10], 'The ``dotsize`` argument should be either 8 or 10.' + + # Initialize codec + if charmap == 'A00': + self.codec = codecs.A00Codec() + elif charmap == 'A02': + self.codec = codecs.A02Codec() + pass + else: + raise ValueError('The ``charmap`` argument must be either ``A00`` or ``A02``') + + # LCD configuration + self.lcd = LCDConfig(rows=rows, cols=cols, dotsize=dotsize) + + # Setup initial display configuration + displayfunction = self.data_bus_mode | c.LCD_5x8DOTS + if rows == 1: + displayfunction |= c.LCD_1LINE + elif rows in [2, 4]: + # LCD only uses two lines on 4 row displays + displayfunction |= c.LCD_2LINE + if dotsize == 10: + # For some 1 line displays you can select a 10px font. + displayfunction |= c.LCD_5x10DOTS + + # Create content cache + self._content = [[0x20] * cols for _ in range(rows)] + + # Set up auto linebreaks + self.auto_linebreaks = auto_linebreaks + self.recent_auto_linebreak = False + + # Initialize display + self._init_connection() + + # Choose 4 or 8 bit mode + if self.data_bus_mode == c.LCD_4BITMODE: + # Hitachi manual page 46 + self.command(0x03) + c.msleep(4.5) + self.command(0x03) + c.msleep(4.5) + self.command(0x03) + c.usleep(100) + self.command(0x02) + elif self.data_bus_mode == c.LCD_8BITMODE: + # Hitachi manual page 45 + self.command(0x30) + c.msleep(4.5) + self.command(0x30) + c.usleep(100) + self.command(0x30) + else: + raise ValueError('Invalid data bus mode: {}'.format(self.data_bus_mode)) + + # Write configuration to display + self.command(c.LCD_FUNCTIONSET | displayfunction) + c.usleep(50) + + # Configure display mode + self._display_mode = c.LCD_DISPLAYON + self._cursor_mode = c.CursorMode.hide + self.command(c.LCD_DISPLAYCONTROL | self._display_mode | self._cursor_mode) + c.usleep(50) + + # Clear display + self.clear() + + # Configure entry mode + self._text_align_mode = c.Alignment.left + self._display_shift_mode = c.ShiftMode.cursor + self._cursor_pos = (0, 0) + self.command(c.LCD_ENTRYMODESET | self._text_align_mode | self._display_shift_mode) + c.usleep(50) + + def close(self, clear=False): + if clear: + self.clear() + self._close_connection() + + # Properties + + def _get_cursor_pos(self): + return self._cursor_pos + + def _set_cursor_pos(self, value): + if not hasattr(value, '__getitem__') or len(value) != 2: + raise ValueError('Cursor position should be determined by a 2-tuple.') + if value[0] not in range(self.lcd.rows) or value[1] not in range(self.lcd.cols): + msg = 'Cursor position {pos!r} invalid on a {lcd.rows}x{lcd.cols} LCD.' + raise ValueError(msg.format(pos=value, lcd=self.lcd)) + row_offsets = [0x00, 0x40, self.lcd.cols, 0x40 + self.lcd.cols] + self._cursor_pos = value + self.command(c.LCD_SETDDRAMADDR | row_offsets[value[0]] + value[1]) + c.usleep(50) + + cursor_pos = property(_get_cursor_pos, _set_cursor_pos, + doc='The cursor position as a 2-tuple (row, col).') + + def _get_text_align_mode(self): + if self._text_align_mode == c.Alignment.left: + return 'left' + elif self._text_align_mode == c.Alignment.right: + return 'right' + else: + raise ValueError('Internal _text_align_mode has invalid value.') + + def _set_text_align_mode(self, value): + if value == 'left': + self._text_align_mode = c.Alignment.left + elif value == 'right': + self._text_align_mode = c.Alignment.right + else: + raise ValueError('Text align mode must be either `left` or `right`') + self.command(c.LCD_ENTRYMODESET | self._text_align_mode | self._display_shift_mode) + c.usleep(50) + + text_align_mode = property(_get_text_align_mode, _set_text_align_mode, + doc='The text alignment (``left`` or ``right``).') + + def _get_write_shift_mode(self): + if self._display_shift_mode == c.ShiftMode.cursor: + return 'cursor' + elif self._display_shift_mode == c.ShiftMode.display: + return 'display' + else: + raise ValueError('Internal _display_shift_mode has invalid value.') + + def _set_write_shift_mode(self, value): + if value == 'cursor': + self._display_shift_mode = c.ShiftMode.cursor + elif value == 'display': + self._display_shift_mode = c.ShiftMode.display + else: + raise ValueError('Write shift mode must be either `cursor` or `display`.') + self.command(c.LCD_ENTRYMODESET | self._text_align_mode | self._display_shift_mode) + c.usleep(50) + + write_shift_mode = property(_get_write_shift_mode, _set_write_shift_mode, + doc='The shift mode when writing (``cursor`` or ``display``).') + + def _get_display_enabled(self): + return self._display_mode == c.LCD_DISPLAYON + + def _set_display_enabled(self, value): + self._display_mode = c.LCD_DISPLAYON if value else c.LCD_DISPLAYOFF + self.command(c.LCD_DISPLAYCONTROL | self._display_mode | self._cursor_mode) + c.usleep(50) + + display_enabled = property(_get_display_enabled, _set_display_enabled, + doc='Whether or not to display any characters.') + + def _get_cursor_mode(self): + if self._cursor_mode == c.CursorMode.hide: + return 'hide' + elif self._cursor_mode == c.CursorMode.line: + return 'line' + elif self._cursor_mode == c.CursorMode.blink: + return 'blink' + else: + raise ValueError('Internal _cursor_mode has invalid value.') + + def _set_cursor_mode(self, value): + if value == 'hide': + self._cursor_mode = c.CursorMode.hide + elif value == 'line': + self._cursor_mode = c.CursorMode.line + elif value == 'blink': + self._cursor_mode = c.CursorMode.blink + else: + raise ValueError('Cursor mode must be one of `hide`, `line` or `blink`.') + self.command(c.LCD_DISPLAYCONTROL | self._display_mode | self._cursor_mode) + c.usleep(50) + + cursor_mode = property(_get_cursor_mode, _set_cursor_mode, + doc='How the cursor should behave (``hide``, ``line`` or ``blink``).') + + # High level commands + + def write_string(self, value): + """ + Write the specified unicode string to the display. + + To control multiline behavior, use newline (``\\n``) and carriage + return (``\\r``) characters. + + Lines that are too long automatically continue on next line, as long as + ``auto_linebreaks`` has not been disabled. + + Make sure that you're only passing unicode objects to this function. + The unicode string is then converted to the correct LCD encoding by + using the charmap specified at instantiation time. + + If you're dealing with bytestrings (the default string type in Python + 2), convert it to a unicode object using the ``.decode(encoding)`` + method and the appropriate encoding. Example for UTF-8 encoded strings: + + .. code:: + + >>> bstring = 'Temperature: 30°C' + >>> bstring + 'Temperature: 30\xc2\xb0C' + >>> bstring.decode('utf-8') + u'Temperature: 30\xb0C' + + """ + encoded = self.codec.encode(value) # type: List[int] + ignored = False + + for [char, lookahead] in c.sliding_window(encoded, lookahead=1): + + # If the previous character has been ignored, skip this one too. + if ignored is True: + ignored = False + continue + + # Write regular chars + if char not in [codecs.CR, codecs.LF]: + self.write(char) + continue + + # We're now left with only CR and LF characters. If an auto + # linebreak happened recently, and the lookahead matches too, + # ignore this write. + if self.recent_auto_linebreak is True: + crlf = (char == codecs.CR and lookahead == codecs.LF) + lfcr = (char == codecs.LF and lookahead == codecs.CR) + if crlf or lfcr: + ignored = True + continue + + # Handle newlines and carriage returns + row, col = self.cursor_pos + if char == codecs.LF: + if row < self.lcd.rows - 1: + self.cursor_pos = (row + 1, col) + else: + self.cursor_pos = (0, col) + elif char == codecs.CR: + if self.text_align_mode == 'left': + self.cursor_pos = (row, 0) + else: + self.cursor_pos = (row, self.lcd.cols - 1) + + def clear(self): + """Overwrite display with blank characters and reset cursor position.""" + self.command(c.LCD_CLEARDISPLAY) + self._cursor_pos = (0, 0) + self._content = [[0x20] * self.lcd.cols for _ in range(self.lcd.rows)] + c.msleep(2) + + def home(self): + """Set cursor to initial position and reset any shifting.""" + self.command(c.LCD_RETURNHOME) + self._cursor_pos = (0, 0) + c.msleep(2) + + def shift_display(self, amount): + """Shift the display. Use negative amounts to shift left and positive + amounts to shift right.""" + if amount == 0: + return + direction = c.LCD_MOVERIGHT if amount > 0 else c.LCD_MOVELEFT + for i in range(abs(amount)): + self.command(c.LCD_CURSORSHIFT | c.LCD_DISPLAYMOVE | direction) + c.usleep(50) + + def create_char(self, location, bitmap): + """Create a new character. + + The HD44780 supports up to 8 custom characters (location 0-7). + + :param location: The place in memory where the character is stored. + Values need to be integers between 0 and 7. + :type location: int + :param bitmap: The bitmap containing the character. This should be a + tuple of 8 numbers, each representing a 5 pixel row. + :type bitmap: tuple of int + :raises AssertionError: Raised when an invalid location is passed in or + when bitmap has an incorrect size. + + Example: + + .. sourcecode:: python + + >>> smiley = ( + ... 0b00000, + ... 0b01010, + ... 0b01010, + ... 0b00000, + ... 0b10001, + ... 0b10001, + ... 0b01110, + ... 0b00000, + ... ) + >>> lcd.create_char(0, smiley) + + """ + assert 0 <= location <= 7, 'Only locations 0-7 are valid.' + assert len(bitmap) == 8, 'Bitmap should have exactly 8 rows.' + + # Store previous position + pos = self.cursor_pos + + # Write character to CGRAM + self.command(c.LCD_SETCGRAMADDR | location << 3) + for row in bitmap: + self._send_data(row) + + # Restore cursor pos + self.cursor_pos = pos + + # Mid level commands + + def command(self, value): + """Send a raw command to the LCD.""" + self._send_instruction(value) + + def write(self, value): # type: (int) -> None + """Write a raw byte to the LCD.""" + + # Get current position + row, col = self._cursor_pos + + # Write byte if changed + try: + if self._content[row][col] != value: + self._send_data(value) + self._content[row][col] = value # Update content cache + unchanged = False + else: + unchanged = True + except IndexError as e: + # Position out of range + if self.auto_linebreaks is True: + raise e + self._send_data(value) + unchanged = False + + # Update cursor position. + if self.text_align_mode == 'left': + if self.auto_linebreaks is False or col < self.lcd.cols - 1: + # No newline, update internal pointer + newpos = (row, col + 1) + if unchanged: + self.cursor_pos = newpos + else: + self._cursor_pos = newpos + self.recent_auto_linebreak = False + else: + # Newline, reset pointer + if row < self.lcd.rows - 1: + self.cursor_pos = (row + 1, 0) + else: + self.cursor_pos = (0, 0) + self.recent_auto_linebreak = True + else: + if self.auto_linebreaks is False or col > 0: + # No newline, update internal pointer + newpos = (row, col - 1) + if unchanged: + self.cursor_pos = newpos + else: + self._cursor_pos = newpos + self.recent_auto_linebreak = False + else: + # Newline, reset pointer + if row < self.lcd.rows - 1: + self.cursor_pos = (row + 1, self.lcd.cols - 1) + else: + self.cursor_pos = (0, self.lcd.cols - 1) + self.recent_auto_linebreak = True + + def cr(self): # type: () -> None + """Write a carriage return (``\\r``) character to the LCD.""" + self.write_string('\r') + + def lf(self): # type: () -> None + """Write a line feed (``\\n``) character to the LCD.""" + self.write_string('\n') + + def crlf(self): # type: () -> None + """Write a line feed and a carriage return (``\\r\\n``) character to the LCD.""" + self.write_string('\r\n') diff --git a/case_study/RPLCD-1.0.0/docs/.gitignore b/case_study/RPLCD-1.0.0/docs/.gitignore new file mode 100755 index 0000000..69fa449 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/.gitignore @@ -0,0 +1 @@ +_build/ diff --git a/case_study/RPLCD-1.0.0/docs/Makefile b/case_study/RPLCD-1.0.0/docs/Makefile new file mode 100755 index 0000000..f22f582 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/Makefile @@ -0,0 +1,186 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build +PDFLATEX = pdflatex +IMCONVERT = convert + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " latex to build wiring illustrations" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/RPLCD.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/RPLCD.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/RPLCD" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/RPLCD" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." + +latex: + $(PDFLATEX) wiring-i2c.tex + $(IMCONVERT) -density 400 wiring-i2c.pdf -resize 500x500 -background white -alpha remove -bordercolor white -border 5 _static/wiring-i2c.png + $(PDFLATEX) wiring-gpio.tex + $(IMCONVERT) -density 400 wiring-gpio.pdf -resize 500x500 -background white -alpha remove -bordercolor white -border 5 _static/wiring-gpio.png diff --git a/case_study/RPLCD-1.0.0/docs/_static/i2c-lcd.jpg b/case_study/RPLCD-1.0.0/docs/_static/i2c-lcd.jpg new file mode 100755 index 0000000..20bcb22 Binary files /dev/null and b/case_study/RPLCD-1.0.0/docs/_static/i2c-lcd.jpg differ diff --git a/case_study/RPLCD-1.0.0/docs/_static/photo.jpg b/case_study/RPLCD-1.0.0/docs/_static/photo.jpg new file mode 100755 index 0000000..e535efd Binary files /dev/null and b/case_study/RPLCD-1.0.0/docs/_static/photo.jpg differ diff --git a/case_study/RPLCD-1.0.0/docs/_static/wiring-gpio.png b/case_study/RPLCD-1.0.0/docs/_static/wiring-gpio.png new file mode 100755 index 0000000..aaf61c7 Binary files /dev/null and b/case_study/RPLCD-1.0.0/docs/_static/wiring-gpio.png differ diff --git a/case_study/RPLCD-1.0.0/docs/_static/wiring-i2c.png b/case_study/RPLCD-1.0.0/docs/_static/wiring-i2c.png new file mode 100755 index 0000000..80e225f Binary files /dev/null and b/case_study/RPLCD-1.0.0/docs/_static/wiring-i2c.png differ diff --git a/case_study/RPLCD-1.0.0/docs/api.rst b/case_study/RPLCD-1.0.0/docs/api.rst new file mode 100755 index 0000000..40a3448 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/api.rst @@ -0,0 +1,16 @@ +API +### + +CharLCD (I²C) +============== + +The main class for controlling I²C connected LCDs. + +.. autoclass:: RPLCD.i2c.CharLCD + +CharLCD (GPIO) +============== + +The main class for controlling GPIO (parallel) connected LCDs. + +.. autoclass:: RPLCD.gpio.CharLCD diff --git a/case_study/RPLCD-1.0.0/docs/conf.py b/case_study/RPLCD-1.0.0/docs/conf.py new file mode 100755 index 0000000..7bf384e --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/conf.py @@ -0,0 +1,277 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# RPLCD documentation build configuration file, created by +# sphinx-quickstart on Sun Apr 20 23:09:39 2014. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys +import mock +import os +import sphinx_rtd_theme + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('..')) + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.coverage', + 'sphinx.ext.viewcode', + 'sphinx.ext.intersphinx', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'RPLCD' +copyright = '2013-2017, Danilo Bargen' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '1.0' +# The full version, including alpha/beta/rc tags. +release = '1.0.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all +# documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +# If true, keep warnings as "system message" paragraphs in the built documents. +#keep_warnings = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'sphinx_rtd_theme' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Add any extra paths that contain custom files (such as robots.txt or +# .htaccess) here, relative to this directory. These files are copied +# directly to the root of the documentation. +#html_extra_path = [] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'RPLCDdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ('index', 'RPLCD.tex', 'RPLCD Documentation', + 'Danilo Bargen', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'rplcd', 'RPLCD Documentation', + ['Danilo Bargen'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'RPLCD', 'RPLCD Documentation', + 'Danilo Bargen', 'RPLCD', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# If true, do not generate a @detailmenu in the "Top" node's menu. +#texinfo_no_detailmenu = False + +sys.modules['RPi'] = mock.Mock() +sys.modules['RPi.GPIO'] = mock.Mock() + +autodoc_default_flags = ['members', 'inherited-members', 'undoc-members'] +autoclass_content = 'init' + +intersphinx_mapping = { + 'python': ('https://docs.python.org/3', None), + 'python2': ('https://docs.python.org/2.7', None), +} diff --git a/case_study/RPLCD-1.0.0/docs/getting_started.rst b/case_study/RPLCD-1.0.0/docs/getting_started.rst new file mode 100755 index 0000000..d653d00 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/getting_started.rst @@ -0,0 +1,160 @@ +.. _getting-started: + +Getting Started +############### + +After you've :doc:`installed ` RPLCD, you need two more steps to +get started: Correct wiring and importing the library. + + +Wiring +====== + +Via I²C +~~~~~~~ + +The wiring is much simpler if you have a LCD module with I²C support. These +boards usually have a "backpack board" and look similar to this: + +.. image:: _static/i2c-lcd.jpg + :alt: LCD with I²C port expander + +The board on this photo has a PCF8574 port expander chip on it. There are also +boards with other chips, e.g. the Adafruit I²C/SPI LCD Backpack which uses an +MCP23008 port expander. + +First, connect the pins on the right with the Raspberry Pi: + +- GND: Pin 6 (GND) +- VCC: Pin 4 (5V) +- SDA: Pin 3 (SDA) +- SCL: Pin 5 (SCL) + +To make things clearer, here's a little visualization: + +.. image:: _static/wiring-i2c.png + :alt: LCD wiring (I²C) + + +Via GPIO +~~~~~~~~ + +If you don't have an I²C version of the board, you can also connect the LCD +Pins directly to the GPIO header of the Raspberry Pi. + +If you don't know how to wire up the LCD to the Raspberry Pi, you could use this +example wiring configuration in 4 bit mode (BOARD numbering scheme): + +- RS: 15 +- RW: 18 +- E: 16 +- Data 4-7: 21, 22, 23, 24 + +To make things clearer, here's a little visualization: + +.. image:: _static/wiring-gpio.png + :alt: LCD wiring (GPIO) + +After wiring up the data pins, you have to connect the voltage input for +controller and backlight, and set up the contrast circuit. As there are some +differences regarding the hardware between different modules, please refer to +the `Adafruit tutorial +`_ to learn +how to wire up these circuits. + + +Initializing the LCD +==================== + +Setup: I²C +~~~~~~~~~~ + +First, import the RPLCD library from your Python script. + +.. sourcecode:: python + + from RPLCD.i2c import CharLCD + +Then create a new instance of the :class:`~RPLCD.i2c.CharLCD` class. For that, +you need to know the address of your LCD. You can find it on the command line +using the ``sudo i2cdetect 1`` command (or ``sudo i2cdetect 0`` on the original +Raspberry Pi). In my case the address of the display was ``0x27``. You also need +to provide the name of the I²C port expander that your board uses. It should be +written on the microchip that's soldered on to your board. Supported port +expanders are the ``PCF8574``, the ``MCP23008`` and the ``MCP23017``. + +.. sourcecode:: python + + lcd = CharLCD('PCF8574', 0x27) + +If you want to customize the way the LCD is instantiated (e.g. by changing the +number of columns and rows on your display or the I²C port), you can change the +corresponding parameters. Example: + +.. sourcecode:: python + + lcd = CharLCD(i2c_expander='PCF8574', address=0x27, port=1, + cols=20, rows=4, dotsize=8, + charmap='A02', + auto_linebreaks=True, + backlight_enabled=True) + +Setup: GPIO +~~~~~~~~~~~ + +First, import the RPLCD library from your Python script. + +.. sourcecode:: python + + from RPLCD.gpio import CharLCD + +Then create a new instance of the :class:`~RPLCD.gpio.CharLCD` class. If you +have a 20x4 LCD, you must at least specify the numbering mode and the pins you +used: + +.. sourcecode:: python + + lcd = CharLCD(pin_rs=15, pin_rw=18, pin_e=16, pins_data=[21, 22, 23, 24], + numbering_mode=GPIO.BOARD) + +If you want to customize the way the LCD is instantiated (e.g. by changing the +pin configuration or the number of columns and rows on your display), you can +change the corresponding parameters. Here's a full example: + +.. sourcecode:: python + + from RPi import GPIO + + lcd = CharLCD(pin_rs=15, pin_rw=18, pin_e=16, pins_data=[21, 22, 23, 24], + numbering_mode=GPIO.BOARD, + cols=20, rows=4, dotsize=8, + charmap='A02', + auto_linebreaks=True) + +Writing Data +~~~~~~~~~~~~ + +Now you can write a string to the LCD: + +.. sourcecode:: python + + lcd.write_string('Hello world') + +To clean the display, use the ``clear()`` method: + +.. sourcecode:: python + + lcd.clear() + +You can control line breaks with the newline (``\n``, moves down 1 line) and +carriage return (``\r``, moves to beginning of line) characters. + +.. sourcecode:: python + + lcd.write_string('Hello\r\n World!') + +And you can also set the cursor position directly: + +.. sourcecode:: python + + lcd.cursor_pos = (2, 0) diff --git a/case_study/RPLCD-1.0.0/docs/index.rst b/case_study/RPLCD-1.0.0/docs/index.rst new file mode 100755 index 0000000..2ea8d5e --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/index.rst @@ -0,0 +1,71 @@ +Welcome to RPLCD's documentation! +################################# + + +About +===== + +RPLCD is a Python 2/3 Raspberry PI Character LCD library for the Hitachi HD44780 +controller. It supports both GPIO (parallel) mode as well as boards with an I²C +port expander (e.g. the PCF8574 or the MCP23008). + +This library is inspired by Adafruit Industries' CharLCD_ library as well as by +Arduino's LiquidCrystal_ library. + +For GPIO mode, no external dependencies (except the ``RPi.GPIO`` library, which +comes preinstalled on Raspbian) are needed to use this library. If you want to +control LCDs via I²C, then you also need the ``python-smbus`` library. + + +Features +======== + +**Already implemented** + +- Simple to use API +- Support for both 4 bit and 8 bit modes +- Support for both parallel (GPIO) and I²C connection +- Support for custom characters +- Support for backlight control circuits +- Built-in support for ``A00`` and ``A02`` character tables +- Python 2/3 compatible +- Caching: Only write characters if they changed +- No external dependencies (except ``RPi.GPIO``, and ``python-smbus`` if you need + I²C support) + +**Wishlist** + +These things may get implemented in the future, depending on my free time and +motivation: + +- MicroPython port + +**Supported I²C Port Expanders** + +- PCF8574 (used by a lot of I²C LCD adapters on Ali Express) +- MCP23008 (used in Adafruit I²C LCD backpack) +- MCP23017 + + +Contents +======== + +.. toctree:: + :maxdepth: 2 + + installation.rst + getting_started.rst + usage.rst + api.rst + + +Indices and tables +################## + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + + +.. _charlcd: https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/tree/master/Adafruit_CharLCD +.. _liquidcrystal: http://arduino.cc/en/Reference/LiquidCrystal diff --git a/case_study/RPLCD-1.0.0/docs/installation.rst b/case_study/RPLCD-1.0.0/docs/installation.rst new file mode 100755 index 0000000..9300d52 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/installation.rst @@ -0,0 +1,24 @@ +Installation +############ + + +From PyPI +========= + +You can install RPLCD directly from `PyPI +`_ using pip:: + + $ sudo pip install RPLCD + +If you want to use I²C, you also need smbus:: + + $ sudo apt-get install python-smbus + + +Manual Installation +=================== + +You can also install the library manually without pip. Either just copy the +scripts to your working directory and import them, or download the repository +and run ``python setup.py install`` to install it into your Python package +directory. diff --git a/case_study/RPLCD-1.0.0/docs/requirements.txt b/case_study/RPLCD-1.0.0/docs/requirements.txt new file mode 100755 index 0000000..3bd5197 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/requirements.txt @@ -0,0 +1,5 @@ +Sphinx==1.5 +sphinx-rtd-theme==0.1.9 +RPi.GPIO==0.6.3 +mock==2.0.0 +smbus-cffi==0.5.1 diff --git a/case_study/RPLCD-1.0.0/docs/usage.rst b/case_study/RPLCD-1.0.0/docs/usage.rst new file mode 100755 index 0000000..1a84425 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/usage.rst @@ -0,0 +1,205 @@ +Usage +##### + +Make sure to read the :ref:`getting-started` section if you haven't done so yet. + +Writing To Display +================== + +Regular text can be written to the :class:`~RPLCD.i2c.CharLCD` instance using +the :meth:`~RPLCD.i2c.CharLCD.write_string` method. It accepts unicode strings +(``str`` in Python 3, ``unicode`` in Python 2). + +The cursor position can be set by assigning a ``(row, col)`` tuple to +:attr:`~RPLCD.i2c.CharLCD.cursor_pos`. It can be reset to the starting position +with :meth:`~RPLCD.i2c.CharLCD.home`. + +Line feed characters (``\n``) move down one line and carriage returns (``\r``) +move to the beginning of the current line. + +.. sourcecode:: python + + lcd.write_string('Raspberry Pi HD44780') + lcd.cursor_pos = (2, 0) + lcd.write_string('https://github.com/\n\rdbrgn/RPLCD') + +.. image:: _static/photo.jpg + :alt: Photo of 20x4 LCD in action + +You can also use the convenience functions ``cr()``, ``lf()`` and ``crlf()`` to +write line feed (``\n``) or carriage return (``\r``) characters to the display. + +.. sourcecode:: python + + lcd.write_string('Hello') + lcd.crlf() + lcd.write_string('world!') + +After your script has finished, you may want to close the connection and +optionally clear the screen with the :meth:`~RPLCD.gpio.CharLCD.close` method. + +.. sourcecode:: python + + lcd.close(clear=True) + +When using a GPIO based LCD, this will reset the GPIO configuration. Note that +doing this without clearing can lead to undesired effects on the LCD, because +the GPIO pins are floating (not configured as input or output anymore). + + +Clearing the Display +==================== + +You can clear the display by using the :meth:`~RPLCD.i2c.CharLCD.clear` method. It +will overwrite the data with blank characters and reset the cursor position. + +Alternatively, if you want to hide all characters but keep the data in the LCD +memory, set the :attr:`~RPLCD.i2c.CharLCD.display_enabled` property to ``False``. + + +Character Maps +============== + +RPLCD supports the two most commonly used character maps for HD44780 style +displays: A00 and A02. You can find them on pages 17 and 18 of `the datasheet +`_. + +The default character map is ``A02``. If you find that some of the characters +you are writing to the display turn out wrong, then try using the ``A00`` +character map: + +.. sourcecode:: python + + lcd = CharLCD(..., charmap='A00') + +As a rule of thumb, if your display can show Japanese characters, it uses +``A00``, otherwise ``A02``. To show the entire character map on your LCD, you +can use the ``show_charmap`` target of the ``lcdtest.py`` script. + +Should you run into the situation that your character map does not seem to match +either the ``A00`` or the ``A02`` tables, please `open an issue +`_ on Github. + +The same thing counts if you have a character that should be supported by your +character map, but which doesn't get written correctly to the display. Let me +know by `opening an issue `_! + +In case you need a character that is not included in the default device +character map, there is a possibility to create custom characters and write them +into the HD44780 CGRAM. For more information, see the :ref:`custom-characters` +section. + + +.. _custom-characters: + +Creating Custom Characters +========================== + +The HD44780 supports up to 8 user created characters. A character is defined by +a 8x5 bitmap. The bitmap should be a tuple of 8 numbers, each representing a 5 +pixel row. Each character is written to a specific location in CGRAM (numbers +0-7). + +.. sourcecode:: python + + >>> lcd = CharLCD(...) + >>> smiley = ( + ... 0b00000, + ... 0b01010, + ... 0b01010, + ... 0b00000, + ... 0b10001, + ... 0b10001, + ... 0b01110, + ... 0b00000, + ... ) + >>> lcd.create_char(0, smiley) + +To actually show a stored character on the display, you can use hex escape codes +with the location number you specified previously. For example, to write the +character at location 3: + +.. sourcecode:: python + + >>> lcd.write_string('\x03') + +The escape code can also be embedded in a longer string: + +.. sourcecode:: python + + >>> lcd.write_string('Hello there \x03') + +The following tool can help you to create your custom characters: +https://omerk.github.io/lcdchargen/ + + +Changing the Cursor Appearance +============================== + +The cursor appearance can be changed by setting the +:attr:`~RPLCD.i2c.CharLCD.cursor_mode` property to one of the following three +values: + +- ``hide`` – No cursor will be displayed +- ``line`` – The cursor will be indicated with an underline +- ``blink`` – The cursor will be indicated with a blinking square + + +Backlight Control +================= + +I²C +~~~ + +If you're using an LCD connected through the I²C bus, you can directly turn on +the backlight using the boolean :attr:`~RPLCD.i2c.CharLCD.backlight_enabled` property. + +GPIO +~~~~ + +By setting the ``pin_backlight`` parameter in the :class:`~RPLCD.gpio.CharLCD` +constructor, you can control a backlight circuit. + +First of all, you need to build an external circuit to control the backlight, +most LCD modules don't support it directly. You could do this for example by +using a transistor and a pull-up resistor. Then connect the transistor to a GPIO +pin and configure that pin using the ``pin_backlight`` parameter in the +constructor. If you use an active high circuit instead of active low, you can +change that behavior by setting the ``backlight_mode`` to either +``active_high`` or ``active_low``. Now you can toggle the +:attr:`~RPLCD.gpio.CharLCD.backlight_enabled` property to turn the backlight on +and off. + + +Automatic Line Breaks +===================== + +By default, RPLCD tries to automatically insert line breaks where appropriate +to achieve (hopefully) intuitive line wrapping. + +Part of these rules is that manual linebreaks (either ``\r\n`` or ``\n\r``) that +immediately follow an automatically issued line break are ignored. + +If you want more control over line breaks, you can disable the automatic system +by setting the ``auto_linebreaks`` parameter of the ``CharLCD`` constructor to +``False``. + +.. sourcecode:: python + + lcd = CharLCD(..., auto_linebreaks=False) + +Scrolling Text +============== + +I wrote a blogpost on how to implement scrolling text: +https://blog.dbrgn.ch/2014/4/20/scrolling-text-with-rplcd/ + +To see the result, go to https://www.youtube.com/watch?v=49RkQeiVTGU. + + +Raw Commands +============ + +You can send raw commands to the LCD with :meth:`~RPLCD.i2c.CharLCD.command` and +write a raw byte to the LCD with :meth:`~RPLCD.i2c.CharLCD.write`. For more +information, please refer to the Hitachi HD44780 datasheet. diff --git a/case_study/RPLCD-1.0.0/docs/wiring-gpio.tex b/case_study/RPLCD-1.0.0/docs/wiring-gpio.tex new file mode 100755 index 0000000..04b6af9 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/wiring-gpio.tex @@ -0,0 +1,45 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{ifthen} +\usepackage[sfdefault]{roboto} +\usepackage[T1]{fontenc} + +\begin{document} + + \begin{tikzpicture} + + % Frame + \draw[thick] (0,0) rectangle (13,2); + + % Pins and rectangles + \tikzstyle{every node}=[font=\scriptsize] + \foreach \x [ + evaluate = \x as \toppin using int(\x*2), + evaluate = \x as \bottompin using int(\x*2-1) + ] in {1,...,13} { + \draw (\x-0.5,1.5) node {\toppin} circle (0.3) circle (0.35); + \draw (\x-0.5,0.5) node {\bottompin} circle (0.3) circle (0.35); + \draw (\x-0.85,2.2) rectangle (\x-0.15,4); + \draw (\x-0.85,-0.2) rectangle (\x-0.15,-2); + } + + % Labelling function + \newcommand{\pinlabel}[2]{% + \ifthenelse{\isodd{#1}}% + {\node[anchor=west,rotate=90] at (#1/2, -2) {#2}}% + {\node[anchor=west,rotate=90] at (#1/2-0.5, 2.2) {#2}} + }; + + % Labels + \pinlabel{15}{RS / 4}; + \pinlabel{16}{E / 6}; + \pinlabel{18}{RW / 5}; + \pinlabel{21}{D4 / 11}; + \pinlabel{22}{D5 / 12}; + \pinlabel{23}{D6 / 13}; + \pinlabel{24}{D7 / 14}; + + \end{tikzpicture} + +\end{document} diff --git a/case_study/RPLCD-1.0.0/docs/wiring-i2c.tex b/case_study/RPLCD-1.0.0/docs/wiring-i2c.tex new file mode 100755 index 0000000..2f740e3 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/wiring-i2c.tex @@ -0,0 +1,42 @@ +\documentclass{standalone} + +\usepackage{tikz} +\usepackage{ifthen} +\usepackage[sfdefault]{roboto} +\usepackage[T1]{fontenc} + +\begin{document} + + \begin{tikzpicture} + + % Frame + \draw[thick] (0,0) rectangle (13,2); + + % Pins and rectangles + \tikzstyle{every node}=[font=\scriptsize] + \foreach \x [ + evaluate = \x as \toppin using int(\x*2), + evaluate = \x as \bottompin using int(\x*2-1) + ] in {1,...,13} { + \draw (\x-0.5,1.5) node {\toppin} circle (0.3) circle (0.35); + \draw (\x-0.5,0.5) node {\bottompin} circle (0.3) circle (0.35); + \draw (\x-0.85,2.2) rectangle (\x-0.15,4); + \draw (\x-0.85,-0.2) rectangle (\x-0.15,-2); + } + + % Labelling function + \newcommand{\pinlabel}[2]{% + \ifthenelse{\isodd{#1}}% + {\node[anchor=west,rotate=90] at (#1/2, -2) {#2}}% + {\node[anchor=west,rotate=90] at (#1/2-0.5, 2.2) {#2}} + }; + + % Labels + \pinlabel{4}{VCC (5V)}; + \pinlabel{6}{GND}; + \pinlabel{5}{SCL}; + \pinlabel{3}{SDA}; + + \end{tikzpicture} + +\end{document} diff --git a/case_study/RPLCD-1.0.0/docs/wiring.sh b/case_study/RPLCD-1.0.0/docs/wiring.sh new file mode 100755 index 0000000..28b9ac4 --- /dev/null +++ b/case_study/RPLCD-1.0.0/docs/wiring.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +mkdir _build/tex + +pdflatex -output-directory _build/tex wiring-gpio.tex && \ +convert -flatten -density 300 _build/tex/wiring-gpio.pdf -quality 90 -resize 500x500 _static/wiring-gpio.png + +pdflatex -output-directory _build/tex wiring-i2c.tex && \ +convert -flatten -density 300 _build/tex/wiring-i2c.pdf -quality 90 -resize 500x500 _static/wiring-i2c.png diff --git a/case_study/RPLCD-1.0.0/example.db b/case_study/RPLCD-1.0.0/example.db new file mode 100644 index 0000000..d1771cc Binary files /dev/null and b/case_study/RPLCD-1.0.0/example.db differ diff --git a/case_study/RPLCD-1.0.0/lcdtest.py b/case_study/RPLCD-1.0.0/lcdtest.py new file mode 100755 index 0000000..cfac518 --- /dev/null +++ b/case_study/RPLCD-1.0.0/lcdtest.py @@ -0,0 +1,209 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +import sys + +import RPi.GPIO as GPIO + +from RPLCD import i2c, gpio + +# Import supported tests +import lcdtests.show_charmap as show_charmap +import lcdtests.testsuite_20x4 as testsuite_20x4 +import lcdtests.testsuite_16x2 as testsuite_16x2 + +# Globals +options = {} +no_default = object() + + +def print_usage(error=None): + print('Usage: %s i2c ' % sys.argv[0]) + print(' %s gpio ' % sys.argv[0]) + print('') + print(' Which test to run:') + print('') + print(' show_charmap - Displays all characters in the charmap') + print(' testsuite - Tests display formatting, 20x4 and 16x2 displays supported.') + print('') + # Options for i2c mode + if ((len(sys.argv) > 1) and (sys.argv[1] == 'i2c')): + print(' i2c options:') + print('') + print(' expander - Supported I²C port expanders are PCF8574, MCP23008 and MCP23017') + print(' addr - The I²C address (in hex format) can be found with') + print(' `i2cdetect 1` from the i2c-tools package.') + print(' port - The I²C port. For the first RPi with 256MB RAM this is 0, else 1') + print(' Default: 1') + print(' cols - The number of columns on your LCD, e.g. 16') + print(' rows - The number of rows on your LCD, e.g. 2') + print(' charmap - Which character map to use. Either A00 or A02. If your display') + print(' contains Japanese characters, it probably uses the A00 charmap,') + print(' otherwise A02. Default: A00') + print('') + print(' Expander specific options:') + print('') + print(' MCP23017: gpio_bank - Either A or B') + print('') + print('Examples:') + print('') + print(sys.argv[0] + ' i2c testsuite expander=PCF8574 addr=0x27 port=1 ' + 'cols=20 rows=4 charmap=A00') + print(sys.argv[0] + ' i2c testsuite expander=MCP23017 addr=0x20 port=1 ' + 'kols=20 rows=4 charmap=A00 gpio_bank=A') + + # Options for GPIO mode + elif ((len(sys.argv) > 1) and (sys.argv[1] == 'gpio')): + + print(' gpio options:') + print('') + print(' mode - GPIO numbering mode, either BOARD or BCM') + print(' cols - The number of columns on your LCD, e.g. 16') + print(' rows - The number of rows on your LCD, e.g. 2') + print(' rs - RS pin number') + print(' rw - RW pin number. Default: None') + print(' e - E pin number') + print(' bl - Backlight pin number. Default: None') + print(' data - Data (d0-d7) gpio pin numbers, 4 or 8 numbers depending') + print(' on if you want 4 or 8 bit mode, separated by commas.') + print(' Example: data=1,2,3,4,5,6,7,8 (for 8-bit mode)') + print(' data=5,6,7,8 (for 4-bit mode)') + print(' charmap - Which character map to use. Either A00 or A02. If your display') + print(' contains Japanese characters, it probably uses the A00 charmap,') + print(' otherwise A02. Default: A00') + print('') + print('Example:') + print('') + print(sys.argv[0] + ' gpio testsuite cols=20 rows=4 mode=BCM rs=15 rw=None e=16 ' + 'bl=None data=21,22,23,24 charmap=A00') + else: + print(' For info about options run:') + print('') + print(' %s i2c' % sys.argv[0]) + print(' %s gpio' % sys.argv[0]) + print('') + if error is not None: + print('\nError: ' + error) + sys.exit(1) + + +def options_pop(value, default=no_default): + ''' Pops value from options with error checking + value: which option to pop and check. + default: optional, sets a default if not defined. + returns: a string corresponding to the option on the command line + ''' + global options + try: + # If no default value is defined + if default is no_default: + return_value = options.pop(value) + else: + return_value = options.pop(value, default) + except KeyError: + print_usage('Option %s is not defined.' % value) + except ValueError as e: + print_usage('The value for %s is not valid.\n%s' % (value, e)) + except Exception as e: + raise e + if return_value == '': + print_usage('Option %s can\'t be blank.' % value) + return return_value + + +if __name__ == '__main__': + if len(sys.argv) < 3: + print_usage() + + lcdmode = sys.argv[1] + test = sys.argv[2] + + # Parse options into a dictionary + try: + options = dict([arg.split('=', 1) for arg in sys.argv[3:]]) + except ValueError: + print_usage('Malformed option detected, must be in the form option=value') + + # Common options + cols = int(options_pop('cols')) + rows = int(options_pop('rows')) + charmap = options_pop('charmap', 'A00') + if lcdmode == 'i2c': + if len(sys.argv) < 5: + print_usage() + + # i2c options, pop all required options, pass remaining options to expander_params + i2c_expander = options_pop('expander') + address = int(options_pop('addr'), 16) + port = int(options_pop('port', '1')) + try: + lcd = i2c.CharLCD(i2c_expander, address, port=port, charmap=charmap, cols=cols, + rows=rows, expander_params=options) + except IOError: + print_usage('IOError: Usually caused by the wrong i2c address/port ' + 'or device not connected properly') + elif lcdmode == 'gpio': + if len(sys.argv) < 8: + print_usage() + + # gpio options + mode = options_pop('mode') + if mode == 'BCM': + numbering_mode = GPIO.BCM + elif mode == 'BOARD': + numbering_mode = GPIO.BOARD + else: + print_usage('Invalid GPIO numbering mode: %s, must be either BOARD or BCM' % mode) + + data = options_pop('data') + rs = int(options_pop('rs')) + e = int(options_pop('e')) + rw = options_pop('rw', 'None') + rw = None if rw == 'None' else int(rw) + bl = options_pop('bl', 'None') + bl = None if bl == 'None' else int(bl) + + # Parse data pins into a list + pins_data = {} + pins_data = data.split(',') + # Convert data pins to int + pins_data = [int(pin) for pin in pins_data] + lcd = gpio.CharLCD(pin_rs=rs, pin_rw=rw, pin_e=e, pins_data=pins_data, pin_backlight=bl, + numbering_mode=numbering_mode, cols=cols, rows=rows, charmap=charmap) + else: + print_usage('Connection type %s is not supported. Must be either i2c or gpio' % lcdmode) + + # Run selected test + if test == 'show_charmap': + show_charmap.run(lcd, rows, cols) + elif test == 'testsuite': + if cols == 20 and rows == 4: + testsuite_20x4.run(lcd) + elif cols == 16 and rows == 2: + testsuite_16x2.run(lcd) + else: + print_usage('%sx%s displays are not supported in this test.' % (cols, rows)) + else: + print_usage('Test \'%s\' is not supported.' % test) diff --git a/case_study/RPLCD-1.0.0/lcdtests/__init__.py b/case_study/RPLCD-1.0.0/lcdtests/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/case_study/RPLCD-1.0.0/lcdtests/show_charmap.py b/case_study/RPLCD-1.0.0/lcdtests/show_charmap.py new file mode 100755 index 0000000..5c67aad --- /dev/null +++ b/case_study/RPLCD-1.0.0/lcdtests/show_charmap.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" + +from __future__ import print_function, division, absolute_import, unicode_literals + +import sys + +try: + range = xrange +except NameError: # Python 3 + pass + +try: + safe_input = raw_input +except NameError: # Python 3 + safe_input = input + + +def run(lcd, rows, cols): + + print('This tool shows the character map of your LCD on the display.') + print('Press ctrl+c at any time to abort.\n') + + page = 0 + chars = rows * cols + text_tpl = 'Displaying page %d (characters %d-%d). Press to continue.' + + try: + while True: + offset = page * chars + start = offset + end = offset + chars + lcd.clear() + for i in range(offset, offset + chars): + if i > 255: + if i > start: + safe_input(text_tpl % (page + 1, start, i - 1)) + else: + pass + sys.exit(0) + lcd.write(i) + safe_input(text_tpl % (page + 1, start, end - 1)) + page += 1 + except KeyboardInterrupt: + print('Aborting.') + finally: + lcd.clear() + try: + lcd.backlight_enabled = False + except ValueError: + pass + lcd.close() + print('Test done. If you have a programmable backlight, it should now be off.') + + +if __name__ == '__main__': + print('This is a submodule of lcdtest.py, please run it instead.') diff --git a/case_study/RPLCD-1.0.0/lcdtests/testsuite_16x2.py b/case_study/RPLCD-1.0.0/lcdtests/testsuite_16x2.py new file mode 100755 index 0000000..e2c86e3 --- /dev/null +++ b/case_study/RPLCD-1.0.0/lcdtests/testsuite_16x2.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +from RPLCD import gpio, i2c + +try: + input = raw_input +except NameError: + pass + +try: + range = xrange +except NameError: # Python 3 + pass + +try: + safe_input = raw_input +except NameError: # Python 3 + safe_input = input + + +def run(lcd): + + lcd.backlight = True + input('Display should be blank. ') + + lcd.cursor_mode = 'blink' + input('The cursor should now blink. ') + + lcd.cursor_mode = 'line' + input('The cursor should now be a line. ') + + lcd.write_string('Hello world!') + input('"Hello world!" should be on the LCD. ') + + assert lcd.cursor_pos == (0, 12), 'cursor_pos should now be (0, 12)' + + lcd.cursor_pos = (0, 15) + lcd.write_string('1') + lcd.cursor_pos = (1, 15) + lcd.write_string('2') + assert lcd.cursor_pos == (0, 0), 'cursor_pos should now be (0, 0)' + input('Lines 1 and 2 should now be labelled with the right numbers on the right side. ') + + lcd.clear() + input('Display should now be clear, cursor should be at initial position. ') + + lcd.cursor_pos = (0, 5) + lcd.write_string('12345') + input('The string should have a left offset of 5 characters. ') + + lcd.write_shift_mode = 'display' + lcd.cursor_pos = (1, 5) + lcd.write_string('12345') + input('Both strings should now be at column 0. ') + + lcd.write_shift_mode = 'cursor' + lcd.cursor_pos = (1, 5) + lcd.write_string('cursor') + input('The string "cursor" should now be on the second row, column 0. ') + + lcd.home() + input('Cursor should now be at initial position. Everything should be shifted ' + 'to the right by 5 characters. ') + + lcd.cursor_pos = (1, 15) + lcd.write_string('X') + input('The last character on the LCD should now be an "X"') + + lcd.display_enabled = False + input('Display should now be blank. ') + + lcd.clear() + lcd.write_string('Eggs, Ham') + lcd.crlf() + lcd.write_string('and Spam') + lcd.display_enabled = True + input('Display should now show "Eggs, Ham and Spam" with a line break after "Ham". ') + + lcd.shift_display(4) + input('Text should now be shifted to the right by 4 characters. ') + lcd.shift_display(-4) + input('Shift should now be undone. ') + + lcd.text_align_mode = 'right' + lcd.write_string(' Spam') + input('The word "Spam" should now be inverted. ') + + lcd.text_align_mode = 'left' + lcd.write_string(' Wurscht') + input('The word "mapS" should now be replaced with "Wurscht". ') + + lcd.clear() + lcd.write_string('1') + lcd.lf() + lcd.write_string('2\n') + lcd.cursor_pos = (0, 2) + lcd.write_string('3\n') + lcd.write_string('4') + lcd.cursor_pos = (0, 4) + lcd.write_string('5\n') + lcd.write_string('6') + input('The numbers 1-6 should now be displayed in a zig zag line starting ' + 'in the top left corner. ') + + lcd.clear() + lcd.write_string('This will wrap around both lines') + input('Text should nicely wrap around lines. ') + + lcd.clear() + lcd.cursor_mode = 'hide' + lcd.write_string('Paris: 21°C\n\rZürich: 18°C') + print('Text should now show "Paris: 21°C, Zürich: 18°C" without any encoding issues.', end='') + input() + + # Test custom chars + lcd.clear() + happy = (0b00000, 0b01010, 0b01010, 0b00000, 0b10001, 0b10001, 0b01110, 0b00000) + sad = (0b00000, 0b01010, 0b01010, 0b00000, 0b01110, 0b10001, 0b10001, 0b00000) + lcd.create_char(0, sad) + lcd.write_string('\x00') + lcd.create_char(1, happy) + lcd.write_string('\x01') + input('You should now see a sad and a happy face next to each other. ') + lcd.create_char(0, happy) + lcd.home() + lcd.write_string('\x00') + input('Now both faces should be happy. ') + + lcd.clear() + lcd.write_string('1234567890123456\r\n2nd line') + input('The first line should be filled with numbers, the second line should show "2nd line"') + + lcd.clear() + lcd.write_string('999456\n\r\n123') + input('The display should show "123456" on the first line') + + lcd.clear() + try: + lcd.backlight_enabled = False + except ValueError: + pass + lcd.close() + print('Test done. If you have a backlight, it should now be off.') + + +if __name__ == '__main__': + + print('This is a submodule of lcdtest.py, please run it instead.') diff --git a/case_study/RPLCD-1.0.0/lcdtests/testsuite_20x4.py b/case_study/RPLCD-1.0.0/lcdtests/testsuite_20x4.py new file mode 100755 index 0000000..6eeed33 --- /dev/null +++ b/case_study/RPLCD-1.0.0/lcdtests/testsuite_20x4.py @@ -0,0 +1,164 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +Copyright (C) 2013-2017 Danilo Bargen + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +""" +from __future__ import print_function, division, absolute_import, unicode_literals + +try: + input = raw_input +except NameError: + pass + +try: + range = xrange +except NameError: # Python 3 + pass + +try: + safe_input = raw_input +except NameError: # Python 3 + safe_input = input + + +def run(lcd): + + lcd.backlight = True + input('Display should be blank. ') + + lcd.cursor_mode = 'blink' + input('The cursor should now blink. ') + + lcd.cursor_mode = 'line' + input('The cursor should now be a line. ') + + lcd.write_string('Hello world!') + input('"Hello world!" should be on the LCD. ') + + assert lcd.cursor_pos == (0, 12), 'cursor_pos should now be (0, 12)' + + lcd.cursor_pos = (1, 0) + lcd.write_string('2') + lcd.cursor_pos = (2, 0) + lcd.write_string('3') + lcd.cursor_pos = (3, 0) + lcd.write_string('4') + assert lcd.cursor_pos == (3, 1), 'cursor_pos should now be (3, 1)' + input('Lines 2, 3 and 4 should now be labelled with the right numbers. ') + + lcd.clear() + input('Display should now be clear, cursor should be at initial position. ') + + lcd.cursor_pos = (0, 5) + lcd.write_string('12345') + input('The string should have a left offset of 5 characters. ') + + lcd.write_shift_mode = 'display' + lcd.cursor_pos = (1, 5) + lcd.write_string('12345') + input('Both strings should now be at column 0. ') + + lcd.write_shift_mode = 'cursor' + lcd.cursor_pos = (2, 5) + lcd.write_string('cursor') + input('The string "cursor" should now be on the third row, column 0. ') + + lcd.home() + input('Cursor should now be at initial position. Everything should be shifted ' + 'to the right by 5 characters. ') + + lcd.cursor_pos = (3, 19) + lcd.write_string('X') + input('The last character on the LCD should now be an "X"') + + lcd.display_enabled = False + input('Display should now be blank. ') + + lcd.clear() + lcd.write_string('Eggs, Ham, Bacon\n\rand Spam') + lcd.display_enabled = True + input('Display should now show "Eggs, Ham, Bacon and Spam". ') + + lcd.shift_display(4) + input('Text should now be shifted to the right by 4 characters. ') + lcd.shift_display(-4) + input('Shift should now be undone. ') + + lcd.text_align_mode = 'right' + lcd.write_string(' Spam') + input('The word "Spam" should now be inverted. ') + + lcd.text_align_mode = 'left' + lcd.write_string(' Wurscht') + input('The word "mapS" should now be replaced with "Wurscht". ') + + lcd.clear() + lcd.write_string('1\n') + lcd.write_string('2\n') + lcd.write_string('3\n') + lcd.write_string('4') + input('The numbers 1-4 should now be displayed, each line shifted to the right ' + 'by 1 char more than the previous. ') + + lcd.clear() + lcd.write_string('This is a long string that will wrap across multiple lines!') + input('Text should nicely wrap around lines. ') + + lcd.clear() + lcd.cursor_mode = 'hide' + lcd.write_string('Paris: 21°C\n\rZürich: 18°C') + print('Text should now show "Paris: 21°C, Zürich: 18°C" without any encoding issues.', end='') + input() + + # Test custom chars + lcd.clear() + happy = (0b00000, 0b01010, 0b01010, 0b00000, 0b10001, 0b10001, 0b01110, 0b00000) + sad = (0b00000, 0b01010, 0b01010, 0b00000, 0b01110, 0b10001, 0b10001, 0b00000) + lcd.create_char(0, sad) + lcd.write_string('\x00') + lcd.create_char(1, happy) + lcd.write_string('\x01') + input('You should now see a sad and a happy face next to each other. ') + lcd.create_char(0, happy) + lcd.home() + lcd.write_string('\x00') + input('Now both faces should be happy. ') + + lcd.clear() + lcd.write_string('12345678901234567890\r\n2nd line') + input('The first line should be filled with numbers, the second line should show "2nd line"') + + lcd.clear() + lcd.write_string('999456..............\n\r\n\n\n123') + input('The display should show "123456...................." on the first line') + + lcd.clear() + try: + lcd.backlight_enabled = False + except ValueError: + pass + lcd.close() + print('Test done. If you have a backlight, it should now be off.') + + +if __name__ == '__main__': + + print('This is a submodule of lcdtest.py, please run it instead.') diff --git a/case_study/RPLCD-1.0.0/photo-i2c.jpg b/case_study/RPLCD-1.0.0/photo-i2c.jpg new file mode 100755 index 0000000..ec5d245 Binary files /dev/null and b/case_study/RPLCD-1.0.0/photo-i2c.jpg differ diff --git a/case_study/RPLCD-1.0.0/photo.jpg b/case_study/RPLCD-1.0.0/photo.jpg new file mode 100755 index 0000000..e535efd Binary files /dev/null and b/case_study/RPLCD-1.0.0/photo.jpg differ diff --git a/case_study/RPLCD-1.0.0/pytest.ini b/case_study/RPLCD-1.0.0/pytest.ini new file mode 100755 index 0000000..bea85c0 --- /dev/null +++ b/case_study/RPLCD-1.0.0/pytest.ini @@ -0,0 +1,11 @@ +[pytest] +addopts = --pep8 --tb=short +python_paths = .. +python_files = tests/test_*.py +pep8ignore = + *.py E126 E127 E128 + */tests/* ALL + RPLCD/codecs/*.py E241 + docs/* ALL + setup.py ALL +pep8maxlinelength = 99 diff --git a/case_study/RPLCD-1.0.0/requirements-dev.txt b/case_study/RPLCD-1.0.0/requirements-dev.txt new file mode 100755 index 0000000..49df2c5 --- /dev/null +++ b/case_study/RPLCD-1.0.0/requirements-dev.txt @@ -0,0 +1,4 @@ +pytest==3.0.5 +pytest-mock==1.5.0 +pytest-pep8==1.0.6 +pytest-pythonpath==0.7.1 diff --git a/case_study/RPLCD-1.0.0/setup.cfg b/case_study/RPLCD-1.0.0/setup.cfg new file mode 100755 index 0000000..2a9acf1 --- /dev/null +++ b/case_study/RPLCD-1.0.0/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal = 1 diff --git a/case_study/RPLCD-1.0.0/setup.py b/case_study/RPLCD-1.0.0/setup.py new file mode 100755 index 0000000..a28c48f --- /dev/null +++ b/case_study/RPLCD-1.0.0/setup.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +from setuptools import setup, find_packages + +readme = open('README.rst').read() + +setup(name='RPLCD', + version='1.0.0', + description='A Raspberry Pi LCD library for the widely used Hitachi HD44780 controller.', + long_description=readme, + author='Danilo Bargen', + author_email='mail@dbrgn.ch', + url='https://github.com/dbrgn/RPLCD', + license='MIT', + keywords='raspberry, raspberry pi, lcd, liquid crystal, hitachi, hd44780', + packages=find_packages(), + platforms=['any'], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Other Environment', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: POSIX', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Topic :: System :: Hardware :: Hardware Drivers', + 'Topic :: Software Development :: Libraries :: Python Modules', + ], + ) diff --git a/case_study/RPLCD-1.0.0/tests/conftest.py b/case_study/RPLCD-1.0.0/tests/conftest.py new file mode 100755 index 0000000..824157c --- /dev/null +++ b/case_study/RPLCD-1.0.0/tests/conftest.py @@ -0,0 +1,25 @@ +import mock +import pytest + + +# Mock RPi.GPIO module (https://m.reddit.com/r/Python/comments/5eddp5/mock_testing_rpigpio/) +MockRPi = mock.MagicMock() +modules = { + 'RPi': MockRPi, + 'RPi.GPIO': MockRPi.GPIO, +} +patcher = mock.patch.dict('sys.modules', modules) +patcher.start() + + +# Provide default kwargs for a CharLCD instance +@pytest.fixture +def charlcd_kwargs(): + import RPi.GPIO as GPIO + return { + 'numbering_mode': GPIO.BOARD, + 'pin_rs': 15, + 'pin_rw': 18, + 'pin_e': 16, + 'pins_data': [21, 22, 23, 24], + } diff --git a/case_study/RPLCD-1.0.0/tests/test_auto_linebreaks.py b/case_study/RPLCD-1.0.0/tests/test_auto_linebreaks.py new file mode 100755 index 0000000..abab131 --- /dev/null +++ b/case_study/RPLCD-1.0.0/tests/test_auto_linebreaks.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +import pytest + +from RPLCD.gpio import CharLCD + + +try: + unichr = unichr +except NameError: # Python 3 + unichr = chr + + +SP = 32 # Space + + +@pytest.fixture +def get_lcd(mocker, charlcd_kwargs): + def _func(cols, rows, auto_linebreaks): + lcd = CharLCD(cols=cols, rows=rows, auto_linebreaks=auto_linebreaks, **charlcd_kwargs) + mocker.patch.object(lcd, '_send_data') + mocker.patch.object(lcd, '_send_instruction') + return lcd + return _func + + +def test_auto_linebreaks(get_lcd): + """ + Simple auto linebreak. + """ + lcd = get_lcd(16, 2, True) + for i in range(48, 67): + lcd.write_string(unichr(i)) + assert lcd._content[0] == [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] + assert lcd._content[1] == [64, 65, 66, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP] + + +def test_no_auto_linebreaks(get_lcd): + """ + Auto linebreaks disabled. + """ + lcd = get_lcd(16, 2, False) + for i in range(48, 67): + lcd.write_string(unichr(i)) + assert lcd._content[0] == [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63] + assert lcd._content[1] == [SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP] + + +def test_auto_linebreaks_no_ignore_lf(get_lcd): + """ + Do not ignore manual \n after auto linebreak. + """ + lcd = get_lcd(16, 2, True) + lcd.write_string('a' * 16) # Fill up line + lcd.write_string('\nb') + assert lcd._content[0] == [98, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97] + assert lcd._content[1] == [SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP, SP] + + +def test_auto_linebreaks_no_ignore_double_lf(get_lcd): + """ + Do not ignore manual \n\n after auto linebreak. + """ + lcd = get_lcd(20, 4, True) + lcd.write_string('a' * 20) # Fill up line + lcd.write_string('\n\nb') + assert lcd._content[0] == [97] * 20 + assert lcd._content[1] == [SP] * 20 + assert lcd._content[2] == [SP] * 20 + assert lcd._content[3] == [98] + [SP] * 19 + + +@pytest.mark.parametrize('pattern', ['\r\n', '\n\r']) +def test_auto_linebreaks_ignore_crlf(get_lcd, pattern): + """ + Ignore manual \r\n and \n\r after auto linebreak. + """ + lcd = get_lcd(20, 4, True) + lcd.write_string('a' * 20) # Fill up line + lcd.write_string(pattern) + lcd.write_string('b') + assert lcd._content[0] == [97] * 20 + assert lcd._content[1] == [98] + [SP] * 19 + assert lcd._content[2] == [SP] * 20 + assert lcd._content[3] == [SP] * 20 diff --git a/case_study/RPLCD-1.0.0/tests/test_codecs.py b/case_study/RPLCD-1.0.0/tests/test_codecs.py new file mode 100755 index 0000000..c669b57 --- /dev/null +++ b/case_study/RPLCD-1.0.0/tests/test_codecs.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +import pytest + +from RPLCD import codecs + + +@pytest.mark.parametrize(['input_', 'result_a00', 'result_a02'], [ + # Empty + ('', [], []), + # Single char, obvious mapping + (' ', [32], [32]), + ('a', [97], [97]), + # Single char, different mapping depending on charmap + ('α', [224], [144]), + # Single char, only available on some charmaps + ('♡', [32], [157]), + ('❤', [32], [157]), + ('°', [223], [32]), + # Multiple 1:1 mapped chars + ('asdf', [97, 115, 100, 102], [97, 115, 100, 102]), + # Combined mapping + ('\u207B\u00B9', [233], [32, 185]), + ('as\u207B\u00B9df', [97, 115, 233, 100, 102], [97, 115, 32, 185, 100, 102]), + ('\u207B', [32], [32]), + ('\u207Ba', [32, 97], [32, 97]), + # Containing newlines and carriage returns + ('a\r\nb', [97, codecs.CR, codecs.LF, 98], [97, codecs.CR, codecs.LF, 98]), +]) +def test_encode(input_, result_a00, result_a02): + a00 = codecs.A00Codec() + a02 = codecs.A02Codec() + + assert a00.encode(input_) == result_a00, \ + 'A00: Input %r encoded to %s' % (input_, a00.encode(input_)) + + assert a02.encode(input_) == result_a02, \ + 'A02: Input %r encoded to %s' % (input_, a02.encode(input_)) diff --git a/case_study/RPLCD-1.0.0/tests/test_common.py b/case_study/RPLCD-1.0.0/tests/test_common.py new file mode 100755 index 0000000..0a77464 --- /dev/null +++ b/case_study/RPLCD-1.0.0/tests/test_common.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +import pytest + +from RPLCD import common + + +@pytest.mark.parametrize(['input_', 'lookahead', 'result'], [ + ('hi', 0, [('h',), ('i',)]), + ('hi', 1, [('h', 'i'), ('i', ' ')]), + ('hi', 2, [('h', 'i', ' '), ('i', ' ', ' ')]), + ('', 0, []), + ('', 1, []), + ('', 7, []), +]) +def test_window_function(input_, lookahead, result): + assert list(common.sliding_window(input_, lookahead)) == result diff --git a/case_study/RPLCD-1.0.0/tests/test_gpio.py b/case_study/RPLCD-1.0.0/tests/test_gpio.py new file mode 100755 index 0000000..42eddd3 --- /dev/null +++ b/case_study/RPLCD-1.0.0/tests/test_gpio.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +import pytest,mock + +import RPi.GPIO as GPIO +from RPLCD.gpio import CharLCD +from RPLCD.common import LCD_SETDDRAMADDR + +def test_gpio_init_connection(mocker, charlcd_kwargs): + """ + test gpio's init_connection + """ + lcd = CharLCD(**charlcd_kwargs) + #init_connection = mocker.patch.object(lcd, '_init_connection') + output = mocker.patch("RPi.GPIO.output") + lcd._init_connection() + #assert init_connection.call_count == 1 + #assert GPIO.input(lcd.pins.rs)==0 + #assert GPIO.input(lcd.pins.e)==0 + #assert GPIO.input(lcd.pins.rw)==0 + assert output.call_count == 3 + output_calls = [c[0] for c in output.call_args_list] + assert output_calls[0]==(lcd.pins.rs,0) + assert output_calls[1]==(lcd.pins.e,0) + assert output_calls[2]==(lcd.pins.rw,0) + + +def test_gpio_pulse(mocker, charlcd_kwargs): + """ + test gpio's init_connection + """ + lcd = CharLCD(**charlcd_kwargs) + output = mocker.patch("RPi.GPIO.output") + lcd._pulse_enable() + assert output.call_count== 3 + output_calls = [c[0] for c in output.call_args_list] + assert output_calls[0]==(lcd.pins.e,0) + assert output_calls[1]==(lcd.pins.e,1) + assert output_calls[2]==(lcd.pins.e,0) + +def test_gpio_write4bits(mocker,charlcd_kwargs): + """ + test gpio's write4bits + """ + lcd = CharLCD(**charlcd_kwargs) + output = mocker.patch("RPi.GPIO.output") + lcd._write4bits(14) + assert output.call_count== 7 + output_calls = [c[0] for c in output.call_args_list] + assert output_calls[0]==(lcd.pins[7],0) + assert output_calls[1]==(lcd.pins[8],1) + assert output_calls[2]==(lcd.pins[9],1) + assert output_calls[3]==(lcd.pins[10],1) + +def test_gpio_write8bits(mocker,charlcd_kwargs): + """ + test gpio's write4bits + """ + lcd = CharLCD(**charlcd_kwargs) + output = mocker.patch("RPi.GPIO.output") + lcd._write8bits(15) + assert output.call_count== 11 + output_calls = [c[0] for c in output.call_args_list] + assert output_calls[0]==(lcd.pins[3],1) + assert output_calls[1]==(lcd.pins[4],1) + assert output_calls[2]==(lcd.pins[5],1) + assert output_calls[3]==(lcd.pins[6],1) + assert output_calls[4]==(lcd.pins[7],0) + assert output_calls[5]==(lcd.pins[8],0) + assert output_calls[6]==(lcd.pins[9],0) + assert output_calls[7]==(lcd.pins[10],0) + +def test_send1(mocker, charlcd_kwargs): + """ + test gpio's send + """ + lcd = CharLCD(**charlcd_kwargs) + output = mocker.patch("RPi.GPIO.output") + lcd._send(4,0) + output_calls = [c[0] for c in output.call_args_list] + #assert GPIO.input(lcd.pins.rs)==0 + #assert GPIO.input(lcd.pins.rw)==0 + assert output_calls[0]==(lcd.pins.rs,0) + assert output_calls[1]==(lcd.pins.rw,0) + + +def test_send2(mocker, charlcd_kwargs): + """ + test gpio's send + """ + lcd = CharLCD(**charlcd_kwargs) + output = mocker.patch("RPi.GPIO.output") + lcd._send(4,1) + output_calls = [c[0] for c in output.call_args_list] + #assert GPIO.input(lcd.pins.rs)==1 + #assert GPIO.input(lcd.pins.rw)==0 + assert output_calls[0]==(lcd.pins.rs,1) + assert output_calls[1]==(lcd.pins.rw,0) diff --git a/case_study/RPLCD-1.0.0/tests/test_write.py b/case_study/RPLCD-1.0.0/tests/test_write.py new file mode 100755 index 0000000..210b498 --- /dev/null +++ b/case_study/RPLCD-1.0.0/tests/test_write.py @@ -0,0 +1,113 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, division, absolute_import, unicode_literals + +import pytest + +from RPLCD.gpio import CharLCD +from RPLCD.common import LCD_SETDDRAMADDR + + +def test_write_simple(mocker, charlcd_kwargs): + """ + Write "HelloWorld" to the display. + """ + lcd = CharLCD(**charlcd_kwargs) + send_data = mocker.patch.object(lcd, '_send_data') + text = 'HelloWorld' + lcd.write_string(text) + assert send_data.call_count == len(text) + calls = [c[0] for c in send_data.call_args_list] + assert calls[0] == (72,) + assert calls[1] == (101,) + assert calls[2] == (108,) + assert calls[3] == (108,) + assert calls[4] == (111,) + assert calls[5] == (87,) + assert calls[6] == (111,) + assert calls[7] == (114,) + assert calls[8] == (108,) + assert calls[9] == (100,) + + +def test_caching(mocker, charlcd_kwargs): + """ + Characters should only be written if they have changed + """ + lcd = CharLCD(**charlcd_kwargs) + send_data = mocker.patch.object(lcd, '_send_data') + send_instruction = mocker.patch.object(lcd, '_send_instruction') + + lcd.write_string('hello') + assert send_data.call_count == 5 + data_calls = [c[0] for c in send_data.call_args_list] + assert data_calls[0] == (104,) + assert data_calls[1] == (101,) + assert data_calls[2] == (108,) + assert data_calls[3] == (108,) + assert data_calls[4] == (111,) + + lcd.home() + send_data.reset_mock() + send_instruction.reset_mock() + + lcd.write_string('he77o') + assert send_data.call_count == 2 + assert send_instruction.call_count == 3 + data_calls = [c[0] for c in send_data.call_args_list] + instruction_calls = [c[0] for c in send_instruction.call_args_list] + assert instruction_calls[0] == (LCD_SETDDRAMADDR | 1,) + assert instruction_calls[1] == (LCD_SETDDRAMADDR | 2,) + assert data_calls[0] == (55,) + assert data_calls[1] == (55,) + assert instruction_calls[2] == (LCD_SETDDRAMADDR | 5,) + + +@pytest.mark.parametrize(['charmap', 'ue'], [ + ('A00', 0b11110101), + ('A02', 0b11111100), +]) +def test_charmap(mocker, charmap, ue, charlcd_kwargs): + """ + The charmap should be used. The "ü" Umlaut should be encoded correctly. + """ + lcd = CharLCD(charmap=charmap, **charlcd_kwargs) + send = mocker.patch.object(lcd, '_send_data') + + text = 'Züri' + + lcd.write_string(text) + assert send.call_count == 4, 'call count was %d' % send.call_count + calls = [c[0] for c in send.call_args_list] + assert calls[0] == (90,) + assert calls[1] == (ue,) + assert calls[2] == (114,) + assert calls[3] == (105,) + + +@pytest.mark.parametrize(['rows', 'cols'], [ + (2, 16), + (4, 20), +]) +def test_write_newline(mocker, rows, cols, charlcd_kwargs): + """ + Write text containing CR/LF chars to the display. + """ + lcd = CharLCD(rows=rows, cols=cols, **charlcd_kwargs) + send_data = mocker.patch.object(lcd, '_send_data') + send_instruction = mocker.patch.object(lcd, '_send_instruction') + text = '\nab\n\rcd' + lcd.write_string(text) + assert send_data.call_count + send_instruction.call_count == len(text) + data_calls = [c[0] for c in send_data.call_args_list] + instruction_calls = [c[0] for c in send_instruction.call_args_list] + assert instruction_calls[0] == (0x80 + 0x40,), instruction_calls + assert data_calls[0] == (97,), data_calls + assert data_calls[1] == (98,), data_calls + if rows == 2: + assert instruction_calls[1] == (0x80 + 2,), instruction_calls + assert instruction_calls[2] == (0x80 + 0,), instruction_calls + else: + assert instruction_calls[1] == (0x80 + cols + 2,), instruction_calls + assert instruction_calls[2] == (0x80 + cols + 0,), instruction_calls + assert data_calls[2] == (99,), data_calls + assert data_calls[3] == (100,), data_calls diff --git a/case_study/arduino_lab/group_01/.pytest_cache/v/cache/lastfailed b/case_study/arduino_lab/group_01/.pytest_cache/v/cache/lastfailed new file mode 100755 index 0000000..9e26dfe --- /dev/null +++ b/case_study/arduino_lab/group_01/.pytest_cache/v/cache/lastfailed @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/failed.txt b/case_study/arduino_lab/group_01/failed.txt new file mode 100755 index 0000000..f25fd24 --- /dev/null +++ b/case_study/arduino_lab/group_01/failed.txt @@ -0,0 +1,108 @@ +./executed/mut14/output.txt +./executed/mut43/output.txt +./executed/mut23/output.txt +./executed/mut15/output.txt +./executed/mut53/output.txt +./executed/mut26/output.txt +./executed/mut17/output.txt +./executed/mut39/output.txt +./executed/mut18/output.txt +./executed/mut27/output.txt +./executed/mut24/output.txt +./executed/mut20/output.txt +./executed/mut5/output.txt +./executed/mut49/output.txt +./executed/mut78/output.txt +./executed/mut22/output.txt +./executed/mut25/output.txt +./executed/mut52/output.txt +./executed/mut54/output.txt +./executed/mut69/output.txt +./executed/mut58/output.txt +./executed/mut21/output.txt +./executed/mut19/output.txt +./executed/mut51/output.txt +./executed/mut48/output.txt +./executed/mut16/output.txt +./executed/mut55/output.txt + +Mutation 0:pin_surround_replacement:digitalWrite(22, ( LOW)); in Line 27 +Mutation 1:pin_surround_replacement:digitalWrite(24, ( LOW)); in Line 27 +Mutation 2:pin_surround_replacement:digitalWrite(25, ( LOW)); in Line 27 +Mutation 3:pin_value_replacement:digitalWrite(23, !( LOW)); in Line 27 +Mutation 4:output_stmt_deletion: in Line 27 +Mutation 5:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 29 +Mutation 6:pin_surround_replacement:digitalWrite(24, ( HIGH)); in Line 29 +Mutation 7:pin_surround_replacement:digitalWrite(25, ( HIGH)); in Line 29 +Mutation 8:pin_value_replacement:digitalWrite(23, !( HIGH)); in Line 29 +Mutation 9:output_stmt_deletion: in Line 29 +Mutation 10:pin_surround_replacement:digitalWrite(22, ( LOW)); in Line 31 +Mutation 11:pin_surround_replacement:digitalWrite(24, ( LOW)); in Line 31 +Mutation 12:pin_surround_replacement:digitalWrite(25, ( LOW)); in Line 31 +Mutation 13:pin_value_replacement:digitalWrite(23, !( LOW)); in Line 31 +Mutation 14:output_stmt_deletion: in Line 31 +Mutation 15:pin_surround_replacement:duration = pulseIn(23, ( HIGH)); in Line 32 +Mutation 16:pin_surround_replacement:duration = pulseIn(24, ( HIGH)); in Line 32 +Mutation 17:pin_surround_replacement:duration = pulseIn(25, ( HIGH)); in Line 32 +Mutation 18:pin_value_replacement:duration = pulseIn(22, !( HIGH)); in Line 32 +Mutation 19:pin_surround_replacement:analogWrite(1, ( right_speed)); in Line 54 +Mutation 20:pin_surround_replacement:analogWrite(3, ( right_speed)); in Line 54 +Mutation 21:pin_surround_replacement:analogWrite(5, ( left_speed)); in Line 55 +Mutation 22:pin_surround_replacement:analogWrite(7, ( left_speed)); in Line 55 +Mutation 23:pin_surround_replacement:analogWrite(1, ( 0)); in Line 58 +Mutation 24:pin_surround_replacement:analogWrite(3, ( 0)); in Line 58 +Mutation 25:pin_surround_replacement:analogWrite(5, ( 0)); in Line 59 +Mutation 26:pin_surround_replacement:analogWrite(7, ( 0)); in Line 59 +Mutation 27:pin_surround_replacement:pinMode(6, OUTPUT); in Line 72 +Mutation 28:pin_surround_replacement:pinMode(8, OUTPUT); in Line 72 +Mutation 29:pin_func_replacement:pinMode(7,INPUT); in Line 72 +Mutation 30:pin_surround_replacement:pinMode(22, OUTPUT); in Line 73 +Mutation 31:pin_surround_replacement:pinMode(23, OUTPUT); in Line 73 +Mutation 32:pin_surround_replacement:pinMode(25, OUTPUT); in Line 73 +Mutation 33:pin_surround_replacement:pinMode(26, OUTPUT); in Line 73 +Mutation 34:pin_surround_replacement:pinMode(27, OUTPUT); in Line 73 +Mutation 35:pin_func_replacement:pinMode(24,INPUT); in Line 73 +Mutation 36:pin_surround_replacement:pinMode(5, OUTPUT); in Line 74 +Mutation 37:pin_surround_replacement:pinMode(7, OUTPUT); in Line 74 +Mutation 38:pin_func_replacement:pinMode(6,INPUT); in Line 74 +Mutation 39:pin_surround_replacement:pinMode(2, OUTPUT); in Line 75 +Mutation 40:pin_surround_replacement:pinMode(4, OUTPUT); in Line 75 +Mutation 41:pin_func_replacement:pinMode(3,INPUT); in Line 75 +Mutation 42:pin_surround_replacement:pinMode(22, OUTPUT); in Line 76 +Mutation 43:pin_surround_replacement:pinMode(23, OUTPUT); in Line 76 +Mutation 44:pin_surround_replacement:pinMode(24, OUTPUT); in Line 76 +Mutation 45:pin_surround_replacement:pinMode(26, OUTPUT); in Line 76 +Mutation 46:pin_surround_replacement:pinMode(27, OUTPUT); in Line 76 +Mutation 47:pin_func_replacement:pinMode(25,INPUT); in Line 76 +Mutation 48:pin_surround_replacement:pinMode(1, OUTPUT); in Line 77 +Mutation 49:pin_surround_replacement:pinMode(3, OUTPUT); in Line 77 +Mutation 50:pin_func_replacement:pinMode(2,INPUT); in Line 77 +Mutation 51:pin_surround_replacement:pinMode(22, OUTPUT); in Line 78 +Mutation 52:pin_surround_replacement:pinMode(24, OUTPUT); in Line 78 +Mutation 53:pin_surround_replacement:pinMode(25, OUTPUT); in Line 78 +Mutation 54:pin_func_replacement:pinMode(23,INPUT); in Line 78 +Mutation 55:pin_surround_replacement:pinMode(23, INPUT); in Line 79 +Mutation 56:pin_surround_replacement:pinMode(24, INPUT); in Line 79 +Mutation 57:pin_surround_replacement:pinMode(25, INPUT); in Line 79 +Mutation 58:pin_func_replacement:pinMode(22,OUTPUT); in Line 79 +Mutation 59:pull_resis_replacement:pinMode(22,INPUT_PULLUP); in Line 79 +Mutation 60:pin_surround_replacement:pinMode(12, OUTPUT); in Line 80 +Mutation 61:pin_func_replacement:pinMode(13,INPUT); in Line 80 +Mutation 62:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 82 +Mutation 63:pin_surround_replacement:digitalWrite(23, ( HIGH)); in Line 82 +Mutation 64:pin_surround_replacement:digitalWrite(25, ( HIGH)); in Line 82 +Mutation 65:pin_surround_replacement:digitalWrite(26, ( HIGH)); in Line 82 +Mutation 66:pin_surround_replacement:digitalWrite(27, ( HIGH)); in Line 82 +Mutation 67:pin_value_replacement:digitalWrite(24, !( HIGH)); in Line 82 +Mutation 68:output_stmt_deletion: in Line 82 +Mutation 69:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 83 +Mutation 70:pin_surround_replacement:digitalWrite(23, ( HIGH)); in Line 83 +Mutation 71:pin_surround_replacement:digitalWrite(24, ( HIGH)); in Line 83 +Mutation 72:pin_surround_replacement:digitalWrite(26, ( HIGH)); in Line 83 +Mutation 73:pin_surround_replacement:digitalWrite(27, ( HIGH)); in Line 83 +Mutation 74:pin_value_replacement:digitalWrite(25, !( HIGH)); in Line 83 +Mutation 75:output_stmt_deletion: in Line 83 +Mutation 76:pin_surround_replacement:digitalWrite(5, ( LOW)); in Line 84 +Mutation 77:pin_surround_replacement:digitalWrite(7, ( LOW)); in Line 84 +Mutation 78:pin_value_replacement:digitalWrite(6, !( LOW)); in Line 84 +Mutation 79:output_stmt_deletion: in Line 84 diff --git a/case_study/arduino_lab/group_01/line_follower_1.cpp b/case_study/arduino_lab/group_01/line_follower_1.cpp new file mode 100755 index 0000000..6617fcf --- /dev/null +++ b/case_study/arduino_lab/group_01/line_follower_1.cpp @@ -0,0 +1,273 @@ +/** + * Group number: 1 + * Student 1: + * Stefan Breetveld, 4374657 + * Student 2: + * David Viteri, 4580958 + */ + +/* + * Initial setup requires a few commands to be run. + * 1. ifconfig | get the adress of this pc. + * 2. ROS_IP= | set the variable ROSIP to the current ip adress. + * 3. export ROS_IP | set the environment variable so you don't have to set it again. + * 4. ROS_MASTER_URI=http://$ROS_IP:11311/ | set the URI where ros should listen for communication. + * 5. export ROS_MASTER_URI | same as before. + * + * Before running make sure to source the workspace + * . /devel/setup.bash + * + * To be able to get an image from the camera we need to use the compressed image transport type + * to do so use the following commands. + * rosparam set /compressed_listener/image_transport compressed + * rosrun line_follower line_follower __name:=compressed_listener + */ + +#include +#include +#include +#include +#include +#include +#include +#include "line_follower_1.h" + +//Use the opencv namespace so we don't have to type cv:: everytime we want to use a function or type from opencv +using namespace cv; +using namespace std; + +//this should be larger than the maximum width of the image. +const double large_number = 1000000; +const char* window_name_1 = "src"; +const char* window_name_2 = "detected"; +const char* window_name_3 = "thresh"; +const char* window_name_4 = "gray"; + +int erosion_size = 11; +int dilation_size = 11; + +const float low_speed = 50; +const float mid_speed = 75; +const float top_speed = 100; + +ros::Publisher pub; + +int main(int argc, char **argv) +{ + // initialise ROS + ros::init(argc, argv, "line_follower"); + // initialise ROS nodehandler + ros::NodeHandle nh; + // tell ROS that we are going to publish messages on /cmd_vel of type geomety_msgs/Twist + pub = nh.advertise("cmd_vel", 1); + // create a window that shows the source image + namedWindow(window_name_1, CV_WINDOW_NORMAL); + // create a window that shows the region, contours and the followed line + namedWindow(window_name_2, CV_WINDOW_NORMAL); + // create a window that shows the image that results from the threshold + namedWindow(window_name_3, CV_WINDOW_NORMAL); + // create a window that shows the grayscale of the source image + namedWindow(window_name_4, CV_WINDOW_NORMAL); + + startWindowThread(); + image_transport::ImageTransport it(nh); + // Tell ROS we want to subscribe to messages on /camera/image + image_transport::Subscriber sub = it.subscribe("camera/image", 1, imageCallback); + // Tell ROS to keep looking for new messages. + ros::spin(); + + destroyWindow(window_name_1); + destroyWindow(window_name_2); + destroyWindow(window_name_3); + destroyWindow(window_name_4); +} + +void imageCallback(const sensor_msgs::ImageConstPtr& msg) +{ + cv_bridge::CvImagePtr cv_ptr; + try + { + // Create a local copy of the image we received so that we are allowed to edit it. + cv_ptr = cv_bridge::toCvCopy(msg, "bgr8"); + + // Rotate image 90 degrees counter clockwise. + transpose(cv_ptr->image, cv_ptr->image); + flip(cv_ptr->image, cv_ptr->image,1); + + // Find something we can follow + float line = getMidPoint(cv_ptr->image.clone()); + // Convert the found value to values we can send to the robot + centerToEngine(line); + + //Publish msg + geometry_msgs::Twist msg; + msg.linear.x = engine_right; + msg.linear.y = engine_left; + pub.publish(msg); + + // Show the source image + imshow(window_name_1, cv_ptr->image); + + waitKey(30); + } + catch (cv_bridge::Exception& e) + { + ROS_ERROR("Could not convert from '%s' to 'bgr8'.", msg->encoding.c_str()); + } +} + +float distToCenter(Point2f point, Mat image) +{ + return abs(((float) image.cols) / 2 - point.x); +} + +float getMidPoint(Mat image) +{ + Mat mono, blur, thresh, erodeImg, dilateImg; + vector > contours; + vector hierarchy; + + // Define our region of interest + int top_left_x = 0; + int top_left_y = image.rows / 4 * 3; + int height = image.rows / 4; + int width = image.cols - 2 * top_left_x; + Rect rect = Rect(top_left_x, top_left_y, width, height); + Mat roi(image, rect); + + // Convert to grayscale + cvtColor(roi, mono, CV_BGR2GRAY); + // Show grayscale image + imshow(window_name_4, mono); + // Blur the gray image + GaussianBlur(mono, blur, Size(9, 9), 2, 2); + // Apply an inverse binary otsu threshold + threshold(blur, thresh, 0, 255, CV_THRESH_BINARY_INV|CV_THRESH_OTSU); + // Show the result of the threshold + imshow(window_name_3, thresh); + + // Remove small lines or areas from the image, but keep everything else the same size + Mat erode_element = getStructuringElement(MORPH_RECT, + Size(2*erosion_size + 1, 2*erosion_size+1 ), + Point(erosion_size, erosion_size)); + Mat dilate_element = getStructuringElement(MORPH_RECT, + Size(2*dilation_size + 1, 2*dilation_size+1), + Point(dilation_size, dilation_size)); + erode(thresh, erodeImg, erode_element); + dilate(erodeImg, dilateImg, dilate_element); + + // Find contours in the image. + findContours(dilateImg, contours, hierarchy, CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE); + + double dist = large_number; + int offset = roi.cols / 2; + + // Get the moments + vector mu(contours.size()); + for( int i = 0; i < contours.size(); i++ ) + { mu[i] = moments( contours[i], false ); } + + // Get the centers of mass + vector mc( contours.size() ); + for( int i = 0; i < contours.size(); i++ ) + { mc[i] = Point2f( mu[i].m10/mu[i].m00 , mu[i].m01/mu[i].m00 ); } + + // overlay contours on source image. + for(int i = 0; i < contours.size(); i++) + { + Scalar color = Scalar( 0, 255, 0); + translate_contour(contours[i], top_left_x, top_left_y); + drawContours( image, contours, i, color, 2, 8, hierarchy, 0, Point() ); + } + + // Find center of mass closest to the center of the image + for(int i = 0; i < mc.size(); i++) + { + Point2f contour_center = mc[i]; + float temp_dist = distToCenter(contour_center, roi) ; + if(temp_dist < dist) { + offset = contour_center.x; + dist = temp_dist; + } + } + + // Overlay roi box on source image + rectangle(image, rect, Scalar(255, 0, 0)); + // Overlay line representing the center of mass. + line(image, Point(top_left_x + offset, top_left_y), Point(top_left_x + offset, top_left_y + height), Scalar(0, 0, 255), 2, 8, 0); + // Show the resulting image + imshow(window_name_2, image); + // Convert the found center of mass to a number betweer minus one and one. minus one being far left and one being far right. + return -1.0f + 2.0f * (float) offset / roi.cols; +} + +// Translate a contour by the given x and y values. +void translate_contour(vector &contour, int x, int y) +{ + for (size_t i=0; i +#include +#include +#include + +using namespace cv; +using namespace std; + +enum states {Straight, SS_Left, SS_Right, S_Left, S_Right, Turn_Left, Turn_Right}; +int state; + +float engine_right; +float engine_left; + +void translate_contour(vector &contour, int x, int y); + +float getMidPoint(Mat image); + +void imageCallback(const sensor_msgs::ImageConstPtr& msg); + +//This function updates the engine right/left values which are being sent to the robot, +//Contour as input argument previously calculated from the image +void centerToEngine(float center); + +void automata_engines(); diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/.sconsign.dblite b/case_study/arduino_lab/group_01/original/.pioenvs/.sconsign.dblite new file mode 100755 index 0000000..9e7c6ac Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/.sconsign.dblite differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/do-not-modify-files-here.url b/case_study/arduino_lab/group_01/original/.pioenvs/do-not-modify-files-here.url new file mode 100755 index 0000000..4d15482 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/.pioenvs/do-not-modify-files-here.url @@ -0,0 +1,3 @@ + +[InternetShortcut] +URL=http://docs.platformio.org/page/projectconf/section_platformio.html#build-dir diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/CDC.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/CDC.o new file mode 100755 index 0000000..c69810a Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/CDC.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o new file mode 100755 index 0000000..86249ea Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o new file mode 100755 index 0000000..8a8650b Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o new file mode 100755 index 0000000..6cb9c64 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o new file mode 100755 index 0000000..0ac5dc8 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o new file mode 100755 index 0000000..d2b7d06 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o new file mode 100755 index 0000000..6970f18 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o new file mode 100755 index 0000000..409669c Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Print.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Print.o new file mode 100755 index 0000000..378a783 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Print.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Stream.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Stream.o new file mode 100755 index 0000000..b26f6db Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Stream.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Tone.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Tone.o new file mode 100755 index 0000000..2b1b89a Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/Tone.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o new file mode 100755 index 0000000..02e5795 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o new file mode 100755 index 0000000..f74663b Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WMath.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WMath.o new file mode 100755 index 0000000..7ad53b7 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WMath.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WString.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WString.o new file mode 100755 index 0000000..7504c08 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/WString.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o new file mode 100755 index 0000000..84256d5 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/abi.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/abi.o new file mode 100755 index 0000000..1545273 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/abi.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/hooks.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/hooks.o new file mode 100755 index 0000000..6125326 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/hooks.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/main.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/main.o new file mode 100755 index 0000000..04c85b4 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/main.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/new.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/new.o new file mode 100755 index 0000000..23852e6 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/new.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring.o new file mode 100755 index 0000000..a045630 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o new file mode 100755 index 0000000..3fc1d7c Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o new file mode 100755 index 0000000..41a2722 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o new file mode 100755 index 0000000..d851d15 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o new file mode 100755 index 0000000..707247f Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/firmware.elf b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/firmware.elf new file mode 100755 index 0000000..f00e6ab Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/firmware.elf differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/firmware.hex b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/firmware.hex new file mode 100755 index 0000000..7480925 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/firmware.hex @@ -0,0 +1,842 @@ +:100000000C94C5010C94F6010C94F6010C94F601C5 +:100010000C94F6010C94F6010C94F6010C94F60184 +:100020000C94F6010C94F6010C94F6010C94F60174 +:100030000C94F6010C94DA0F0C94F6010C94F60172 +:100040000C94F6010C94F6010C94F6010C94F60154 +:100050000C94F6010C94F6010C94F6010C945A12CF +:100060000C94F6010C94B00F0C94860F0C94F601CE +:100070000C94F6010C94F6010C94F6010C94F60124 +:100080000C94F6010C94F6010C94F6010C94F60114 +:100090000C945C0F0C94320F0C94F6010C94F60146 +:1000A0000C94F6010C94F6010C94F6010C94F601F4 +:1000B0000C94F6010C94F6010C94F6010C94F601E4 +:1000C0000C94F6010C94F6010C94F6010C94F601D4 +:1000D0000C94F6010C94F6010C94F6010C94F601C4 +:1000E0000C94F601FB10FE10ED10F110F510351117 +:1000F000021106110C11101114111A111E112211E6 +:10010000351128112C113011AE11B311B811C211D3 +:10011000CC114512D611DE11E611F011FA110412BC +:1001200013121D124512271231123B120C944B0967 +:100130000C94FB100C9471020C9435110C94550323 +:100140000C94DE080C94F1100C94E6110C94ED1054 +:100150000C94E0140C94B4070C9406110C944F0208 +:100160000C94AE110C944A0A0C9463020C94720A1B +:100170000C9416060C9436040C94FA110C9422116B +:100180000C9427120C945B030C94F9070C94DE1169 +:100190000C9402110C94090C0C9440020C942C1138 +:1001A0000C9445120C9450030C94FE100C948F0781 +:1001B0000C9485090C94B8110C94AE070C9432067B +:1001C0000C940A040C941D120C94DB080C9430114E +:1001D0000C94CC110C9413120C94B1070C947F0462 +:1001E0000C9414110C943B120C9458030C94F902C7 +:1001F0000C94B7070C9433040C94FF070C94F01183 +:100200000C9428110C9447060C941A110C94E108D4 +:100210000C94D6110C9427090C94F50A0C941E1119 +:100220000C9473040C94F8010C9479040C945F03FF +:100230000C94B2020C94AB090C9476040C94FC0759 +:100240000C94F5100C9404120C940C110C947C0476 +:100250000C9410110C94AB070C94C2110C94300444 +:100260000C9431120C94B3110000200023002600DE +:1002700029002C002F0032000001000003010601BC +:10028000090100002100240027002A002D00300071 +:10029000330001010000040107010A0100002200EF +:1002A000250028002B002E00310034000201000040 +:1002B000050108010B0105050505070508080808E3 +:1002C000020202020A0A08080404040401010101EE +:1002D00001010101030303030303030304070707E9 +:1002E0000C0C0C0C0C0C0C0C02020202060606068E +:1002F000060606060B0B0B0B0B0B0B0B010210205B +:10030000200808102040102040800201020108044B +:1003100002010102040810204080804020100804DF +:100320000201800402018040201008040201080438 +:10033000020101020408102040800102040810207C +:10034000408000000A0B02090C0D0E08070304018F +:10035000000000000000000000000000000000009D +:10036000000000000000000000000000000012116A +:10037000100000000000000000000000000000006D +:100380000000000000000000E01411241FBECFEFA9 +:10039000D1E2DEBFCDBF00E00CBF14E0A0E0B2E0D0 +:1003A000E2E2F2E300E00BBF02C007900D92A43539 +:1003B000B107D9F72AE0A4E5B4E001C01D92AC383A +:1003C000B207E1F711E0C5ECD1E000E006C02197EB +:1003D0000109802FFE010E942D16C43CD10780E048 +:1003E0000807A9F70E94E9120C940F190C94000059 +:1003F000CF92DF92EF92FF920F931F93CF93DF93F1 +:100400006C017A018B01C0E0D0E0CE15DF0589F0E8 +:10041000D8016D918D01D601ED91FC910190F08193 +:10042000E02DC6011995892B11F47E0102C0219699 +:10043000ECCFC701DF91CF911F910F91FF90EF900B +:10044000DF90CF900895FC01A089B1898C91A68995 +:10045000B78982FD0FC09C91818D8F5F8F73228D34 +:10046000821749F0218DDF01A20FB11D5D969C938B +:10047000818F08958C910895089580E090E008950B +:10048000FC01538D448D252F30E0842F90E0821B9A +:10049000930B541710F0CF96089501970895FC011F +:1004A000918D828D981761F0828DDF01A80FB11DAB +:1004B0005D968C91928D9F5F9F73928F90E00895CF +:1004C0008FEF9FEF0895FC01918D828D981731F089 +:1004D000828DE80FF11D858D90E008958FEF9FEFDD +:1004E0000895FC01918D228D892F90E0805C9F4FB3 +:1004F000821B91098F739927089587E095E00E94E8 +:10050000710221E0892B09F420E0822F08958AE608 +:1005100094E00E94710221E0892B09F420E0822FEF +:100520000895FC01848DDF01A80FB11DA35ABF4FB0 +:100530002C91848D90E001968F739927848FA689E2 +:10054000B7892C93A089B1898C9180648C93938D09 +:10055000848D981306C00288F389E02D80818F7DF9 +:1005600080830895EF92FF920F931F93CF93DF93B1 +:10057000EC0181E0888F9B8D8C8D981305C0E889F4 +:10058000F989808185FD24C0F62E0B8D10E00F5F68 +:100590001F4F0F731127E02E8C8DE8120CC00FB681 +:1005A00007FCFACFE889F989808185FFF5CFCE0174 +:1005B0000E949102F1CF8B8DFE01E80FF11DE35AED +:1005C000FF4FF0820B8FEA89FB898081806207C030 +:1005D000EE89FF896083E889F9898081806480835E +:1005E00081E090E0DF91CF911F910F91FF90EF900C +:1005F0000895CF93DF93EC01888D8823C9F0EA89B1 +:10060000FB89808185FD05C0A889B9898C9186FD0B +:100610000FC00FB607FCF5CF808185FFF2CFA88908 +:10062000B9898C9185FFEDCFCE010E949102E7CF71 +:10063000DF91CF91089580E090E0892B21F00E9416 +:100640008702811121C080E090E0892B21F00E9477 +:100650007D0281111CC080E090E0892B41F080E098 +:1006600090E0892B21F00E940000811113C080E0EE +:1006700090E0892BA1F080E090E0892B81F00E942E +:10068000000081110AC008950E940000DCCF0E9482 +:100690000000E1CF0E940000EACF0C940000089512 +:1006A000FC01EE57FB4F808108958CEA92E008959B +:1006B0008DEC92E00895FC0186A197A108958F9298 +:1006C0009F92AF92BF92CF92DF92EF92FF920F93E1 +:1006D0001F93CF93DF9300D01F921F92CDB7DEB749 +:1006E0008C016B0164E6C616D1043CF0FC01EE57A8 +:1006F000FB4F8081882309F478C0DA01ED91FC91E9 +:100700000190F081E02DB801655E7D4FCA01199519 +:100710009C017801BCEEEB1ABDEFFB0A4FEFF7012D +:1007200040834EEF3196408331968083319690839B +:100730003196890F809580833196C082D801A65E5C +:10074000BD4FDC9265E070E040E050E0C9010796E3 +:100750006817790730F4A1914A0F511D6F5F7F4FE1 +:10076000F7CF6901F8E0CF0ED11C800F911FFC017B +:10077000EC5EFD4F4095408341E0C41642E0D40654 +:10078000C1F056014701D80112968D919C911397A3 +:10079000F40161914F01DC01ED91FC910190F08138 +:1007A000E02D1995C4018E199F098C159D055CF3E8 +:1007B0001EC080E492E09A83898383E08B8381EE7C +:1007C00092E09D838C83D801ED91FC910190F081A2 +:1007D000E02DAE014F5F5F4F67E070E0C8011995F3 +:1007E000AA24AA94BB24BA9402C0A12CB12CC5019E +:1007F0000F900F900F900F900F90DF91CF911F915E +:100800000F91FF90EF90DF90CF90BF90AF909F90AF +:100810008F9008951092B2001092690410926804AB +:1008200021E030E03093010220930002FC0144817A +:100830005581668177814093600450936104609391 +:1008400062047093630480859185A285B38580934B +:100850005C0490935D04A0935E04B0935F040895DC +:100860008AE193E008958BE393E00895AF92BF92FD +:10087000CF92DF92EF92FF920F931F93CF93DF936C +:100880005C01FB0181919191A191B1916C017D017C +:1008900024E0C20ED11CE11CF11C8F01061B170BBA +:1008A00020E030E00C151D052E053F0538F4419180 +:1008B0009F0122503109E9014883EFCFFB01E80F86 +:1008C000F91F13826D5F7F4FF50173836283049676 +:1008D000DF91CF911F910F91FF90EF90DF90CF901C +:1008E000BF90AF9008958CEA92E008958DEC92E06D +:1008F00008958BE493E008958CE693E00895CF92F9 +:10090000DF92EF92FF920F931F93DC01FB01438173 +:10091000429546954770C42ED12CE12CF12C1296AD +:10092000CD92DD92ED92FC921597448150E060E00B +:1009300070E093E0440F551F661F771F9A95D1F71B +:100940004C295D296E297F2912964D935D936D93F5 +:100950007C931597058110E020E030E08BE0000FDC +:10096000111F221F331F8A95D1F7402B512B622B69 +:10097000732B12964D935D936D937C93159706811F +:100980000F7010E020E030E093E1000F111F221FF4 +:10099000331F9A95D1F7042B152B262B372B129644 +:1009A0000D931D932D933C931597868182958F709F +:1009B00047814F7750E060E070E094E0440F551FAE +:1009C000661F771F9A95D1F7482B41155105610590 +:1009D0007105A9F0405853406109710987E1440F3E +:1009E000551F661F771F8A95D1F7402B512B622B1D +:1009F000732B12964D935D936D937C93159787811E +:100A000087FF07C0305812960D931D932D933C938A +:100A100015974385429546954770C42ED12CE12CFD +:100A2000F12C1696CD92DD92ED92FC9219974485A9 +:100A300050E060E070E093E0440F551F661F771FA1 +:100A40009A95D1F74C295D296E297F2916964D93E9 +:100A50005D936D937C931997058510E020E030E05D +:100A60008BE0000F111F221F331F8A95D1F7402BF7 +:100A7000512B622B732B16964D935D936D937C9344 +:100A8000199706850F7010E020E030E093E1000F29 +:100A9000111F221F331F9A95D1F7042B152B262BDC +:100AA000372B16960D931D932D933C93199786859E +:100AB00082958F7047854F7750E060E070E094E05A +:100AC000440F551F661F771F9A95D1F7482B411584 +:100AD000510561057105A9F040585340610971093C +:100AE00087E1440F551F661F771F8A95D1F7402B6A +:100AF000512B622B732B16964D935D936D937C93C4 +:100B00001997878587FF07C0305816960D931D9358 +:100B10002D933C9319974389429546954770C42E6F +:100B2000D12CE12CF12C1A96CD92DD92ED92FC9213 +:100B30001D97448950E060E070E093E0440F551F3A +:100B4000661F771F9A95D1F74C295D296E297F2959 +:100B50001A964D935D936D937C931D97058910E0D4 +:100B600020E030E08BE0000F111F221F331F8A9519 +:100B7000D1F7402B512B622B732B1A964D935D931B +:100B80006D937C931D9706890F7010E020E030E094 +:100B900093E1000F111F221F331F9A95D1F7042BE9 +:100BA000152B262B372B1A960D931D932D933C93C3 +:100BB0001D97868982958F7047894F7750E060E056 +:100BC00070E094E0440F551F661F771F9A95D1F788 +:100BD000482B4115510561057105A9F04058534056 +:100BE0006109710987E1440F551F661F771F8A95B8 +:100BF000D1F7402B512B622B732B1A964D935D939B +:100C00006D937C931D97878987FF07C030581A968C +:100C10000D931D932D933C931D9788E190E01F91B8 +:100C20000F91FF90EF90DF90CF900895EF92FF9299 +:100C30000F931F93CF93DF937C01EB0102960E94E9 +:100C40007F048C01BE01680F791FC70140960E9486 +:100C50007F04800F911FDF91CF911F910F91FF9023 +:100C6000EF9008950F931F93CF93DF938C01EC01C6 +:100C70002696CE010E941606D8019496ED91FC911D +:100C80009597CE01DF91CF911F910F911994CF923B +:100C9000DF92EF92FF920F931F93CF93DF938C011C +:100CA000EB01FC014281538164817581DB01CA0142 +:100CB000E7E1B595A79597958795EA95D1F7992797 +:100CC000AA27BB270097A105B10521F080589C4FAA +:100CD000AF4FBF4F188219821A826A017B0135E03B +:100CE000CC0CDD1CEE1CFF1C3A95D1F7CB826A01BF +:100CF0007B01E3E0F594E794D794C794EA95D1F7A4 +:100D0000CC826A017B01FBE0F594E794D794C79409 +:100D1000FA95D1F7CD826C017D0124E0CC0CDD1C6D +:100D2000EE1CFF1C2A95D1F733E175956795579511 +:100D300047953A95D1F74F70C42ACE826C017D0158 +:100D400044E0F594E794D794C7944A95D1F7CF82BD +:100D500020E030E0A901F8016281738184819581EE +:100D60000E94631687FF03C08C2D80688F83F80173 +:100D70004681578160857185DB01CA0127E1B59500 +:100D8000A795979587952A95D1F79927AA27BB27E5 +:100D90000097A105B10521F080589C4FAF4FBF4F80 +:100DA000188619861A866A017B01F5E0CC0CDD1CD9 +:100DB000EE1CFF1CFA95D1F7CB866A017B0123E07C +:100DC000F594E794D794C7942A95D1F7CC866A0115 +:100DD0007B013BE0F594E794D794C7943A95D1F71B +:100DE000CD866C017D01E4E0CC0CDD1CEE1CFF1C0B +:100DF000EA95D1F7F3E17595679557954795FA957B +:100E0000D1F74F70C42ACE866C017D01A4E0F59421 +:100E1000E794D794C794AA95D1F7CF8620E030E025 +:100E2000A901F80166817781808591850E9463160A +:100E300087FF03C08C2D80688F87F801828593859A +:100E4000A485B585AC01BD01E7E17595679557951A +:100E50004795EA95D1F7552766277727411551051C +:100E60006105710521F040585C4F6F4F7F4F188A24 +:100E7000198A1A8A6C017D0125E0CC0CDD1CEE1C60 +:100E8000FF1C2A95D1F7CB8A6C017D0133E0F594E4 +:100E9000E794D794C7943A95D1F7CC8A6C017D0139 +:100EA000EBE0F594E794D794C794EA95D1F7CD8A0F +:100EB0006A017B01F4E0CC0CDD1CEE1CFF1CFA95F2 +:100EC000D1F723E1B595A795979587952A95D1F701 +:100ED0008F70C82ACE8A6A017B0134E0F594E794CA +:100EE000D794C7943A95D1F7CF8A20E030E0A90192 +:100EF000F80162857385848595850E94631687FF56 +:100F000003C04C2D40684F8B88E190E0DF91CF917A +:100F10001F910F91FF90EF90DF90CF900895EF9287 +:100F2000FF920F931F93CF93DF937C01EB01029607 +:100F30000E9447068C01BE01680F791FC7014096C9 +:100F40000E944706800F911FDF91CF911F910F9153 +:100F5000FF90EF90089582E893E0089588E092E092 +:100F6000089583EA93E0089584EC93E00895AF92A6 +:100F7000BF92CF92DF92EF92FF920F931F93CF9386 +:100F8000DF935C01EB018881F501828389819A817D +:100F9000AB81BC81FB0135966C017D0125E0C20E61 +:100FA000D11CE11CF11C8F01061B170B20E030E067 +:100FB0000C151D052E053F0538F441919F01225067 +:100FC0003109E9014883EFCFFB01E80FF91F1482D3 +:100FD0006C5F7F4FF501748363830596DF91CF913A +:100FE0001F910F91FF90EF90DF90CF90BF90AF9047 +:100FF000089587ED93E0089588EF93E008956F9248 +:101000007F928F929F92AF92BF92CF92DF92EF9298 +:10101000FF920F931F93CF93DF93DC01FB0180813D +:1010200090E013969C938E9312972181922B1396A6 +:101030009C938E93129702811381248135815B01E9 +:1010400086E0A80EB11C68017901C6E0CC0ED11C67 +:10105000E11CF11CA5014E1B5F0B60E070E04C151C +:101060005D056E057F0540F4E50149915E01CE0105 +:101070000297EC014883EECFEF01C00FD11F1D8214 +:10108000CF01059615969C938E931497EF01C00F90 +:10109000D11F4E815F8168857985065F1F4F3F01B3 +:1010A000600E711E6801012E000CEE08FF08C40ED0 +:1010B000D51EE61EF71E43018E1A9F0AA12CB12CE5 +:1010C0008C149D04AE04BF0440F4E30129913E0159 +:1010D000CE010297EC012883EECF400F511F9F01F4 +:1010E000240F351FC9010197EC011882C80101972F +:1010F0008E0F9F1F17969C938E931697E9018880F9 +:101100009980AA80BB804C5F5F4F3F01640E751EC3 +:101110008A01052E000C220B330B080D191D2A1D08 +:101120003B1D6301CE1ADF0AE12CF12CC016D1065B +:10113000E206F30640F4E30169913E01CE01029715 +:10114000EC016883EECFCA01880D991D8F01080F4D +:10115000191F980121503109E9011882BA01615023 +:101160007109E60FF71F1996FC93EE931897F80193 +:101170002181428150E060E070E0BA0155274427A8 +:10118000522B2081422B2381722B1A964D935D9313 +:101190006D937C931D970496DF91CF911F910F91D2 +:1011A000FF90EF90DF90CF90BF90AF909F908F9087 +:1011B0007F906F90089581E194E0089582E394E038 +:1011C0000895FC01DB014C9150E060E070E0428347 +:1011D00053836483758311968C911197582B4283A6 +:1011E00053836483758312968C911297682B428384 +:1011F00053836483758313968C911397782B428362 +:1012000053836483758314964C91149750E060E087 +:1012100070E0468357836087718715968C91159788 +:10122000582B468357836087718716968C91169743 +:10123000682B468357836087718717968C91782B2C +:10124000468357836087718788E090E00895DC01CA +:10125000FB0112968C911297808313968C911397B1 +:10126000818314968C911497828315968C9115978F +:10127000838316968C911697848317968C91179773 +:10128000858318968C911897868319968C918783FD +:1012900088E090E008950E94D4170F931F93CF9396 +:1012A000DF93CDB7DEB72A970FB6F894DEBF0FBE37 +:1012B000CDBF8C0184E392E09A8389831B821C82D8 +:1012C0001D821E821F82188619861A86D801ED910A +:1012D000FC910190F081E02DAE014F5F5F4F6AE01D +:1012E00070E0C80119950E944E12F801608771875D +:1012F000828793872A960FB6F894DEBF0FBECDBFC4 +:10130000DF91CF911F910F910895CF93DF93362FE7 +:10131000272FDC011296ED91FC911397EF010990B4 +:101320000020E9F72197CE1BDF0BAE0160E070E0F3 +:10133000E32FF22F419351936193719312966D9124 +:101340007C911397AE01CF010E94D917CE0104966C +:10135000DF91CF910895BF92CF92DF92EF92FF92EB +:101360000F931F93CF93DF93EC018B018A81FB01D5 +:101370008083118212821382DB01179680E0E4E001 +:10138000F0E09A819F012C5F3F4F8917B8F4EF81FD +:10139000F88594E0899FE00DF11D11247081518141 +:1013A00042819381FD01339770833196508331964A +:1013B00040839C93F9018F5F1496E3CF8985E00FFA +:1013C000F11F808311821282138280E09985F801D7 +:1013D000E20FF31F2C5F3F4F8917B0F4AE85BF8536 +:1013E00094E0899FA00DB11D11246C9111965C9120 +:1013F000119712964C91129713969C91608351838A +:10140000428393838F5FE2CF888980831182128227 +:10141000C9011382B12C2889B21690F5EB2DF0E0AA +:10142000EE0FFF1FAB89BC89AE0FBF1F2D913C9102 +:10143000D9010D900020E9F711976D01C21AD30A66 +:10144000D801A80FB91FA60160E070E04D935D932D +:101450006D937C9313977C0124E0E20EF11C8B8941 +:101460009C89E80FF91F60817181A601C8018E0D6A +:101470009F1D0E94D917C6018E0D9F1DB394CBCF1F +:10148000DF91CF911F910F91FF90EF90DF90CF9060 +:10149000BF900895CF93DF93DC01FB0112968C91EE +:1014A0001297808313968D919C911497EC0109906B +:1014B0000020E9F72197C81BD90BAE0160E070E06E +:1014C000418352836383748313966D917C91149747 +:1014D000AE01CF0105960E94D917CE010596DF9186 +:1014E000CF910895CF92DF92EF92FF920F931F93C7 +:1014F000CF93DF937C01EB01FC01828188838381A0 +:101500008983A481B581FD0101900020E9F731971D +:101510006F01CA1ADB0AC601A0E0B0E08A839B8390 +:10152000AC83BD83F70164817581A601CE01069667 +:101530000E94D917F701A681B781FD010190002013 +:10154000E9F731978F010A1B1B0BFE01EC0DFD1D06 +:10155000C801A0E0B0E086839783A087B187FAE056 +:10156000CF0ED11CF70166817781A801CE018C0DC9 +:101570009D1D0E94D9170C0D1D1DF701A085B18579 +:10158000FD0101900020E9F731976F01CA1ADB0ACB +:10159000FE01E00FF11FC601A0E0B0E0808391835F +:1015A000A283B3830C5F1F4FF70160857185A6018D +:1015B000CE01800F911F0E94D9170C0D1D1DF70140 +:1015C0004285238594858585C00FD11F4883298353 +:1015D0009A838B83C8010496DF91CF911F910F915D +:1015E000FF90EF90DF90CF9008954F925F926F92AF +:1015F0007F928F929F92AF92BF92CF92DF92EF92A3 +:10160000FF920F931F93CF93DF93EC017B01DB01DC +:101610001C918A81811750F4B4E01B9FB001112402 +:101620008F8198850E94EB1698878F831A83F70124 +:10163000379680E024E030E06E0193E0C90ED11CC3 +:101640009A8189010C5F1F4F891790F5408150E006 +:1016500060E070E0742F6627552744279F012350D0 +:101660003109D9019C91492B2F5F3F4FD9019C91A2 +:10167000592B2F5F3F4FD9019C91692B4B835C8382 +:101680006D837E8398014F815885B4E08B9F400D18 +:10169000511D1124D6018D909D90AD90BC90DA0122 +:1016A0008D929D92AD92BC9213978F5F3496C8CF66 +:1016B000F701E20FF31FB08089858B1550F4B4E079 +:1016C000BB9EB00111248E859F850E94EB169F87DB +:1016D0008E87B98640E0BE01665F7F4F8985F7013E +:1016E000E00FF11F0C5F1F4F481720F551818281D9 +:1016F00090E0A0E0B0E0DC0199278827952B50818D +:10170000852B2381B22B8A879B87AC87BD87AE85CB +:10171000BF85E4E04E9FA00DB11D1124FB01808028 +:101720009180A280B3808D929D92AD92BC921397CE +:101730004F5FD4CFB08088898B1550F46B2D70E04B +:10174000660F771F8B899C890E94EB169C8B8B8B75 +:10175000B88A90E06E01F1E1CF0ED11C888998170C +:1017600008F045C0F701E00FF11F4081518162810F +:10177000738198012C5F3F4FF701E20FF31F49017E +:10178000032E000CAA08BB08840E951EA61EB71EC9 +:101790008F010E191F092801612C712C481459045E +:1017A0006A047B0438F481918F0102501109D80139 +:1017B0008C93EECF420F531FF701E40FF51F3197C3 +:1017C0001082215031092E0D3F1D3A8B298B8A0141 +:1017D0002B898C89E22FF82FE90FF11DE90FF11DFC +:1017E000D6012D913C91318320839F5FB7CFC801F3 +:1017F000DF91CF911F910F91FF90EF90DF90CF90ED +:10180000BF90AF909F908F907F906F905F904F9020 +:1018100008952F923F924F925F926F927F928F9294 +:101820009F92AF92BF92CF92DF92EF92FF920F936F +:101830001F93CF93DF93CDB7DEB7A8970FB6F89479 +:10184000DEBF0FBECDBF8C010E944E122B013C01AA +:10185000980129573B4F3C8B2B8BF901808191815B +:10186000A281B381A3019201281B390B4A0B5B0BA8 +:10187000DA01C901893F9A42A105B10510F03597F7 +:101880001082780148E8E41A4BEFF40AD7018D91F1 +:101890009C91892B79F0F801E557FB4F808191816C +:1018A000A281B38184159505A605B70518F4F70143 +:1018B00011821082980120583B4F388B2F87A80146 +:1018C00044585B4F5A8B498BC80144969E8B8D8B35 +:1018D000D801AE57BB4FBA8FA98FF801E057FB4F25 +:1018E000F8A3EF8F215F3F4F3AA329A3180136E8F1 +:1018F000231A3BEF330A4E5F5F4F588F4F8B895847 +:101900009B4F9CA38BA3A30192012C5E3F4F4F4F93 +:101910005F4F2DA33EA34FA358A7D80112968D91D8 +:101920009C911397DC01ED91FC910284F385E02DED +:1019300019959C0197FD55C2EF85F88980819181A9 +:10194000820F931F91838083D7014D915C91473023 +:101950005105C9F4EF89F88D80819181AC014F5F09 +:101960005F4F51834083F801E80FF91F248BD101A9 +:101970008D919C91119701978D939C93892B69F67A +:1019800088E090E01FC041155105A1F42F3F3105BB +:1019900021F681E090E0D7018D939C932DA13EA18B +:1019A0004FA158A5ABA1BCA12D933D934D935C9342 +:1019B0001397B3CF41305105A9F42E3F310531F4CF +:1019C00082E090E0F70191838083A7CFD7011D9239 +:1019D0001C92E98DFA8D808181119FCFC8010E94F0 +:1019E0004D099BCF4230510589F4D1012D933C9391 +:1019F000EF89F88D1182108283E090E0D7018D93FA +:101A00009C93EF85F8893183208387CF433051053C +:101A100069F4322F2227D1018D919C911197280FC3 +:101A2000391F2D933C9384E090E0CCCF4430510596 +:101A300089F460E071E00E94F7158F3F910531F461 +:101A400085E090E0D7018D939C9367CFF7011182D9 +:101A5000108263CF4530510571F4A989BA892D935D +:101A60003C9386E090E0F70191838083AF85B8894D +:101A70002D933C9352CF4630510599F4322F2227B3 +:101A8000E989FA8980819181280F391F3183208368 +:101A900087E090E0D7018D939C93F1018081918143 +:101AA0006DCF4830510509F038CFD7011D921C92F7 +:101AB00060E071E00E94F7158F3F910509F02DCF8E +:101AC000E989FA8980819181009709F0B9C0C8013C +:101AD0000E944D0988E292E09A8389835801FCEEC6 +:101AE000AF1AFBEFBF0A68012AEBC21A2BEFD20A2A +:101AF000D501ED91FC913097D9F1848195819C833A +:101B00008B83808191819E838D8382819381DC018F +:101B1000ED91FC910480F581E02D199598878F83D4 +:101B2000D501ED91FC9182819381DC01ED91FC91D5 +:101B30000680F781E02D19959A87898720E032E0A9 +:101B400040E050E02B873C874D875E87D8018D9120 +:101B50009C91F501A081B18118966D917C911997A6 +:101B6000DC01ED91FC91AE014F5F5F4FC80119950B +:101B7000B2E0AB0EB11CAC14BD0409F0B9CF812C9E +:101B800092E0992EA12CB12CF601A081B181109781 +:101B9000E1F112968D919C9113979C838B831496FF +:101BA0008D919C9115979E838D83ED91FC9111975A +:101BB0000480F581E02DCD01199598878F83D6019A +:101BC0008D919C91DC01ED91FC910680F781E02DD7 +:101BD00019959A8789878B869C86AD86BE86D801A3 +:101BE000ED91FC9120803180F60180819181DC01B2 +:101BF000ED91FC910280F381E02D1995AE014F5FCC +:101C00005F4FBC01C801F1011995F2E0CF0ED11C64 +:101C1000CE14DF0409F0B8CFF801EE57FB4F81E096 +:101C2000808331964082518262827382AB89BC8903 +:101C30004D925D926D927C9213978FEF9FEFF9C05A +:101C40008A30910509F0A2C084E392E09A838983E7 +:101C50001B821C821D821E821F82188619861A868C +:101C60000E944E12F80180849184A284B3849B0167 +:101C7000AC01281939094A095B0949015A016D89E2 +:101C80007E89CE0101960E94E108C501B40128EECB +:101C900033E040E050E00E940B168B809C80AD80CA +:101CA000BE80820E931EA41EB51E8B829C82AD82C6 +:101CB000BE829B01AC0160E472E48FE090E00E9480 +:101CC000E7158F809884A984BA84DC01CB01880D44 +:101CD000991DAA1DBB1D8F839887A987BA870E946B +:101CE0004E128F809884A984BA8436E3931A35E61D +:101CF000A30A34ECB30A28EE33E040E050E00E943F +:101D00000B162B8F3C8F4D8F5E8F9B01AC0160E4D7 +:101D100072E48FE090E00E94E715A5019401261B74 +:101D2000370B480B590BCA01B9018B809C80AD80E1 +:101D3000BE8031E0831A9108A108B1082B8D3C8D3B +:101D40004D8D5E8D821A930AA40AB50A20E03AEC02 +:101D50004AE95BE30E940B16820E931EA41EB51E79 +:101D6000D8011C968D929D92AD92BC921F97F8015E +:101D7000608B718B828B938B0E944E12AB89BC89D6 +:101D80006D937D938D939C931397C7CD863091056A +:101D900059F46D897E898F8D98A10E94F50A81E0A2 +:101DA000E9A1FAA18083B9CD8B30910521F4A98DE9 +:101DB000BA8D1C92B2CDFC01E154FE4FEE0FFF1F15 +:101DC000E00FF11F80819181009709F4A6CDDC011D +:101DD000ED91FC910190F081E02D6D897E8919953E +:101DE0009CCDF801EE57FB4F8081882301F17801EB +:101DF000BDE7EB1ABBEFFB0AF70180819181A2815D +:101E0000B381A3019201281B390B4A0B5B0BDA014A +:101E1000C901853C9940A105B10548F0C8010E945F +:101E20004D09D7014D925D926D927C92139780E09F +:101E300090E0A8960FB6F894DEBF0FBECDBFDF913D +:101E4000CF911F910F91FF90EF90DF90CF90BF90B7 +:101E5000AF909F908F907F906F905F904F903F904A +:101E60002F9008951F920F920FB60F9211240BB668 +:101E70000F922F933F934F935F936F937F938F9323 +:101E80009F93AF93BF93EF93FF9387E095E00E94FA +:101E90009102FF91EF91BF91AF919F918F917F91AF +:101EA0006F915F914F913F912F910F900BBE0F90CB +:101EB0000FBE0F901F9018951F920F920FB60F92A2 +:101EC00011240BB60F922F933F934F935F936F9311 +:101ED0007F938F939F93AF93BF93EF93FF9387E08D +:101EE00095E00E942302FF91EF91BF91AF919F91E6 +:101EF0008F917F916F915F914F913F912F910F90B3 +:101F00000BBE0F900FBE0F901F9018951F920F924F +:101F10000FB60F9211240BB60F922F933F934F934E +:101F20005F936F937F938F939F93AF93BF93EF9341 +:101F3000FF938AE694E00E949102FF91EF91BF9196 +:101F4000AF919F918F917F916F915F914F913F9151 +:101F50002F910F900BBE0F900FBE0F901F901895F2 +:101F60001F920F920FB60F9211240BB60F922F9360 +:101F70003F934F935F936F937F938F939F93AF9311 +:101F8000BF93EF93FF938AE694E00E942302FF91B0 +:101F9000EF91BF91AF919F918F917F916F915F91E1 +:101FA0004F913F912F910F900BBE0F900FBE0F904E +:101FB0001F9018951F920F920FB60F9211242F9316 +:101FC0003F935F936F937F938F939F93AF93BF9351 +:101FD0002091680430916904C90163E070E00E94B7 +:101FE000F715892B31F081E090E09093670480939E +:101FF00066042E31310524F0109201021092000285 +:102000002F5F3F4F3093690420936804BF91AF91D5 +:102010009F918F917F916F915F913F912F910F9041 +:102020000FBE0F901F901895CF92DF92EF92FF9204 +:102030000F931F93CF93DF93EC016A017B01E88933 +:10204000F98982E080834115514E61057105B1F037 +:1020500060E079E08DE390E0A70196010E940B1605 +:1020600089019A01015011092109310936952795F5 +:1020700017950795980101151041A8F0E889F9898D +:10208000108260E874E88EE190E0A70196010E945A +:102090000B16DA01C9010197A109B109B695A795F7 +:1020A000979587959C01EC85FD853083EE85FF85AE +:1020B0002083188EEC89FD8986E08083EA89FB897C +:1020C000808180618083EA89FB8980818860808348 +:1020D000EA89FB89808180688083EA89FB89808125 +:1020E0008F7D8083DF91CF911F910F91FF90EF90B3 +:1020F000DF90CF9008958F929F92AF92BF920F93EF +:102100001F93CF93DF93CDB7DEB7A1970FB6F894A7 +:10211000DEBF0FBECDBF19A2423008F44AE08E01E7 +:102120000F5D1F4F842E912CA12CB12CA501940181 +:102130000E940B16E62FB901CA0101501109EA30BD +:1021400014F4E05D01C0E95CD801EC93232B242B4F +:10215000252B61F70115110571F0F80101900020A0 +:10216000E9F73197AF01401B510BB8018AE694E0C3 +:102170000E94F80102C080E090E0A1960FB6F894AA +:10218000DEBF0FBECDBFDF91CF911F910F91BF90EA +:10219000AF909F908F900895362F90E0FC01EE5BFA +:1021A000FC4F4491FC01E450FD4F2491FC01EA54A2 +:1021B000FD4F9491992309F46BC0442309F455C051 +:1021C00050E0FA013197E231F10508F04EC088275E +:1021D000EE58FF4F8F4F0C942D16809180008F7713 +:1021E00007C0809180008F7D03C080918000877F31 +:1021F000809380003AC084B58F7702C084B58F7D0C +:1022000084BD33C08091B0008F7703C08091B0004F +:102210008F7D8093B00029C0809190008F7707C098 +:10222000809190008F7D03C080919000877F809384 +:1022300090001BC08091A0008F7707C08091A00004 +:102240008F7D03C08091A000877F8093A0000DC088 +:10225000809120018F7707C0809120018F7D03C07E +:1022600080912001877F80932001E92FF0E0EE0F1D +:10227000FF1FE456FD4FA591B4918FB7F894EC91F0 +:10228000311103C020952E2301C02E2B2C938FBF1C +:102290000895CF93DF9390E0FC01E450FD4F24912B +:1022A000FC01EA54FD4F8491882361F190E0880F8E +:1022B000991FFC01EE57FD4FC591D491FC01E456E6 +:1022C000FD4FA591B491611109C09FB7F894888121 +:1022D000209582238883EC912E230BC0623061F419 +:1022E0009FB7F8943881822F809583238883EC915F +:1022F0002E2B2C939FBF06C08FB7F894E8812E2B0E +:1023000028838FBFDF91CF9108951F93CF93DF93E1 +:10231000182FEB0161E00E944911209711F460E051 +:1023200004C0CF3FD10539F461E0812FDF91CF9117 +:102330001F910C94CC10E12FF0E0EE5BFC4FE49188 +:102340004E2F50E0FA013197E231F10508F09DC0BF +:102350008827EC57FF4F8F4F0C942D1684B580685B +:1023600084BDC7BD97C084B5806284BDC8BD92C01E +:1023700080918000806880938000D0938900C09312 +:10238000880088C080918000806280938000D09314 +:102390008B00C0938A007EC080918000886080930B +:1023A0008000D0938D00C0938C0074C08091B000E9 +:1023B00080688093B000C093B3006CC08091B0007F +:1023C00080628093B000C093B40064C0809190009C +:1023D000806880939000D0939900C09398005AC071 +:1023E00080919000806280939000D0939B00C09376 +:1023F0009A0050C080919000886080939000D093A4 +:102400009D00C0939C0046C08091A000806880938E +:10241000A0008091A0008F7B8093A000D093A900A2 +:10242000C093A80037C08091A00080628093A00074 +:10243000D093AB00C093AA002DC08091A00088600B +:102440008093A000D093AD00C093AC0023C08091D6 +:102450002001806880932001D0932901C093280136 +:1024600019C080912001806280932001D0932B01BC +:10247000C0932A010FC080912001886080932001C1 +:10248000D0932D01C0932C0105C0C038D1050CF0AC +:102490004BCF45CFDF91CF911F9108952FB7F8947F +:1024A0006091800A7091810A8091820A9091830ADA +:1024B0002FBF08951F920F920FB60F9211242F93E2 +:1024C0003F938F939F93AF93BF938091800A909196 +:1024D000810AA091820AB091830A30917F0A23E099 +:1024E000230F2D3720F40196A11DB11D05C026E84C +:1024F000230F0296A11DB11D20937F0A8093800AAD +:102500009093810AA093820AB093830A80917B0AF8 +:1025100090917C0AA0917D0AB0917E0A0196A11D3E +:10252000B11D80937B0A90937C0AA0937D0AB0939F +:102530007E0ABF91AF919F918F913F912F910F9004 +:102540000FBE0F901F901895CF92DF92EF92FF92DF +:102550000F931F93E82FF92F05C00150110921098E +:10256000310961F1908196239417B9F305C00150A8 +:1025700011092109310911F1908196239413F7CFA4 +:10258000C12CD12CE12CF12C0AC08FEFC81AD80A2B +:10259000E80AF80A0C151D052E053F0579F0808123 +:1025A0008623841791F36C2D7D2D8E2D9F2D1F91E9 +:1025B0000F91FF90EF90DF90CF90089560E070E072 +:1025C00080E090E01F910F91FF90EF90DF90CF900F +:1025D0000895789484B5826084BD84B5816084BD9B +:1025E00085B5826085BD85B5816085BD80916E00B1 +:1025F000816080936E0010928100809181008260E2 +:10260000809381008091810081608093810080911E +:1026100080008160809380008091B100846080930D +:10262000B1008091B00081608093B00080919100F2 +:1026300082608093910080919100816080939100ED +:10264000809190008160809390008091A1008260D1 +:102650008093A1008091A10081608093A10080916E +:10266000A00081608093A00080912101826080930E +:1026700021018091210181608093210180912001BD +:1026800081608093200180917A00846080937A0039 +:1026900080917A00826080937A0080917A008160D4 +:1026A00080937A0080917A00806880937A001092FB +:1026B000C10040E855E260E070E08AE694E00E94E4 +:1026C000141061E087E00E94491161E088E10E94F6 +:1026D000491161E086E00E94491161E083E00E94B7 +:1026E000491161E089E10E94491161E082E00E94A4 +:1026F000491161E087E10E94491160E086E10E9492 +:10270000491161E08DE00E94491161E088E10E9479 +:10271000CC1061E089E10E94CC1060E086E00E946C +:10272000CC104091DA055091DB056091DC05709189 +:10273000DD058091D8059091D9050E941410109262 +:102740004F0A10924E0A1092510A1092500A10929B +:10275000550A1092540A1092530A1092520AECE150 +:10276000FAE080E090E021913191232B81F4FC018B +:10277000EE0FFF1FE45EF54F2EEA35E03183208334 +:102780008C599F4F9093B1058093B00504C001967A +:102790008931910541F7EAEEF9E080E090E021917E +:1027A0003191232BB1F4FC01EE0FFF1FE651F64FE0 +:1027B00024EA35E03183208383589F4F9093A90505 +:1027C0008093A80586ED95E09093AB058093AA05CC +:1027D00004C001968931910511F7F8941092B00068 +:1027E0001092B1008091B00082608093B00080911F +:1027F000B10087608093B1008FEF8093B300809128 +:1028000070008260809370007894C3E0D0E092E121 +:10281000892E93E0992E2CEC222E22E0322E38EED7 +:10282000432E33E0532E612C712CAA24A394B12C97 +:1028300060916804709169046B01770FEE08FF08DE +:10284000F7FE14C0E0916A04F0916B040190F081EE +:10285000E02D6DE28AE694E0199566277727CB0193 +:102860006C197D098E099F094AE003C04AE0C7013F +:10287000B6010E947B1042E050E060E474E08AE61A +:1028800094E00E94F8018091660490916704892B7E +:1028900009F461C060E087E10E94CC10CE0101978D +:1028A000F1F761E087E10E94CC1083E290E00197AC +:1028B000F1F760E087E10E94CC10F4016491F1012E +:1028C0008491E82FF0E0EE0FFF1FE859FD4F85914E +:1028D000949100E412E42FE030E0462F0E94A4120D +:1028E000611571058105910549F0DC01CB01019667 +:1028F000A11DB11D9C01AD015F7003C020E030E05F +:10290000A901209358043093590440935A045093DA +:102910005B04A1E1B0E00E943516A30192010E9480 +:102920000B1620935404309355044093560450934F +:1029300057042A3131054105510528F0B09265044C +:10294000A092640404C01092650410926404109272 +:102950006704109266042091000230910102809178 +:1029600064049091650482239323892BC1F06091C4 +:1029700060047091610480916204909163040E94EC +:10298000681682E00E94851160915C0470915D047C +:1029900080915E0490915F040E94681607C060E019 +:1029A00070E082E00E94851160E070E086E00E94A5 +:1029B000851186ED95E00E94090C0E941B0338CF1B +:1029C00010920A051092090548EE53E060E070E0AD +:1029D00040930B0550930C0560930D0570930E0505 +:1029E0008CE492E090930805809307052DEC30E08D +:1029F00030931405209313052CEC30E0309316052A +:102A00002093150528EC30E0309318052093170526 +:102A100029EC30E030931A05209319052AEC30E0B8 +:102A200030931C0520931B052EEC30E030931E05DF +:102A300020931D0510922005109221051092220569 +:102A40001092230510926D0410926C0440936E0452 +:102A500050936F04609370047093710490936B04AF +:102A600080936A0485EC90E09093770480937604D9 +:102A700084EC90E0909379048093780480EC90E06B +:102A800090937B0480937A0481EC90E090937D0492 +:102A900080937C0482EC90E090937F0480937E048A +:102AA00086EC90E0909381048093800410928304DC +:102AB00010928404109285041092860482E892E0B9 +:102AC0009093D7058093D60587E095E09093D9053C +:102AD0008093D80580E091EEA0E0B0E08093DA0525 +:102AE0009093DB05A093DC05B093DD051092580AA6 +:102AF00086E792E09093670A8093660AEAEEF9E02F +:102B0000119211928AE0EC31F807D1F7ECE1FAE08A +:102B1000119211928AE0EE34F807D1F7EAEEF5E06F +:102B2000119287E0EA3EF807D9F7EAEEF7E0119252 +:102B300089E0EA3EF807D9F71092680A10926E0A07 +:102B400010926D0A10926F0A1092750A1092740A10 +:102B500084EA92E09093AF058093AE058AE692E016 +:102B60009093B5058093B4058EE592E09093B705F8 +:102B70008093B6059093C5058093C4058AE094E0E0 +:102B80009093D3058093D20581E090E09093D50592 +:102B90008093D40583E494E09093B3058093B205C9 +:102BA0008CE892E09093850A8093840A8BE494E009 +:102BB0009093A5058093A40584E89AE09093A705D7 +:102BC0008093A6051092AD051092AC050895DB0127 +:102BD0008F939F930E943516BF91AF91A29F800D56 +:102BE000911DA39F900DB29F900D1124089597FB06 +:102BF000072E16F4009407D077FD09D00E944016E6 +:102C000007FC05D03EF4909581959F4F08957095EF +:102C100061957F4F0895A1E21A2EAA1BBB1BFD01EF +:102C20000DC0AA1FBB1FEE1FFF1FA217B307E407AB +:102C3000F50720F0A21BB30BE40BF50B661F771F03 +:102C4000881F991F1A9469F76095709580959095E3 +:102C50009B01AC01BD01CF010895EE0FFF1F881F3E +:102C60008BBF0790F691E02D19940E945416A59FF2 +:102C7000900DB49F900DA49F800D911D1124089577 +:102C8000AA1BBB1B51E107C0AA1FBB1FA617B70792 +:102C900010F0A61BB70B881F991F5A95A9F78095AE +:102CA0009095BC01CD010895A29FB001B39FC001D2 +:102CB000A39F700D811D1124911DB29F700D811D68 +:102CC0001124911D08950E949E1608F481E0089534 +:102CD0000E946F166894B1110C94E51608950E9435 +:102CE000CA1688F09F5798F0B92F9927B751B0F0BE +:102CF000E1F0660F771F881F991F1AF0BA95C9F780 +:102D000014C0B13091F00E94E416B1E008950C9423 +:102D1000E416672F782F8827B85F39F0B93FCCF3D6 +:102D2000869577956795B395D9F73EF490958095FC +:102D3000709561957F4F8F4F9F4F0895990F0008B1 +:102D4000550FAA0BE0E8FEEF16161706E807F9077D +:102D5000C0F012161306E407F50798F0621B730B18 +:102D6000840B950B39F40A2661F0232B242B252B99 +:102D700021F408950A2609F4A140A6958FEF811D3C +:102D8000811D089557FD9058440F551F59F05F3F1E +:102D900071F04795880F97FB991F61F09F3F79F07D +:102DA00087950895121613061406551FF2CF4695FF +:102DB000F1DF08C0161617061806991FF1CF869581 +:102DC0007105610508940895E894BB276627772765 +:102DD000CB0197F908956F927F928F929F92AF9255 +:102DE000BF92CF92DF92EF92FF920F931F93CF93F8 +:102DF000DF93EC01009789F4CB01DF91CF911F9114 +:102E00000F91FF90EF90DF90CF90BF90AF909F9089 +:102E10008F907F906F900C94E217FC01E60FF71FE4 +:102E20009C0122503109E217F30708F4ACC0D90124 +:102E30000D911C91119706171707B0F00530110579 +:102E400008F49FC0C80104978617970708F499C033 +:102E500002501109061B170B019311936D937C937C +:102E6000CF010E9477188DC05B01A01AB10A4C01F6 +:102E7000800E911EA0918A0AB0918B0A40E050E02A +:102E8000E12CF12C109709F44AC0A815B905D1F529 +:102E90006D907C901197630182E0C80ED11CCA141A +:102EA000DB0480F1A3014A195B096A0182E0C80EC4 +:102EB000D11C1296BC9012971396AC91B5E0CB162C +:102EC000D10440F0B282A38351834083D9016D9332 +:102ED0007C930AC00E5F1F4FC301800F911FF90141 +:102EE00091838083EB2DFA2FE114F10431F0D701A7 +:102EF0001396FC93EE93129744C0F0938B0AE093E1 +:102F00008A0A3FC08D919C9111974817590708F480 +:102F1000AC017D0112960D90BC91A02DB3CF809194 +:102F2000880A9091890A88159905E1F44617570790 +:102F3000C8F48091020290910302009741F48DB78A +:102F40009EB74091060250910702841B950BE8172B +:102F5000F907C8F4F093890AE093880AF9017183AC +:102F600060830FC0CB010E94E2177C01009759F0EB +:102F7000A801BE010E94D917CE010E947718C7018F +:102F800004C0CE0102C080E090E0DF91CF911F919C +:102F90000F91FF90EF90DF90CF90BF90AF909F90F8 +:102FA0008F907F906F90089581E090E0F8940C945A +:102FB0000F19FB01DC0102C001900D9241505040FD +:102FC000D8F70895CF93DF938230910510F482E013 +:102FD00090E0E0918A0AF0918B0A20E030E0C0E0B6 +:102FE000D0E0309711F14081518148175907C0F066 +:102FF0004817590761F482819381209719F09B83C8 +:103000008A832BC090938B0A80938A0A26C021154D +:10301000310519F04217530718F49A01BE01DF0178 +:10302000EF010280F381E02DDCCF2115310509F19C +:10303000281B390B2430310590F412968D919C9108 +:1030400013976115710521F0FB019383828304C0FE +:1030500090938B0A80938A0AFD01329644C0FD0149 +:10306000E20FF31F81939193225031092D933C93EA +:103070003AC02091880A3091890A232B41F420918B +:103080000402309105023093890A2093880A209126 +:103090000202309103022115310541F42DB73EB7EC +:1030A0004091060250910702241B350BE091880ADB +:1030B000F091890AE217F307A0F42E1B3F0B2817A3 +:1030C000390778F0AC014E5F5F4F2417350748F0A1 +:1030D0004E0F5F1F5093890A4093880A8193919302 +:1030E00002C0E0E0F0E0CF01DF91CF9108950F93AF +:1030F0001F93CF93DF93009709F48CC0FC013297A4 +:103100001382128200918A0A10918B0A011511050F +:1031100081F420813181820F931F2091880A3091A0 +:10312000890A2817390779F5F093890AE093880A04 +:1031300071C0D80140E050E0AE17BF0750F41296BE +:103140002D913C911397AD012115310509F1D9015C +:10315000F3CF9D01DA013383228360817181860F71 +:10316000971F8217930769F4EC0128813981260F94 +:10317000371F2E5F3F4F318320838A819B8193834A +:103180008283452B29F4F0938B0AE0938A0A42C08C +:103190001396FC93EE931297ED01499159919E017C +:1031A000240F351FE217F30771F480819181840F9A +:1031B000951F029611969C938E938281938113960C +:1031C0009C938E931297E0E0F0E0D80112968D91D7 +:1031D0009C911397009719F0F8018C01F6CF8D910F +:1031E0009C9198012E5F3F4F820F931F2091880A78 +:1031F0003091890A2817390769F4309729F4109219 +:103200008B0A10928A0A02C0138212821093890AD2 +:103210000093880ADF91CF911F910F910895F89440 +:02322000FFCFDE +:10322200010000008C0A8000726F7373657269611D +:103232006C5F6D7367732F5265717565737450613E +:1032420072616D0000000000720AFF07FC07F907B7 +:10325200000000002709E108DE08DB08000000008A +:103262004A0AB707B407B10700000000B202F8012A +:103272004002F90271024F02630200000000470699 +:103282007F047C047904000000008F071606760490 +:10329200730400000000AB09F50AAE07AB0700009B +:1032A20000005F03090C500300000000850936048A +:1032B20033043004000000004B094B094B094B0951 +:1032C2000000000032065B035803550339663139AA +:1032D20035663838313234366664666132373938A9 +:1032E2006431643365656263613834610067656FB8 +:1032F2006D657472795F6D7367732F547769737438 +:10330200004D6573736167652066726F6D20646539 +:10331200766963652064726F707065643A206D65CA +:103322007373616765206C6172676572207468618E +:103332006E206275666665722E00393932636538B1 +:1033420061313638376365633863386264383833DD +:1033520065633733636134316431007374645F6D64 +:103362007367732F537472696E6700346138343235 +:103372006236356634313330383464633262313028 +:1033820066623438346561376631370067656F6D60 +:10339200657472795F6D7367732F566563746F72AC +:1033A200330039663065393862646136353938310F +:1033B2003938366464663533616661376134306545 +:1033C2003439003131616264373331633235393334 +:1033D20033323631636436313833626431326436C3 +:1033E20032393500726F7373657269616C5F6D7328 +:1033F20067732F4C6F670030616435316638386609 +:1034020063343438393266386331303638343037E1 +:103412003736343630303500726F737365726961D6 +:103422006C5F6D7367732F546F706963496E666F5B +:10343200006364373136366337346335353263338C +:103442003131666263633266653561376263323891 +:1034520039007374645F6D7367732F54696D65000F +:103462000D0A00636D645F76656C00636861747455 +:04347200657200007F +:00000001FF diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/libros_lib.a b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/libros_lib.a new file mode 100755 index 0000000..6fe6a3c Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/libros_lib.a differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/ros_lib/duration.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/ros_lib/duration.o new file mode 100755 index 0000000..ee14281 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/ros_lib/duration.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/ros_lib/time.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/ros_lib/time.o new file mode 100755 index 0000000..101a7de Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/lib966/ros_lib/time.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/libFrameworkArduino.a b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/libFrameworkArduino.a new file mode 100755 index 0000000..4cfd2b8 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/libFrameworkArduino.a differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a new file mode 100755 index 0000000..8b277f0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a @@ -0,0 +1 @@ +! diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/src/robotbase_1.ino.o b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/src/robotbase_1.ino.o new file mode 100755 index 0000000..a76ae9b Binary files /dev/null and b/case_study/arduino_lab/group_01/original/.pioenvs/megaADK/src/robotbase_1.ino.o differ diff --git a/case_study/arduino_lab/group_01/original/.pioenvs/structure.hash b/case_study/arduino_lab/group_01/original/.pioenvs/structure.hash new file mode 100755 index 0000000..3aa2269 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/.pioenvs/structure.hash @@ -0,0 +1 @@ +a72b1e7c5741660a4b957aa0f0f4217e3a3f8ab2 \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/README.rst b/case_study/arduino_lab/group_01/original/README.rst new file mode 100755 index 0000000..fc64cfa --- /dev/null +++ b/case_study/arduino_lab/group_01/original/README.rst @@ -0,0 +1,29 @@ +.. Copyright (c) 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to test PlatformIO based project +==================================== + +1. `Install PlatformIO Core `_ +2. Download `examples source code `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-examples/unit-testing/wiring-blink + + # Test project + > platformio test + + # Test specific environment + > platformio test -e uno diff --git a/case_study/arduino_lab/group_01/original/lib/readme.txt b/case_study/arduino_lab/group_01/original/lib/readme.txt new file mode 100755 index 0000000..dbadc3d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/readme.txt @@ -0,0 +1,36 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| |--Foo +| | |- Foo.c +| | |- Foo.h +| |- readme.txt --> THIS FILE +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ArduinoHardware.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ArduinoHardware.h new file mode 100755 index 0000000..0f7ff6b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ArduinoHardware.h @@ -0,0 +1,106 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_ARDUINO_HARDWARE_H_ +#define ROS_ARDUINO_HARDWARE_H_ + +#if ARDUINO>=100 + #include // Arduino 1.0 +#else + #include // Arduino 0022 +#endif + +#if defined(__MK20DX128__) || defined(__MK20DX256__) + #include // Teensy 3.0 and 3.1 + #define SERIAL_CLASS usb_serial_class +#elif defined(_SAM3XA_) + #include // Arduino Due + #define SERIAL_CLASS UARTClass +#elif defined(USE_USBCON) + // Arduino Leonardo USB Serial Port + #define SERIAL_CLASS Serial_ +#else + #include // Arduino AVR + #define SERIAL_CLASS HardwareSerial +#endif + +class ArduinoHardware { + public: + ArduinoHardware(SERIAL_CLASS* io , long baud= 57600){ + iostream = io; + baud_ = baud; + } + ArduinoHardware() + { +#if defined(USBCON) and !(defined(USE_USBCON)) + /* Leonardo support */ + iostream = &Serial1; +#else + iostream = &Serial; +#endif + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h){ + this->iostream = iostream; + this->baud_ = h.baud_; + } + + void setBaud(long baud){ + this->baud_= baud; + } + + int getBaud(){return baud_;} + + void init(){ +#if defined(USE_USBCON) + // Startup delay as a fail-safe to upload a new sketch + delay(3000); +#endif + iostream->begin(baud_); + } + + int read(){return iostream->read();}; + void write(uint8_t* data, int length){ + for(int i=0; iwrite(data[i]); + } + + unsigned long time(){return millis();} + + protected: + SERIAL_CLASS* iostream; + long baud_; +}; + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestAction.h new file mode 100755 index 0000000..fe48516 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestAction_h +#define _ROS_actionlib_TestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestActionGoal.h" +#include "actionlib/TestActionResult.h" +#include "actionlib/TestActionFeedback.h" + +namespace actionlib +{ + + class TestAction : public ros::Msg + { + public: + actionlib::TestActionGoal action_goal; + actionlib::TestActionResult action_result; + actionlib::TestActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestAction"; }; + const char * getMD5(){ return "991e87a72802262dfbe5d1b3cf6efc9a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionFeedback.h new file mode 100755 index 0000000..491d404 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestActionFeedback_h +#define _ROS_actionlib_TestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestFeedback.h" + +namespace actionlib +{ + + class TestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionFeedback"; }; + const char * getMD5(){ return "6d3d0bf7fb3dda24779c010a9f3eb7cb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionGoal.h new file mode 100755 index 0000000..81484ad --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestActionGoal_h +#define _ROS_actionlib_TestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestGoal.h" + +namespace actionlib +{ + + class TestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionGoal"; }; + const char * getMD5(){ return "348369c5b403676156094e8c159720bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionResult.h new file mode 100755 index 0000000..8c0c871 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestActionResult_h +#define _ROS_actionlib_TestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestResult.h" + +namespace actionlib +{ + + class TestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionResult"; }; + const char * getMD5(){ return "3d669e3a63aa986c667ea7b0f46ce85e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestFeedback.h new file mode 100755 index 0000000..037e3b6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestFeedback.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestFeedback_h +#define _ROS_actionlib_TestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestFeedback : public ros::Msg + { + public: + int32_t feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.real = this->feedback; + *(outbuffer + offset + 0) = (u_feedback.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_feedback.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_feedback.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_feedback.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->feedback); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.base = 0; + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->feedback = u_feedback.real; + offset += sizeof(this->feedback); + return offset; + } + + const char * getType(){ return "actionlib/TestFeedback"; }; + const char * getMD5(){ return "49ceb5b32ea3af22073ede4a0328249e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestGoal.h new file mode 100755 index 0000000..a5b7418 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestGoal_h +#define _ROS_actionlib_TestGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestGoal : public ros::Msg + { + public: + int32_t goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.real = this->goal; + *(outbuffer + offset + 0) = (u_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.base = 0; + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->goal = u_goal.real; + offset += sizeof(this->goal); + return offset; + } + + const char * getType(){ return "actionlib/TestGoal"; }; + const char * getMD5(){ return "18df0149936b7aa95588e3862476ebde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestAction.h new file mode 100755 index 0000000..f2c63fc --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestRequestAction_h +#define _ROS_actionlib_TestRequestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestRequestActionGoal.h" +#include "actionlib/TestRequestActionResult.h" +#include "actionlib/TestRequestActionFeedback.h" + +namespace actionlib +{ + + class TestRequestAction : public ros::Msg + { + public: + actionlib::TestRequestActionGoal action_goal; + actionlib::TestRequestActionResult action_result; + actionlib::TestRequestActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestAction"; }; + const char * getMD5(){ return "dc44b1f4045dbf0d1db54423b3b86b30"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h new file mode 100755 index 0000000..f15d664 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestRequestActionFeedback_h +#define _ROS_actionlib_TestRequestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestFeedback.h" + +namespace actionlib +{ + + class TestRequestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionGoal.h new file mode 100755 index 0000000..d21e633 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestRequestActionGoal_h +#define _ROS_actionlib_TestRequestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestRequestGoal.h" + +namespace actionlib +{ + + class TestRequestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestRequestGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionGoal"; }; + const char * getMD5(){ return "1889556d3fef88f821c7cb004e4251f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionResult.h new file mode 100755 index 0000000..fcc7ba5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TestRequestActionResult_h +#define _ROS_actionlib_TestRequestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestResult.h" + +namespace actionlib +{ + + class TestRequestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionResult"; }; + const char * getMD5(){ return "0476d1fdf437a3a6e7d6d0e9f5561298"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestFeedback.h new file mode 100755 index 0000000..974635c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestFeedback.h @@ -0,0 +1,34 @@ +#ifndef _ROS_actionlib_TestRequestFeedback_h +#define _ROS_actionlib_TestRequestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestFeedback : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TestRequestFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestGoal.h new file mode 100755 index 0000000..8391bf0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestGoal.h @@ -0,0 +1,195 @@ +#ifndef _ROS_actionlib_TestRequestGoal_h +#define _ROS_actionlib_TestRequestGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace actionlib +{ + + class TestRequestGoal : public ros::Msg + { + public: + int32_t terminate_status; + bool ignore_cancel; + char * result_text; + int32_t the_result; + bool is_simple_client; + ros::Duration delay_accept; + ros::Duration delay_terminate; + ros::Duration pause_status; + enum { TERMINATE_SUCCESS = 0 }; + enum { TERMINATE_ABORTED = 1 }; + enum { TERMINATE_REJECTED = 2 }; + enum { TERMINATE_LOSE = 3 }; + enum { TERMINATE_DROP = 4 }; + enum { TERMINATE_EXCEPTION = 5 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.real = this->terminate_status; + *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.real = this->ignore_cancel; + *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text = strlen( (const char*) this->result_text); + memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->result_text, length_result_text); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.real = this->is_simple_client; + *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_client); + *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.sec); + *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.nsec); + *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.sec); + *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.nsec); + *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.sec); + *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.base = 0; + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terminate_status = u_terminate_status.real; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.base = 0; + u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ignore_cancel = u_ignore_cancel.real; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text; + memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result_text-1]=0; + this->result_text = (char *)(inbuffer + offset-1); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.base = 0; + u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_client = u_is_simple_client.real; + offset += sizeof(this->is_simple_client); + this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.sec); + this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.nsec); + this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.sec); + this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.nsec); + this->pause_status.sec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.sec); + this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.nsec); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestGoal"; }; + const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestResult.h new file mode 100755 index 0000000..231d050 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestRequestResult.h @@ -0,0 +1,72 @@ +#ifndef _ROS_actionlib_TestRequestResult_h +#define _ROS_actionlib_TestRequestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestResult : public ros::Msg + { + public: + int32_t the_result; + bool is_simple_server; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.real = this->is_simple_server; + *(outbuffer + offset + 0) = (u_is_simple_server.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_server); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.base = 0; + u_is_simple_server.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_server = u_is_simple_server.real; + offset += sizeof(this->is_simple_server); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestResult"; }; + const char * getMD5(){ return "61c2364524499c7c5017e2f3fce7ba06"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestResult.h new file mode 100755 index 0000000..c4ea383 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TestResult.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_TestResult_h +#define _ROS_actionlib_TestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestResult : public ros::Msg + { + public: + int32_t result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->result = u_result.real; + offset += sizeof(this->result); + return offset; + } + + const char * getType(){ return "actionlib/TestResult"; }; + const char * getMD5(){ return "034a8e20d6a306665e3a5b340fab3f09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsAction.h new file mode 100755 index 0000000..0ff8695 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TwoIntsAction_h +#define _ROS_actionlib_TwoIntsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TwoIntsActionGoal.h" +#include "actionlib/TwoIntsActionResult.h" +#include "actionlib/TwoIntsActionFeedback.h" + +namespace actionlib +{ + + class TwoIntsAction : public ros::Msg + { + public: + actionlib::TwoIntsActionGoal action_goal; + actionlib::TwoIntsActionResult action_result; + actionlib::TwoIntsActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsAction"; }; + const char * getMD5(){ return "6d1aa538c4bd6183a2dfb7fcac41ee50"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h new file mode 100755 index 0000000..7b9d55a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TwoIntsActionFeedback_h +#define _ROS_actionlib_TwoIntsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsFeedback.h" + +namespace actionlib +{ + + class TwoIntsActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h new file mode 100755 index 0000000..acf7acb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TwoIntsActionGoal_h +#define _ROS_actionlib_TwoIntsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TwoIntsGoal.h" + +namespace actionlib +{ + + class TwoIntsActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TwoIntsGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionGoal"; }; + const char * getMD5(){ return "684a2db55d6ffb8046fb9d6764ce0860"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionResult.h new file mode 100755 index 0000000..0816908 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_TwoIntsActionResult_h +#define _ROS_actionlib_TwoIntsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsResult.h" + +namespace actionlib +{ + + class TwoIntsActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionResult"; }; + const char * getMD5(){ return "3ba7dea8b8cddcae4528ade4ef74b6e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsFeedback.h new file mode 100755 index 0000000..2e9bd9a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsFeedback.h @@ -0,0 +1,34 @@ +#ifndef _ROS_actionlib_TwoIntsFeedback_h +#define _ROS_actionlib_TwoIntsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsFeedback : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsGoal.h new file mode 100755 index 0000000..eebc1d0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsGoal.h @@ -0,0 +1,94 @@ +#ifndef _ROS_actionlib_TwoIntsGoal_h +#define _ROS_actionlib_TwoIntsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsGoal : public ros::Msg + { + public: + int64_t a; + int64_t b; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsGoal"; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsResult.h new file mode 100755 index 0000000..7438aed --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib/TwoIntsResult.h @@ -0,0 +1,64 @@ +#ifndef _ROS_actionlib_TwoIntsResult_h +#define _ROS_actionlib_TwoIntsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsResult : public ros::Msg + { + public: + int64_t sum; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsResult"; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalID.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalID.h new file mode 100755 index 0000000..d8ef0a5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalID.h @@ -0,0 +1,71 @@ +#ifndef _ROS_actionlib_msgs_GoalID_h +#define _ROS_actionlib_msgs_GoalID_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace actionlib_msgs +{ + + class GoalID : public ros::Msg + { + public: + ros::Time stamp; + char * id; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_id = strlen( (const char*) this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalID"; }; + const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalStatus.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalStatus.h new file mode 100755 index 0000000..c925b9e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalStatus.h @@ -0,0 +1,68 @@ +#ifndef _ROS_actionlib_msgs_GoalStatus_h +#define _ROS_actionlib_msgs_GoalStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_msgs/GoalID.h" + +namespace actionlib_msgs +{ + + class GoalStatus : public ros::Msg + { + public: + actionlib_msgs::GoalID goal_id; + uint8_t status; + char * text; + enum { PENDING = 0 }; + enum { ACTIVE = 1 }; + enum { PREEMPTED = 2 }; + enum { SUCCEEDED = 3 }; + enum { ABORTED = 4 }; + enum { REJECTED = 5 }; + enum { PREEMPTING = 6 }; + enum { RECALLING = 7 }; + enum { RECALLED = 8 }; + enum { LOST = 9 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->goal_id.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + uint32_t length_text = strlen( (const char*) this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->goal_id.deserialize(inbuffer + offset); + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatus"; }; + const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h new file mode 100755 index 0000000..36a9714 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h @@ -0,0 +1,58 @@ +#ifndef _ROS_actionlib_msgs_GoalStatusArray_h +#define _ROS_actionlib_msgs_GoalStatusArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" + +namespace actionlib_msgs +{ + + class GoalStatusArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_list_length; + actionlib_msgs::GoalStatus st_status_list; + actionlib_msgs::GoalStatus * status_list; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_list_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->status_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_list_lengthT = *(inbuffer + offset++); + if(status_list_lengthT > status_list_length) + this->status_list = (actionlib_msgs::GoalStatus*)realloc(this->status_list, status_list_lengthT * sizeof(actionlib_msgs::GoalStatus)); + offset += 3; + status_list_length = status_list_lengthT; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->st_status_list.deserialize(inbuffer + offset); + memcpy( &(this->status_list[i]), &(this->st_status_list), sizeof(actionlib_msgs::GoalStatus)); + } + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatusArray"; }; + const char * getMD5(){ return "8b2b82f13216d0a8ea88bd3af735e619"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h new file mode 100755 index 0000000..04d020a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_AveragingAction_h +#define _ROS_actionlib_tutorials_AveragingAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/AveragingActionGoal.h" +#include "actionlib_tutorials/AveragingActionResult.h" +#include "actionlib_tutorials/AveragingActionFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingAction : public ros::Msg + { + public: + actionlib_tutorials::AveragingActionGoal action_goal; + actionlib_tutorials::AveragingActionResult action_result; + actionlib_tutorials::AveragingActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingAction"; }; + const char * getMD5(){ return "628678f2b4fa6a5951746a4a2d39e716"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h new file mode 100755 index 0000000..424ac36 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionFeedback_h +#define _ROS_actionlib_tutorials_AveragingActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionFeedback"; }; + const char * getMD5(){ return "78a4a09241b1791069223ae7ebd5b16b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h new file mode 100755 index 0000000..3c9a8b1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionGoal_h +#define _ROS_actionlib_tutorials_AveragingActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/AveragingGoal.h" + +namespace actionlib_tutorials +{ + + class AveragingActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::AveragingGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionGoal"; }; + const char * getMD5(){ return "1561825b734ebd6039851c501e3fb570"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h new file mode 100755 index 0000000..b1a0623 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionResult_h +#define _ROS_actionlib_tutorials_AveragingActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingResult.h" + +namespace actionlib_tutorials +{ + + class AveragingActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionResult"; }; + const char * getMD5(){ return "8672cb489d347580acdcd05c5d497497"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h new file mode 100755 index 0000000..c7d4e74 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h @@ -0,0 +1,122 @@ +#ifndef _ROS_actionlib_tutorials_AveragingFeedback_h +#define _ROS_actionlib_tutorials_AveragingFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingFeedback : public ros::Msg + { + public: + int32_t sample; + float data; + float mean; + float std_dev; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.real = this->sample; + *(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.base = 0; + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sample = u_sample.real; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; }; + const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h new file mode 100755 index 0000000..09c1fa1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_tutorials_AveragingGoal_h +#define _ROS_actionlib_tutorials_AveragingGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingGoal : public ros::Msg + { + public: + int32_t samples; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.real = this->samples; + *(outbuffer + offset + 0) = (u_samples.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_samples.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_samples.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_samples.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.base = 0; + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->samples = u_samples.real; + offset += sizeof(this->samples); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingGoal"; }; + const char * getMD5(){ return "32c9b10ef9b253faa93b93f564762c8f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h new file mode 100755 index 0000000..7de31a7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h @@ -0,0 +1,78 @@ +#ifndef _ROS_actionlib_tutorials_AveragingResult_h +#define _ROS_actionlib_tutorials_AveragingResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingResult : public ros::Msg + { + public: + float mean; + float std_dev; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingResult"; }; + const char * getMD5(){ return "d5c7decf6df75ffb4367a05c1bcc7612"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h new file mode 100755 index 0000000..d2df8c1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciAction_h +#define _ROS_actionlib_tutorials_FibonacciAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/FibonacciActionGoal.h" +#include "actionlib_tutorials/FibonacciActionResult.h" +#include "actionlib_tutorials/FibonacciActionFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciAction : public ros::Msg + { + public: + actionlib_tutorials::FibonacciActionGoal action_goal; + actionlib_tutorials::FibonacciActionResult action_result; + actionlib_tutorials::FibonacciActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciAction"; }; + const char * getMD5(){ return "f59df5767bf7634684781c92598b2406"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h new file mode 100755 index 0000000..cfa5ebe --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionFeedback_h +#define _ROS_actionlib_tutorials_FibonacciActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionFeedback"; }; + const char * getMD5(){ return "73b8497a9f629a31c0020900e4148f07"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h new file mode 100755 index 0000000..027f3cb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionGoal_h +#define _ROS_actionlib_tutorials_FibonacciActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/FibonacciGoal.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::FibonacciGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionGoal"; }; + const char * getMD5(){ return "006871c7fa1d0e3d5fe2226bf17b2a94"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h new file mode 100755 index 0000000..32d5f41 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionResult_h +#define _ROS_actionlib_tutorials_FibonacciActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciResult.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionResult"; }; + const char * getMD5(){ return "bee73a9fe29ae25e966e105f5553dd03"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h new file mode 100755 index 0000000..ef07284 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h @@ -0,0 +1,72 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciFeedback_h +#define _ROS_actionlib_tutorials_FibonacciFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciFeedback : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciFeedback"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h new file mode 100755 index 0000000..a22afa0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h @@ -0,0 +1,56 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciGoal_h +#define _ROS_actionlib_tutorials_FibonacciGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciGoal : public ros::Msg + { + public: + int32_t order; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.real = this->order; + *(outbuffer + offset + 0) = (u_order.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_order.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_order.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_order.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->order); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.base = 0; + u_order.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->order = u_order.real; + offset += sizeof(this->order); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciGoal"; }; + const char * getMD5(){ return "6889063349a00b249bd1661df429d822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h new file mode 100755 index 0000000..6e7f8f3 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h @@ -0,0 +1,72 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciResult_h +#define _ROS_actionlib_tutorials_FibonacciResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciResult : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciResult"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/bond/Constants.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/bond/Constants.h new file mode 100755 index 0000000..ba29f41 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/bond/Constants.h @@ -0,0 +1,40 @@ +#ifndef _ROS_bond_Constants_h +#define _ROS_bond_Constants_h + +#include +#include +#include +#include "ros/msg.h" + +namespace bond +{ + + class Constants : public ros::Msg + { + public: + enum { DEAD_PUBLISH_PERIOD = 0.05 }; + enum { DEFAULT_CONNECT_TIMEOUT = 10.0 }; + enum { DEFAULT_HEARTBEAT_TIMEOUT = 4.0 }; + enum { DEFAULT_DISCONNECT_TIMEOUT = 2.0 }; + enum { DEFAULT_HEARTBEAT_PERIOD = 1.0 }; + enum { DISABLE_HEARTBEAT_TIMEOUT_PARAM = /bond_disable_heartbeat_timeout }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "bond/Constants"; }; + const char * getMD5(){ return "6fc594dc1d7bd7919077042712f8c8b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/bond/Status.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/bond/Status.h new file mode 100755 index 0000000..776b259 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/bond/Status.h @@ -0,0 +1,128 @@ +#ifndef _ROS_bond_Status_h +#define _ROS_bond_Status_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace bond +{ + + class Status : public ros::Msg + { + public: + std_msgs::Header header; + char * id; + char * instance_id; + bool active; + float heartbeat_timeout; + float heartbeat_period; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_id = strlen( (const char*) this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + uint32_t length_instance_id = strlen( (const char*) this->instance_id); + memcpy(outbuffer + offset, &length_instance_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->instance_id, length_instance_id); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.real = this->active; + *(outbuffer + offset + 0) = (u_active.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.real = this->heartbeat_timeout; + *(outbuffer + offset + 0) = (u_heartbeat_timeout.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_timeout.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_timeout.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_timeout.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.real = this->heartbeat_period; + *(outbuffer + offset + 0) = (u_heartbeat_period.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_period.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_period.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_period.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_period); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + uint32_t length_instance_id; + memcpy(&length_instance_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_instance_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_instance_id-1]=0; + this->instance_id = (char *)(inbuffer + offset-1); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.base = 0; + u_active.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->active = u_active.real; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.base = 0; + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_timeout = u_heartbeat_timeout.real; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.base = 0; + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_period = u_heartbeat_period.real; + offset += sizeof(this->heartbeat_period); + return offset; + } + + const char * getType(){ return "bond/Status"; }; + const char * getMD5(){ return "eacc84bf5d65b6777d4c50f463dfb9c8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h new file mode 100755 index 0000000..2a08398 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryAction_h +#define _ROS_control_msgs_FollowJointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/FollowJointTrajectoryActionGoal.h" +#include "control_msgs/FollowJointTrajectoryActionResult.h" +#include "control_msgs/FollowJointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryAction : public ros::Msg + { + public: + control_msgs::FollowJointTrajectoryActionGoal action_goal; + control_msgs::FollowJointTrajectoryActionResult action_result; + control_msgs::FollowJointTrajectoryActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryAction"; }; + const char * getMD5(){ return "a187484b9b42d27963c3e43098e345c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h new file mode 100755 index 0000000..d073e60 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "d8920dc4eae9fc107e00999cce4be641"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h new file mode 100755 index 0000000..e45b2b9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/FollowJointTrajectoryGoal.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::FollowJointTrajectoryGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionGoal"; }; + const char * getMD5(){ return "cff5c1d533bf2f82dd0138d57f4304bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h new file mode 100755 index 0000000..1b03bb9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionResult_h +#define _ROS_control_msgs_FollowJointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryResult.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionResult"; }; + const char * getMD5(){ return "bce83d50f7bb28226801436caf0e2043"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h new file mode 100755 index 0000000..8409db1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h @@ -0,0 +1,79 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryFeedback : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryFeedback"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h new file mode 100755 index 0000000..54a3f59 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h @@ -0,0 +1,99 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "control_msgs/JointTolerance.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + uint8_t path_tolerance_length; + control_msgs::JointTolerance st_path_tolerance; + control_msgs::JointTolerance * path_tolerance; + uint8_t goal_tolerance_length; + control_msgs::JointTolerance st_goal_tolerance; + control_msgs::JointTolerance * goal_tolerance; + ros::Duration goal_time_tolerance; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset++) = path_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->path_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = goal_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->goal_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->goal_time_tolerance.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.sec); + *(outbuffer + offset + 0) = (this->goal_time_tolerance.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + uint8_t path_tolerance_lengthT = *(inbuffer + offset++); + if(path_tolerance_lengthT > path_tolerance_length) + this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + path_tolerance_length = path_tolerance_lengthT; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->st_path_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->path_tolerance[i]), &(this->st_path_tolerance), sizeof(control_msgs::JointTolerance)); + } + uint8_t goal_tolerance_lengthT = *(inbuffer + offset++); + if(goal_tolerance_lengthT > goal_tolerance_length) + this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + goal_tolerance_length = goal_tolerance_lengthT; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->st_goal_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->goal_tolerance[i]), &(this->st_goal_tolerance), sizeof(control_msgs::JointTolerance)); + } + this->goal_time_tolerance.sec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.sec); + this->goal_time_tolerance.nsec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryGoal"; }; + const char * getMD5(){ return "69636787b6ecbde4d61d711979bc7ecb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h new file mode 100755 index 0000000..df24659 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h @@ -0,0 +1,62 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryResult_h +#define _ROS_control_msgs_FollowJointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryResult : public ros::Msg + { + public: + int32_t error_code; + enum { SUCCESSFUL = 0 }; + enum { INVALID_GOAL = -1 }; + enum { INVALID_JOINTS = -2 }; + enum { OLD_HEADER_TIMESTAMP = -3 }; + enum { PATH_TOLERANCE_VIOLATED = -4 }; + enum { GOAL_TOLERANCE_VIOLATED = -5 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryResult"; }; + const char * getMD5(){ return "6243274b5d629dc838814109754410d5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommand.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommand.h new file mode 100755 index 0000000..d5e8e56 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommand.h @@ -0,0 +1,86 @@ +#ifndef _ROS_control_msgs_GripperCommand_h +#define _ROS_control_msgs_GripperCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommand : public ros::Msg + { + public: + float position; + float max_effort; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_position = (int32_t *) &(this->position); + int32_t exp_position = (((*val_position)>>23)&255); + if(exp_position != 0) + exp_position += 1023-127; + int32_t sig_position = *val_position; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position<<5) & 0xff; + *(outbuffer + offset++) = (sig_position>>3) & 0xff; + *(outbuffer + offset++) = (sig_position>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position<<4) & 0xF0) | ((sig_position>>19)&0x0F); + *(outbuffer + offset++) = (exp_position>>4) & 0x7F; + if(this->position < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_max_effort = (int32_t *) &(this->max_effort); + int32_t exp_max_effort = (((*val_max_effort)>>23)&255); + if(exp_max_effort != 0) + exp_max_effort += 1023-127; + int32_t sig_max_effort = *val_max_effort; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_max_effort<<5) & 0xff; + *(outbuffer + offset++) = (sig_max_effort>>3) & 0xff; + *(outbuffer + offset++) = (sig_max_effort>>11) & 0xff; + *(outbuffer + offset++) = ((exp_max_effort<<4) & 0xF0) | ((sig_max_effort>>19)&0x0F); + *(outbuffer + offset++) = (exp_max_effort>>4) & 0x7F; + if(this->max_effort < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_position = (uint32_t*) &(this->position); + offset += 3; + *val_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position !=0) + *val_position |= ((exp_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position = -this->position; + uint32_t * val_max_effort = (uint32_t*) &(this->max_effort); + offset += 3; + *val_max_effort = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_max_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_max_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_max_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_max_effort = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_max_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_max_effort !=0) + *val_max_effort |= ((exp_max_effort)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->max_effort = -this->max_effort; + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommand"; }; + const char * getMD5(){ return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandAction.h new file mode 100755 index 0000000..be41a39 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommandAction_h +#define _ROS_control_msgs_GripperCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommandActionGoal.h" +#include "control_msgs/GripperCommandActionResult.h" +#include "control_msgs/GripperCommandActionFeedback.h" + +namespace control_msgs +{ + + class GripperCommandAction : public ros::Msg + { + public: + control_msgs::GripperCommandActionGoal action_goal; + control_msgs::GripperCommandActionResult action_result; + control_msgs::GripperCommandActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandAction"; }; + const char * getMD5(){ return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h new file mode 100755 index 0000000..a1c48bb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommandActionFeedback_h +#define _ROS_control_msgs_GripperCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandFeedback.h" + +namespace control_msgs +{ + + class GripperCommandActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionFeedback"; }; + const char * getMD5(){ return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h new file mode 100755 index 0000000..c675bba --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommandActionGoal_h +#define _ROS_control_msgs_GripperCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/GripperCommandGoal.h" + +namespace control_msgs +{ + + class GripperCommandActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::GripperCommandGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionGoal"; }; + const char * getMD5(){ return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h new file mode 100755 index 0000000..39eb817 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommandActionResult_h +#define _ROS_control_msgs_GripperCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandResult.h" + +namespace control_msgs +{ + + class GripperCommandActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionResult"; }; + const char * getMD5(){ return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h new file mode 100755 index 0000000..b9dbc65 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h @@ -0,0 +1,118 @@ +#ifndef _ROS_control_msgs_GripperCommandFeedback_h +#define _ROS_control_msgs_GripperCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandFeedback : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_position = (int32_t *) &(this->position); + int32_t exp_position = (((*val_position)>>23)&255); + if(exp_position != 0) + exp_position += 1023-127; + int32_t sig_position = *val_position; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position<<5) & 0xff; + *(outbuffer + offset++) = (sig_position>>3) & 0xff; + *(outbuffer + offset++) = (sig_position>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position<<4) & 0xF0) | ((sig_position>>19)&0x0F); + *(outbuffer + offset++) = (exp_position>>4) & 0x7F; + if(this->position < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_effort = (int32_t *) &(this->effort); + int32_t exp_effort = (((*val_effort)>>23)&255); + if(exp_effort != 0) + exp_effort += 1023-127; + int32_t sig_effort = *val_effort; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_effort<<5) & 0xff; + *(outbuffer + offset++) = (sig_effort>>3) & 0xff; + *(outbuffer + offset++) = (sig_effort>>11) & 0xff; + *(outbuffer + offset++) = ((exp_effort<<4) & 0xF0) | ((sig_effort>>19)&0x0F); + *(outbuffer + offset++) = (exp_effort>>4) & 0x7F; + if(this->effort < 0) *(outbuffer + offset -1) |= 0x80; + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_position = (uint32_t*) &(this->position); + offset += 3; + *val_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position !=0) + *val_position |= ((exp_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position = -this->position; + uint32_t * val_effort = (uint32_t*) &(this->effort); + offset += 3; + *val_effort = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_effort = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_effort !=0) + *val_effort |= ((exp_effort)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->effort = -this->effort; + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandFeedback"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandGoal.h new file mode 100755 index 0000000..3080c71 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_GripperCommandGoal_h +#define _ROS_control_msgs_GripperCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommand.h" + +namespace control_msgs +{ + + class GripperCommandGoal : public ros::Msg + { + public: + control_msgs::GripperCommand command; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandGoal"; }; + const char * getMD5(){ return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandResult.h new file mode 100755 index 0000000..1df1c99 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/GripperCommandResult.h @@ -0,0 +1,118 @@ +#ifndef _ROS_control_msgs_GripperCommandResult_h +#define _ROS_control_msgs_GripperCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandResult : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_position = (int32_t *) &(this->position); + int32_t exp_position = (((*val_position)>>23)&255); + if(exp_position != 0) + exp_position += 1023-127; + int32_t sig_position = *val_position; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position<<5) & 0xff; + *(outbuffer + offset++) = (sig_position>>3) & 0xff; + *(outbuffer + offset++) = (sig_position>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position<<4) & 0xF0) | ((sig_position>>19)&0x0F); + *(outbuffer + offset++) = (exp_position>>4) & 0x7F; + if(this->position < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_effort = (int32_t *) &(this->effort); + int32_t exp_effort = (((*val_effort)>>23)&255); + if(exp_effort != 0) + exp_effort += 1023-127; + int32_t sig_effort = *val_effort; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_effort<<5) & 0xff; + *(outbuffer + offset++) = (sig_effort>>3) & 0xff; + *(outbuffer + offset++) = (sig_effort>>11) & 0xff; + *(outbuffer + offset++) = ((exp_effort<<4) & 0xF0) | ((sig_effort>>19)&0x0F); + *(outbuffer + offset++) = (exp_effort>>4) & 0x7F; + if(this->effort < 0) *(outbuffer + offset -1) |= 0x80; + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_position = (uint32_t*) &(this->position); + offset += 3; + *val_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position !=0) + *val_position |= ((exp_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position = -this->position; + uint32_t * val_effort = (uint32_t*) &(this->effort); + offset += 3; + *val_effort = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_effort = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_effort !=0) + *val_effort |= ((exp_effort)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->effort = -this->effort; + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandResult"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointControllerState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointControllerState.h new file mode 100755 index 0000000..732d3e6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointControllerState.h @@ -0,0 +1,298 @@ +#ifndef _ROS_control_msgs_JointControllerState_h +#define _ROS_control_msgs_JointControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class JointControllerState : public ros::Msg + { + public: + std_msgs::Header header; + float set_point; + float process_value; + float process_value_dot; + float error; + float time_step; + float command; + float p; + float i; + float d; + float i_clamp; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + int32_t * val_set_point = (int32_t *) &(this->set_point); + int32_t exp_set_point = (((*val_set_point)>>23)&255); + if(exp_set_point != 0) + exp_set_point += 1023-127; + int32_t sig_set_point = *val_set_point; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_set_point<<5) & 0xff; + *(outbuffer + offset++) = (sig_set_point>>3) & 0xff; + *(outbuffer + offset++) = (sig_set_point>>11) & 0xff; + *(outbuffer + offset++) = ((exp_set_point<<4) & 0xF0) | ((sig_set_point>>19)&0x0F); + *(outbuffer + offset++) = (exp_set_point>>4) & 0x7F; + if(this->set_point < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_process_value = (int32_t *) &(this->process_value); + int32_t exp_process_value = (((*val_process_value)>>23)&255); + if(exp_process_value != 0) + exp_process_value += 1023-127; + int32_t sig_process_value = *val_process_value; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_process_value<<5) & 0xff; + *(outbuffer + offset++) = (sig_process_value>>3) & 0xff; + *(outbuffer + offset++) = (sig_process_value>>11) & 0xff; + *(outbuffer + offset++) = ((exp_process_value<<4) & 0xF0) | ((sig_process_value>>19)&0x0F); + *(outbuffer + offset++) = (exp_process_value>>4) & 0x7F; + if(this->process_value < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_process_value_dot = (int32_t *) &(this->process_value_dot); + int32_t exp_process_value_dot = (((*val_process_value_dot)>>23)&255); + if(exp_process_value_dot != 0) + exp_process_value_dot += 1023-127; + int32_t sig_process_value_dot = *val_process_value_dot; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_process_value_dot<<5) & 0xff; + *(outbuffer + offset++) = (sig_process_value_dot>>3) & 0xff; + *(outbuffer + offset++) = (sig_process_value_dot>>11) & 0xff; + *(outbuffer + offset++) = ((exp_process_value_dot<<4) & 0xF0) | ((sig_process_value_dot>>19)&0x0F); + *(outbuffer + offset++) = (exp_process_value_dot>>4) & 0x7F; + if(this->process_value_dot < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_error = (int32_t *) &(this->error); + int32_t exp_error = (((*val_error)>>23)&255); + if(exp_error != 0) + exp_error += 1023-127; + int32_t sig_error = *val_error; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_error<<5) & 0xff; + *(outbuffer + offset++) = (sig_error>>3) & 0xff; + *(outbuffer + offset++) = (sig_error>>11) & 0xff; + *(outbuffer + offset++) = ((exp_error<<4) & 0xF0) | ((sig_error>>19)&0x0F); + *(outbuffer + offset++) = (exp_error>>4) & 0x7F; + if(this->error < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_time_step = (int32_t *) &(this->time_step); + int32_t exp_time_step = (((*val_time_step)>>23)&255); + if(exp_time_step != 0) + exp_time_step += 1023-127; + int32_t sig_time_step = *val_time_step; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_time_step<<5) & 0xff; + *(outbuffer + offset++) = (sig_time_step>>3) & 0xff; + *(outbuffer + offset++) = (sig_time_step>>11) & 0xff; + *(outbuffer + offset++) = ((exp_time_step<<4) & 0xF0) | ((sig_time_step>>19)&0x0F); + *(outbuffer + offset++) = (exp_time_step>>4) & 0x7F; + if(this->time_step < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_command = (int32_t *) &(this->command); + int32_t exp_command = (((*val_command)>>23)&255); + if(exp_command != 0) + exp_command += 1023-127; + int32_t sig_command = *val_command; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_command<<5) & 0xff; + *(outbuffer + offset++) = (sig_command>>3) & 0xff; + *(outbuffer + offset++) = (sig_command>>11) & 0xff; + *(outbuffer + offset++) = ((exp_command<<4) & 0xF0) | ((sig_command>>19)&0x0F); + *(outbuffer + offset++) = (exp_command>>4) & 0x7F; + if(this->command < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_p = (int32_t *) &(this->p); + int32_t exp_p = (((*val_p)>>23)&255); + if(exp_p != 0) + exp_p += 1023-127; + int32_t sig_p = *val_p; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_p<<5) & 0xff; + *(outbuffer + offset++) = (sig_p>>3) & 0xff; + *(outbuffer + offset++) = (sig_p>>11) & 0xff; + *(outbuffer + offset++) = ((exp_p<<4) & 0xF0) | ((sig_p>>19)&0x0F); + *(outbuffer + offset++) = (exp_p>>4) & 0x7F; + if(this->p < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_i = (int32_t *) &(this->i); + int32_t exp_i = (((*val_i)>>23)&255); + if(exp_i != 0) + exp_i += 1023-127; + int32_t sig_i = *val_i; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_i<<5) & 0xff; + *(outbuffer + offset++) = (sig_i>>3) & 0xff; + *(outbuffer + offset++) = (sig_i>>11) & 0xff; + *(outbuffer + offset++) = ((exp_i<<4) & 0xF0) | ((sig_i>>19)&0x0F); + *(outbuffer + offset++) = (exp_i>>4) & 0x7F; + if(this->i < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_d = (int32_t *) &(this->d); + int32_t exp_d = (((*val_d)>>23)&255); + if(exp_d != 0) + exp_d += 1023-127; + int32_t sig_d = *val_d; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_d<<5) & 0xff; + *(outbuffer + offset++) = (sig_d>>3) & 0xff; + *(outbuffer + offset++) = (sig_d>>11) & 0xff; + *(outbuffer + offset++) = ((exp_d<<4) & 0xF0) | ((sig_d>>19)&0x0F); + *(outbuffer + offset++) = (exp_d>>4) & 0x7F; + if(this->d < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_i_clamp = (int32_t *) &(this->i_clamp); + int32_t exp_i_clamp = (((*val_i_clamp)>>23)&255); + if(exp_i_clamp != 0) + exp_i_clamp += 1023-127; + int32_t sig_i_clamp = *val_i_clamp; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_i_clamp<<5) & 0xff; + *(outbuffer + offset++) = (sig_i_clamp>>3) & 0xff; + *(outbuffer + offset++) = (sig_i_clamp>>11) & 0xff; + *(outbuffer + offset++) = ((exp_i_clamp<<4) & 0xF0) | ((sig_i_clamp>>19)&0x0F); + *(outbuffer + offset++) = (exp_i_clamp>>4) & 0x7F; + if(this->i_clamp < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t * val_set_point = (uint32_t*) &(this->set_point); + offset += 3; + *val_set_point = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_set_point |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_set_point |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_set_point |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_set_point = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_set_point |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_set_point !=0) + *val_set_point |= ((exp_set_point)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->set_point = -this->set_point; + uint32_t * val_process_value = (uint32_t*) &(this->process_value); + offset += 3; + *val_process_value = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_process_value |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_process_value |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_process_value |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_process_value = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_process_value |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_process_value !=0) + *val_process_value |= ((exp_process_value)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->process_value = -this->process_value; + uint32_t * val_process_value_dot = (uint32_t*) &(this->process_value_dot); + offset += 3; + *val_process_value_dot = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_process_value_dot |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_process_value_dot |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_process_value_dot |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_process_value_dot = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_process_value_dot |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_process_value_dot !=0) + *val_process_value_dot |= ((exp_process_value_dot)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->process_value_dot = -this->process_value_dot; + uint32_t * val_error = (uint32_t*) &(this->error); + offset += 3; + *val_error = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_error |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_error |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_error |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_error = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_error |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_error !=0) + *val_error |= ((exp_error)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->error = -this->error; + uint32_t * val_time_step = (uint32_t*) &(this->time_step); + offset += 3; + *val_time_step = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_time_step |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_time_step |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_time_step |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_time_step = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_time_step |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_time_step !=0) + *val_time_step |= ((exp_time_step)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->time_step = -this->time_step; + uint32_t * val_command = (uint32_t*) &(this->command); + offset += 3; + *val_command = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_command |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_command |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_command |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_command = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_command |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_command !=0) + *val_command |= ((exp_command)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->command = -this->command; + uint32_t * val_p = (uint32_t*) &(this->p); + offset += 3; + *val_p = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_p |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_p |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_p |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_p = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_p |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_p !=0) + *val_p |= ((exp_p)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->p = -this->p; + uint32_t * val_i = (uint32_t*) &(this->i); + offset += 3; + *val_i = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_i |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_i |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_i |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_i = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_i |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_i !=0) + *val_i |= ((exp_i)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->i = -this->i; + uint32_t * val_d = (uint32_t*) &(this->d); + offset += 3; + *val_d = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_d |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_d |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_d |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_d = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_d |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_d !=0) + *val_d |= ((exp_d)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->d = -this->d; + uint32_t * val_i_clamp = (uint32_t*) &(this->i_clamp); + offset += 3; + *val_i_clamp = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_i_clamp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_i_clamp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_i_clamp |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_i_clamp = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_i_clamp |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_i_clamp !=0) + *val_i_clamp |= ((exp_i_clamp)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->i_clamp = -this->i_clamp; + return offset; + } + + const char * getType(){ return "control_msgs/JointControllerState"; }; + const char * getMD5(){ return "c0d034a7bf20aeb1c37f3eccb7992b69"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTolerance.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTolerance.h new file mode 100755 index 0000000..b9bdd5d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTolerance.h @@ -0,0 +1,127 @@ +#ifndef _ROS_control_msgs_JointTolerance_h +#define _ROS_control_msgs_JointTolerance_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTolerance : public ros::Msg + { + public: + char * name; + float position; + float velocity; + float acceleration; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + int32_t * val_position = (int32_t *) &(this->position); + int32_t exp_position = (((*val_position)>>23)&255); + if(exp_position != 0) + exp_position += 1023-127; + int32_t sig_position = *val_position; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position<<5) & 0xff; + *(outbuffer + offset++) = (sig_position>>3) & 0xff; + *(outbuffer + offset++) = (sig_position>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position<<4) & 0xF0) | ((sig_position>>19)&0x0F); + *(outbuffer + offset++) = (exp_position>>4) & 0x7F; + if(this->position < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_velocity = (int32_t *) &(this->velocity); + int32_t exp_velocity = (((*val_velocity)>>23)&255); + if(exp_velocity != 0) + exp_velocity += 1023-127; + int32_t sig_velocity = *val_velocity; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_velocity<<5) & 0xff; + *(outbuffer + offset++) = (sig_velocity>>3) & 0xff; + *(outbuffer + offset++) = (sig_velocity>>11) & 0xff; + *(outbuffer + offset++) = ((exp_velocity<<4) & 0xF0) | ((sig_velocity>>19)&0x0F); + *(outbuffer + offset++) = (exp_velocity>>4) & 0x7F; + if(this->velocity < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_acceleration = (int32_t *) &(this->acceleration); + int32_t exp_acceleration = (((*val_acceleration)>>23)&255); + if(exp_acceleration != 0) + exp_acceleration += 1023-127; + int32_t sig_acceleration = *val_acceleration; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_acceleration<<5) & 0xff; + *(outbuffer + offset++) = (sig_acceleration>>3) & 0xff; + *(outbuffer + offset++) = (sig_acceleration>>11) & 0xff; + *(outbuffer + offset++) = ((exp_acceleration<<4) & 0xF0) | ((sig_acceleration>>19)&0x0F); + *(outbuffer + offset++) = (exp_acceleration>>4) & 0x7F; + if(this->acceleration < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t * val_position = (uint32_t*) &(this->position); + offset += 3; + *val_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position !=0) + *val_position |= ((exp_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position = -this->position; + uint32_t * val_velocity = (uint32_t*) &(this->velocity); + offset += 3; + *val_velocity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_velocity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_velocity !=0) + *val_velocity |= ((exp_velocity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->velocity = -this->velocity; + uint32_t * val_acceleration = (uint32_t*) &(this->acceleration); + offset += 3; + *val_acceleration = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_acceleration |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_acceleration |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_acceleration |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_acceleration = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_acceleration |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_acceleration !=0) + *val_acceleration |= ((exp_acceleration)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->acceleration = -this->acceleration; + return offset; + } + + const char * getType(){ return "control_msgs/JointTolerance"; }; + const char * getMD5(){ return "f544fe9c16cf04547e135dd6063ff5be"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h new file mode 100755 index 0000000..21b7d24 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_JointTrajectoryAction_h +#define _ROS_control_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/JointTrajectoryActionGoal.h" +#include "control_msgs/JointTrajectoryActionResult.h" +#include "control_msgs/JointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + control_msgs::JointTrajectoryActionGoal action_goal; + control_msgs::JointTrajectoryActionResult action_result; + control_msgs::JointTrajectoryActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryAction"; }; + const char * getMD5(){ return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h new file mode 100755 index 0000000..b247339 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionFeedback_h +#define _ROS_control_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h new file mode 100755 index 0000000..0dab116 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionGoal_h +#define _ROS_control_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/JointTrajectoryGoal.h" + +namespace control_msgs +{ + + class JointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::JointTrajectoryGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionGoal"; }; + const char * getMD5(){ return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h new file mode 100755 index 0000000..0d00dbf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionResult_h +#define _ROS_control_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryResult.h" + +namespace control_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h new file mode 100755 index 0000000..86285b5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,79 @@ +#ifndef _ROS_control_msgs_JointTrajectoryControllerState_h +#define _ROS_control_msgs_JointTrajectoryControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class JointTrajectoryControllerState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryControllerState"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h new file mode 100755 index 0000000..7ea511e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,34 @@ +#ifndef _ROS_control_msgs_JointTrajectoryFeedback_h +#define _ROS_control_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h new file mode 100755 index 0000000..2acae50 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryGoal_h +#define _ROS_control_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace control_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryGoal"; }; + const char * getMD5(){ return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h new file mode 100755 index 0000000..2b987a5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h @@ -0,0 +1,34 @@ +#ifndef _ROS_control_msgs_JointTrajectoryResult_h +#define _ROS_control_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadAction.h new file mode 100755 index 0000000..e6929d0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_PointHeadAction_h +#define _ROS_control_msgs_PointHeadAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/PointHeadActionGoal.h" +#include "control_msgs/PointHeadActionResult.h" +#include "control_msgs/PointHeadActionFeedback.h" + +namespace control_msgs +{ + + class PointHeadAction : public ros::Msg + { + public: + control_msgs::PointHeadActionGoal action_goal; + control_msgs::PointHeadActionResult action_result; + control_msgs::PointHeadActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadAction"; }; + const char * getMD5(){ return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h new file mode 100755 index 0000000..7bca75e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_PointHeadActionFeedback_h +#define _ROS_control_msgs_PointHeadActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadFeedback.h" + +namespace control_msgs +{ + + class PointHeadActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionFeedback"; }; + const char * getMD5(){ return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h new file mode 100755 index 0000000..e6be0d2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_PointHeadActionGoal_h +#define _ROS_control_msgs_PointHeadActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/PointHeadGoal.h" + +namespace control_msgs +{ + + class PointHeadActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::PointHeadGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionGoal"; }; + const char * getMD5(){ return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionResult.h new file mode 100755 index 0000000..1ce6883 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_PointHeadActionResult_h +#define _ROS_control_msgs_PointHeadActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadResult.h" + +namespace control_msgs +{ + + class PointHeadActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadFeedback.h new file mode 100755 index 0000000..bb3a6ec --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadFeedback.h @@ -0,0 +1,60 @@ +#ifndef _ROS_control_msgs_PointHeadFeedback_h +#define _ROS_control_msgs_PointHeadFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadFeedback : public ros::Msg + { + public: + float pointing_angle_error; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_pointing_angle_error = (int32_t *) &(this->pointing_angle_error); + int32_t exp_pointing_angle_error = (((*val_pointing_angle_error)>>23)&255); + if(exp_pointing_angle_error != 0) + exp_pointing_angle_error += 1023-127; + int32_t sig_pointing_angle_error = *val_pointing_angle_error; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_pointing_angle_error<<5) & 0xff; + *(outbuffer + offset++) = (sig_pointing_angle_error>>3) & 0xff; + *(outbuffer + offset++) = (sig_pointing_angle_error>>11) & 0xff; + *(outbuffer + offset++) = ((exp_pointing_angle_error<<4) & 0xF0) | ((sig_pointing_angle_error>>19)&0x0F); + *(outbuffer + offset++) = (exp_pointing_angle_error>>4) & 0x7F; + if(this->pointing_angle_error < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_pointing_angle_error = (uint32_t*) &(this->pointing_angle_error); + offset += 3; + *val_pointing_angle_error = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_pointing_angle_error |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_pointing_angle_error |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_pointing_angle_error |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_pointing_angle_error = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_pointing_angle_error |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_pointing_angle_error !=0) + *val_pointing_angle_error |= ((exp_pointing_angle_error)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->pointing_angle_error = -this->pointing_angle_error; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadFeedback"; }; + const char * getMD5(){ return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadGoal.h new file mode 100755 index 0000000..a2ea6d6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadGoal.h @@ -0,0 +1,105 @@ +#ifndef _ROS_control_msgs_PointHeadGoal_h +#define _ROS_control_msgs_PointHeadGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class PointHeadGoal : public ros::Msg + { + public: + geometry_msgs::PointStamped target; + geometry_msgs::Vector3 pointing_axis; + char * pointing_frame; + ros::Duration min_duration; + float max_velocity; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->target.serialize(outbuffer + offset); + offset += this->pointing_axis.serialize(outbuffer + offset); + uint32_t length_pointing_frame = strlen( (const char*) this->pointing_frame); + memcpy(outbuffer + offset, &length_pointing_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame); + offset += length_pointing_frame; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + int32_t * val_max_velocity = (int32_t *) &(this->max_velocity); + int32_t exp_max_velocity = (((*val_max_velocity)>>23)&255); + if(exp_max_velocity != 0) + exp_max_velocity += 1023-127; + int32_t sig_max_velocity = *val_max_velocity; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_max_velocity<<5) & 0xff; + *(outbuffer + offset++) = (sig_max_velocity>>3) & 0xff; + *(outbuffer + offset++) = (sig_max_velocity>>11) & 0xff; + *(outbuffer + offset++) = ((exp_max_velocity<<4) & 0xF0) | ((sig_max_velocity>>19)&0x0F); + *(outbuffer + offset++) = (exp_max_velocity>>4) & 0x7F; + if(this->max_velocity < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + memcpy(&length_pointing_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pointing_frame-1]=0; + this->pointing_frame = (char *)(inbuffer + offset-1); + offset += length_pointing_frame; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + uint32_t * val_max_velocity = (uint32_t*) &(this->max_velocity); + offset += 3; + *val_max_velocity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_max_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_max_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_max_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_max_velocity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_max_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_max_velocity !=0) + *val_max_velocity |= ((exp_max_velocity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->max_velocity = -this->max_velocity; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadGoal"; }; + const char * getMD5(){ return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadResult.h new file mode 100755 index 0000000..95d22c1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/PointHeadResult.h @@ -0,0 +1,34 @@ +#ifndef _ROS_control_msgs_PointHeadResult_h +#define _ROS_control_msgs_PointHeadResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadResult : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/QueryCalibrationState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/QueryCalibrationState.h new file mode 100755 index 0000000..e31d05a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/QueryCalibrationState.h @@ -0,0 +1,78 @@ +#ifndef _ROS_SERVICE_QueryCalibrationState_h +#define _ROS_SERVICE_QueryCalibrationState_h +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + +static const char QUERYCALIBRATIONSTATE[] = "control_msgs/QueryCalibrationState"; + + class QueryCalibrationStateRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + bool is_calibrated; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h new file mode 100755 index 0000000..72f1f02 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h @@ -0,0 +1,241 @@ +#ifndef _ROS_SERVICE_QueryTrajectoryState_h +#define _ROS_SERVICE_QueryTrajectoryState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace control_msgs +{ + +static const char QUERYTRAJECTORYSTATE[] = "control_msgs/QueryTrajectoryState"; + + class QueryTrajectoryStateRequest : public ros::Msg + { + public: + ros::Time time; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t acceleration_length; + float st_acceleration; + float * acceleration; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen( (const char*) this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + int32_t * val_positioni = (int32_t *) &(this->position[i]); + int32_t exp_positioni = (((*val_positioni)>>23)&255); + if(exp_positioni != 0) + exp_positioni += 1023-127; + int32_t sig_positioni = *val_positioni; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_positioni<<5) & 0xff; + *(outbuffer + offset++) = (sig_positioni>>3) & 0xff; + *(outbuffer + offset++) = (sig_positioni>>11) & 0xff; + *(outbuffer + offset++) = ((exp_positioni<<4) & 0xF0) | ((sig_positioni>>19)&0x0F); + *(outbuffer + offset++) = (exp_positioni>>4) & 0x7F; + if(this->position[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + int32_t * val_velocityi = (int32_t *) &(this->velocity[i]); + int32_t exp_velocityi = (((*val_velocityi)>>23)&255); + if(exp_velocityi != 0) + exp_velocityi += 1023-127; + int32_t sig_velocityi = *val_velocityi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_velocityi<<5) & 0xff; + *(outbuffer + offset++) = (sig_velocityi>>3) & 0xff; + *(outbuffer + offset++) = (sig_velocityi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_velocityi<<4) & 0xF0) | ((sig_velocityi>>19)&0x0F); + *(outbuffer + offset++) = (exp_velocityi>>4) & 0x7F; + if(this->velocity[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = acceleration_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < acceleration_length; i++){ + int32_t * val_accelerationi = (int32_t *) &(this->acceleration[i]); + int32_t exp_accelerationi = (((*val_accelerationi)>>23)&255); + if(exp_accelerationi != 0) + exp_accelerationi += 1023-127; + int32_t sig_accelerationi = *val_accelerationi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_accelerationi<<5) & 0xff; + *(outbuffer + offset++) = (sig_accelerationi>>3) & 0xff; + *(outbuffer + offset++) = (sig_accelerationi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_accelerationi<<4) & 0xF0) | ((sig_accelerationi>>19)&0x0F); + *(outbuffer + offset++) = (exp_accelerationi>>4) & 0x7F; + if(this->acceleration[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + uint32_t * val_st_position = (uint32_t*) &(this->st_position); + offset += 3; + *val_st_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_position !=0) + *val_st_position |= ((exp_st_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_position = -this->st_position; + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + uint32_t * val_st_velocity = (uint32_t*) &(this->st_velocity); + offset += 3; + *val_st_velocity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_velocity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_velocity !=0) + *val_st_velocity |= ((exp_st_velocity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_velocity = -this->st_velocity; + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t acceleration_lengthT = *(inbuffer + offset++); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + offset += 3; + acceleration_length = acceleration_lengthT; + for( uint8_t i = 0; i < acceleration_length; i++){ + uint32_t * val_st_acceleration = (uint32_t*) &(this->st_acceleration); + offset += 3; + *val_st_acceleration = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_acceleration |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_acceleration |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_acceleration |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_acceleration = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_acceleration |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_acceleration !=0) + *val_st_acceleration |= ((exp_st_acceleration)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_acceleration = -this->st_acceleration; + memcpy( &(this->acceleration[i]), &(this->st_acceleration), sizeof(float)); + } + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h new file mode 100755 index 0000000..a6bbb88 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_SingleJointPositionAction_h +#define _ROS_control_msgs_SingleJointPositionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/SingleJointPositionActionGoal.h" +#include "control_msgs/SingleJointPositionActionResult.h" +#include "control_msgs/SingleJointPositionActionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionAction : public ros::Msg + { + public: + control_msgs::SingleJointPositionActionGoal action_goal; + control_msgs::SingleJointPositionActionResult action_result; + control_msgs::SingleJointPositionActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionAction"; }; + const char * getMD5(){ return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h new file mode 100755 index 0000000..c88c07b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionFeedback_h +#define _ROS_control_msgs_SingleJointPositionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionFeedback"; }; + const char * getMD5(){ return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h new file mode 100755 index 0000000..54a8cc2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionGoal_h +#define _ROS_control_msgs_SingleJointPositionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/SingleJointPositionGoal.h" + +namespace control_msgs +{ + + class SingleJointPositionActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::SingleJointPositionGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionGoal"; }; + const char * getMD5(){ return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h new file mode 100755 index 0000000..440eea5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionResult_h +#define _ROS_control_msgs_SingleJointPositionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionResult.h" + +namespace control_msgs +{ + + class SingleJointPositionActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h new file mode 100755 index 0000000..ed8a18e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,116 @@ +#ifndef _ROS_control_msgs_SingleJointPositionFeedback_h +#define _ROS_control_msgs_SingleJointPositionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class SingleJointPositionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + float position; + float velocity; + float error; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + int32_t * val_position = (int32_t *) &(this->position); + int32_t exp_position = (((*val_position)>>23)&255); + if(exp_position != 0) + exp_position += 1023-127; + int32_t sig_position = *val_position; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position<<5) & 0xff; + *(outbuffer + offset++) = (sig_position>>3) & 0xff; + *(outbuffer + offset++) = (sig_position>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position<<4) & 0xF0) | ((sig_position>>19)&0x0F); + *(outbuffer + offset++) = (exp_position>>4) & 0x7F; + if(this->position < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_velocity = (int32_t *) &(this->velocity); + int32_t exp_velocity = (((*val_velocity)>>23)&255); + if(exp_velocity != 0) + exp_velocity += 1023-127; + int32_t sig_velocity = *val_velocity; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_velocity<<5) & 0xff; + *(outbuffer + offset++) = (sig_velocity>>3) & 0xff; + *(outbuffer + offset++) = (sig_velocity>>11) & 0xff; + *(outbuffer + offset++) = ((exp_velocity<<4) & 0xF0) | ((sig_velocity>>19)&0x0F); + *(outbuffer + offset++) = (exp_velocity>>4) & 0x7F; + if(this->velocity < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_error = (int32_t *) &(this->error); + int32_t exp_error = (((*val_error)>>23)&255); + if(exp_error != 0) + exp_error += 1023-127; + int32_t sig_error = *val_error; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_error<<5) & 0xff; + *(outbuffer + offset++) = (sig_error>>3) & 0xff; + *(outbuffer + offset++) = (sig_error>>11) & 0xff; + *(outbuffer + offset++) = ((exp_error<<4) & 0xF0) | ((sig_error>>19)&0x0F); + *(outbuffer + offset++) = (exp_error>>4) & 0x7F; + if(this->error < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t * val_position = (uint32_t*) &(this->position); + offset += 3; + *val_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position !=0) + *val_position |= ((exp_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position = -this->position; + uint32_t * val_velocity = (uint32_t*) &(this->velocity); + offset += 3; + *val_velocity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_velocity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_velocity !=0) + *val_velocity |= ((exp_velocity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->velocity = -this->velocity; + uint32_t * val_error = (uint32_t*) &(this->error); + offset += 3; + *val_error = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_error |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_error |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_error |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_error = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_error |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_error !=0) + *val_error |= ((exp_error)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->error = -this->error; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionFeedback"; }; + const char * getMD5(){ return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h new file mode 100755 index 0000000..d0196c4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h @@ -0,0 +1,108 @@ +#ifndef _ROS_control_msgs_SingleJointPositionGoal_h +#define _ROS_control_msgs_SingleJointPositionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class SingleJointPositionGoal : public ros::Msg + { + public: + float position; + ros::Duration min_duration; + float max_velocity; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_position = (int32_t *) &(this->position); + int32_t exp_position = (((*val_position)>>23)&255); + if(exp_position != 0) + exp_position += 1023-127; + int32_t sig_position = *val_position; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position<<5) & 0xff; + *(outbuffer + offset++) = (sig_position>>3) & 0xff; + *(outbuffer + offset++) = (sig_position>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position<<4) & 0xF0) | ((sig_position>>19)&0x0F); + *(outbuffer + offset++) = (exp_position>>4) & 0x7F; + if(this->position < 0) *(outbuffer + offset -1) |= 0x80; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + int32_t * val_max_velocity = (int32_t *) &(this->max_velocity); + int32_t exp_max_velocity = (((*val_max_velocity)>>23)&255); + if(exp_max_velocity != 0) + exp_max_velocity += 1023-127; + int32_t sig_max_velocity = *val_max_velocity; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_max_velocity<<5) & 0xff; + *(outbuffer + offset++) = (sig_max_velocity>>3) & 0xff; + *(outbuffer + offset++) = (sig_max_velocity>>11) & 0xff; + *(outbuffer + offset++) = ((exp_max_velocity<<4) & 0xF0) | ((sig_max_velocity>>19)&0x0F); + *(outbuffer + offset++) = (exp_max_velocity>>4) & 0x7F; + if(this->max_velocity < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_position = (uint32_t*) &(this->position); + offset += 3; + *val_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position !=0) + *val_position |= ((exp_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position = -this->position; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + uint32_t * val_max_velocity = (uint32_t*) &(this->max_velocity); + offset += 3; + *val_max_velocity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_max_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_max_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_max_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_max_velocity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_max_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_max_velocity !=0) + *val_max_velocity |= ((exp_max_velocity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->max_velocity = -this->max_velocity; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionGoal"; }; + const char * getMD5(){ return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h new file mode 100755 index 0000000..e797342 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h @@ -0,0 +1,34 @@ +#ifndef _ROS_control_msgs_SingleJointPositionResult_h +#define _ROS_control_msgs_SingleJointPositionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class SingleJointPositionResult : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/costmap_2d/VoxelGrid.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/costmap_2d/VoxelGrid.h new file mode 100755 index 0000000..f77e885 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/costmap_2d/VoxelGrid.h @@ -0,0 +1,106 @@ +#ifndef _ROS_costmap_2d_VoxelGrid_h +#define _ROS_costmap_2d_VoxelGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "geometry_msgs/Vector3.h" + +namespace costmap_2d +{ + + class VoxelGrid : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t data_length; + uint32_t st_data; + uint32_t * data; + geometry_msgs::Point32 origin; + geometry_msgs::Vector3 resolutions; + uint32_t size_x; + uint32_t size_y; + uint32_t size_z; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + offset += this->origin.serialize(outbuffer + offset); + offset += this->resolutions.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->size_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_x); + *(outbuffer + offset + 0) = (this->size_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_y); + *(outbuffer + offset + 0) = (this->size_z >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size_z >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size_z >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size_z >> (8 * 3)) & 0xFF; + offset += sizeof(this->size_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint32_t) (*(inbuffer + offset))); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint32_t)); + } + offset += this->origin.deserialize(inbuffer + offset); + offset += this->resolutions.deserialize(inbuffer + offset); + this->size_x = ((uint32_t) (*(inbuffer + offset))); + this->size_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_x); + this->size_y = ((uint32_t) (*(inbuffer + offset))); + this->size_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_y); + this->size_z = ((uint32_t) (*(inbuffer + offset))); + this->size_z |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size_z |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size_z |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size_z); + return offset; + } + + const char * getType(){ return "costmap_2d/VoxelGrid"; }; + const char * getMD5(){ return "48a040827e1322073d78ece5a497029c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h new file mode 100755 index 0000000..e8624c3 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h @@ -0,0 +1,58 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticArray_h +#define _ROS_diagnostic_msgs_DiagnosticArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + + class DiagnosticArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticArray"; }; + const char * getMD5(){ return "3cfbeff055e708a24c3d946a5c8139cd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h new file mode 100755 index 0000000..5c9236b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h @@ -0,0 +1,118 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticStatus_h +#define _ROS_diagnostic_msgs_DiagnosticStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/KeyValue.h" + +namespace diagnostic_msgs +{ + + class DiagnosticStatus : public ros::Msg + { + public: + int8_t level; + char * name; + char * message; + char * hardware_id; + uint8_t values_length; + diagnostic_msgs::KeyValue st_values; + diagnostic_msgs::KeyValue * values; + enum { OK = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_message = strlen( (const char*) this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_hardware_id = strlen( (const char*) this->hardware_id); + memcpy(outbuffer + offset, &length_hardware_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->values[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + uint32_t length_hardware_id; + memcpy(&length_hardware_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_id-1]=0; + this->hardware_id = (char *)(inbuffer + offset-1); + offset += length_hardware_id; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (diagnostic_msgs::KeyValue*)realloc(this->values, values_lengthT * sizeof(diagnostic_msgs::KeyValue)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->st_values.deserialize(inbuffer + offset); + memcpy( &(this->values[i]), &(this->st_values), sizeof(diagnostic_msgs::KeyValue)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticStatus"; }; + const char * getMD5(){ return "67d15a62edb26e9d52b0f0efa3ef9da7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/KeyValue.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/KeyValue.h new file mode 100755 index 0000000..a634ea3 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/KeyValue.h @@ -0,0 +1,64 @@ +#ifndef _ROS_diagnostic_msgs_KeyValue_h +#define _ROS_diagnostic_msgs_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + + class KeyValue : public ros::Msg + { + public: + char * key; + char * value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_key = strlen( (const char*) this->key); + memcpy(outbuffer + offset, &length_key, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->key, length_key); + offset += length_key; + uint32_t length_value = strlen( (const char*) this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_key; + memcpy(&length_key, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_key; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_key-1]=0; + this->key = (char *)(inbuffer + offset-1); + offset += length_key; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "diagnostic_msgs/KeyValue"; }; + const char * getMD5(){ return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/SelfTest.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/SelfTest.h new file mode 100755 index 0000000..a5523ad --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/diagnostic_msgs/SelfTest.h @@ -0,0 +1,113 @@ +#ifndef _ROS_SERVICE_SelfTest_h +#define _ROS_SERVICE_SelfTest_h +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + +static const char SELFTEST[] = "diagnostic_msgs/SelfTest"; + + class SelfTestRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SelfTestResponse : public ros::Msg + { + public: + char * id; + int8_t passed; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_id = strlen( (const char*) this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.real = this->passed; + *(outbuffer + offset + 0) = (u_passed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->passed); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.base = 0; + u_passed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->passed = u_passed.real; + offset += sizeof(this->passed); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "74c9372c870a76da4fc2b3973978b898"; }; + + }; + + class SelfTest { + public: + typedef SelfTestRequest Request; + typedef SelfTestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/ConfigString.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/ConfigString.h new file mode 100755 index 0000000..3ecd9c0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/ConfigString.h @@ -0,0 +1,64 @@ +#ifndef _ROS_driver_base_ConfigString_h +#define _ROS_driver_base_ConfigString_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigString : public ros::Msg + { + public: + char * name; + char * value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen( (const char*) this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "driver_base/ConfigString"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/ConfigValue.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/ConfigValue.h new file mode 100755 index 0000000..d2fa57e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/ConfigValue.h @@ -0,0 +1,75 @@ +#ifndef _ROS_driver_base_ConfigValue_h +#define _ROS_driver_base_ConfigValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigValue : public ros::Msg + { + public: + char * name; + float value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + int32_t * val_value = (int32_t *) &(this->value); + int32_t exp_value = (((*val_value)>>23)&255); + if(exp_value != 0) + exp_value += 1023-127; + int32_t sig_value = *val_value; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_value<<5) & 0xff; + *(outbuffer + offset++) = (sig_value>>3) & 0xff; + *(outbuffer + offset++) = (sig_value>>11) & 0xff; + *(outbuffer + offset++) = ((exp_value<<4) & 0xF0) | ((sig_value>>19)&0x0F); + *(outbuffer + offset++) = (exp_value>>4) & 0x7F; + if(this->value < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t * val_value = (uint32_t*) &(this->value); + offset += 3; + *val_value = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_value |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_value |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_value |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_value = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_value |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_value !=0) + *val_value |= ((exp_value)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->value = -this->value; + return offset; + } + + const char * getType(){ return "driver_base/ConfigValue"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/SensorLevels.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/SensorLevels.h new file mode 100755 index 0000000..28b8c55 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/driver_base/SensorLevels.h @@ -0,0 +1,37 @@ +#ifndef _ROS_driver_base_SensorLevels_h +#define _ROS_driver_base_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "driver_base/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/duration.cpp b/case_study/arduino_lab/group_01/original/lib/ros_lib/duration.cpp new file mode 100755 index 0000000..7a55efd --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/duration.cpp @@ -0,0 +1,81 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSecSigned(long &sec, long &nsec) + { + long nsec_part = nsec; + long sec_part = sec; + + while (nsec_part > 1000000000L) + { + nsec_part -= 1000000000L; + ++sec_part; + } + while (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + sec = sec_part; + nsec = nsec_part; + } + + Duration& Duration::operator+=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator-=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator*=(double scale){ + sec *= scale; + nsec *= scale; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h new file mode 100755 index 0000000..3af7843 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h @@ -0,0 +1,65 @@ +#ifndef _ROS_dynamic_reconfigure_BoolParameter_h +#define _ROS_dynamic_reconfigure_BoolParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class BoolParameter : public ros::Msg + { + public: + char * name; + bool value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/BoolParameter"; }; + const char * getMD5(){ return "23f05028c1a699fb83e22401228c3a9e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Config.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Config.h new file mode 100755 index 0000000..48b248d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Config.h @@ -0,0 +1,134 @@ +#ifndef _ROS_dynamic_reconfigure_Config_h +#define _ROS_dynamic_reconfigure_Config_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/BoolParameter.h" +#include "dynamic_reconfigure/IntParameter.h" +#include "dynamic_reconfigure/StrParameter.h" +#include "dynamic_reconfigure/DoubleParameter.h" +#include "dynamic_reconfigure/GroupState.h" + +namespace dynamic_reconfigure +{ + + class Config : public ros::Msg + { + public: + uint8_t bools_length; + dynamic_reconfigure::BoolParameter st_bools; + dynamic_reconfigure::BoolParameter * bools; + uint8_t ints_length; + dynamic_reconfigure::IntParameter st_ints; + dynamic_reconfigure::IntParameter * ints; + uint8_t strs_length; + dynamic_reconfigure::StrParameter st_strs; + dynamic_reconfigure::StrParameter * strs; + uint8_t doubles_length; + dynamic_reconfigure::DoubleParameter st_doubles; + dynamic_reconfigure::DoubleParameter * doubles; + uint8_t groups_length; + dynamic_reconfigure::GroupState st_groups; + dynamic_reconfigure::GroupState * groups; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = bools_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->bools[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = strs_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->strs[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = doubles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->doubles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t bools_lengthT = *(inbuffer + offset++); + if(bools_lengthT > bools_length) + this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); + offset += 3; + bools_length = bools_lengthT; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->st_bools.deserialize(inbuffer + offset); + memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter)); + } + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->st_ints.deserialize(inbuffer + offset); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter)); + } + uint8_t strs_lengthT = *(inbuffer + offset++); + if(strs_lengthT > strs_length) + this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); + offset += 3; + strs_length = strs_lengthT; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->st_strs.deserialize(inbuffer + offset); + memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter)); + } + uint8_t doubles_lengthT = *(inbuffer + offset++); + if(doubles_lengthT > doubles_length) + this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); + offset += 3; + doubles_length = doubles_lengthT; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->st_doubles.deserialize(inbuffer + offset); + memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter)); + } + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState)); + } + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Config"; }; + const char * getMD5(){ return "958f16a05573709014982821e6822580"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h new file mode 100755 index 0000000..221abf9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h @@ -0,0 +1,64 @@ +#ifndef _ROS_dynamic_reconfigure_ConfigDescription_h +#define _ROS_dynamic_reconfigure_ConfigDescription_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Group.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + + class ConfigDescription : public ros::Msg + { + public: + uint8_t groups_length; + dynamic_reconfigure::Group st_groups; + dynamic_reconfigure::Group * groups; + dynamic_reconfigure::Config max; + dynamic_reconfigure::Config min; + dynamic_reconfigure::Config dflt; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + offset += this->max.serialize(outbuffer + offset); + offset += this->min.serialize(outbuffer + offset); + offset += this->dflt.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::Group*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::Group)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::Group)); + } + offset += this->max.deserialize(inbuffer + offset); + offset += this->min.deserialize(inbuffer + offset); + offset += this->dflt.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ConfigDescription"; }; + const char * getMD5(){ return "757ce9d44ba8ddd801bb30bc456f946f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h new file mode 100755 index 0000000..6deca77 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h @@ -0,0 +1,75 @@ +#ifndef _ROS_dynamic_reconfigure_DoubleParameter_h +#define _ROS_dynamic_reconfigure_DoubleParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class DoubleParameter : public ros::Msg + { + public: + char * name; + float value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + int32_t * val_value = (int32_t *) &(this->value); + int32_t exp_value = (((*val_value)>>23)&255); + if(exp_value != 0) + exp_value += 1023-127; + int32_t sig_value = *val_value; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_value<<5) & 0xff; + *(outbuffer + offset++) = (sig_value>>3) & 0xff; + *(outbuffer + offset++) = (sig_value>>11) & 0xff; + *(outbuffer + offset++) = ((exp_value<<4) & 0xF0) | ((sig_value>>19)&0x0F); + *(outbuffer + offset++) = (exp_value>>4) & 0x7F; + if(this->value < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t * val_value = (uint32_t*) &(this->value); + offset += 3; + *val_value = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_value |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_value |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_value |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_value = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_value |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_value !=0) + *val_value |= ((exp_value)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->value = -this->value; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/DoubleParameter"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Group.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Group.h new file mode 100755 index 0000000..e0fc9c5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Group.h @@ -0,0 +1,128 @@ +#ifndef _ROS_dynamic_reconfigure_Group_h +#define _ROS_dynamic_reconfigure_Group_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/ParamDescription.h" + +namespace dynamic_reconfigure +{ + + class Group : public ros::Msg + { + public: + char * name; + char * type; + uint8_t parameters_length; + dynamic_reconfigure::ParamDescription st_parameters; + dynamic_reconfigure::ParamDescription * parameters; + int32_t parent; + int32_t id; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen( (const char*) this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = parameters_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t parameters_lengthT = *(inbuffer + offset++); + if(parameters_lengthT > parameters_length) + this->parameters = (dynamic_reconfigure::ParamDescription*)realloc(this->parameters, parameters_lengthT * sizeof(dynamic_reconfigure::ParamDescription)); + offset += 3; + parameters_length = parameters_lengthT; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(dynamic_reconfigure::ParamDescription)); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Group"; }; + const char * getMD5(){ return "9e8cd9e9423c94823db3614dd8b1cf7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/GroupState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/GroupState.h new file mode 100755 index 0000000..1aaf792 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/GroupState.h @@ -0,0 +1,109 @@ +#ifndef _ROS_dynamic_reconfigure_GroupState_h +#define _ROS_dynamic_reconfigure_GroupState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class GroupState : public ros::Msg + { + public: + char * name; + bool state; + int32_t id; + int32_t parent; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.real = this->state; + *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.base = 0; + u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->state = u_state.real; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/GroupState"; }; + const char * getMD5(){ return "a2d87f51dc22930325041a2f8b1571f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h new file mode 100755 index 0000000..95c1da8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h @@ -0,0 +1,71 @@ +#ifndef _ROS_dynamic_reconfigure_IntParameter_h +#define _ROS_dynamic_reconfigure_IntParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class IntParameter : public ros::Msg + { + public: + char * name; + int32_t value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/IntParameter"; }; + const char * getMD5(){ return "65fedc7a0cbfb8db035e46194a350bf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h new file mode 100755 index 0000000..3d6419d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h @@ -0,0 +1,105 @@ +#ifndef _ROS_dynamic_reconfigure_ParamDescription_h +#define _ROS_dynamic_reconfigure_ParamDescription_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class ParamDescription : public ros::Msg + { + public: + char * name; + char * type; + uint32_t level; + char * description; + char * edit_method; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen( (const char*) this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->level >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->level >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->level >> (8 * 3)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_description = strlen( (const char*) this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_edit_method = strlen( (const char*) this->edit_method); + memcpy(outbuffer + offset, &length_edit_method, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->edit_method, length_edit_method); + offset += length_edit_method; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + this->level = ((uint32_t) (*(inbuffer + offset))); + this->level |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->level |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->level |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->level); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + uint32_t length_edit_method; + memcpy(&length_edit_method, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_edit_method; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_edit_method-1]=0; + this->edit_method = (char *)(inbuffer + offset-1); + offset += length_edit_method; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ParamDescription"; }; + const char * getMD5(){ return "7434fcb9348c13054e0c3b267c8cb34d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h new file mode 100755 index 0000000..e8188ea --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h @@ -0,0 +1,69 @@ +#ifndef _ROS_SERVICE_Reconfigure_h +#define _ROS_SERVICE_Reconfigure_h +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + +static const char RECONFIGURE[] = "dynamic_reconfigure/Reconfigure"; + + class ReconfigureRequest : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class ReconfigureResponse : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class Reconfigure { + public: + typedef ReconfigureRequest Request; + typedef ReconfigureResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h new file mode 100755 index 0000000..75739eb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h @@ -0,0 +1,37 @@ +#ifndef _ROS_dynamic_reconfigure_SensorLevels_h +#define _ROS_dynamic_reconfigure_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h new file mode 100755 index 0000000..0c78be7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h @@ -0,0 +1,64 @@ +#ifndef _ROS_dynamic_reconfigure_StrParameter_h +#define _ROS_dynamic_reconfigure_StrParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class StrParameter : public ros::Msg + { + public: + char * name; + char * value; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen( (const char*) this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/StrParameter"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ADC/ADC.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ADC/ADC.pde new file mode 100755 index 0000000..a6cabe9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ADC/ADC.pde @@ -0,0 +1,52 @@ +/* + * rosserial ADC Example + * + * This is a poor man's Oscilloscope. It does not have the sampling + * rate or accuracy of a commerical scope, but it is great to get + * an analog value into ROS in a pinch. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +rosserial_arduino::Adc adc_msg; +ros::Publisher p("adc", &adc_msg); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); +} + +//We average the analog reading to elminate some of the noise +int averageAnalog(int pin){ + int v=0; + for(int i=0; i<4; i++) v+= analogRead(pin); + return v/4; +} + +long adc_timer; + +void loop() +{ + adc_msg.adc0 = averageAnalog(0); + adc_msg.adc1 = averageAnalog(1); + adc_msg.adc2 = averageAnalog(2); + adc_msg.adc3 = averageAnalog(3); + adc_msg.adc4 = averageAnalog(4); + adc_msg.adc5 = averageAnalog(5); + + p.publish(&adc_msg); + + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Blink/Blink.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Blink/Blink.pde new file mode 100755 index 0000000..4e9e185 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Blink/Blink.pde @@ -0,0 +1,29 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include + +ros::NodeHandle nh; + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/BlinkM/BlinkM.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/BlinkM/BlinkM.pde new file mode 100755 index 0000000..f54ea28 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/BlinkM/BlinkM.pde @@ -0,0 +1,162 @@ +/* +* RosSerial BlinkM Example +* This program shows how to control a blinkm +* from an arduino using RosSerial +*/ + +#include + + +#include +#include + + +//include Wire/ twi for the BlinkM +#include +extern "C" { +#include "utility/twi.h" +} + +#include "BlinkM_funcs.h" +const byte blinkm_addr = 0x09; //default blinkm address + + +void setLED( bool solid, char color) +{ + + if (solid) + { + switch (color) + { + + case 'w': // white + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0xff); + break; + + case 'r': //RED + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0); + break; + + case 'g':// Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0); + break; + + case 'b':// Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0xff); + break; + + case 'c':// Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0xff); + break; + + case 'm': // Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0xff); + break; + + case 'y': // yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0); + break; + + default: // Black + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0); + break; + } + } + + + else + { + switch (color) + { + case 'r': // Blink Red + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 3,0,0 ); + break; + case 'w': // Blink white + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 2,0,0 ); + break; + case 'g': // Blink Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 4,0,0 ); + break; + + case 'b': // Blink Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 5,0,0 ); + break; + + case 'c': //Blink Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 6,0,0 ); + break; + + case 'm': //Blink Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 7,0,0 ); + break; + + case 'y': //Blink Yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 8,0,0 ); + break; + + default: //OFF + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 9,0,0 ); + break; + } + + } +} + +void light_cb( const std_msgs::String& light_cmd){ + bool solid =false; + char color; + if (strlen( (const char* ) light_cmd.data) ==2 ){ + solid = (light_cmd.data[0] == 'S') || (light_cmd.data[0] == 's'); + color = light_cmd.data[1]; + } + else{ + solid= false; + color = light_cmd.data[0]; + } + + setLED(solid, color); +} + + + +ros::NodeHandle nh; +ros::Subscriber sub("blinkm" , light_cb); + + +void setup() +{ + + pinMode(13, OUTPUT); //set up the LED + + BlinkM_beginWithPower(); + delay(100); + BlinkM_stopScript(blinkm_addr); // turn off startup script + setLED(false, 0); //turn off the led + + nh.initNode(); + nh.subscribe(sub); + +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h new file mode 100755 index 0000000..94cabeb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h @@ -0,0 +1,440 @@ +/* + * BlinkM_funcs.h -- Arduino 'library' to control BlinkM + * -------------- + * + * + * Note: original version of this file lives with the BlinkMTester sketch + * + * Note: all the functions are declared 'static' because + * it saves about 1.5 kbyte in code space in final compiled sketch. + * A C++ library of this costs a 1kB more. + * + * 2007-8, Tod E. Kurt, ThingM, http://thingm.com/ + * + * version: 20081101 + * + * history: + * 20080101 - initial release + * 20080203 - added setStartupParam(), bugfix receiveBytes() from Dan Julio + * 20081101 - fixed to work with Arduino-0012, added MaxM commands, + * added test script read/write functions, cleaned up some functions + * 20090121 - added I2C bus scan functions, has dependencies on private + * functions inside Wire library, so might break in the future + * 20100420 - added BlinkM_startPower and _stopPower + * + */ + +#include + +extern "C" { +#include "utility/twi.h" // from Wire library, so we can do bus scanning +} + + +// format of light script lines: duration, command, arg1,arg2,arg3 +typedef struct _blinkm_script_line { + uint8_t dur; + uint8_t cmd[4]; // cmd,arg1,arg2,arg3 +} blinkm_script_line; + + +// Call this first (when powering BlinkM from a power supply) +static void BlinkM_begin() +{ + Wire.begin(); // join i2c bus (address optional for master) +} + +/* + * actually can't do this either, because twi_init() has THREE callocs in it too + * +static void BlinkM_reset() +{ + twi_init(); // can't just call Wire.begin() again because of calloc()s there +} +*/ + +// +// each call to twi_writeTo() should return 0 if device is there +// or other value (usually 2) if nothing is at that address +// +static void BlinkM_scanI2CBus(byte from, byte to, + void(*callback)(byte add, byte result) ) +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr = from; addr <= to; addr++ ) { + rc = twi_writeTo(addr, &data, 0, 1, 1); + callback( addr, rc ); + } +} + +// +// +static int8_t BlinkM_findFirstI2CDevice() +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr=1; addr < 120; addr++ ) { // only scan addrs 1-120 + rc = twi_writeTo(addr, &data, 0, 1, 1); + if( rc == 0 ) return addr; // found an address + } + return -1; // no device found in range given +} + +// FIXME: make this more Arduino-like +static void BlinkM_startPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC |= _BV(pwrpin) | _BV(gndpin); // make outputs + PORTC &=~ _BV(gndpin); + PORTC |= _BV(pwrpin); +} + +// FIXME: make this more Arduino-like +static void BlinkM_stopPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC &=~ (_BV(pwrpin) | _BV(gndpin)); +} + +// +static void BlinkM_startPower() +{ + BlinkM_startPowerWithPins( PORTC3, PORTC2 ); +} + +// +static void BlinkM_stopPower() +{ + BlinkM_stopPowerWithPins( PORTC3, PORTC2 ); +} + +// General version of BlinkM_beginWithPower(). +// Call this first when BlinkM is plugged directly into Arduino +static void BlinkM_beginWithPowerPins(byte pwrpin, byte gndpin) +{ + BlinkM_startPowerWithPins(pwrpin,gndpin); + delay(100); // wait for things to stabilize + Wire.begin(); +} + +// Call this first when BlinkM is plugged directly into Arduino +// FIXME: make this more Arduino-like +static void BlinkM_beginWithPower() +{ + BlinkM_beginWithPowerPins( PORTC3, PORTC2 ); +} + +// sends a generic command +static void BlinkM_sendCmd(byte addr, byte* cmd, int cmdlen) +{ + Wire.beginTransmission(addr); + for( byte i=0; idur = Wire.read(); + script_line->cmd[0] = Wire.read(); + script_line->cmd[1] = Wire.read(); + script_line->cmd[2] = Wire.read(); + script_line->cmd[3] = Wire.read(); +} + +// +static void BlinkM_writeScriptLine(byte addr, byte script_id, + byte pos, byte dur, + byte cmd, byte arg1, byte arg2, byte arg3) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing line:"); Serial.print(pos,DEC); + Serial.print(" with cmd:"); Serial.print(cmd); + Serial.print(" arg1:"); Serial.println(arg1,HEX); +#endif + Wire.beginTransmission(addr); + Wire.write('W'); + Wire.write(script_id); + Wire.write(pos); + Wire.write(dur); + Wire.write(cmd); + Wire.write(arg1); + Wire.write(arg2); + Wire.write(arg3); + Wire.endTransmission(); + +} + +// +static void BlinkM_writeScript(byte addr, byte script_id, + byte len, byte reps, + blinkm_script_line* lines) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing script to addr:"); Serial.print(addr,DEC); + Serial.print(", script_id:"); Serial.println(script_id,DEC); +#endif + for(byte i=0; i < len; i++) { + blinkm_script_line l = lines[i]; + BlinkM_writeScriptLine( addr, script_id, i, l.dur, + l.cmd[0], l.cmd[1], l.cmd[2], l.cmd[3]); + delay(20); // must wait for EEPROM to be programmed + } + BlinkM_setScriptLengthReps(addr, script_id, len, reps); +} + +// +static void BlinkM_setStartupParams(byte addr, byte mode, byte script_id, + byte reps, byte fadespeed, byte timeadj) +{ + Wire.beginTransmission(addr); + Wire.write('B'); + Wire.write(mode); // default 0x01 == Play script + Wire.write(script_id); // default 0x00 == script #0 + Wire.write(reps); // default 0x00 == repeat infinitely + Wire.write(fadespeed); // default 0x08 == usually overridden by sketch + Wire.write(timeadj); // default 0x00 == sometimes overridden by sketch + Wire.endTransmission(); +} + + +// Gets digital inputs of the BlinkM +// returns -1 on failure +static int BlinkM_getInputsO(byte addr) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)1); + if( Wire.available() ) { + byte b = Wire.read(); + return b; + } + return -1; +} + +// Gets digital inputs of the BlinkM +// stores them in passed in array +// returns -1 on failure +static int BlinkM_getInputs(byte addr, byte inputs[]) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)4); + while( Wire.available() < 4 ) ; // FIXME: wait until we get 4 bytes + + inputs[0] = Wire.read(); + inputs[1] = Wire.read(); + inputs[2] = Wire.read(); + inputs[3] = Wire.read(); + + return 0; +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Clapper/Clapper.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Clapper/Clapper.pde new file mode 100755 index 0000000..712b6f9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Clapper/Clapper.pde @@ -0,0 +1,94 @@ +/* + * rosserial Clapper Example + * + * This code is a very simple example of the kinds of + * custom sensors that you can easily set up with rosserial + * and Arduino. This code uses a microphone attached to + * analog pin 5 detect two claps (2 loud sounds). + * You can use this clapper, for example, to command a robot + * in the area to come do your bidding. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +std_msgs::Empty clap_msg; +ros::Publisher p("clap", &clap_msg); + +enum clapper_state { clap1, clap_one_waiting, pause, clap2}; +clapper_state clap; + +int volume_thresh = 200; //a clap sound needs to be: + //abs(clap_volume) > average noise + volume_thresh +int mic_pin = 5; +int adc_ave=0; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); + + //measure the average volume of the noise in the area + for (int i =0; i<10;i++) adc_ave += analogRead(mic_pin); + adc_ave /= 10; +} + +long event_timer; + +void loop() +{ + int mic_val = 0; + for(int i=0; i<4; i++) mic_val += analogRead(mic_pin); + + mic_val = mic_val/4-adc_ave; + + switch(clap){ + case clap1: + if (abs(mic_val) > volume_thresh){ + clap = clap_one_waiting; + event_timer = millis(); + } + break; + case clap_one_waiting: + if ( (abs(mic_val) < 30) && ( (millis() - event_timer) > 20 ) ) + { + clap= pause; + event_timer = millis(); + + } + break; + case pause: // make sure there is a pause between + // the loud sounds + if ( mic_val > volume_thresh) + { + clap = clap1; + + } + else if ( (millis()-event_timer)> 60) { + clap = clap2; + event_timer = millis(); + + } + break; + case clap2: + if (abs(mic_val) > volume_thresh){ //we have got a double clap! + clap = clap1; + p.publish(&clap_msg); + } + else if ( (millis()-event_timer)> 200) { + clap= clap1; // no clap detected, reset state machine + } + + break; + } + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde new file mode 100755 index 0000000..2474413 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde @@ -0,0 +1,28 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + */ + +#include +#include + +ros::NodeHandle nh; + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(1000); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/IrRanger/IrRanger.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/IrRanger/IrRanger.pde new file mode 100755 index 0000000..240b5a1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/IrRanger/IrRanger.pde @@ -0,0 +1,64 @@ +/* + * rosserial IR Ranger Example + * + * This example is calibrated for the Sharp GP2D120XJ00F. + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "range_data", &range_msg); + +const int analog_pin = 0; +unsigned long range_timer; + +/* + * getRange() - samples the analog input from the ranger + * and converts it into meters. + */ +float getRange(int pin_num){ + int sample; + // Get data + sample = analogRead(pin_num)/4; + // if the ADC reading is too low, + // then we are really far away from anything + if(sample < 10) + return 254; // max range + // Magic numbers to get cm + sample= 1309/(sample-3); + return (sample - 1)/100; //convert to meters +} + +char frameid[] = "/ir_ranger"; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + range_msg.radiation_type = sensor_msgs::Range::INFRARED; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.01; + range_msg.min_range = 0.03; + range_msg.max_range = 0.4; + +} + +void loop() +{ + // publish the range value every 50 milliseconds + // since it takes that long for the sensor to stabilize + if ( (millis()-range_timer) > 50){ + range_msg.range = getRange(analog_pin); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_timer = millis() + 50; + } + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Logging/Logging.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Logging/Logging.pde new file mode 100755 index 0000000..400a9cd --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Logging/Logging.pde @@ -0,0 +1,45 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + + +char debug[]= "debug statements"; +char info[] = "infos"; +char warn[] = "warnings"; +char error[] = "errors"; +char fatal[] = "fatalities"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + + nh.logdebug(debug); + nh.loginfo(info); + nh.logwarn(warn); + nh.logerror(error); + nh.logfatal(fatal); + + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Odom/Odom.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Odom/Odom.pde new file mode 100755 index 0000000..5841020 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Odom/Odom.pde @@ -0,0 +1,53 @@ +/* + * rosserial Planar Odometry Example + */ + +#include +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +double x = 1.0; +double y = 0.0; +double theta = 1.57; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + // drive in a circle + double dx = 0.2; + double dtheta = 0.18; + x += cos(theta)*dx*0.1; + y += sin(theta)*dx*0.1; + theta += dtheta*0.1; + if(theta > 3.14) + theta=-3.14; + + // tf odom->base_link + t.header.frame_id = odom; + t.child_frame_id = base_link; + + t.transform.translation.x = x; + t.transform.translation.y = y; + + t.transform.rotation = tf::createQuaternionFromYaw(theta); + t.header.stamp = nh.now(); + + broadcaster.sendTransform(t); + nh.spinOnce(); + + delay(10); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde new file mode 100755 index 0000000..75093a9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde @@ -0,0 +1,38 @@ +/* + * rosserial Service Client + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +ros::ServiceClient client("test_srv"); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.serviceClient(client); + nh.advertise(chatter); + while(!nh.connected()) nh.spinOnce(); + nh.loginfo("Startup complete"); +} + +void loop() +{ + Test::Request req; + Test::Response res; + req.input = hello; + client.call(req, res); + str_msg.data = res.output; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(100); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceClient/client.py b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceClient/client.py new file mode 100755 index 0000000..3b27bd5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceClient/client.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +""" +Sample code to use with ServiceClient.pde +""" + +import roslib; roslib.load_manifest("rosserial_arduino") +import rospy + +from rosserial_arduino.srv import * + +def callback(req): + print "The arduino is calling! Please send it a message:" + t = TestResponse() + t.output = raw_input() + return t + +rospy.init_node("service_client_test") +rospy.Service("test_srv", Test, callback) +rospy.spin() diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde new file mode 100755 index 0000000..2d3fd70 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde @@ -0,0 +1,40 @@ +/* + * rosserial Service Server + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +int i; +void callback(const Test::Request & req, Test::Response & res){ + if((i++)%2) + res.output = "hello"; + else + res.output = "world"; +} + +ros::ServiceServer server("test_srv",&callback); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertiseService(server); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServoControl/ServoControl.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServoControl/ServoControl.pde new file mode 100755 index 0000000..24db409 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/ServoControl/ServoControl.pde @@ -0,0 +1,49 @@ +/* + * rosserial Servo Control Example + * + * This sketch demonstrates the control of hobby R/C servos + * using ROS and the arduiono + * + * For the full tutorial write up, visit + * www.ros.org/wiki/rosserial_arduino_demos + * + * For more information on the Arduino Servo Library + * Checkout : + * http://www.arduino.cc/en/Reference/Servo + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif + +#include +#include +#include + +ros::NodeHandle nh; + +Servo servo; + +void servo_cb( const std_msgs::UInt16& cmd_msg){ + servo.write(cmd_msg.data); //set servo angle, should be from 0-180 + digitalWrite(13, HIGH-digitalRead(13)); //toggle led +} + + +ros::Subscriber sub("servo", servo_cb); + +void setup(){ + pinMode(13, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + servo.attach(9); //attach it to pin 9 +} + +void loop(){ + nh.spinOnce(); + delay(1); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Temperature/Temperature.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Temperature/Temperature.pde new file mode 100755 index 0000000..2c2f865 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Temperature/Temperature.pde @@ -0,0 +1,72 @@ +/* + * rosserial Temperature Sensor Example + * + * This tutorial demonstrates the usage of the + * Sparkfun TMP102 Digital Temperature Breakout board + * http://www.sparkfun.com/products/9418 + * + * Source Code Based off of: + * http://wiring.org.co/learning/libraries/tmp102sparkfun.html + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::Float32 temp_msg; +ros::Publisher pub_temp("temperature", &temp_msg); + + +// From the datasheet the BMP module address LSB distinguishes +// between read (1) and write (0) operations, corresponding to +// address 0x91 (read) and 0x90 (write). +// shift the address 1 bit right (0x91 or 0x90), the Wire library only needs the 7 +// most significant bits for the address 0x91 >> 1 = 0x48 +// 0x90 >> 1 = 0x48 (72) + +int sensorAddress = 0x91 >> 1; // From datasheet sensor address is 0x91 + // shift the address 1 bit right, the Wire library only needs the 7 + // most significant bits for the address + + +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + + nh.initNode(); + nh.advertise(pub_temp); + +} + +long publisher_timer; + +void loop() +{ + + if (millis() > publisher_timer) { + // step 1: request reading from sensor + Wire.requestFrom(sensorAddress,2); + delay(10); + if (2 <= Wire.available()) // if two bytes were received + { + byte msb; + byte lsb; + int temperature; + + msb = Wire.read(); // receive high byte (full degrees) + lsb = Wire.read(); // receive low byte (fraction degrees) + temperature = ((msb) << 4); // MSB + temperature |= (lsb >> 4); // LSB + + temp_msg.data = temperature*0.0625; + pub_temp.publish(&temp_msg); + } + + publisher_timer = millis() + 1000; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/TimeTF/TimeTF.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/TimeTF/TimeTF.pde new file mode 100755 index 0000000..16fbb70 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/TimeTF/TimeTF.pde @@ -0,0 +1,37 @@ +/* + * rosserial Time and TF Example + * Publishes a transform at current time + */ + +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + t.header.frame_id = odom; + t.child_frame_id = base_link; + t.transform.translation.x = 1.0; + t.transform.rotation.x = 0.0; + t.transform.rotation.y = 0.0; + t.transform.rotation.z = 0.0; + t.transform.rotation.w = 1.0; + t.header.stamp = nh.now(); + broadcaster.sendTransform(t); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde new file mode 100755 index 0000000..d5870cb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde @@ -0,0 +1,61 @@ +/* + * rosserial Ultrasound Example + * + * This example is for the Maxbotix Ultrasound rangers. + */ + +#include +#include +#include + +ros::NodeHandle nh; + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "/ultrasound", &range_msg); + +const int adc_pin = 0; + +char frameid[] = "/ultrasound"; + +float getRange_Ultrasound(int pin_num){ + int val = 0; + for(int i=0; i<4; i++) val += analogRead(pin_num); + float range = val; + return range /322.519685; // (0.0124023437 /4) ; //cvt to meters +} + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + + range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.1; // fake + range_msg.min_range = 0.0; + range_msg.max_range = 6.47; + + pinMode(8,OUTPUT); + digitalWrite(8, LOW); +} + + +long range_time; + +void loop() +{ + + //publish the adc value every 50 milliseconds + //since it takes that long for the sensor to stablize + if ( millis() >= range_time ){ + int r =0; + + range_msg.range = getRange_Ultrasound(5); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_time = millis() + 50; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/button_example/button_example.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/button_example/button_example.pde new file mode 100755 index 0000000..0404542 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/button_example/button_example.pde @@ -0,0 +1,61 @@ +/* + * Button Example for Rosserial + */ + +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Bool pushed_msg; +ros::Publisher pub_button("pushed", &pushed_msg); + +const int button_pin = 7; +const int led_pin = 13; + +bool last_reading; +long last_debounce_time=0; +long debounce_delay=50; +bool published = true; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_button); + + //initialize an LED output pin + //and a input pin for our push button + pinMode(led_pin, OUTPUT); + pinMode(button_pin, INPUT); + + //Enable the pullup resistor on the button + digitalWrite(button_pin, HIGH); + + //The button is a normally button + last_reading = ! digitalRead(button_pin); + +} + +void loop() +{ + + bool reading = ! digitalRead(button_pin); + + if (last_reading!= reading){ + last_debounce_time = millis(); + published = false; + } + + //if the button value has not changed for the debounce delay, we know its stable + if ( !published && (millis() - last_debounce_time) > debounce_delay) { + digitalWrite(led_pin, reading); + pushed_msg.data = reading; + pub_button.publish(&pushed_msg); + published = true; + } + + last_reading = reading; + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/pubsub/pubsub.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/pubsub/pubsub.pde new file mode 100755 index 0000000..753d8ed --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/examples/pubsub/pubsub.pde @@ -0,0 +1,40 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", messageCb ); + + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); + nh.subscribe(sub); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h new file mode 100755 index 0000000..7dbaf93 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -0,0 +1,175 @@ +#ifndef _ROS_SERVICE_ApplyBodyWrench_h +#define _ROS_SERVICE_ApplyBodyWrench_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "geometry_msgs/Wrench.h" +#include "ros/time.h" +#include "geometry_msgs/Point.h" + +namespace gazebo_msgs +{ + +static const char APPLYBODYWRENCH[] = "gazebo_msgs/ApplyBodyWrench"; + + class ApplyBodyWrenchRequest : public ros::Msg + { + public: + char * body_name; + char * reference_frame; + geometry_msgs::Point reference_point; + geometry_msgs::Wrench wrench; + ros::Time start_time; + ros::Duration duration; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen( (const char*) this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + uint32_t length_reference_frame = strlen( (const char*) this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + offset += this->reference_point.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + offset += this->reference_point.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "e37e6adf97eba5095baa77dffb71e5bd"; }; + + }; + + class ApplyBodyWrenchResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyBodyWrench { + public: + typedef ApplyBodyWrenchRequest Request; + typedef ApplyBodyWrenchResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h new file mode 100755 index 0000000..0d9c9b1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -0,0 +1,178 @@ +#ifndef _ROS_SERVICE_ApplyJointEffort_h +#define _ROS_SERVICE_ApplyJointEffort_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace gazebo_msgs +{ + +static const char APPLYJOINTEFFORT[] = "gazebo_msgs/ApplyJointEffort"; + + class ApplyJointEffortRequest : public ros::Msg + { + public: + char * joint_name; + float effort; + ros::Time start_time; + ros::Duration duration; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen( (const char*) this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + int32_t * val_effort = (int32_t *) &(this->effort); + int32_t exp_effort = (((*val_effort)>>23)&255); + if(exp_effort != 0) + exp_effort += 1023-127; + int32_t sig_effort = *val_effort; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_effort<<5) & 0xff; + *(outbuffer + offset++) = (sig_effort>>3) & 0xff; + *(outbuffer + offset++) = (sig_effort>>11) & 0xff; + *(outbuffer + offset++) = ((exp_effort<<4) & 0xF0) | ((sig_effort>>19)&0x0F); + *(outbuffer + offset++) = (exp_effort>>4) & 0x7F; + if(this->effort < 0) *(outbuffer + offset -1) |= 0x80; + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + uint32_t * val_effort = (uint32_t*) &(this->effort); + offset += 3; + *val_effort = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_effort = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_effort !=0) + *val_effort |= ((exp_effort)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->effort = -this->effort; + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2c3396ab9af67a509ecd2167a8fe41a2"; }; + + }; + + class ApplyJointEffortResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyJointEffort { + public: + typedef ApplyJointEffortRequest Request; + typedef ApplyJointEffortResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/BodyRequest.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/BodyRequest.h new file mode 100755 index 0000000..6e733bf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/BodyRequest.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_BodyRequest_h +#define _ROS_SERVICE_BodyRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char BODYREQUEST[] = "gazebo_msgs/BodyRequest"; + + class BodyRequestRequest : public ros::Msg + { + public: + char * body_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen( (const char*) this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "5eade9afe7f232d78005bd0cafeab755"; }; + + }; + + class BodyRequestResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BodyRequest { + public: + typedef BodyRequestRequest Request; + typedef BodyRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ContactState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ContactState.h new file mode 100755 index 0000000..451c170 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ContactState.h @@ -0,0 +1,183 @@ +#ifndef _ROS_gazebo_msgs_ContactState_h +#define _ROS_gazebo_msgs_ContactState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Wrench.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + + class ContactState : public ros::Msg + { + public: + char * info; + char * collision1_name; + char * collision2_name; + uint8_t wrenches_length; + geometry_msgs::Wrench st_wrenches; + geometry_msgs::Wrench * wrenches; + geometry_msgs::Wrench total_wrench; + uint8_t contact_positions_length; + geometry_msgs::Vector3 st_contact_positions; + geometry_msgs::Vector3 * contact_positions; + uint8_t contact_normals_length; + geometry_msgs::Vector3 st_contact_normals; + geometry_msgs::Vector3 * contact_normals; + uint8_t depths_length; + float st_depths; + float * depths; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_info = strlen( (const char*) this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + uint32_t length_collision1_name = strlen( (const char*) this->collision1_name); + memcpy(outbuffer + offset, &length_collision1_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision1_name, length_collision1_name); + offset += length_collision1_name; + uint32_t length_collision2_name = strlen( (const char*) this->collision2_name); + memcpy(outbuffer + offset, &length_collision2_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision2_name, length_collision2_name); + offset += length_collision2_name; + *(outbuffer + offset++) = wrenches_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->wrenches[i].serialize(outbuffer + offset); + } + offset += this->total_wrench.serialize(outbuffer + offset); + *(outbuffer + offset++) = contact_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->contact_positions[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = contact_normals_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->contact_normals[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = depths_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < depths_length; i++){ + int32_t * val_depthsi = (int32_t *) &(this->depths[i]); + int32_t exp_depthsi = (((*val_depthsi)>>23)&255); + if(exp_depthsi != 0) + exp_depthsi += 1023-127; + int32_t sig_depthsi = *val_depthsi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_depthsi<<5) & 0xff; + *(outbuffer + offset++) = (sig_depthsi>>3) & 0xff; + *(outbuffer + offset++) = (sig_depthsi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_depthsi<<4) & 0xF0) | ((sig_depthsi>>19)&0x0F); + *(outbuffer + offset++) = (exp_depthsi>>4) & 0x7F; + if(this->depths[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + uint32_t length_collision1_name; + memcpy(&length_collision1_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision1_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision1_name-1]=0; + this->collision1_name = (char *)(inbuffer + offset-1); + offset += length_collision1_name; + uint32_t length_collision2_name; + memcpy(&length_collision2_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision2_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision2_name-1]=0; + this->collision2_name = (char *)(inbuffer + offset-1); + offset += length_collision2_name; + uint8_t wrenches_lengthT = *(inbuffer + offset++); + if(wrenches_lengthT > wrenches_length) + this->wrenches = (geometry_msgs::Wrench*)realloc(this->wrenches, wrenches_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrenches_length = wrenches_lengthT; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->st_wrenches.deserialize(inbuffer + offset); + memcpy( &(this->wrenches[i]), &(this->st_wrenches), sizeof(geometry_msgs::Wrench)); + } + offset += this->total_wrench.deserialize(inbuffer + offset); + uint8_t contact_positions_lengthT = *(inbuffer + offset++); + if(contact_positions_lengthT > contact_positions_length) + this->contact_positions = (geometry_msgs::Vector3*)realloc(this->contact_positions, contact_positions_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_positions_length = contact_positions_lengthT; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->st_contact_positions.deserialize(inbuffer + offset); + memcpy( &(this->contact_positions[i]), &(this->st_contact_positions), sizeof(geometry_msgs::Vector3)); + } + uint8_t contact_normals_lengthT = *(inbuffer + offset++); + if(contact_normals_lengthT > contact_normals_length) + this->contact_normals = (geometry_msgs::Vector3*)realloc(this->contact_normals, contact_normals_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_normals_length = contact_normals_lengthT; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->st_contact_normals.deserialize(inbuffer + offset); + memcpy( &(this->contact_normals[i]), &(this->st_contact_normals), sizeof(geometry_msgs::Vector3)); + } + uint8_t depths_lengthT = *(inbuffer + offset++); + if(depths_lengthT > depths_length) + this->depths = (float*)realloc(this->depths, depths_lengthT * sizeof(float)); + offset += 3; + depths_length = depths_lengthT; + for( uint8_t i = 0; i < depths_length; i++){ + uint32_t * val_st_depths = (uint32_t*) &(this->st_depths); + offset += 3; + *val_st_depths = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_depths |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_depths |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_depths |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_depths = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_depths |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_depths !=0) + *val_st_depths |= ((exp_st_depths)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_depths = -this->st_depths; + memcpy( &(this->depths[i]), &(this->st_depths), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactState"; }; + const char * getMD5(){ return "48c0ffb054b8c444f870cecea1ee50d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ContactsState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ContactsState.h new file mode 100755 index 0000000..c282cf6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ContactsState.h @@ -0,0 +1,58 @@ +#ifndef _ROS_gazebo_msgs_ContactsState_h +#define _ROS_gazebo_msgs_ContactsState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/ContactState.h" + +namespace gazebo_msgs +{ + + class ContactsState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t states_length; + gazebo_msgs::ContactState st_states; + gazebo_msgs::ContactState * states; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t states_lengthT = *(inbuffer + offset++); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + offset += 3; + states_length = states_lengthT; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->st_states.deserialize(inbuffer + offset); + memcpy( &(this->states[i]), &(this->st_states), sizeof(gazebo_msgs::ContactState)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactsState"; }; + const char * getMD5(){ return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/DeleteModel.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/DeleteModel.h new file mode 100755 index 0000000..1e210dc --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/DeleteModel.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_DeleteModel_h +#define _ROS_SERVICE_DeleteModel_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char DELETEMODEL[] = "gazebo_msgs/DeleteModel"; + + class DeleteModelRequest : public ros::Msg + { + public: + char * model_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class DeleteModelResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteModel { + public: + typedef DeleteModelRequest Request; + typedef DeleteModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h new file mode 100755 index 0000000..a64b1f2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h @@ -0,0 +1,245 @@ +#ifndef _ROS_SERVICE_GetJointProperties_h +#define _ROS_SERVICE_GetJointProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETJOINTPROPERTIES[] = "gazebo_msgs/GetJointProperties"; + + class GetJointPropertiesRequest : public ros::Msg + { + public: + char * joint_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen( (const char*) this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class GetJointPropertiesResponse : public ros::Msg + { + public: + uint8_t type; + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t position_length; + float st_position; + float * position; + uint8_t rate_length; + float st_rate; + float * rate; + bool success; + char * status_message; + enum { REVOLUTE = 0 }; + enum { CONTINUOUS = 1 }; + enum { PRISMATIC = 2 }; + enum { FIXED = 3 }; + enum { BALL = 4 }; + enum { UNIVERSAL = 5 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + int32_t * val_dampingi = (int32_t *) &(this->damping[i]); + int32_t exp_dampingi = (((*val_dampingi)>>23)&255); + if(exp_dampingi != 0) + exp_dampingi += 1023-127; + int32_t sig_dampingi = *val_dampingi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_dampingi<<5) & 0xff; + *(outbuffer + offset++) = (sig_dampingi>>3) & 0xff; + *(outbuffer + offset++) = (sig_dampingi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_dampingi<<4) & 0xF0) | ((sig_dampingi>>19)&0x0F); + *(outbuffer + offset++) = (exp_dampingi>>4) & 0x7F; + if(this->damping[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + int32_t * val_positioni = (int32_t *) &(this->position[i]); + int32_t exp_positioni = (((*val_positioni)>>23)&255); + if(exp_positioni != 0) + exp_positioni += 1023-127; + int32_t sig_positioni = *val_positioni; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_positioni<<5) & 0xff; + *(outbuffer + offset++) = (sig_positioni>>3) & 0xff; + *(outbuffer + offset++) = (sig_positioni>>11) & 0xff; + *(outbuffer + offset++) = ((exp_positioni<<4) & 0xF0) | ((sig_positioni>>19)&0x0F); + *(outbuffer + offset++) = (exp_positioni>>4) & 0x7F; + if(this->position[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = rate_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rate_length; i++){ + int32_t * val_ratei = (int32_t *) &(this->rate[i]); + int32_t exp_ratei = (((*val_ratei)>>23)&255); + if(exp_ratei != 0) + exp_ratei += 1023-127; + int32_t sig_ratei = *val_ratei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ratei<<5) & 0xff; + *(outbuffer + offset++) = (sig_ratei>>3) & 0xff; + *(outbuffer + offset++) = (sig_ratei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ratei<<4) & 0xF0) | ((sig_ratei>>19)&0x0F); + *(outbuffer + offset++) = (exp_ratei>>4) & 0x7F; + if(this->rate[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + uint32_t * val_st_damping = (uint32_t*) &(this->st_damping); + offset += 3; + *val_st_damping = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_damping |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_damping |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_damping |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_damping = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_damping |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_damping !=0) + *val_st_damping |= ((exp_st_damping)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_damping = -this->st_damping; + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + uint32_t * val_st_position = (uint32_t*) &(this->st_position); + offset += 3; + *val_st_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_position !=0) + *val_st_position |= ((exp_st_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_position = -this->st_position; + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t rate_lengthT = *(inbuffer + offset++); + if(rate_lengthT > rate_length) + this->rate = (float*)realloc(this->rate, rate_lengthT * sizeof(float)); + offset += 3; + rate_length = rate_lengthT; + for( uint8_t i = 0; i < rate_length; i++){ + uint32_t * val_st_rate = (uint32_t*) &(this->st_rate); + offset += 3; + *val_st_rate = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_rate |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_rate |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_rate |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_rate = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_rate |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_rate !=0) + *val_st_rate |= ((exp_st_rate)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_rate = -this->st_rate; + memcpy( &(this->rate[i]), &(this->st_rate), sizeof(float)); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "cd7b30a39faa372283dc94c5f6457f82"; }; + + }; + + class GetJointProperties { + public: + typedef GetJointPropertiesRequest Request; + typedef GetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h new file mode 100755 index 0000000..756d5d7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h @@ -0,0 +1,310 @@ +#ifndef _ROS_SERVICE_GetLinkProperties_h +#define _ROS_SERVICE_GetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char GETLINKPROPERTIES[] = "gazebo_msgs/GetLinkProperties"; + + class GetLinkPropertiesRequest : public ros::Msg + { + public: + char * link_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen( (const char*) this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "7d82d60381f1b66a30f2157f60884345"; }; + + }; + + class GetLinkPropertiesResponse : public ros::Msg + { + public: + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + int32_t * val_mass = (int32_t *) &(this->mass); + int32_t exp_mass = (((*val_mass)>>23)&255); + if(exp_mass != 0) + exp_mass += 1023-127; + int32_t sig_mass = *val_mass; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_mass<<5) & 0xff; + *(outbuffer + offset++) = (sig_mass>>3) & 0xff; + *(outbuffer + offset++) = (sig_mass>>11) & 0xff; + *(outbuffer + offset++) = ((exp_mass<<4) & 0xF0) | ((sig_mass>>19)&0x0F); + *(outbuffer + offset++) = (exp_mass>>4) & 0x7F; + if(this->mass < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_ixx = (int32_t *) &(this->ixx); + int32_t exp_ixx = (((*val_ixx)>>23)&255); + if(exp_ixx != 0) + exp_ixx += 1023-127; + int32_t sig_ixx = *val_ixx; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ixx<<5) & 0xff; + *(outbuffer + offset++) = (sig_ixx>>3) & 0xff; + *(outbuffer + offset++) = (sig_ixx>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ixx<<4) & 0xF0) | ((sig_ixx>>19)&0x0F); + *(outbuffer + offset++) = (exp_ixx>>4) & 0x7F; + if(this->ixx < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_ixy = (int32_t *) &(this->ixy); + int32_t exp_ixy = (((*val_ixy)>>23)&255); + if(exp_ixy != 0) + exp_ixy += 1023-127; + int32_t sig_ixy = *val_ixy; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ixy<<5) & 0xff; + *(outbuffer + offset++) = (sig_ixy>>3) & 0xff; + *(outbuffer + offset++) = (sig_ixy>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ixy<<4) & 0xF0) | ((sig_ixy>>19)&0x0F); + *(outbuffer + offset++) = (exp_ixy>>4) & 0x7F; + if(this->ixy < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_ixz = (int32_t *) &(this->ixz); + int32_t exp_ixz = (((*val_ixz)>>23)&255); + if(exp_ixz != 0) + exp_ixz += 1023-127; + int32_t sig_ixz = *val_ixz; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ixz<<5) & 0xff; + *(outbuffer + offset++) = (sig_ixz>>3) & 0xff; + *(outbuffer + offset++) = (sig_ixz>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ixz<<4) & 0xF0) | ((sig_ixz>>19)&0x0F); + *(outbuffer + offset++) = (exp_ixz>>4) & 0x7F; + if(this->ixz < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_iyy = (int32_t *) &(this->iyy); + int32_t exp_iyy = (((*val_iyy)>>23)&255); + if(exp_iyy != 0) + exp_iyy += 1023-127; + int32_t sig_iyy = *val_iyy; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_iyy<<5) & 0xff; + *(outbuffer + offset++) = (sig_iyy>>3) & 0xff; + *(outbuffer + offset++) = (sig_iyy>>11) & 0xff; + *(outbuffer + offset++) = ((exp_iyy<<4) & 0xF0) | ((sig_iyy>>19)&0x0F); + *(outbuffer + offset++) = (exp_iyy>>4) & 0x7F; + if(this->iyy < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_iyz = (int32_t *) &(this->iyz); + int32_t exp_iyz = (((*val_iyz)>>23)&255); + if(exp_iyz != 0) + exp_iyz += 1023-127; + int32_t sig_iyz = *val_iyz; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_iyz<<5) & 0xff; + *(outbuffer + offset++) = (sig_iyz>>3) & 0xff; + *(outbuffer + offset++) = (sig_iyz>>11) & 0xff; + *(outbuffer + offset++) = ((exp_iyz<<4) & 0xF0) | ((sig_iyz>>19)&0x0F); + *(outbuffer + offset++) = (exp_iyz>>4) & 0x7F; + if(this->iyz < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_izz = (int32_t *) &(this->izz); + int32_t exp_izz = (((*val_izz)>>23)&255); + if(exp_izz != 0) + exp_izz += 1023-127; + int32_t sig_izz = *val_izz; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_izz<<5) & 0xff; + *(outbuffer + offset++) = (sig_izz>>3) & 0xff; + *(outbuffer + offset++) = (sig_izz>>11) & 0xff; + *(outbuffer + offset++) = ((exp_izz<<4) & 0xF0) | ((sig_izz>>19)&0x0F); + *(outbuffer + offset++) = (exp_izz>>4) & 0x7F; + if(this->izz < 0) *(outbuffer + offset -1) |= 0x80; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + uint32_t * val_mass = (uint32_t*) &(this->mass); + offset += 3; + *val_mass = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_mass |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_mass |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_mass |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_mass = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_mass |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_mass !=0) + *val_mass |= ((exp_mass)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->mass = -this->mass; + uint32_t * val_ixx = (uint32_t*) &(this->ixx); + offset += 3; + *val_ixx = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_ixx |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_ixx |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_ixx |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_ixx = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_ixx |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_ixx !=0) + *val_ixx |= ((exp_ixx)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixx = -this->ixx; + uint32_t * val_ixy = (uint32_t*) &(this->ixy); + offset += 3; + *val_ixy = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_ixy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_ixy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_ixy |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_ixy = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_ixy |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_ixy !=0) + *val_ixy |= ((exp_ixy)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixy = -this->ixy; + uint32_t * val_ixz = (uint32_t*) &(this->ixz); + offset += 3; + *val_ixz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_ixz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_ixz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_ixz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_ixz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_ixz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_ixz !=0) + *val_ixz |= ((exp_ixz)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixz = -this->ixz; + uint32_t * val_iyy = (uint32_t*) &(this->iyy); + offset += 3; + *val_iyy = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_iyy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_iyy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_iyy |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_iyy = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_iyy |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_iyy !=0) + *val_iyy |= ((exp_iyy)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->iyy = -this->iyy; + uint32_t * val_iyz = (uint32_t*) &(this->iyz); + offset += 3; + *val_iyz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_iyz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_iyz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_iyz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_iyz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_iyz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_iyz !=0) + *val_iyz |= ((exp_iyz)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->iyz = -this->iyz; + uint32_t * val_izz = (uint32_t*) &(this->izz); + offset += 3; + *val_izz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_izz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_izz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_izz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_izz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_izz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_izz !=0) + *val_izz |= ((exp_izz)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->izz = -this->izz; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "a8619f92d17cfcc3958c0fd13299443d"; }; + + }; + + class GetLinkProperties { + public: + typedef GetLinkPropertiesRequest Request; + typedef GetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetLinkState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetLinkState.h new file mode 100755 index 0000000..93c93ba --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetLinkState.h @@ -0,0 +1,127 @@ +#ifndef _ROS_SERVICE_GetLinkState_h +#define _ROS_SERVICE_GetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char GETLINKSTATE[] = "gazebo_msgs/GetLinkState"; + + class GetLinkStateRequest : public ros::Msg + { + public: + char * link_name; + char * reference_frame; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen( (const char*) this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + uint32_t length_reference_frame = strlen( (const char*) this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "7551675c30aaa71f7c288d4864552001"; }; + + }; + + class GetLinkStateResponse : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "8ba55ad34f9c072e75c0de57b089753b"; }; + + }; + + class GetLinkState { + public: + typedef GetLinkStateRequest Request; + typedef GetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h new file mode 100755 index 0000000..0674055 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h @@ -0,0 +1,278 @@ +#ifndef _ROS_SERVICE_GetModelProperties_h +#define _ROS_SERVICE_GetModelProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties"; + + class GetModelPropertiesRequest : public ros::Msg + { + public: + char * model_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class GetModelPropertiesResponse : public ros::Msg + { + public: + char * parent_model_name; + char * canonical_body_name; + uint8_t body_names_length; + char* st_body_names; + char* * body_names; + uint8_t geom_names_length; + char* st_geom_names; + char* * geom_names; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t child_model_names_length; + char* st_child_model_names; + char* * child_model_names; + bool is_static; + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_parent_model_name = strlen( (const char*) this->parent_model_name); + memcpy(outbuffer + offset, &length_parent_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); + offset += length_parent_model_name; + uint32_t length_canonical_body_name = strlen( (const char*) this->canonical_body_name); + memcpy(outbuffer + offset, &length_canonical_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); + offset += length_canonical_body_name; + *(outbuffer + offset++) = body_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_body_namesi = strlen( (const char*) this->body_names[i]); + memcpy(outbuffer + offset, &length_body_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); + offset += length_body_namesi; + } + *(outbuffer + offset++) = geom_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_geom_namesi = strlen( (const char*) this->geom_names[i]); + memcpy(outbuffer + offset, &length_geom_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); + offset += length_geom_namesi; + } + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = child_model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_child_model_namesi = strlen( (const char*) this->child_model_names[i]); + memcpy(outbuffer + offset, &length_child_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); + offset += length_child_model_namesi; + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.real = this->is_static; + *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_parent_model_name; + memcpy(&length_parent_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_model_name-1]=0; + this->parent_model_name = (char *)(inbuffer + offset-1); + offset += length_parent_model_name; + uint32_t length_canonical_body_name; + memcpy(&length_canonical_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_canonical_body_name-1]=0; + this->canonical_body_name = (char *)(inbuffer + offset-1); + offset += length_canonical_body_name; + uint8_t body_names_lengthT = *(inbuffer + offset++); + if(body_names_lengthT > body_names_length) + this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); + offset += 3; + body_names_length = body_names_lengthT; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_st_body_names; + memcpy(&length_st_body_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_body_names-1]=0; + this->st_body_names = (char *)(inbuffer + offset-1); + offset += length_st_body_names; + memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); + } + uint8_t geom_names_lengthT = *(inbuffer + offset++); + if(geom_names_lengthT > geom_names_length) + this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); + offset += 3; + geom_names_length = geom_names_lengthT; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_st_geom_names; + memcpy(&length_st_geom_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_geom_names-1]=0; + this->st_geom_names = (char *)(inbuffer + offset-1); + offset += length_st_geom_names; + memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); + } + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t child_model_names_lengthT = *(inbuffer + offset++); + if(child_model_names_lengthT > child_model_names_length) + this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); + offset += 3; + child_model_names_length = child_model_names_lengthT; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_st_child_model_names; + memcpy(&length_st_child_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_child_model_names-1]=0; + this->st_child_model_names = (char *)(inbuffer + offset-1); + offset += length_st_child_model_names; + memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.base = 0; + u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_static = u_is_static.real; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; + + }; + + class GetModelProperties { + public: + typedef GetModelPropertiesRequest Request; + typedef GetModelPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetModelState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetModelState.h new file mode 100755 index 0000000..77d0397 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetModelState.h @@ -0,0 +1,131 @@ +#ifndef _ROS_SERVICE_GetModelState_h +#define _ROS_SERVICE_GetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + +static const char GETMODELSTATE[] = "gazebo_msgs/GetModelState"; + + class GetModelStateRequest : public ros::Msg + { + public: + char * model_name; + char * relative_entity_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_relative_entity_name = strlen( (const char*) this->relative_entity_name); + memcpy(outbuffer + offset, &length_relative_entity_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->relative_entity_name, length_relative_entity_name); + offset += length_relative_entity_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_relative_entity_name; + memcpy(&length_relative_entity_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_relative_entity_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_relative_entity_name-1]=0; + this->relative_entity_name = (char *)(inbuffer + offset-1); + offset += length_relative_entity_name; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "19d412713cefe4a67437e17a951e759e"; }; + + }; + + class GetModelStateResponse : public ros::Msg + { + public: + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "1f8f991dc94e0cb27fe61383e0f576bb"; }; + + }; + + class GetModelState { + public: + typedef GetModelStateRequest Request; + typedef GetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h new file mode 100755 index 0000000..e01b195 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_GetPhysicsProperties_h +#define _ROS_SERVICE_GetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char GETPHYSICSPROPERTIES[] = "gazebo_msgs/GetPhysicsProperties"; + + class GetPhysicsPropertiesRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPhysicsPropertiesResponse : public ros::Msg + { + public: + float time_step; + bool pause; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_time_step = (int32_t *) &(this->time_step); + int32_t exp_time_step = (((*val_time_step)>>23)&255); + if(exp_time_step != 0) + exp_time_step += 1023-127; + int32_t sig_time_step = *val_time_step; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_time_step<<5) & 0xff; + *(outbuffer + offset++) = (sig_time_step>>3) & 0xff; + *(outbuffer + offset++) = (sig_time_step>>11) & 0xff; + *(outbuffer + offset++) = ((exp_time_step<<4) & 0xF0) | ((sig_time_step>>19)&0x0F); + *(outbuffer + offset++) = (exp_time_step>>4) & 0x7F; + if(this->time_step < 0) *(outbuffer + offset -1) |= 0x80; + union { + bool real; + uint8_t base; + } u_pause; + u_pause.real = this->pause; + *(outbuffer + offset + 0) = (u_pause.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pause); + int32_t * val_max_update_rate = (int32_t *) &(this->max_update_rate); + int32_t exp_max_update_rate = (((*val_max_update_rate)>>23)&255); + if(exp_max_update_rate != 0) + exp_max_update_rate += 1023-127; + int32_t sig_max_update_rate = *val_max_update_rate; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_max_update_rate<<5) & 0xff; + *(outbuffer + offset++) = (sig_max_update_rate>>3) & 0xff; + *(outbuffer + offset++) = (sig_max_update_rate>>11) & 0xff; + *(outbuffer + offset++) = ((exp_max_update_rate<<4) & 0xF0) | ((sig_max_update_rate>>19)&0x0F); + *(outbuffer + offset++) = (exp_max_update_rate>>4) & 0x7F; + if(this->max_update_rate < 0) *(outbuffer + offset -1) |= 0x80; + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_time_step = (uint32_t*) &(this->time_step); + offset += 3; + *val_time_step = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_time_step |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_time_step |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_time_step |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_time_step = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_time_step |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_time_step !=0) + *val_time_step |= ((exp_time_step)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->time_step = -this->time_step; + union { + bool real; + uint8_t base; + } u_pause; + u_pause.base = 0; + u_pause.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pause = u_pause.real; + offset += sizeof(this->pause); + uint32_t * val_max_update_rate = (uint32_t*) &(this->max_update_rate); + offset += 3; + *val_max_update_rate = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_max_update_rate |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_max_update_rate |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_max_update_rate |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_max_update_rate = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_max_update_rate |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_max_update_rate !=0) + *val_max_update_rate |= ((exp_max_update_rate)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->max_update_rate = -this->max_update_rate; + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "575a5e74786981b7df2e3afc567693a6"; }; + + }; + + class GetPhysicsProperties { + public: + typedef GetPhysicsPropertiesRequest Request; + typedef GetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h new file mode 100755 index 0000000..89f0be5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h @@ -0,0 +1,166 @@ +#ifndef _ROS_SERVICE_GetWorldProperties_h +#define _ROS_SERVICE_GetWorldProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETWORLDPROPERTIES[] = "gazebo_msgs/GetWorldProperties"; + + class GetWorldPropertiesRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetWorldPropertiesResponse : public ros::Msg + { + public: + float sim_time; + uint8_t model_names_length; + char* st_model_names; + char* * model_names; + bool rendering_enabled; + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_sim_time = (int32_t *) &(this->sim_time); + int32_t exp_sim_time = (((*val_sim_time)>>23)&255); + if(exp_sim_time != 0) + exp_sim_time += 1023-127; + int32_t sig_sim_time = *val_sim_time; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_sim_time<<5) & 0xff; + *(outbuffer + offset++) = (sig_sim_time>>3) & 0xff; + *(outbuffer + offset++) = (sig_sim_time>>11) & 0xff; + *(outbuffer + offset++) = ((exp_sim_time<<4) & 0xF0) | ((sig_sim_time>>19)&0x0F); + *(outbuffer + offset++) = (exp_sim_time>>4) & 0x7F; + if(this->sim_time < 0) *(outbuffer + offset -1) |= 0x80; + *(outbuffer + offset++) = model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen( (const char*) this->model_names[i]); + memcpy(outbuffer + offset, &length_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_names[i], length_model_namesi); + offset += length_model_namesi; + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.real = this->rendering_enabled; + *(outbuffer + offset + 0) = (u_rendering_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_sim_time = (uint32_t*) &(this->sim_time); + offset += 3; + *val_sim_time = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_sim_time |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_sim_time |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_sim_time |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_sim_time = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_sim_time |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_sim_time !=0) + *val_sim_time |= ((exp_sim_time)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->sim_time = -this->sim_time; + uint8_t model_names_lengthT = *(inbuffer + offset++); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + offset += 3; + model_names_length = model_names_lengthT; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + memcpy(&length_st_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_model_names-1]=0; + this->st_model_names = (char *)(inbuffer + offset-1); + offset += length_st_model_names; + memcpy( &(this->model_names[i]), &(this->st_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.base = 0; + u_rendering_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->rendering_enabled = u_rendering_enabled.real; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "36bb0f2eccf4d8be971410c22818ba3f"; }; + + }; + + class GetWorldProperties { + public: + typedef GetWorldPropertiesRequest Request; + typedef GetWorldPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/JointRequest.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/JointRequest.h new file mode 100755 index 0000000..f6abde2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/JointRequest.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_JointRequest_h +#define _ROS_SERVICE_JointRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char JOINTREQUEST[] = "gazebo_msgs/JointRequest"; + + class JointRequestRequest : public ros::Msg + { + public: + char * joint_name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen( (const char*) this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class JointRequestResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class JointRequest { + public: + typedef JointRequestRequest Request; + typedef JointRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/LinkState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/LinkState.h new file mode 100755 index 0000000..439888a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/LinkState.h @@ -0,0 +1,72 @@ +#ifndef _ROS_gazebo_msgs_LinkState_h +#define _ROS_gazebo_msgs_LinkState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkState : public ros::Msg + { + public: + char * link_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + char * reference_frame; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen( (const char*) this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen( (const char*) this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkState"; }; + const char * getMD5(){ return "0818ebbf28ce3a08d48ab1eaa7309ebe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/LinkStates.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/LinkStates.h new file mode 100755 index 0000000..ba21a11 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/LinkStates.h @@ -0,0 +1,105 @@ +#ifndef _ROS_gazebo_msgs_LinkStates_h +#define _ROS_gazebo_msgs_LinkStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen( (const char*) this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ModelState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ModelState.h new file mode 100755 index 0000000..62694a8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ModelState.h @@ -0,0 +1,72 @@ +#ifndef _ROS_gazebo_msgs_ModelState_h +#define _ROS_gazebo_msgs_ModelState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelState : public ros::Msg + { + public: + char * model_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + char * reference_frame; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen( (const char*) this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelState"; }; + const char * getMD5(){ return "9330fd35f2fcd82d457e54bd54e10593"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ModelStates.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ModelStates.h new file mode 100755 index 0000000..cffb60f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ModelStates.h @@ -0,0 +1,105 @@ +#ifndef _ROS_gazebo_msgs_ModelStates_h +#define _ROS_gazebo_msgs_ModelStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen( (const char*) this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h new file mode 100755 index 0000000..12a7bc2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h @@ -0,0 +1,454 @@ +#ifndef _ROS_gazebo_msgs_ODEJointProperties_h +#define _ROS_gazebo_msgs_ODEJointProperties_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEJointProperties : public ros::Msg + { + public: + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t hiStop_length; + float st_hiStop; + float * hiStop; + uint8_t loStop_length; + float st_loStop; + float * loStop; + uint8_t erp_length; + float st_erp; + float * erp; + uint8_t cfm_length; + float st_cfm; + float * cfm; + uint8_t stop_erp_length; + float st_stop_erp; + float * stop_erp; + uint8_t stop_cfm_length; + float st_stop_cfm; + float * stop_cfm; + uint8_t fudge_factor_length; + float st_fudge_factor; + float * fudge_factor; + uint8_t fmax_length; + float st_fmax; + float * fmax; + uint8_t vel_length; + float st_vel; + float * vel; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + int32_t * val_dampingi = (int32_t *) &(this->damping[i]); + int32_t exp_dampingi = (((*val_dampingi)>>23)&255); + if(exp_dampingi != 0) + exp_dampingi += 1023-127; + int32_t sig_dampingi = *val_dampingi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_dampingi<<5) & 0xff; + *(outbuffer + offset++) = (sig_dampingi>>3) & 0xff; + *(outbuffer + offset++) = (sig_dampingi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_dampingi<<4) & 0xF0) | ((sig_dampingi>>19)&0x0F); + *(outbuffer + offset++) = (exp_dampingi>>4) & 0x7F; + if(this->damping[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = hiStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < hiStop_length; i++){ + int32_t * val_hiStopi = (int32_t *) &(this->hiStop[i]); + int32_t exp_hiStopi = (((*val_hiStopi)>>23)&255); + if(exp_hiStopi != 0) + exp_hiStopi += 1023-127; + int32_t sig_hiStopi = *val_hiStopi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_hiStopi<<5) & 0xff; + *(outbuffer + offset++) = (sig_hiStopi>>3) & 0xff; + *(outbuffer + offset++) = (sig_hiStopi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_hiStopi<<4) & 0xF0) | ((sig_hiStopi>>19)&0x0F); + *(outbuffer + offset++) = (exp_hiStopi>>4) & 0x7F; + if(this->hiStop[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = loStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loStop_length; i++){ + int32_t * val_loStopi = (int32_t *) &(this->loStop[i]); + int32_t exp_loStopi = (((*val_loStopi)>>23)&255); + if(exp_loStopi != 0) + exp_loStopi += 1023-127; + int32_t sig_loStopi = *val_loStopi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_loStopi<<5) & 0xff; + *(outbuffer + offset++) = (sig_loStopi>>3) & 0xff; + *(outbuffer + offset++) = (sig_loStopi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_loStopi<<4) & 0xF0) | ((sig_loStopi>>19)&0x0F); + *(outbuffer + offset++) = (exp_loStopi>>4) & 0x7F; + if(this->loStop[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erp_length; i++){ + int32_t * val_erpi = (int32_t *) &(this->erp[i]); + int32_t exp_erpi = (((*val_erpi)>>23)&255); + if(exp_erpi != 0) + exp_erpi += 1023-127; + int32_t sig_erpi = *val_erpi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_erpi<<5) & 0xff; + *(outbuffer + offset++) = (sig_erpi>>3) & 0xff; + *(outbuffer + offset++) = (sig_erpi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_erpi<<4) & 0xF0) | ((sig_erpi>>19)&0x0F); + *(outbuffer + offset++) = (exp_erpi>>4) & 0x7F; + if(this->erp[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cfm_length; i++){ + int32_t * val_cfmi = (int32_t *) &(this->cfm[i]); + int32_t exp_cfmi = (((*val_cfmi)>>23)&255); + if(exp_cfmi != 0) + exp_cfmi += 1023-127; + int32_t sig_cfmi = *val_cfmi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_cfmi<<5) & 0xff; + *(outbuffer + offset++) = (sig_cfmi>>3) & 0xff; + *(outbuffer + offset++) = (sig_cfmi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_cfmi<<4) & 0xF0) | ((sig_cfmi>>19)&0x0F); + *(outbuffer + offset++) = (exp_cfmi>>4) & 0x7F; + if(this->cfm[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = stop_erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_erp_length; i++){ + int32_t * val_stop_erpi = (int32_t *) &(this->stop_erp[i]); + int32_t exp_stop_erpi = (((*val_stop_erpi)>>23)&255); + if(exp_stop_erpi != 0) + exp_stop_erpi += 1023-127; + int32_t sig_stop_erpi = *val_stop_erpi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_stop_erpi<<5) & 0xff; + *(outbuffer + offset++) = (sig_stop_erpi>>3) & 0xff; + *(outbuffer + offset++) = (sig_stop_erpi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_stop_erpi<<4) & 0xF0) | ((sig_stop_erpi>>19)&0x0F); + *(outbuffer + offset++) = (exp_stop_erpi>>4) & 0x7F; + if(this->stop_erp[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = stop_cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + int32_t * val_stop_cfmi = (int32_t *) &(this->stop_cfm[i]); + int32_t exp_stop_cfmi = (((*val_stop_cfmi)>>23)&255); + if(exp_stop_cfmi != 0) + exp_stop_cfmi += 1023-127; + int32_t sig_stop_cfmi = *val_stop_cfmi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_stop_cfmi<<5) & 0xff; + *(outbuffer + offset++) = (sig_stop_cfmi>>3) & 0xff; + *(outbuffer + offset++) = (sig_stop_cfmi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_stop_cfmi<<4) & 0xF0) | ((sig_stop_cfmi>>19)&0x0F); + *(outbuffer + offset++) = (exp_stop_cfmi>>4) & 0x7F; + if(this->stop_cfm[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = fudge_factor_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + int32_t * val_fudge_factori = (int32_t *) &(this->fudge_factor[i]); + int32_t exp_fudge_factori = (((*val_fudge_factori)>>23)&255); + if(exp_fudge_factori != 0) + exp_fudge_factori += 1023-127; + int32_t sig_fudge_factori = *val_fudge_factori; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_fudge_factori<<5) & 0xff; + *(outbuffer + offset++) = (sig_fudge_factori>>3) & 0xff; + *(outbuffer + offset++) = (sig_fudge_factori>>11) & 0xff; + *(outbuffer + offset++) = ((exp_fudge_factori<<4) & 0xF0) | ((sig_fudge_factori>>19)&0x0F); + *(outbuffer + offset++) = (exp_fudge_factori>>4) & 0x7F; + if(this->fudge_factor[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = fmax_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fmax_length; i++){ + int32_t * val_fmaxi = (int32_t *) &(this->fmax[i]); + int32_t exp_fmaxi = (((*val_fmaxi)>>23)&255); + if(exp_fmaxi != 0) + exp_fmaxi += 1023-127; + int32_t sig_fmaxi = *val_fmaxi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_fmaxi<<5) & 0xff; + *(outbuffer + offset++) = (sig_fmaxi>>3) & 0xff; + *(outbuffer + offset++) = (sig_fmaxi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_fmaxi<<4) & 0xF0) | ((sig_fmaxi>>19)&0x0F); + *(outbuffer + offset++) = (exp_fmaxi>>4) & 0x7F; + if(this->fmax[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = vel_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vel_length; i++){ + int32_t * val_veli = (int32_t *) &(this->vel[i]); + int32_t exp_veli = (((*val_veli)>>23)&255); + if(exp_veli != 0) + exp_veli += 1023-127; + int32_t sig_veli = *val_veli; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_veli<<5) & 0xff; + *(outbuffer + offset++) = (sig_veli>>3) & 0xff; + *(outbuffer + offset++) = (sig_veli>>11) & 0xff; + *(outbuffer + offset++) = ((exp_veli<<4) & 0xF0) | ((sig_veli>>19)&0x0F); + *(outbuffer + offset++) = (exp_veli>>4) & 0x7F; + if(this->vel[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + uint32_t * val_st_damping = (uint32_t*) &(this->st_damping); + offset += 3; + *val_st_damping = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_damping |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_damping |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_damping |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_damping = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_damping |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_damping !=0) + *val_st_damping |= ((exp_st_damping)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_damping = -this->st_damping; + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t hiStop_lengthT = *(inbuffer + offset++); + if(hiStop_lengthT > hiStop_length) + this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); + offset += 3; + hiStop_length = hiStop_lengthT; + for( uint8_t i = 0; i < hiStop_length; i++){ + uint32_t * val_st_hiStop = (uint32_t*) &(this->st_hiStop); + offset += 3; + *val_st_hiStop = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_hiStop |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_hiStop |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_hiStop |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_hiStop = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_hiStop |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_hiStop !=0) + *val_st_hiStop |= ((exp_st_hiStop)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_hiStop = -this->st_hiStop; + memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); + } + uint8_t loStop_lengthT = *(inbuffer + offset++); + if(loStop_lengthT > loStop_length) + this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); + offset += 3; + loStop_length = loStop_lengthT; + for( uint8_t i = 0; i < loStop_length; i++){ + uint32_t * val_st_loStop = (uint32_t*) &(this->st_loStop); + offset += 3; + *val_st_loStop = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_loStop |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_loStop |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_loStop |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_loStop = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_loStop |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_loStop !=0) + *val_st_loStop |= ((exp_st_loStop)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_loStop = -this->st_loStop; + memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); + } + uint8_t erp_lengthT = *(inbuffer + offset++); + if(erp_lengthT > erp_length) + this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); + offset += 3; + erp_length = erp_lengthT; + for( uint8_t i = 0; i < erp_length; i++){ + uint32_t * val_st_erp = (uint32_t*) &(this->st_erp); + offset += 3; + *val_st_erp = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_erp = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_erp !=0) + *val_st_erp |= ((exp_st_erp)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_erp = -this->st_erp; + memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); + } + uint8_t cfm_lengthT = *(inbuffer + offset++); + if(cfm_lengthT > cfm_length) + this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); + offset += 3; + cfm_length = cfm_lengthT; + for( uint8_t i = 0; i < cfm_length; i++){ + uint32_t * val_st_cfm = (uint32_t*) &(this->st_cfm); + offset += 3; + *val_st_cfm = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_cfm = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_cfm !=0) + *val_st_cfm |= ((exp_st_cfm)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_cfm = -this->st_cfm; + memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); + } + uint8_t stop_erp_lengthT = *(inbuffer + offset++); + if(stop_erp_lengthT > stop_erp_length) + this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); + offset += 3; + stop_erp_length = stop_erp_lengthT; + for( uint8_t i = 0; i < stop_erp_length; i++){ + uint32_t * val_st_stop_erp = (uint32_t*) &(this->st_stop_erp); + offset += 3; + *val_st_stop_erp = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_stop_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_stop_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_stop_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_stop_erp = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_stop_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_stop_erp !=0) + *val_st_stop_erp |= ((exp_st_stop_erp)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_stop_erp = -this->st_stop_erp; + memcpy( &(this->stop_erp[i]), &(this->st_stop_erp), sizeof(float)); + } + uint8_t stop_cfm_lengthT = *(inbuffer + offset++); + if(stop_cfm_lengthT > stop_cfm_length) + this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); + offset += 3; + stop_cfm_length = stop_cfm_lengthT; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + uint32_t * val_st_stop_cfm = (uint32_t*) &(this->st_stop_cfm); + offset += 3; + *val_st_stop_cfm = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_stop_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_stop_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_stop_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_stop_cfm = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_stop_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_stop_cfm !=0) + *val_st_stop_cfm |= ((exp_st_stop_cfm)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_stop_cfm = -this->st_stop_cfm; + memcpy( &(this->stop_cfm[i]), &(this->st_stop_cfm), sizeof(float)); + } + uint8_t fudge_factor_lengthT = *(inbuffer + offset++); + if(fudge_factor_lengthT > fudge_factor_length) + this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); + offset += 3; + fudge_factor_length = fudge_factor_lengthT; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + uint32_t * val_st_fudge_factor = (uint32_t*) &(this->st_fudge_factor); + offset += 3; + *val_st_fudge_factor = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_fudge_factor |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_fudge_factor |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_fudge_factor |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_fudge_factor = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_fudge_factor |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_fudge_factor !=0) + *val_st_fudge_factor |= ((exp_st_fudge_factor)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_fudge_factor = -this->st_fudge_factor; + memcpy( &(this->fudge_factor[i]), &(this->st_fudge_factor), sizeof(float)); + } + uint8_t fmax_lengthT = *(inbuffer + offset++); + if(fmax_lengthT > fmax_length) + this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); + offset += 3; + fmax_length = fmax_lengthT; + for( uint8_t i = 0; i < fmax_length; i++){ + uint32_t * val_st_fmax = (uint32_t*) &(this->st_fmax); + offset += 3; + *val_st_fmax = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_fmax |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_fmax |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_fmax |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_fmax = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_fmax |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_fmax !=0) + *val_st_fmax |= ((exp_st_fmax)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_fmax = -this->st_fmax; + memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); + } + uint8_t vel_lengthT = *(inbuffer + offset++); + if(vel_lengthT > vel_length) + this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); + offset += 3; + vel_length = vel_lengthT; + for( uint8_t i = 0; i < vel_length; i++){ + uint32_t * val_st_vel = (uint32_t*) &(this->st_vel); + offset += 3; + *val_st_vel = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_vel |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_vel |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_vel |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_vel = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_vel |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_vel !=0) + *val_st_vel |= ((exp_st_vel)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_vel = -this->st_vel; + memcpy( &(this->vel[i]), &(this->st_vel), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEJointProperties"; }; + const char * getMD5(){ return "1b744c32a920af979f53afe2f9c3511f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h new file mode 100755 index 0000000..fad4e1b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h @@ -0,0 +1,239 @@ +#ifndef _ROS_gazebo_msgs_ODEPhysics_h +#define _ROS_gazebo_msgs_ODEPhysics_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEPhysics : public ros::Msg + { + public: + bool auto_disable_bodies; + uint32_t sor_pgs_precon_iters; + uint32_t sor_pgs_iters; + float sor_pgs_w; + float sor_pgs_rms_error_tol; + float contact_surface_layer; + float contact_max_correcting_vel; + float cfm; + float erp; + uint32_t max_contacts; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.real = this->auto_disable_bodies; + *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->auto_disable_bodies); + *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_precon_iters); + *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_iters); + int32_t * val_sor_pgs_w = (int32_t *) &(this->sor_pgs_w); + int32_t exp_sor_pgs_w = (((*val_sor_pgs_w)>>23)&255); + if(exp_sor_pgs_w != 0) + exp_sor_pgs_w += 1023-127; + int32_t sig_sor_pgs_w = *val_sor_pgs_w; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_sor_pgs_w<<5) & 0xff; + *(outbuffer + offset++) = (sig_sor_pgs_w>>3) & 0xff; + *(outbuffer + offset++) = (sig_sor_pgs_w>>11) & 0xff; + *(outbuffer + offset++) = ((exp_sor_pgs_w<<4) & 0xF0) | ((sig_sor_pgs_w>>19)&0x0F); + *(outbuffer + offset++) = (exp_sor_pgs_w>>4) & 0x7F; + if(this->sor_pgs_w < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_sor_pgs_rms_error_tol = (int32_t *) &(this->sor_pgs_rms_error_tol); + int32_t exp_sor_pgs_rms_error_tol = (((*val_sor_pgs_rms_error_tol)>>23)&255); + if(exp_sor_pgs_rms_error_tol != 0) + exp_sor_pgs_rms_error_tol += 1023-127; + int32_t sig_sor_pgs_rms_error_tol = *val_sor_pgs_rms_error_tol; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_sor_pgs_rms_error_tol<<5) & 0xff; + *(outbuffer + offset++) = (sig_sor_pgs_rms_error_tol>>3) & 0xff; + *(outbuffer + offset++) = (sig_sor_pgs_rms_error_tol>>11) & 0xff; + *(outbuffer + offset++) = ((exp_sor_pgs_rms_error_tol<<4) & 0xF0) | ((sig_sor_pgs_rms_error_tol>>19)&0x0F); + *(outbuffer + offset++) = (exp_sor_pgs_rms_error_tol>>4) & 0x7F; + if(this->sor_pgs_rms_error_tol < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_contact_surface_layer = (int32_t *) &(this->contact_surface_layer); + int32_t exp_contact_surface_layer = (((*val_contact_surface_layer)>>23)&255); + if(exp_contact_surface_layer != 0) + exp_contact_surface_layer += 1023-127; + int32_t sig_contact_surface_layer = *val_contact_surface_layer; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_contact_surface_layer<<5) & 0xff; + *(outbuffer + offset++) = (sig_contact_surface_layer>>3) & 0xff; + *(outbuffer + offset++) = (sig_contact_surface_layer>>11) & 0xff; + *(outbuffer + offset++) = ((exp_contact_surface_layer<<4) & 0xF0) | ((sig_contact_surface_layer>>19)&0x0F); + *(outbuffer + offset++) = (exp_contact_surface_layer>>4) & 0x7F; + if(this->contact_surface_layer < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_contact_max_correcting_vel = (int32_t *) &(this->contact_max_correcting_vel); + int32_t exp_contact_max_correcting_vel = (((*val_contact_max_correcting_vel)>>23)&255); + if(exp_contact_max_correcting_vel != 0) + exp_contact_max_correcting_vel += 1023-127; + int32_t sig_contact_max_correcting_vel = *val_contact_max_correcting_vel; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_contact_max_correcting_vel<<5) & 0xff; + *(outbuffer + offset++) = (sig_contact_max_correcting_vel>>3) & 0xff; + *(outbuffer + offset++) = (sig_contact_max_correcting_vel>>11) & 0xff; + *(outbuffer + offset++) = ((exp_contact_max_correcting_vel<<4) & 0xF0) | ((sig_contact_max_correcting_vel>>19)&0x0F); + *(outbuffer + offset++) = (exp_contact_max_correcting_vel>>4) & 0x7F; + if(this->contact_max_correcting_vel < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_cfm = (int32_t *) &(this->cfm); + int32_t exp_cfm = (((*val_cfm)>>23)&255); + if(exp_cfm != 0) + exp_cfm += 1023-127; + int32_t sig_cfm = *val_cfm; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_cfm<<5) & 0xff; + *(outbuffer + offset++) = (sig_cfm>>3) & 0xff; + *(outbuffer + offset++) = (sig_cfm>>11) & 0xff; + *(outbuffer + offset++) = ((exp_cfm<<4) & 0xF0) | ((sig_cfm>>19)&0x0F); + *(outbuffer + offset++) = (exp_cfm>>4) & 0x7F; + if(this->cfm < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_erp = (int32_t *) &(this->erp); + int32_t exp_erp = (((*val_erp)>>23)&255); + if(exp_erp != 0) + exp_erp += 1023-127; + int32_t sig_erp = *val_erp; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_erp<<5) & 0xff; + *(outbuffer + offset++) = (sig_erp>>3) & 0xff; + *(outbuffer + offset++) = (sig_erp>>11) & 0xff; + *(outbuffer + offset++) = ((exp_erp<<4) & 0xF0) | ((sig_erp>>19)&0x0F); + *(outbuffer + offset++) = (exp_erp>>4) & 0x7F; + if(this->erp < 0) *(outbuffer + offset -1) |= 0x80; + *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_contacts); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.base = 0; + u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->auto_disable_bodies = u_auto_disable_bodies.real; + offset += sizeof(this->auto_disable_bodies); + this->sor_pgs_precon_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_precon_iters); + this->sor_pgs_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_iters); + uint32_t * val_sor_pgs_w = (uint32_t*) &(this->sor_pgs_w); + offset += 3; + *val_sor_pgs_w = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_sor_pgs_w = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_sor_pgs_w |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_sor_pgs_w !=0) + *val_sor_pgs_w |= ((exp_sor_pgs_w)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->sor_pgs_w = -this->sor_pgs_w; + uint32_t * val_sor_pgs_rms_error_tol = (uint32_t*) &(this->sor_pgs_rms_error_tol); + offset += 3; + *val_sor_pgs_rms_error_tol = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_sor_pgs_rms_error_tol = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_sor_pgs_rms_error_tol |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_sor_pgs_rms_error_tol !=0) + *val_sor_pgs_rms_error_tol |= ((exp_sor_pgs_rms_error_tol)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->sor_pgs_rms_error_tol = -this->sor_pgs_rms_error_tol; + uint32_t * val_contact_surface_layer = (uint32_t*) &(this->contact_surface_layer); + offset += 3; + *val_contact_surface_layer = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_contact_surface_layer = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_contact_surface_layer |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_contact_surface_layer !=0) + *val_contact_surface_layer |= ((exp_contact_surface_layer)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->contact_surface_layer = -this->contact_surface_layer; + uint32_t * val_contact_max_correcting_vel = (uint32_t*) &(this->contact_max_correcting_vel); + offset += 3; + *val_contact_max_correcting_vel = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_contact_max_correcting_vel = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_contact_max_correcting_vel |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_contact_max_correcting_vel !=0) + *val_contact_max_correcting_vel |= ((exp_contact_max_correcting_vel)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->contact_max_correcting_vel = -this->contact_max_correcting_vel; + uint32_t * val_cfm = (uint32_t*) &(this->cfm); + offset += 3; + *val_cfm = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_cfm |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_cfm = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_cfm |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_cfm !=0) + *val_cfm |= ((exp_cfm)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->cfm = -this->cfm; + uint32_t * val_erp = (uint32_t*) &(this->erp); + offset += 3; + *val_erp = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_erp |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_erp = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_erp |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_erp !=0) + *val_erp |= ((exp_erp)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->erp = -this->erp; + this->max_contacts = ((uint32_t) (*(inbuffer + offset))); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->max_contacts); + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEPhysics"; }; + const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h new file mode 100755 index 0000000..08f5c54 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h @@ -0,0 +1,112 @@ +#ifndef _ROS_SERVICE_SetJointProperties_h +#define _ROS_SERVICE_SetJointProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEJointProperties.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTPROPERTIES[] = "gazebo_msgs/SetJointProperties"; + + class SetJointPropertiesRequest : public ros::Msg + { + public: + char * joint_name; + gazebo_msgs::ODEJointProperties ode_joint_config; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen( (const char*) this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += this->ode_joint_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += this->ode_joint_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "331fd8f35fd27e3c1421175590258e26"; }; + + }; + + class SetJointPropertiesResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointProperties { + public: + typedef SetJointPropertiesRequest Request; + typedef SetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h new file mode 100755 index 0000000..59dfbd7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -0,0 +1,148 @@ +#ifndef _ROS_SERVICE_SetJointTrajectory_h +#define _ROS_SERVICE_SetJointTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTTRAJECTORY[] = "gazebo_msgs/SetJointTrajectory"; + + class SetJointTrajectoryRequest : public ros::Msg + { + public: + char * model_name; + trajectory_msgs::JointTrajectory joint_trajectory; + geometry_msgs::Pose model_pose; + bool set_model_pose; + bool disable_physics_updates; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->joint_trajectory.serialize(outbuffer + offset); + offset += this->model_pose.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.real = this->set_model_pose; + *(outbuffer + offset + 0) = (u_set_model_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.real = this->disable_physics_updates; + *(outbuffer + offset + 0) = (u_disable_physics_updates.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->joint_trajectory.deserialize(inbuffer + offset); + offset += this->model_pose.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.base = 0; + u_set_model_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->set_model_pose = u_set_model_pose.real; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.base = 0; + u_disable_physics_updates.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->disable_physics_updates = u_disable_physics_updates.real; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "649dd2eba5ffd358069238825f9f85ab"; }; + + }; + + class SetJointTrajectoryResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointTrajectory { + public: + typedef SetJointTrajectoryRequest Request; + typedef SetJointTrajectoryResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h new file mode 100755 index 0000000..86c2372 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h @@ -0,0 +1,310 @@ +#ifndef _ROS_SERVICE_SetLinkProperties_h +#define _ROS_SERVICE_SetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETLINKPROPERTIES[] = "gazebo_msgs/SetLinkProperties"; + + class SetLinkPropertiesRequest : public ros::Msg + { + public: + char * link_name; + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen( (const char*) this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + int32_t * val_mass = (int32_t *) &(this->mass); + int32_t exp_mass = (((*val_mass)>>23)&255); + if(exp_mass != 0) + exp_mass += 1023-127; + int32_t sig_mass = *val_mass; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_mass<<5) & 0xff; + *(outbuffer + offset++) = (sig_mass>>3) & 0xff; + *(outbuffer + offset++) = (sig_mass>>11) & 0xff; + *(outbuffer + offset++) = ((exp_mass<<4) & 0xF0) | ((sig_mass>>19)&0x0F); + *(outbuffer + offset++) = (exp_mass>>4) & 0x7F; + if(this->mass < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_ixx = (int32_t *) &(this->ixx); + int32_t exp_ixx = (((*val_ixx)>>23)&255); + if(exp_ixx != 0) + exp_ixx += 1023-127; + int32_t sig_ixx = *val_ixx; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ixx<<5) & 0xff; + *(outbuffer + offset++) = (sig_ixx>>3) & 0xff; + *(outbuffer + offset++) = (sig_ixx>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ixx<<4) & 0xF0) | ((sig_ixx>>19)&0x0F); + *(outbuffer + offset++) = (exp_ixx>>4) & 0x7F; + if(this->ixx < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_ixy = (int32_t *) &(this->ixy); + int32_t exp_ixy = (((*val_ixy)>>23)&255); + if(exp_ixy != 0) + exp_ixy += 1023-127; + int32_t sig_ixy = *val_ixy; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ixy<<5) & 0xff; + *(outbuffer + offset++) = (sig_ixy>>3) & 0xff; + *(outbuffer + offset++) = (sig_ixy>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ixy<<4) & 0xF0) | ((sig_ixy>>19)&0x0F); + *(outbuffer + offset++) = (exp_ixy>>4) & 0x7F; + if(this->ixy < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_ixz = (int32_t *) &(this->ixz); + int32_t exp_ixz = (((*val_ixz)>>23)&255); + if(exp_ixz != 0) + exp_ixz += 1023-127; + int32_t sig_ixz = *val_ixz; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_ixz<<5) & 0xff; + *(outbuffer + offset++) = (sig_ixz>>3) & 0xff; + *(outbuffer + offset++) = (sig_ixz>>11) & 0xff; + *(outbuffer + offset++) = ((exp_ixz<<4) & 0xF0) | ((sig_ixz>>19)&0x0F); + *(outbuffer + offset++) = (exp_ixz>>4) & 0x7F; + if(this->ixz < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_iyy = (int32_t *) &(this->iyy); + int32_t exp_iyy = (((*val_iyy)>>23)&255); + if(exp_iyy != 0) + exp_iyy += 1023-127; + int32_t sig_iyy = *val_iyy; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_iyy<<5) & 0xff; + *(outbuffer + offset++) = (sig_iyy>>3) & 0xff; + *(outbuffer + offset++) = (sig_iyy>>11) & 0xff; + *(outbuffer + offset++) = ((exp_iyy<<4) & 0xF0) | ((sig_iyy>>19)&0x0F); + *(outbuffer + offset++) = (exp_iyy>>4) & 0x7F; + if(this->iyy < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_iyz = (int32_t *) &(this->iyz); + int32_t exp_iyz = (((*val_iyz)>>23)&255); + if(exp_iyz != 0) + exp_iyz += 1023-127; + int32_t sig_iyz = *val_iyz; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_iyz<<5) & 0xff; + *(outbuffer + offset++) = (sig_iyz>>3) & 0xff; + *(outbuffer + offset++) = (sig_iyz>>11) & 0xff; + *(outbuffer + offset++) = ((exp_iyz<<4) & 0xF0) | ((sig_iyz>>19)&0x0F); + *(outbuffer + offset++) = (exp_iyz>>4) & 0x7F; + if(this->iyz < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_izz = (int32_t *) &(this->izz); + int32_t exp_izz = (((*val_izz)>>23)&255); + if(exp_izz != 0) + exp_izz += 1023-127; + int32_t sig_izz = *val_izz; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_izz<<5) & 0xff; + *(outbuffer + offset++) = (sig_izz>>3) & 0xff; + *(outbuffer + offset++) = (sig_izz>>11) & 0xff; + *(outbuffer + offset++) = ((exp_izz<<4) & 0xF0) | ((sig_izz>>19)&0x0F); + *(outbuffer + offset++) = (exp_izz>>4) & 0x7F; + if(this->izz < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + uint32_t * val_mass = (uint32_t*) &(this->mass); + offset += 3; + *val_mass = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_mass |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_mass |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_mass |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_mass = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_mass |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_mass !=0) + *val_mass |= ((exp_mass)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->mass = -this->mass; + uint32_t * val_ixx = (uint32_t*) &(this->ixx); + offset += 3; + *val_ixx = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_ixx |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_ixx |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_ixx |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_ixx = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_ixx |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_ixx !=0) + *val_ixx |= ((exp_ixx)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixx = -this->ixx; + uint32_t * val_ixy = (uint32_t*) &(this->ixy); + offset += 3; + *val_ixy = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_ixy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_ixy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_ixy |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_ixy = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_ixy |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_ixy !=0) + *val_ixy |= ((exp_ixy)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixy = -this->ixy; + uint32_t * val_ixz = (uint32_t*) &(this->ixz); + offset += 3; + *val_ixz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_ixz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_ixz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_ixz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_ixz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_ixz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_ixz !=0) + *val_ixz |= ((exp_ixz)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->ixz = -this->ixz; + uint32_t * val_iyy = (uint32_t*) &(this->iyy); + offset += 3; + *val_iyy = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_iyy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_iyy |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_iyy |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_iyy = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_iyy |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_iyy !=0) + *val_iyy |= ((exp_iyy)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->iyy = -this->iyy; + uint32_t * val_iyz = (uint32_t*) &(this->iyz); + offset += 3; + *val_iyz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_iyz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_iyz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_iyz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_iyz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_iyz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_iyz !=0) + *val_iyz |= ((exp_iyz)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->iyz = -this->iyz; + uint32_t * val_izz = (uint32_t*) &(this->izz); + offset += 3; + *val_izz = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_izz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_izz |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_izz |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_izz = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_izz |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_izz !=0) + *val_izz |= ((exp_izz)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->izz = -this->izz; + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "68ac74a4be01b165bc305b5ccdc45e91"; }; + + }; + + class SetLinkPropertiesResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkProperties { + public: + typedef SetLinkPropertiesRequest Request; + typedef SetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetLinkState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetLinkState.h new file mode 100755 index 0000000..91a4353 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetLinkState.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetLinkState_h +#define _ROS_SERVICE_SetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char SETLINKSTATE[] = "gazebo_msgs/SetLinkState"; + + class SetLinkStateRequest : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "22a2c757d56911b6f27868159e9a872d"; }; + + }; + + class SetLinkStateResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkState { + public: + typedef SetLinkStateRequest Request; + typedef SetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h new file mode 100755 index 0000000..717a895 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h @@ -0,0 +1,196 @@ +#ifndef _ROS_SERVICE_SetModelConfiguration_h +#define _ROS_SERVICE_SetModelConfiguration_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char SETMODELCONFIGURATION[] = "gazebo_msgs/SetModelConfiguration"; + + class SetModelConfigurationRequest : public ros::Msg + { + public: + char * model_name; + char * urdf_param_name; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t joint_positions_length; + float st_joint_positions; + float * joint_positions; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_urdf_param_name = strlen( (const char*) this->urdf_param_name); + memcpy(outbuffer + offset, &length_urdf_param_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->urdf_param_name, length_urdf_param_name); + offset += length_urdf_param_name; + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = joint_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_positions_length; i++){ + int32_t * val_joint_positionsi = (int32_t *) &(this->joint_positions[i]); + int32_t exp_joint_positionsi = (((*val_joint_positionsi)>>23)&255); + if(exp_joint_positionsi != 0) + exp_joint_positionsi += 1023-127; + int32_t sig_joint_positionsi = *val_joint_positionsi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_joint_positionsi<<5) & 0xff; + *(outbuffer + offset++) = (sig_joint_positionsi>>3) & 0xff; + *(outbuffer + offset++) = (sig_joint_positionsi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_joint_positionsi<<4) & 0xF0) | ((sig_joint_positionsi>>19)&0x0F); + *(outbuffer + offset++) = (exp_joint_positionsi>>4) & 0x7F; + if(this->joint_positions[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_urdf_param_name; + memcpy(&length_urdf_param_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_urdf_param_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_urdf_param_name-1]=0; + this->urdf_param_name = (char *)(inbuffer + offset-1); + offset += length_urdf_param_name; + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t joint_positions_lengthT = *(inbuffer + offset++); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + offset += 3; + joint_positions_length = joint_positions_lengthT; + for( uint8_t i = 0; i < joint_positions_length; i++){ + uint32_t * val_st_joint_positions = (uint32_t*) &(this->st_joint_positions); + offset += 3; + *val_st_joint_positions = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_joint_positions |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_joint_positions |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_joint_positions |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_joint_positions = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_joint_positions |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_joint_positions !=0) + *val_st_joint_positions |= ((exp_st_joint_positions)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_joint_positions = -this->st_joint_positions; + memcpy( &(this->joint_positions[i]), &(this->st_joint_positions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "160eae60f51fabff255480c70afa289f"; }; + + }; + + class SetModelConfigurationResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelConfiguration { + public: + typedef SetModelConfigurationRequest Request; + typedef SetModelConfigurationResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetModelState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetModelState.h new file mode 100755 index 0000000..04edf19 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetModelState.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetModelState_h +#define _ROS_SERVICE_SetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ModelState.h" + +namespace gazebo_msgs +{ + +static const char SETMODELSTATE[] = "gazebo_msgs/SetModelState"; + + class SetModelStateRequest : public ros::Msg + { + public: + gazebo_msgs::ModelState model_state; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->model_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->model_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "cb042b0e91880f4661b29ea5b6234350"; }; + + }; + + class SetModelStateResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelState { + public: + typedef SetModelStateRequest Request; + typedef SetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h new file mode 100755 index 0000000..5a2e740 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h @@ -0,0 +1,153 @@ +#ifndef _ROS_SERVICE_SetPhysicsProperties_h +#define _ROS_SERVICE_SetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char SETPHYSICSPROPERTIES[] = "gazebo_msgs/SetPhysicsProperties"; + + class SetPhysicsPropertiesRequest : public ros::Msg + { + public: + float time_step; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_time_step = (int32_t *) &(this->time_step); + int32_t exp_time_step = (((*val_time_step)>>23)&255); + if(exp_time_step != 0) + exp_time_step += 1023-127; + int32_t sig_time_step = *val_time_step; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_time_step<<5) & 0xff; + *(outbuffer + offset++) = (sig_time_step>>3) & 0xff; + *(outbuffer + offset++) = (sig_time_step>>11) & 0xff; + *(outbuffer + offset++) = ((exp_time_step<<4) & 0xF0) | ((sig_time_step>>19)&0x0F); + *(outbuffer + offset++) = (exp_time_step>>4) & 0x7F; + if(this->time_step < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_max_update_rate = (int32_t *) &(this->max_update_rate); + int32_t exp_max_update_rate = (((*val_max_update_rate)>>23)&255); + if(exp_max_update_rate != 0) + exp_max_update_rate += 1023-127; + int32_t sig_max_update_rate = *val_max_update_rate; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_max_update_rate<<5) & 0xff; + *(outbuffer + offset++) = (sig_max_update_rate>>3) & 0xff; + *(outbuffer + offset++) = (sig_max_update_rate>>11) & 0xff; + *(outbuffer + offset++) = ((exp_max_update_rate<<4) & 0xF0) | ((sig_max_update_rate>>19)&0x0F); + *(outbuffer + offset++) = (exp_max_update_rate>>4) & 0x7F; + if(this->max_update_rate < 0) *(outbuffer + offset -1) |= 0x80; + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_time_step = (uint32_t*) &(this->time_step); + offset += 3; + *val_time_step = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_time_step |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_time_step |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_time_step |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_time_step = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_time_step |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_time_step !=0) + *val_time_step |= ((exp_time_step)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->time_step = -this->time_step; + uint32_t * val_max_update_rate = (uint32_t*) &(this->max_update_rate); + offset += 3; + *val_max_update_rate = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_max_update_rate |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_max_update_rate |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_max_update_rate |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_max_update_rate = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_max_update_rate |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_max_update_rate !=0) + *val_max_update_rate |= ((exp_max_update_rate)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->max_update_rate = -this->max_update_rate; + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "abd9f82732b52b92e9d6bb36e6a82452"; }; + + }; + + class SetPhysicsPropertiesResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetPhysicsProperties { + public: + typedef SetPhysicsPropertiesRequest Request; + typedef SetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SpawnModel.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SpawnModel.h new file mode 100755 index 0000000..cdc2d96 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/SpawnModel.h @@ -0,0 +1,157 @@ +#ifndef _ROS_SERVICE_SpawnModel_h +#define _ROS_SERVICE_SpawnModel_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SPAWNMODEL[] = "gazebo_msgs/SpawnModel"; + + class SpawnModelRequest : public ros::Msg + { + public: + char * model_name; + char * model_xml; + char * robot_namespace; + geometry_msgs::Pose initial_pose; + char * reference_frame; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen( (const char*) this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_model_xml = strlen( (const char*) this->model_xml); + memcpy(outbuffer + offset, &length_model_xml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_xml, length_model_xml); + offset += length_model_xml; + uint32_t length_robot_namespace = strlen( (const char*) this->robot_namespace); + memcpy(outbuffer + offset, &length_robot_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->robot_namespace, length_robot_namespace); + offset += length_robot_namespace; + offset += this->initial_pose.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen( (const char*) this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_model_xml; + memcpy(&length_model_xml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_xml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_xml-1]=0; + this->model_xml = (char *)(inbuffer + offset-1); + offset += length_model_xml; + uint32_t length_robot_namespace; + memcpy(&length_robot_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_namespace-1]=0; + this->robot_namespace = (char *)(inbuffer + offset-1); + offset += length_robot_namespace; + offset += this->initial_pose.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "6d0eba5753761cd57e6263a056b79930"; }; + + }; + + class SpawnModelResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SpawnModel { + public: + typedef SpawnModelRequest Request; + typedef SpawnModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/WorldState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/WorldState.h new file mode 100755 index 0000000..5110455 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/gazebo_msgs/WorldState.h @@ -0,0 +1,129 @@ +#ifndef _ROS_gazebo_msgs_WorldState_h +#define _ROS_gazebo_msgs_WorldState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace gazebo_msgs +{ + + class WorldState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen( (const char*) this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/WorldState"; }; + const char * getMD5(){ return "de1a9de3ab7ba97ac0e9ec01a4eb481e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Point.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Point.h new file mode 100755 index 0000000..a0726ca --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Point.h @@ -0,0 +1,112 @@ +#ifndef _ROS_geometry_msgs_Point_h +#define _ROS_geometry_msgs_Point_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point : public ros::Msg + { + public: + float x; + float y; + float z; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_x = (int32_t *) &(this->x); + int32_t exp_x = (((*val_x)>>23)&255); + if(exp_x != 0) + exp_x += 1023-127; + int32_t sig_x = *val_x; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_x<<5) & 0xff; + *(outbuffer + offset++) = (sig_x>>3) & 0xff; + *(outbuffer + offset++) = (sig_x>>11) & 0xff; + *(outbuffer + offset++) = ((exp_x<<4) & 0xF0) | ((sig_x>>19)&0x0F); + *(outbuffer + offset++) = (exp_x>>4) & 0x7F; + if(this->x < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_y = (int32_t *) &(this->y); + int32_t exp_y = (((*val_y)>>23)&255); + if(exp_y != 0) + exp_y += 1023-127; + int32_t sig_y = *val_y; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_y<<5) & 0xff; + *(outbuffer + offset++) = (sig_y>>3) & 0xff; + *(outbuffer + offset++) = (sig_y>>11) & 0xff; + *(outbuffer + offset++) = ((exp_y<<4) & 0xF0) | ((sig_y>>19)&0x0F); + *(outbuffer + offset++) = (exp_y>>4) & 0x7F; + if(this->y < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_z = (int32_t *) &(this->z); + int32_t exp_z = (((*val_z)>>23)&255); + if(exp_z != 0) + exp_z += 1023-127; + int32_t sig_z = *val_z; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_z<<5) & 0xff; + *(outbuffer + offset++) = (sig_z>>3) & 0xff; + *(outbuffer + offset++) = (sig_z>>11) & 0xff; + *(outbuffer + offset++) = ((exp_z<<4) & 0xF0) | ((sig_z>>19)&0x0F); + *(outbuffer + offset++) = (exp_z>>4) & 0x7F; + if(this->z < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_x = (uint32_t*) &(this->x); + offset += 3; + *val_x = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_x |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_x = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_x |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_x !=0) + *val_x |= ((exp_x)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->x = -this->x; + uint32_t * val_y = (uint32_t*) &(this->y); + offset += 3; + *val_y = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_y |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_y = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_y |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_y !=0) + *val_y |= ((exp_y)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->y = -this->y; + uint32_t * val_z = (uint32_t*) &(this->z); + offset += 3; + *val_z = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_z |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_z |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_z |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_z = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_z |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_z !=0) + *val_z |= ((exp_z)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->z = -this->z; + return offset; + } + + const char * getType(){ return "geometry_msgs/Point"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Point32.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Point32.h new file mode 100755 index 0000000..92c8b22 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Point32.h @@ -0,0 +1,100 @@ +#ifndef _ROS_geometry_msgs_Point32_h +#define _ROS_geometry_msgs_Point32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point32 : public ros::Msg + { + public: + float x; + float y; + float z; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point32"; }; + const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PointStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PointStamped.h new file mode 100755 index 0000000..f6cd226 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PointStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_PointStamped_h +#define _ROS_geometry_msgs_PointStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace geometry_msgs +{ + + class PointStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Point point; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PointStamped"; }; + const char * getMD5(){ return "c63aecb41bfdfd6b7e1fac37c7cbe7bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Polygon.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Polygon.h new file mode 100755 index 0000000..5987b5f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Polygon.h @@ -0,0 +1,54 @@ +#ifndef _ROS_geometry_msgs_Polygon_h +#define _ROS_geometry_msgs_Polygon_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point32.h" + +namespace geometry_msgs +{ + + class Polygon : public ros::Msg + { + public: + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/Polygon"; }; + const char * getMD5(){ return "cd60a26494a087f577976f0329fa120e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PolygonStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PolygonStamped.h new file mode 100755 index 0000000..5cf90e5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PolygonStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_PolygonStamped_h +#define _ROS_geometry_msgs_PolygonStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Polygon.h" + +namespace geometry_msgs +{ + + class PolygonStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Polygon polygon; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PolygonStamped"; }; + const char * getMD5(){ return "c6be8f7dc3bee7fe9e8d296070f53340"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Pose.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Pose.h new file mode 100755 index 0000000..d67ce17 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Pose.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_Pose_h +#define _ROS_geometry_msgs_Pose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Pose : public ros::Msg + { + public: + geometry_msgs::Point position; + geometry_msgs::Quaternion orientation; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose"; }; + const char * getMD5(){ return "e45d45a5a1ce597b249e23fb30fc871f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Pose2D.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Pose2D.h new file mode 100755 index 0000000..d6a59fc --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Pose2D.h @@ -0,0 +1,112 @@ +#ifndef _ROS_geometry_msgs_Pose2D_h +#define _ROS_geometry_msgs_Pose2D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Pose2D : public ros::Msg + { + public: + float x; + float y; + float theta; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_x = (int32_t *) &(this->x); + int32_t exp_x = (((*val_x)>>23)&255); + if(exp_x != 0) + exp_x += 1023-127; + int32_t sig_x = *val_x; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_x<<5) & 0xff; + *(outbuffer + offset++) = (sig_x>>3) & 0xff; + *(outbuffer + offset++) = (sig_x>>11) & 0xff; + *(outbuffer + offset++) = ((exp_x<<4) & 0xF0) | ((sig_x>>19)&0x0F); + *(outbuffer + offset++) = (exp_x>>4) & 0x7F; + if(this->x < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_y = (int32_t *) &(this->y); + int32_t exp_y = (((*val_y)>>23)&255); + if(exp_y != 0) + exp_y += 1023-127; + int32_t sig_y = *val_y; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_y<<5) & 0xff; + *(outbuffer + offset++) = (sig_y>>3) & 0xff; + *(outbuffer + offset++) = (sig_y>>11) & 0xff; + *(outbuffer + offset++) = ((exp_y<<4) & 0xF0) | ((sig_y>>19)&0x0F); + *(outbuffer + offset++) = (exp_y>>4) & 0x7F; + if(this->y < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_theta = (int32_t *) &(this->theta); + int32_t exp_theta = (((*val_theta)>>23)&255); + if(exp_theta != 0) + exp_theta += 1023-127; + int32_t sig_theta = *val_theta; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_theta<<5) & 0xff; + *(outbuffer + offset++) = (sig_theta>>3) & 0xff; + *(outbuffer + offset++) = (sig_theta>>11) & 0xff; + *(outbuffer + offset++) = ((exp_theta<<4) & 0xF0) | ((sig_theta>>19)&0x0F); + *(outbuffer + offset++) = (exp_theta>>4) & 0x7F; + if(this->theta < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_x = (uint32_t*) &(this->x); + offset += 3; + *val_x = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_x |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_x = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_x |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_x !=0) + *val_x |= ((exp_x)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->x = -this->x; + uint32_t * val_y = (uint32_t*) &(this->y); + offset += 3; + *val_y = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_y |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_y = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_y |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_y !=0) + *val_y |= ((exp_y)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->y = -this->y; + uint32_t * val_theta = (uint32_t*) &(this->theta); + offset += 3; + *val_theta = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_theta |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_theta |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_theta |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_theta = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_theta |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_theta !=0) + *val_theta |= ((exp_theta)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->theta = -this->theta; + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose2D"; }; + const char * getMD5(){ return "938fa65709584ad8e77d238529be13b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseArray.h new file mode 100755 index 0000000..7ae7de4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseArray.h @@ -0,0 +1,58 @@ +#ifndef _ROS_geometry_msgs_PoseArray_h +#define _ROS_geometry_msgs_PoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::Pose st_poses; + geometry_msgs::Pose * poses; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseArray"; }; + const char * getMD5(){ return "916c28c5764443f268b296bb671b9d97"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseStamped.h new file mode 100755 index 0000000..b0ef4a3 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_PoseStamped_h +#define _ROS_geometry_msgs_PoseStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseStamped"; }; + const char * getMD5(){ return "d3812c3cbc69362b77dc0b19b345f8f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h new file mode 100755 index 0000000..7ff1b14 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,70 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovariance_h +#define _ROS_geometry_msgs_PoseWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseWithCovariance : public ros::Msg + { + public: + geometry_msgs::Pose pose; + float covariance[36]; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + unsigned char * covariance_val = (unsigned char *) this->covariance; + for( uint8_t i = 0; i < 36; i++){ + int32_t * val_covariancei = (int32_t *) &(this->covariance[i]); + int32_t exp_covariancei = (((*val_covariancei)>>23)&255); + if(exp_covariancei != 0) + exp_covariancei += 1023-127; + int32_t sig_covariancei = *val_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_covariancei<<4) & 0xF0) | ((sig_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_covariancei>>4) & 0x7F; + if(this->covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + uint8_t * covariance_val = (uint8_t*) this->covariance; + for( uint8_t i = 0; i < 36; i++){ + uint32_t * val_covariancei = (uint32_t*) &(this->covariance[i]); + offset += 3; + *val_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_covariancei !=0) + *val_covariancei |= ((exp_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->covariance[i] = -this->covariance[i]; + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovariance"; }; + const char * getMD5(){ return "c23e848cf1b7533a8d7c259073a97e6f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h new file mode 100755 index 0000000..92023cf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovarianceStamped_h +#define _ROS_geometry_msgs_PoseWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" + +namespace geometry_msgs +{ + + class PoseWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::PoseWithCovariance pose; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovarianceStamped"; }; + const char * getMD5(){ return "953b798c0f514ff060a53a3498ce6246"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Quaternion.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Quaternion.h new file mode 100755 index 0000000..45ae126 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Quaternion.h @@ -0,0 +1,138 @@ +#ifndef _ROS_geometry_msgs_Quaternion_h +#define _ROS_geometry_msgs_Quaternion_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Quaternion : public ros::Msg + { + public: + float x; + float y; + float z; + float w; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_x = (int32_t *) &(this->x); + int32_t exp_x = (((*val_x)>>23)&255); + if(exp_x != 0) + exp_x += 1023-127; + int32_t sig_x = *val_x; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_x<<5) & 0xff; + *(outbuffer + offset++) = (sig_x>>3) & 0xff; + *(outbuffer + offset++) = (sig_x>>11) & 0xff; + *(outbuffer + offset++) = ((exp_x<<4) & 0xF0) | ((sig_x>>19)&0x0F); + *(outbuffer + offset++) = (exp_x>>4) & 0x7F; + if(this->x < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_y = (int32_t *) &(this->y); + int32_t exp_y = (((*val_y)>>23)&255); + if(exp_y != 0) + exp_y += 1023-127; + int32_t sig_y = *val_y; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_y<<5) & 0xff; + *(outbuffer + offset++) = (sig_y>>3) & 0xff; + *(outbuffer + offset++) = (sig_y>>11) & 0xff; + *(outbuffer + offset++) = ((exp_y<<4) & 0xF0) | ((sig_y>>19)&0x0F); + *(outbuffer + offset++) = (exp_y>>4) & 0x7F; + if(this->y < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_z = (int32_t *) &(this->z); + int32_t exp_z = (((*val_z)>>23)&255); + if(exp_z != 0) + exp_z += 1023-127; + int32_t sig_z = *val_z; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_z<<5) & 0xff; + *(outbuffer + offset++) = (sig_z>>3) & 0xff; + *(outbuffer + offset++) = (sig_z>>11) & 0xff; + *(outbuffer + offset++) = ((exp_z<<4) & 0xF0) | ((sig_z>>19)&0x0F); + *(outbuffer + offset++) = (exp_z>>4) & 0x7F; + if(this->z < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_w = (int32_t *) &(this->w); + int32_t exp_w = (((*val_w)>>23)&255); + if(exp_w != 0) + exp_w += 1023-127; + int32_t sig_w = *val_w; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_w<<5) & 0xff; + *(outbuffer + offset++) = (sig_w>>3) & 0xff; + *(outbuffer + offset++) = (sig_w>>11) & 0xff; + *(outbuffer + offset++) = ((exp_w<<4) & 0xF0) | ((sig_w>>19)&0x0F); + *(outbuffer + offset++) = (exp_w>>4) & 0x7F; + if(this->w < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_x = (uint32_t*) &(this->x); + offset += 3; + *val_x = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_x |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_x = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_x |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_x !=0) + *val_x |= ((exp_x)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->x = -this->x; + uint32_t * val_y = (uint32_t*) &(this->y); + offset += 3; + *val_y = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_y |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_y = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_y |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_y !=0) + *val_y |= ((exp_y)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->y = -this->y; + uint32_t * val_z = (uint32_t*) &(this->z); + offset += 3; + *val_z = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_z |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_z |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_z |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_z = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_z |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_z !=0) + *val_z |= ((exp_z)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->z = -this->z; + uint32_t * val_w = (uint32_t*) &(this->w); + offset += 3; + *val_w = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_w |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_w |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_w |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_w = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_w |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_w !=0) + *val_w |= ((exp_w)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->w = -this->w; + return offset; + } + + const char * getType(){ return "geometry_msgs/Quaternion"; }; + const char * getMD5(){ return "a779879fadf0160734f906b8c19c7004"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h new file mode 100755 index 0000000..e4e5606 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_QuaternionStamped_h +#define _ROS_geometry_msgs_QuaternionStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class QuaternionStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion quaternion; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->quaternion.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->quaternion.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/QuaternionStamped"; }; + const char * getMD5(){ return "e57f1e547e0e1fd13504588ffc8334e2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Transform.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Transform.h new file mode 100755 index 0000000..307620f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Transform.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_Transform_h +#define _ROS_geometry_msgs_Transform_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Transform : public ros::Msg + { + public: + geometry_msgs::Vector3 translation; + geometry_msgs::Quaternion rotation; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->translation.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->translation.deserialize(inbuffer + offset); + offset += this->rotation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Transform"; }; + const char * getMD5(){ return "ac9eff44abf714214112b05d54a3cf9b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TransformStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TransformStamped.h new file mode 100755 index 0000000..cfcc3df --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TransformStamped.h @@ -0,0 +1,57 @@ +#ifndef _ROS_geometry_msgs_TransformStamped_h +#define _ROS_geometry_msgs_TransformStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" + +namespace geometry_msgs +{ + + class TransformStamped : public ros::Msg + { + public: + std_msgs::Header header; + char * child_frame_id; + geometry_msgs::Transform transform; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen( (const char*) this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->transform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->transform.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TransformStamped"; }; + const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Twist.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Twist.h new file mode 100755 index 0000000..ca2b7b9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Twist.h @@ -0,0 +1,41 @@ +#ifndef _ROS_geometry_msgs_Twist_h +#define _ROS_geometry_msgs_Twist_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Twist : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Twist"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistStamped.h new file mode 100755 index 0000000..d3cf0c1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_TwistStamped_h +#define _ROS_geometry_msgs_TwistStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Twist twist; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistStamped"; }; + const char * getMD5(){ return "98d34b0043a2093cf9d9345ab6eef12e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h new file mode 100755 index 0000000..71dcc29 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,70 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovariance_h +#define _ROS_geometry_msgs_TwistWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistWithCovariance : public ros::Msg + { + public: + geometry_msgs::Twist twist; + float covariance[36]; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + unsigned char * covariance_val = (unsigned char *) this->covariance; + for( uint8_t i = 0; i < 36; i++){ + int32_t * val_covariancei = (int32_t *) &(this->covariance[i]); + int32_t exp_covariancei = (((*val_covariancei)>>23)&255); + if(exp_covariancei != 0) + exp_covariancei += 1023-127; + int32_t sig_covariancei = *val_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_covariancei<<4) & 0xF0) | ((sig_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_covariancei>>4) & 0x7F; + if(this->covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + uint8_t * covariance_val = (uint8_t*) this->covariance; + for( uint8_t i = 0; i < 36; i++){ + uint32_t * val_covariancei = (uint32_t*) &(this->covariance[i]); + offset += 3; + *val_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_covariancei !=0) + *val_covariancei |= ((exp_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->covariance[i] = -this->covariance[i]; + } + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovariance"; }; + const char * getMD5(){ return "1fe8a28e6890a4cc3ae4c3ca5c7d82e6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h new file mode 100755 index 0000000..d362ad9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovarianceStamped_h +#define _ROS_geometry_msgs_TwistWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace geometry_msgs +{ + + class TwistWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::TwistWithCovariance twist; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovarianceStamped"; }; + const char * getMD5(){ return "8927a1a12fb2607ceea095b2dc440a96"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Vector3.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Vector3.h new file mode 100755 index 0000000..5f0ae1d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Vector3.h @@ -0,0 +1,112 @@ +#ifndef _ROS_geometry_msgs_Vector3_h +#define _ROS_geometry_msgs_Vector3_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Vector3 : public ros::Msg + { + public: + float x; + float y; + float z; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_x = (int32_t *) &(this->x); + int32_t exp_x = (((*val_x)>>23)&255); + if(exp_x != 0) + exp_x += 1023-127; + int32_t sig_x = *val_x; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_x<<5) & 0xff; + *(outbuffer + offset++) = (sig_x>>3) & 0xff; + *(outbuffer + offset++) = (sig_x>>11) & 0xff; + *(outbuffer + offset++) = ((exp_x<<4) & 0xF0) | ((sig_x>>19)&0x0F); + *(outbuffer + offset++) = (exp_x>>4) & 0x7F; + if(this->x < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_y = (int32_t *) &(this->y); + int32_t exp_y = (((*val_y)>>23)&255); + if(exp_y != 0) + exp_y += 1023-127; + int32_t sig_y = *val_y; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_y<<5) & 0xff; + *(outbuffer + offset++) = (sig_y>>3) & 0xff; + *(outbuffer + offset++) = (sig_y>>11) & 0xff; + *(outbuffer + offset++) = ((exp_y<<4) & 0xF0) | ((sig_y>>19)&0x0F); + *(outbuffer + offset++) = (exp_y>>4) & 0x7F; + if(this->y < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_z = (int32_t *) &(this->z); + int32_t exp_z = (((*val_z)>>23)&255); + if(exp_z != 0) + exp_z += 1023-127; + int32_t sig_z = *val_z; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_z<<5) & 0xff; + *(outbuffer + offset++) = (sig_z>>3) & 0xff; + *(outbuffer + offset++) = (sig_z>>11) & 0xff; + *(outbuffer + offset++) = ((exp_z<<4) & 0xF0) | ((sig_z>>19)&0x0F); + *(outbuffer + offset++) = (exp_z>>4) & 0x7F; + if(this->z < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_x = (uint32_t*) &(this->x); + offset += 3; + *val_x = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_x |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_x |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_x = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_x |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_x !=0) + *val_x |= ((exp_x)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->x = -this->x; + uint32_t * val_y = (uint32_t*) &(this->y); + offset += 3; + *val_y = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_y |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_y |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_y = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_y |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_y !=0) + *val_y |= ((exp_y)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->y = -this->y; + uint32_t * val_z = (uint32_t*) &(this->z); + offset += 3; + *val_z = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_z |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_z |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_z |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_z = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_z |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_z !=0) + *val_z |= ((exp_z)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->z = -this->z; + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h new file mode 100755 index 0000000..9062d60 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_Vector3Stamped_h +#define _ROS_geometry_msgs_Vector3Stamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Vector3Stamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 vector; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3Stamped"; }; + const char * getMD5(){ return "7b324c7325e683bf02a9b14b01090ec7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Wrench.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Wrench.h new file mode 100755 index 0000000..58a4f0d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/Wrench.h @@ -0,0 +1,41 @@ +#ifndef _ROS_geometry_msgs_Wrench_h +#define _ROS_geometry_msgs_Wrench_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Wrench : public ros::Msg + { + public: + geometry_msgs::Vector3 force; + geometry_msgs::Vector3 torque; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->force.serialize(outbuffer + offset); + offset += this->torque.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->force.deserialize(inbuffer + offset); + offset += this->torque.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Wrench"; }; + const char * getMD5(){ return "4f539cf138b23283b520fd271b567936"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/WrenchStamped.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/WrenchStamped.h new file mode 100755 index 0000000..3c9f74c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/geometry_msgs/WrenchStamped.h @@ -0,0 +1,42 @@ +#ifndef _ROS_geometry_msgs_WrenchStamped_h +#define _ROS_geometry_msgs_WrenchStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Wrench.h" + +namespace geometry_msgs +{ + + class WrenchStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Wrench wrench; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/WrenchStamped"; }; + const char * getMD5(){ return "d78d3cb249ce23087ade7e7d0c40cfa7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/laser_assembler/AssembleScans.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/laser_assembler/AssembleScans.h new file mode 100755 index 0000000..186fa77 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/laser_assembler/AssembleScans.h @@ -0,0 +1,109 @@ +#ifndef _ROS_SERVICE_AssembleScans_h +#define _ROS_SERVICE_AssembleScans_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "sensor_msgs/PointCloud.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS[] = "laser_assembler/AssembleScans"; + + class AssembleScansRequest : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScansResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud cloud; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "4217b28a903e4ad7869a83b3653110ff"; }; + + }; + + class AssembleScans { + public: + typedef AssembleScansRequest Request; + typedef AssembleScansResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/laser_assembler/AssembleScans2.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/laser_assembler/AssembleScans2.h new file mode 100755 index 0000000..f4475cf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/laser_assembler/AssembleScans2.h @@ -0,0 +1,109 @@ +#ifndef _ROS_SERVICE_AssembleScans2_h +#define _ROS_SERVICE_AssembleScans2_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" +#include "ros/time.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS2[] = "laser_assembler/AssembleScans2"; + + class AssembleScans2Request : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScans2Response : public ros::Msg + { + public: + sensor_msgs::PointCloud2 cloud; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; + + }; + + class AssembleScans2 { + public: + typedef AssembleScans2Request Request; + typedef AssembleScans2Response Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseAction.h new file mode 100755 index 0000000..421fecb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_move_base_msgs_MoveBaseAction_h +#define _ROS_move_base_msgs_MoveBaseAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "move_base_msgs/MoveBaseActionGoal.h" +#include "move_base_msgs/MoveBaseActionResult.h" +#include "move_base_msgs/MoveBaseActionFeedback.h" + +namespace move_base_msgs +{ + + class MoveBaseAction : public ros::Msg + { + public: + move_base_msgs::MoveBaseActionGoal action_goal; + move_base_msgs::MoveBaseActionResult action_result; + move_base_msgs::MoveBaseActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseAction"; }; + const char * getMD5(){ return "70b6aca7c7f7746d8d1609ad94c80bb8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h new file mode 100755 index 0000000..3cf0a9d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_move_base_msgs_MoveBaseActionFeedback_h +#define _ROS_move_base_msgs_MoveBaseActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "move_base_msgs/MoveBaseFeedback.h" + +namespace move_base_msgs +{ + + class MoveBaseActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + move_base_msgs::MoveBaseFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseActionFeedback"; }; + const char * getMD5(){ return "7d1870ff6e0decea702b943b5af0b42e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h new file mode 100755 index 0000000..294089a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_move_base_msgs_MoveBaseActionGoal_h +#define _ROS_move_base_msgs_MoveBaseActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "move_base_msgs/MoveBaseGoal.h" + +namespace move_base_msgs +{ + + class MoveBaseActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + move_base_msgs::MoveBaseGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseActionGoal"; }; + const char * getMD5(){ return "660d6895a1b9a16dce51fbdd9a64a56b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionResult.h new file mode 100755 index 0000000..c9cf6d5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_move_base_msgs_MoveBaseActionResult_h +#define _ROS_move_base_msgs_MoveBaseActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "move_base_msgs/MoveBaseResult.h" + +namespace move_base_msgs +{ + + class MoveBaseActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + move_base_msgs::MoveBaseResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h new file mode 100755 index 0000000..8317fc7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_move_base_msgs_MoveBaseFeedback_h +#define _ROS_move_base_msgs_MoveBaseFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace move_base_msgs +{ + + class MoveBaseFeedback : public ros::Msg + { + public: + geometry_msgs::PoseStamped base_position; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->base_position.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->base_position.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseFeedback"; }; + const char * getMD5(){ return "3fb824c456a757373a226f6d08071bf0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseGoal.h new file mode 100755 index 0000000..fd35621 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_move_base_msgs_MoveBaseGoal_h +#define _ROS_move_base_msgs_MoveBaseGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" + +namespace move_base_msgs +{ + + class MoveBaseGoal : public ros::Msg + { + public: + geometry_msgs::PoseStamped target_pose; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->target_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->target_pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseGoal"; }; + const char * getMD5(){ return "257d089627d7eb7136c24d3593d05a16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseResult.h new file mode 100755 index 0000000..1646f44 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/move_base_msgs/MoveBaseResult.h @@ -0,0 +1,34 @@ +#ifndef _ROS_move_base_msgs_MoveBaseResult_h +#define _ROS_move_base_msgs_MoveBaseResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace move_base_msgs +{ + + class MoveBaseResult : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "move_base_msgs/MoveBaseResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMap.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMap.h new file mode 100755 index 0000000..d97393a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMap.h @@ -0,0 +1,66 @@ +#ifndef _ROS_SERVICE_GetMap_h +#define _ROS_SERVICE_GetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char GETMAP[] = "nav_msgs/GetMap"; + + class GetMapRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapAction.h new file mode 100755 index 0000000..a6f5d52 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_nav_msgs_GetMapAction_h +#define _ROS_nav_msgs_GetMapAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/GetMapActionGoal.h" +#include "nav_msgs/GetMapActionResult.h" +#include "nav_msgs/GetMapActionFeedback.h" + +namespace nav_msgs +{ + + class GetMapAction : public ros::Msg + { + public: + nav_msgs::GetMapActionGoal action_goal; + nav_msgs::GetMapActionResult action_result; + nav_msgs::GetMapActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapAction"; }; + const char * getMD5(){ return "e611ad23fbf237c031b7536416dc7cd7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h new file mode 100755 index 0000000..d523c06 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_nav_msgs_GetMapActionFeedback_h +#define _ROS_nav_msgs_GetMapActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapFeedback.h" + +namespace nav_msgs +{ + + class GetMapActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h new file mode 100755 index 0000000..86c56c4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_nav_msgs_GetMapActionGoal_h +#define _ROS_nav_msgs_GetMapActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "nav_msgs/GetMapGoal.h" + +namespace nav_msgs +{ + + class GetMapActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + nav_msgs::GetMapGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionGoal"; }; + const char * getMD5(){ return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionResult.h new file mode 100755 index 0000000..6bd53f4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_nav_msgs_GetMapActionResult_h +#define _ROS_nav_msgs_GetMapActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapResult.h" + +namespace nav_msgs +{ + + class GetMapActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionResult"; }; + const char * getMD5(){ return "ac66e5b9a79bb4bbd33dab245236c892"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapFeedback.h new file mode 100755 index 0000000..b74c6b0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapFeedback.h @@ -0,0 +1,34 @@ +#ifndef _ROS_nav_msgs_GetMapFeedback_h +#define _ROS_nav_msgs_GetMapFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapFeedback : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapGoal.h new file mode 100755 index 0000000..ffc6fce --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapGoal.h @@ -0,0 +1,34 @@ +#ifndef _ROS_nav_msgs_GetMapGoal_h +#define _ROS_nav_msgs_GetMapGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapGoal : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapGoal"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapResult.h new file mode 100755 index 0000000..9e2774b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetMapResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapResult_h +#define _ROS_nav_msgs_GetMapResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + + class GetMapResult : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapResult"; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetPlan.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetPlan.h new file mode 100755 index 0000000..cfe4970 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GetPlan.h @@ -0,0 +1,95 @@ +#ifndef _ROS_SERVICE_GetPlan_h +#define _ROS_SERVICE_GetPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "nav_msgs/Path.h" + +namespace nav_msgs +{ + +static const char GETPLAN[] = "nav_msgs/GetPlan"; + + class GetPlanRequest : public ros::Msg + { + public: + geometry_msgs::PoseStamped start; + geometry_msgs::PoseStamped goal; + float tolerance; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.real = this->tolerance; + *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tolerance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.base = 0; + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tolerance = u_tolerance.real; + offset += sizeof(this->tolerance); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + nav_msgs::Path plan; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GridCells.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GridCells.h new file mode 100755 index 0000000..1b5b86d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/GridCells.h @@ -0,0 +1,102 @@ +#ifndef _ROS_nav_msgs_GridCells_h +#define _ROS_nav_msgs_GridCells_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace nav_msgs +{ + + class GridCells : public ros::Msg + { + public: + std_msgs::Header header; + float cell_width; + float cell_height; + uint8_t cells_length; + geometry_msgs::Point st_cells; + geometry_msgs::Point * cells; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.real = this->cell_width; + *(outbuffer + offset + 0) = (u_cell_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.real = this->cell_height; + *(outbuffer + offset + 0) = (u_cell_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_height); + *(outbuffer + offset++) = cells_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.base = 0; + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_width = u_cell_width.real; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.base = 0; + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_height = u_cell_height.real; + offset += sizeof(this->cell_height); + uint8_t cells_lengthT = *(inbuffer + offset++); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + cells_length = cells_lengthT; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/GridCells"; }; + const char * getMD5(){ return "b9e4f5df6d28e272ebde00a3994830f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/MapMetaData.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/MapMetaData.h new file mode 100755 index 0000000..2ba8b47 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/MapMetaData.h @@ -0,0 +1,104 @@ +#ifndef _ROS_nav_msgs_MapMetaData_h +#define _ROS_nav_msgs_MapMetaData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "geometry_msgs/Pose.h" + +namespace nav_msgs +{ + + class MapMetaData : public ros::Msg + { + public: + ros::Time map_load_time; + float resolution; + uint32_t width; + uint32_t height; + geometry_msgs::Pose origin; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->map_load_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.sec); + *(outbuffer + offset + 0) = (this->map_load_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.real = this->resolution; + *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->resolution); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + offset += this->origin.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->map_load_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.sec); + this->map_load_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.base = 0; + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->resolution = u_resolution.real; + offset += sizeof(this->resolution); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + offset += this->origin.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/MapMetaData"; }; + const char * getMD5(){ return "10cfc8a2818024d3248802c00c95f11b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/OccupancyGrid.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/OccupancyGrid.h new file mode 100755 index 0000000..be2ac65 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/OccupancyGrid.h @@ -0,0 +1,74 @@ +#ifndef _ROS_nav_msgs_OccupancyGrid_h +#define _ROS_nav_msgs_OccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "nav_msgs/MapMetaData.h" + +namespace nav_msgs +{ + + class OccupancyGrid : public ros::Msg + { + public: + std_msgs::Header header; + nav_msgs::MapMetaData info; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/OccupancyGrid"; }; + const char * getMD5(){ return "3381f2d731d4076ec5c71b0759edbe4e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/Odometry.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/Odometry.h new file mode 100755 index 0000000..2922c53 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/Odometry.h @@ -0,0 +1,61 @@ +#ifndef _ROS_nav_msgs_Odometry_h +#define _ROS_nav_msgs_Odometry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace nav_msgs +{ + + class Odometry : public ros::Msg + { + public: + std_msgs::Header header; + char * child_frame_id; + geometry_msgs::PoseWithCovariance pose; + geometry_msgs::TwistWithCovariance twist; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen( (const char*) this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/Odometry"; }; + const char * getMD5(){ return "cd5e73d190d741a2f92e81eda573aca7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/Path.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/Path.h new file mode 100755 index 0000000..f643237 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nav_msgs/Path.h @@ -0,0 +1,58 @@ +#ifndef _ROS_nav_msgs_Path_h +#define _ROS_nav_msgs_Path_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseStamped.h" + +namespace nav_msgs +{ + + class Path : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::PoseStamped st_poses; + geometry_msgs::PoseStamped * poses; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::PoseStamped)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/Path"; }; + const char * getMD5(){ return "6227e2b7e9cce15051f669a5e197bbf7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletList.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletList.h new file mode 100755 index 0000000..1757a80 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletList.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_NodeletList_h +#define _ROS_SERVICE_NodeletList_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLIST[] = "nodelet/NodeletList"; + + class NodeletListRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodeletListResponse : public ros::Msg + { + public: + uint8_t nodelets_length; + char* st_nodelets; + char* * nodelets; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = nodelets_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_nodeletsi = strlen( (const char*) this->nodelets[i]); + memcpy(outbuffer + offset, &length_nodeletsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->nodelets[i], length_nodeletsi); + offset += length_nodeletsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t nodelets_lengthT = *(inbuffer + offset++); + if(nodelets_lengthT > nodelets_length) + this->nodelets = (char**)realloc(this->nodelets, nodelets_lengthT * sizeof(char*)); + offset += 3; + nodelets_length = nodelets_lengthT; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_st_nodelets; + memcpy(&length_st_nodelets, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_nodelets; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_nodelets-1]=0; + this->st_nodelets = (char *)(inbuffer + offset-1); + offset += length_st_nodelets; + memcpy( &(this->nodelets[i]), &(this->st_nodelets), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "99c7b10e794f5600b8030e697e946ca7"; }; + + }; + + class NodeletList { + public: + typedef NodeletListRequest Request; + typedef NodeletListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletLoad.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletLoad.h new file mode 100755 index 0000000..7a5a060 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletLoad.h @@ -0,0 +1,216 @@ +#ifndef _ROS_SERVICE_NodeletLoad_h +#define _ROS_SERVICE_NodeletLoad_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLOAD[] = "nodelet/NodeletLoad"; + + class NodeletLoadRequest : public ros::Msg + { + public: + char * name; + char * type; + uint8_t remap_source_args_length; + char* st_remap_source_args; + char* * remap_source_args; + uint8_t remap_target_args_length; + char* st_remap_target_args; + char* * remap_target_args; + uint8_t my_argv_length; + char* st_my_argv; + char* * my_argv; + char * bond_id; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen( (const char*) this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = remap_source_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_remap_source_argsi = strlen( (const char*) this->remap_source_args[i]); + memcpy(outbuffer + offset, &length_remap_source_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_source_args[i], length_remap_source_argsi); + offset += length_remap_source_argsi; + } + *(outbuffer + offset++) = remap_target_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_remap_target_argsi = strlen( (const char*) this->remap_target_args[i]); + memcpy(outbuffer + offset, &length_remap_target_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_target_args[i], length_remap_target_argsi); + offset += length_remap_target_argsi; + } + *(outbuffer + offset++) = my_argv_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_my_argvi = strlen( (const char*) this->my_argv[i]); + memcpy(outbuffer + offset, &length_my_argvi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->my_argv[i], length_my_argvi); + offset += length_my_argvi; + } + uint32_t length_bond_id = strlen( (const char*) this->bond_id); + memcpy(outbuffer + offset, &length_bond_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->bond_id, length_bond_id); + offset += length_bond_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t remap_source_args_lengthT = *(inbuffer + offset++); + if(remap_source_args_lengthT > remap_source_args_length) + this->remap_source_args = (char**)realloc(this->remap_source_args, remap_source_args_lengthT * sizeof(char*)); + offset += 3; + remap_source_args_length = remap_source_args_lengthT; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_st_remap_source_args; + memcpy(&length_st_remap_source_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_source_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_source_args-1]=0; + this->st_remap_source_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_source_args; + memcpy( &(this->remap_source_args[i]), &(this->st_remap_source_args), sizeof(char*)); + } + uint8_t remap_target_args_lengthT = *(inbuffer + offset++); + if(remap_target_args_lengthT > remap_target_args_length) + this->remap_target_args = (char**)realloc(this->remap_target_args, remap_target_args_lengthT * sizeof(char*)); + offset += 3; + remap_target_args_length = remap_target_args_lengthT; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_st_remap_target_args; + memcpy(&length_st_remap_target_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_target_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_target_args-1]=0; + this->st_remap_target_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_target_args; + memcpy( &(this->remap_target_args[i]), &(this->st_remap_target_args), sizeof(char*)); + } + uint8_t my_argv_lengthT = *(inbuffer + offset++); + if(my_argv_lengthT > my_argv_length) + this->my_argv = (char**)realloc(this->my_argv, my_argv_lengthT * sizeof(char*)); + offset += 3; + my_argv_length = my_argv_lengthT; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_st_my_argv; + memcpy(&length_st_my_argv, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_my_argv; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_my_argv-1]=0; + this->st_my_argv = (char *)(inbuffer + offset-1); + offset += length_st_my_argv; + memcpy( &(this->my_argv[i]), &(this->st_my_argv), sizeof(char*)); + } + uint32_t length_bond_id; + memcpy(&length_bond_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_bond_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_bond_id-1]=0; + this->bond_id = (char *)(inbuffer + offset-1); + offset += length_bond_id; + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "c6e28cc4d2e259249d96cfb50658fbec"; }; + + }; + + class NodeletLoadResponse : public ros::Msg + { + public: + bool success; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletLoad { + public: + typedef NodeletLoadRequest Request; + typedef NodeletLoadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletUnload.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletUnload.h new file mode 100755 index 0000000..f586b01 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/nodelet/NodeletUnload.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_NodeletUnload_h +#define _ROS_SERVICE_NodeletUnload_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETUNLOAD[] = "nodelet/NodeletUnload"; + + class NodeletUnloadRequest : public ros::Msg + { + public: + char * name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class NodeletUnloadResponse : public ros::Msg + { + public: + bool success; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletUnload { + public: + typedef NodeletUnloadRequest Request; + typedef NodeletUnloadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h new file mode 100755 index 0000000..0edcea2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h @@ -0,0 +1,76 @@ +#ifndef _ROS_pcl_msgs_ModelCoefficients_h +#define _ROS_pcl_msgs_ModelCoefficients_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class ModelCoefficients : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t values_length; + float st_values; + float * values; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/ModelCoefficients"; }; + const char * getMD5(){ return "ca27dea75e72cb894cd36f9e5005e93e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/PointIndices.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/PointIndices.h new file mode 100755 index 0000000..c6b7f52 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/PointIndices.h @@ -0,0 +1,76 @@ +#ifndef _ROS_pcl_msgs_PointIndices_h +#define _ROS_pcl_msgs_PointIndices_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class PointIndices : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t indices_length; + int32_t st_indices; + int32_t * indices; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = indices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_indicesi; + u_indicesi.real = this->indices[i]; + *(outbuffer + offset + 0) = (u_indicesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_indicesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_indicesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_indicesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t indices_lengthT = *(inbuffer + offset++); + if(indices_lengthT > indices_length) + this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t)); + offset += 3; + indices_length = indices_lengthT; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_indices; + u_st_indices.base = 0; + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_indices = u_st_indices.real; + offset += sizeof(this->st_indices); + memcpy( &(this->indices[i]), &(this->st_indices), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PointIndices"; }; + const char * getMD5(){ return "458c7998b7eaf99908256472e273b3d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/PolygonMesh.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/PolygonMesh.h new file mode 100755 index 0000000..4d0d822 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/PolygonMesh.h @@ -0,0 +1,62 @@ +#ifndef _ROS_pcl_msgs_PolygonMesh_h +#define _ROS_pcl_msgs_PolygonMesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" +#include "pcl_msgs/Vertices.h" + +namespace pcl_msgs +{ + + class PolygonMesh : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::PointCloud2 cloud; + uint8_t polygons_length; + pcl_msgs::Vertices st_polygons; + pcl_msgs::Vertices * polygons; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + *(outbuffer + offset++) = polygons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + uint8_t polygons_lengthT = *(inbuffer + offset++); + if(polygons_lengthT > polygons_length) + this->polygons = (pcl_msgs::Vertices*)realloc(this->polygons, polygons_lengthT * sizeof(pcl_msgs::Vertices)); + offset += 3; + polygons_length = polygons_lengthT; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->st_polygons.deserialize(inbuffer + offset); + memcpy( &(this->polygons[i]), &(this->st_polygons), sizeof(pcl_msgs::Vertices)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PolygonMesh"; }; + const char * getMD5(){ return "45a5fc6ad2cde8489600a790acc9a38a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/Vertices.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/Vertices.h new file mode 100755 index 0000000..dd94da5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/pcl_msgs/Vertices.h @@ -0,0 +1,61 @@ +#ifndef _ROS_pcl_msgs_Vertices_h +#define _ROS_pcl_msgs_Vertices_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pcl_msgs +{ + + class Vertices : public ros::Msg + { + public: + uint8_t vertices_length; + uint32_t st_vertices; + uint32_t * vertices; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + this->st_vertices = ((uint32_t) (*(inbuffer + offset))); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_vertices); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/Vertices"; }; + const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/polled_camera/GetPolledImage.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/polled_camera/GetPolledImage.h new file mode 100755 index 0000000..683488f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/polled_camera/GetPolledImage.h @@ -0,0 +1,178 @@ +#ifndef _ROS_SERVICE_GetPolledImage_h +#define _ROS_SERVICE_GetPolledImage_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/RegionOfInterest.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace polled_camera +{ + +static const char GETPOLLEDIMAGE[] = "polled_camera/GetPolledImage"; + + class GetPolledImageRequest : public ros::Msg + { + public: + char * response_namespace; + ros::Duration timeout; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_response_namespace = strlen( (const char*) this->response_namespace); + memcpy(outbuffer + offset, &length_response_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_namespace, length_response_namespace); + offset += length_response_namespace; + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_response_namespace; + memcpy(&length_response_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_namespace-1]=0; + this->response_namespace = (char *)(inbuffer + offset-1); + offset += length_response_namespace; + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "c77ed43e530fd48e9e7a2a93845e154c"; }; + + }; + + class GetPolledImageResponse : public ros::Msg + { + public: + bool success; + char * status_message; + ros::Time stamp; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "dbf1f851bc511800e6129ccd5a3542ab"; }; + + }; + + class GetPolledImage { + public: + typedef GetPolledImageRequest Request; + typedef GetPolledImageResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/robot_pose_ekf/GetStatus.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/robot_pose_ekf/GetStatus.h new file mode 100755 index 0000000..d8abd3c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/robot_pose_ekf/GetStatus.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_GetStatus_h +#define _ROS_SERVICE_GetStatus_h +#include +#include +#include +#include "ros/msg.h" + +namespace robot_pose_ekf +{ + +static const char GETSTATUS[] = "robot_pose_ekf/GetStatus"; + + class GetStatusRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETSTATUS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetStatusResponse : public ros::Msg + { + public: + char * status; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_status = strlen( (const char*) this->status); + memcpy(outbuffer + offset, &length_status, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status, length_status); + offset += length_status; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_status; + memcpy(&length_status, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status-1]=0; + this->status = (char *)(inbuffer + offset-1); + offset += length_status; + return offset; + } + + const char * getType(){ return GETSTATUS; }; + const char * getMD5(){ return "4fe5af303955c287688e7347e9b00278"; }; + + }; + + class GetStatus { + public: + typedef GetStatusRequest Request; + typedef GetStatusResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros.h new file mode 100755 index 0000000..447cf32 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros.h @@ -0,0 +1,58 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_H_ +#define _ROS_H_ + +#include "ros/node_handle.h" +#include "ArduinoHardware.h" + +namespace ros +{ +#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega168__) + /* downsize our buffers */ + typedef NodeHandle_ NodeHandle; + +#elif defined(__AVR_ATmega328P__) + + typedef NodeHandle_ NodeHandle; + +#else + + typedef NodeHandle_ NodeHandle; + +#endif +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/duration.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/duration.h new file mode 100755 index 0000000..ec47bb5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/duration.h @@ -0,0 +1,66 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_DURATION_H_ +#define _ROS_DURATION_H_ + +#include + +namespace ros { + + void normalizeSecNSecSigned(long& sec, long& nsec); + + class Duration + { + public: + long sec, nsec; + + Duration() : sec(0), nsec(0) {} + Duration(long _sec, long _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSecSigned(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (unsigned long) floor(t); nsec = (unsigned long) round((t-sec) * 1e9); }; + + Duration& operator+=(const Duration &rhs); + Duration& operator-=(const Duration &rhs); + Duration& operator*=(double scale); + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/msg.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/msg.h new file mode 100755 index 0000000..41991c6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/msg.h @@ -0,0 +1,52 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_MSG_H_ +#define _ROS_MSG_H_ + +namespace ros { + + /* Base Message Type */ + class Msg + { + public: + virtual int serialize(unsigned char *outbuffer) const = 0; + virtual int deserialize(unsigned char *data) = 0; + virtual const char * getType() = 0; + virtual const char * getMD5() = 0; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/node_handle.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/node_handle.h new file mode 100755 index 0000000..62ab0ba --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/node_handle.h @@ -0,0 +1,537 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_NODE_HANDLE_H_ +#define ROS_NODE_HANDLE_H_ + +#include "std_msgs/Time.h" +#include "rosserial_msgs/TopicInfo.h" +#include "rosserial_msgs/Log.h" +#include "rosserial_msgs/RequestParam.h" + +#define SYNC_SECONDS 5 + +#define MODE_FIRST_FF 0 +/* + * The second sync byte is a protocol version. It's value is 0xff for the first + * version of the rosserial protocol (used up to hydro), 0xfe for the second version + * (introduced in hydro), 0xfd for the next, and so on. Its purpose is to enable + * detection of mismatched protocol versions (e.g. hydro rosserial_python with groovy + * rosserial_arduino. It must be changed in both this file and in + * rosserial_python/src/rosserial_python/SerialClient.py + */ +#define MODE_PROTOCOL_VER 1 +#define PROTOCOL_VER1 0xff // through groovy +#define PROTOCOL_VER2 0xfe // in hydro +#define PROTOCOL_VER PROTOCOL_VER2 +#define MODE_SIZE_L 2 +#define MODE_SIZE_H 3 +#define MODE_SIZE_CHECKSUM 4 // checksum for msg size received from size L and H +#define MODE_TOPIC_L 5 // waiting for topic id +#define MODE_TOPIC_H 6 +#define MODE_MESSAGE 7 +#define MODE_MSG_CHECKSUM 8 // checksum for msg and topic id + + +#define MSG_TIMEOUT 20 //20 milliseconds to recieve all of message data + +#define ID_TX_STOP 11 //hardcode for hydro version + +#include "msg.h" + +namespace ros { + + class NodeHandleBase_{ + public: + virtual int publish(int id, const Msg* msg)=0; + virtual int spinOnce()=0; + virtual bool connected()=0; + }; +} + +#include "publisher.h" +#include "subscriber.h" +#include "service_server.h" +#include "service_client.h" + +namespace ros { + + using rosserial_msgs::TopicInfo; + + /* Node Handle */ + template + class NodeHandle_ : public NodeHandleBase_ + { + protected: + Hardware hardware_; + + /* time used for syncing */ + unsigned long rt_time; + + /* used for computing current time */ + unsigned long sec_offset, nsec_offset; + + unsigned char message_in[INPUT_SIZE]; + unsigned char message_out[OUTPUT_SIZE]; + + Publisher * publishers[MAX_PUBLISHERS]; + Subscriber_ * subscribers[MAX_SUBSCRIBERS]; + + /* + * Setup Functions + */ + public: + NodeHandle_() : configured_(false) { + + for(unsigned int i=0; i< MAX_PUBLISHERS; i++) + publishers[i] = 0; + + for(unsigned int i=0; i< MAX_SUBSCRIBERS; i++) + subscribers[i] = 0; + + for(unsigned int i=0; i< INPUT_SIZE; i++) + message_in[i] = 0; + + for(unsigned int i=0; i< OUTPUT_SIZE; i++) + message_out[i] = 0; + + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + req_param_resp.floats_length = 0; + req_param_resp.floats = NULL; + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + } + + Hardware* getHardware(){ + return &hardware_; + } + + /* Start serial, initialize buffers */ + void initNode(){ + hardware_.init(); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + /* Start a named port, which may be network server IP, initialize buffers */ + void initNode(char *portName){ + hardware_.init(portName); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + protected: + //State machine variables for spinOnce + int mode_; + int bytes_; + int topic_; + int index_; + int checksum_; + + bool configured_; + + /* used for syncing the time */ + unsigned long last_sync_time; + unsigned long last_sync_receive_time; + unsigned long last_msg_timeout_time; + + public: + /* This function goes in your loop() function, it handles + * serial input and callbacks for subscribers. + */ + + + virtual int spinOnce(){ + + /* restart if timed out */ + unsigned long c_time = hardware_.time(); + if( (c_time - last_sync_receive_time) > (SYNC_SECONDS*2200) ){ + configured_ = false; + } + + /* reset if message has timed out */ + if ( mode_ != MODE_FIRST_FF){ + if (c_time > last_msg_timeout_time){ + mode_ = MODE_FIRST_FF; + } + } + + /* while available buffer, read data */ + while( true ) + { + int data = hardware_.read(); + if( data < 0 ) + break; + checksum_ += data; + if( mode_ == MODE_MESSAGE ){ /* message data being recieved */ + message_in[index_++] = data; + bytes_--; + if(bytes_ == 0) /* is message complete? if so, checksum */ + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_FIRST_FF ){ + if(data == 0xff){ + mode_++; + last_msg_timeout_time = c_time + MSG_TIMEOUT; + } + }else if( mode_ == MODE_PROTOCOL_VER ){ + if(data == PROTOCOL_VER){ + mode_++; + }else{ + mode_ = MODE_FIRST_FF; + if (configured_ == false) + requestSyncTime(); /* send a msg back showing our protocol version */ + } + }else if( mode_ == MODE_SIZE_L ){ /* bottom half of message size */ + bytes_ = data; + index_ = 0; + mode_++; + checksum_ = data; /* first byte for calculating size checksum */ + }else if( mode_ == MODE_SIZE_H ){ /* top half of message size */ + bytes_ += data<<8; + mode_++; + }else if( mode_ == MODE_SIZE_CHECKSUM ){ + if( (checksum_%256) == 255) + mode_++; + else + mode_ = MODE_FIRST_FF; /* Abandon the frame if the msg len is wrong */ + }else if( mode_ == MODE_TOPIC_L ){ /* bottom half of topic id */ + topic_ = data; + mode_++; + checksum_ = data; /* first byte included in checksum */ + }else if( mode_ == MODE_TOPIC_H ){ /* top half of topic id */ + topic_ += data<<8; + mode_ = MODE_MESSAGE; + if(bytes_ == 0) + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_MSG_CHECKSUM ){ /* do checksum */ + mode_ = MODE_FIRST_FF; + if( (checksum_%256) == 255){ + if(topic_ == TopicInfo::ID_PUBLISHER){ + requestSyncTime(); + negotiateTopics(); + last_sync_time = c_time; + last_sync_receive_time = c_time; + return -1; + }else if(topic_ == TopicInfo::ID_TIME){ + syncTime(message_in); + }else if (topic_ == TopicInfo::ID_PARAMETER_REQUEST){ + req_param_resp.deserialize(message_in); + param_recieved= true; + }else if(topic_ == ID_TX_STOP){ + configured_ = false; + }else{ + if(subscribers[topic_-100]) + subscribers[topic_-100]->callback( message_in ); + } + } + } + } + + /* occasionally sync time */ + if( configured_ && ((c_time-last_sync_time) > (SYNC_SECONDS*500) )){ + requestSyncTime(); + last_sync_time = c_time; + } + + return 0; + } + + + /* Are we connected to the PC? */ + virtual bool connected() { + return configured_; + }; + + /******************************************************************** + * Time functions + */ + + void requestSyncTime() + { + std_msgs::Time t; + publish(TopicInfo::ID_TIME, &t); + rt_time = hardware_.time(); + } + + void syncTime( unsigned char * data ) + { + std_msgs::Time t; + unsigned long offset = hardware_.time() - rt_time; + + t.deserialize(data); + t.data.sec += offset/1000; + t.data.nsec += (offset%1000)*1000000UL; + + this->setNow(t.data); + last_sync_receive_time = hardware_.time(); + } + + Time now(){ + unsigned long ms = hardware_.time(); + Time current_time; + current_time.sec = ms/1000 + sec_offset; + current_time.nsec = (ms%1000)*1000000UL + nsec_offset; + normalizeSecNSec(current_time.sec, current_time.nsec); + return current_time; + } + + void setNow( Time & new_now ) + { + unsigned long ms = hardware_.time(); + sec_offset = new_now.sec - ms/1000 - 1; + nsec_offset = new_now.nsec - (ms%1000)*1000000UL + 1000000000UL; + normalizeSecNSec(sec_offset, nsec_offset); + } + + /******************************************************************** + * Topic Management + */ + + /* Register a new publisher */ + bool advertise(Publisher & p) + { + for(int i = 0; i < MAX_PUBLISHERS; i++){ + if(publishers[i] == 0){ // empty slot + publishers[i] = &p; + p.id_ = i+100+MAX_SUBSCRIBERS; + p.nh_ = this; + return true; + } + } + return false; + } + + /* Register a new subscriber */ + template + bool subscribe(Subscriber< MsgT> & s){ + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &s; + s.id_ = i+100; + return true; + } + } + return false; + } + + /* Register a new Service Server */ + template + bool advertiseService(ServiceServer& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + /* Register a new Service Client */ + template + bool serviceClient(ServiceClient& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + void negotiateTopics() + { + rosserial_msgs::TopicInfo ti; + int i; + for(i = 0; i < MAX_PUBLISHERS; i++) + { + if(publishers[i] != 0) // non-empty slot + { + ti.topic_id = publishers[i]->id_; + ti.topic_name = (char *) publishers[i]->topic_; + ti.message_type = (char *) publishers[i]->msg_->getType(); + ti.md5sum = (char *) publishers[i]->msg_->getMD5(); + ti.buffer_size = OUTPUT_SIZE; + publish( publishers[i]->getEndpointType(), &ti ); + } + } + for(i = 0; i < MAX_SUBSCRIBERS; i++) + { + if(subscribers[i] != 0) // non-empty slot + { + ti.topic_id = subscribers[i]->id_; + ti.topic_name = (char *) subscribers[i]->topic_; + ti.message_type = (char *) subscribers[i]->getMsgType(); + ti.md5sum = (char *) subscribers[i]->getMsgMD5(); + ti.buffer_size = INPUT_SIZE; + publish( subscribers[i]->getEndpointType(), &ti ); + } + } + configured_ = true; + } + + virtual int publish(int id, const Msg * msg) + { + if(id >= 100 && !configured_) + return 0; + + /* serialize message */ + unsigned int l = msg->serialize(message_out+7); + + /* setup the header */ + message_out[0] = 0xff; + message_out[1] = PROTOCOL_VER; + message_out[2] = (unsigned char) ((unsigned int)l&255); + message_out[3] = (unsigned char) ((unsigned int)l>>8); + message_out[4] = 255 - ((message_out[2] + message_out[3])%256); + message_out[5] = (unsigned char) ((int)id&255); + message_out[6] = (unsigned char) ((int)id>>8); + + /* calculate checksum */ + int chk = 0; + for(int i =5; i end_time) return false; + } + return true; + } + + public: + bool getParam(const char* name, int* param, int length =1){ + if (requestParam(name) ){ + if (length == req_param_resp.ints_length){ + //copy it over + for(int i=0; ipublish(id_, msg); }; + int getEndpointType(){ return endpoint_; } + + const char * topic_; + Msg *msg_; + // id_ and no_ are set by NodeHandle when we advertise + int id_; + NodeHandleBase_* nh_; + + private: + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/service_client.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/service_client.h new file mode 100755 index 0000000..06522f2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/service_client.h @@ -0,0 +1,83 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_CLIENT_H_ +#define _ROS_SERVICE_CLIENT_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceClient : public Subscriber_ { + public: + ServiceClient(const char* topic_name) : + pub(topic_name, &req, rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->waiting = true; + } + + virtual void call(const MReq & request, MRes & response) + { + if(!pub.nh_->connected()) return; + ret = &response; + waiting = true; + pub.publish(&request); + while(waiting && pub.nh_->connected()) + if(pub.nh_->spinOnce() < 0) break; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + ret->deserialize(data); + waiting = false; + } + virtual const char * getMsgType(){ return this->resp.getType(); } + virtual const char * getMsgMD5(){ return this->resp.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + MRes * ret; + bool waiting; + Publisher pub; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/service_server.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/service_server.h new file mode 100755 index 0000000..67a3e0a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/service_server.h @@ -0,0 +1,76 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_SERVER_H_ +#define _ROS_SERVICE_SERVER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceServer : public Subscriber_ { + public: + typedef void(*CallbackT)(const MReq&, MRes&); + + ServiceServer(const char* topic_name, CallbackT cb) : + pub(topic_name, &resp, rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->cb_ = cb; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + req.deserialize(data); + cb_(req,resp); + pub.publish(&resp); + } + virtual const char * getMsgType(){ return this->req.getType(); } + virtual const char * getMsgMD5(){ return this->req.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + Publisher pub; + private: + CallbackT cb_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/subscriber.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/subscriber.h new file mode 100755 index 0000000..5464646 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/subscriber.h @@ -0,0 +1,88 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_SUBSCRIBER_H_ +#define ROS_SUBSCRIBER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +namespace ros { + + /* Base class for objects subscribers. */ + class Subscriber_ + { + public: + virtual void callback(unsigned char *data)=0; + virtual int getEndpointType()=0; + + // id_ is set by NodeHandle when we advertise + int id_; + + virtual const char * getMsgType()=0; + virtual const char * getMsgMD5()=0; + const char * topic_; + }; + + + /* Actual subscriber, templated on message type. */ + template + class Subscriber: public Subscriber_{ + public: + typedef void(*CallbackT)(const MsgT&); + MsgT msg; + + Subscriber(const char * topic_name, CallbackT cb, int endpoint=rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : + cb_(cb), + endpoint_(endpoint) + { + topic_ = topic_name; + }; + + virtual void callback(unsigned char* data){ + msg.deserialize(data); + this->cb_(msg); + } + + virtual const char * getMsgType(){ return this->msg.getType(); } + virtual const char * getMsgMD5(){ return this->msg.getMD5(); } + virtual int getEndpointType(){ return endpoint_; } + + private: + CallbackT cb_; + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/time.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/time.h new file mode 100755 index 0000000..602fbdb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/ros/time.h @@ -0,0 +1,71 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TIME_H_ +#define ROS_TIME_H_ + +#include +#include + +namespace ros +{ + void normalizeSecNSec(unsigned long &sec, unsigned long &nsec); + + class Time + { + public: + unsigned long sec, nsec; + + Time() : sec(0), nsec(0) {} + Time(unsigned long _sec, unsigned long _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSec(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (unsigned long) floor(t); nsec = (unsigned long) round((t-sec) * 1e9); }; + + unsigned long toNsec() { return (unsigned long)sec*1000000000ull + (unsigned long)nsec; }; + Time& fromNSec(long t); + + Time& operator +=(const Duration &rhs); + Time& operator -=(const Duration &rhs); + + static Time now(); + static void setNow( Time & new_now); + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/Empty.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/Empty.h new file mode 100755 index 0000000..6df3c92 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/Empty.h @@ -0,0 +1,62 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char EMPTY[] = "roscpp/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/GetLoggers.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/GetLoggers.h new file mode 100755 index 0000000..eac80c5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/GetLoggers.h @@ -0,0 +1,82 @@ +#ifndef _ROS_SERVICE_GetLoggers_h +#define _ROS_SERVICE_GetLoggers_h +#include +#include +#include +#include "ros/msg.h" +#include "roscpp/Logger.h" + +namespace roscpp +{ + +static const char GETLOGGERS[] = "roscpp/GetLoggers"; + + class GetLoggersRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetLoggersResponse : public ros::Msg + { + public: + uint8_t loggers_length; + roscpp::Logger st_loggers; + roscpp::Logger * loggers; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = loggers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->loggers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t loggers_lengthT = *(inbuffer + offset++); + if(loggers_lengthT > loggers_length) + this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger)); + offset += 3; + loggers_length = loggers_lengthT; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->st_loggers.deserialize(inbuffer + offset); + memcpy( &(this->loggers[i]), &(this->st_loggers), sizeof(roscpp::Logger)); + } + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "32e97e85527d4678a8f9279894bb64b0"; }; + + }; + + class GetLoggers { + public: + typedef GetLoggersRequest Request; + typedef GetLoggersResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/Logger.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/Logger.h new file mode 100755 index 0000000..fc2e0fc --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/Logger.h @@ -0,0 +1,64 @@ +#ifndef _ROS_roscpp_Logger_h +#define _ROS_roscpp_Logger_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + + class Logger : public ros::Msg + { + public: + char * name; + char * level; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_level = strlen( (const char*) this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return "roscpp/Logger"; }; + const char * getMD5(){ return "a6069a2ff40db7bd32143dd66e1f408e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/SetLoggerLevel.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/SetLoggerLevel.h new file mode 100755 index 0000000..962433a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp/SetLoggerLevel.h @@ -0,0 +1,92 @@ +#ifndef _ROS_SERVICE_SetLoggerLevel_h +#define _ROS_SERVICE_SetLoggerLevel_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; + + class SetLoggerLevelRequest : public ros::Msg + { + public: + char * logger; + char * level; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_logger = strlen( (const char*) this->logger); + memcpy(outbuffer + offset, &length_logger, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->logger, length_logger); + offset += length_logger; + uint32_t length_level = strlen( (const char*) this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_logger; + memcpy(&length_logger, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_logger; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_logger-1]=0; + this->logger = (char *)(inbuffer + offset-1); + offset += length_logger; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp_tutorials/TwoInts.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp_tutorials/TwoInts.h new file mode 100755 index 0000000..f0b947e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/roscpp_tutorials/TwoInts.h @@ -0,0 +1,152 @@ +#ifndef _ROS_SERVICE_TwoInts_h +#define _ROS_SERVICE_TwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp_tutorials +{ + +static const char TWOINTS[] = "roscpp_tutorials/TwoInts"; + + class TwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class TwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class TwoInts { + public: + typedef TwoIntsRequest Request; + typedef TwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosgraph_msgs/Clock.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosgraph_msgs/Clock.h new file mode 100755 index 0000000..165dd6b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosgraph_msgs/Clock.h @@ -0,0 +1,56 @@ +#ifndef _ROS_rosgraph_msgs_Clock_h +#define _ROS_rosgraph_msgs_Clock_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosgraph_msgs +{ + + class Clock : public ros::Msg + { + public: + ros::Time clock; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.sec); + *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->clock.sec = ((uint32_t) (*(inbuffer + offset))); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.sec); + this->clock.nsec = ((uint32_t) (*(inbuffer + offset))); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Clock"; }; + const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosgraph_msgs/Log.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosgraph_msgs/Log.h new file mode 100755 index 0000000..f159be8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosgraph_msgs/Log.h @@ -0,0 +1,161 @@ +#ifndef _ROS_rosgraph_msgs_Log_h +#define _ROS_rosgraph_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rosgraph_msgs +{ + + class Log : public ros::Msg + { + public: + std_msgs::Header header; + int8_t level; + char * name; + char * msg; + char * file; + char * function; + uint32_t line; + uint8_t topics_length; + char* st_topics; + char* * topics; + enum { DEBUG = 1 }; + enum { INFO = 2 }; + enum { WARN = 4 }; + enum { ERROR = 8 }; + enum { FATAL = 16 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_msg = strlen( (const char*) this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + uint32_t length_file = strlen( (const char*) this->file); + memcpy(outbuffer + offset, &length_file, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->file, length_file); + offset += length_file; + uint32_t length_function = strlen( (const char*) this->function); + memcpy(outbuffer + offset, &length_function, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->function, length_function); + offset += length_function; + *(outbuffer + offset + 0) = (this->line >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->line >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->line >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->line >> (8 * 3)) & 0xFF; + offset += sizeof(this->line); + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen( (const char*) this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + uint32_t length_file; + memcpy(&length_file, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file-1]=0; + this->file = (char *)(inbuffer + offset-1); + offset += length_file; + uint32_t length_function; + memcpy(&length_function, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_function; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_function-1]=0; + this->function = (char *)(inbuffer + offset-1); + offset += length_function; + this->line = ((uint32_t) (*(inbuffer + offset))); + this->line |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->line |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->line |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->line); + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Log"; }; + const char * getMD5(){ return "acffd30cd6b6de30f120938c17c593fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h new file mode 100755 index 0000000..8a4a033 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h @@ -0,0 +1,152 @@ +#ifndef _ROS_SERVICE_AddTwoInts_h +#define _ROS_SERVICE_AddTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char ADDTWOINTS[] = "rospy_tutorials/AddTwoInts"; + + class AddTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class AddTwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class AddTwoInts { + public: + typedef AddTwoIntsRequest Request; + typedef AddTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h new file mode 100755 index 0000000..8c382f6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h @@ -0,0 +1,136 @@ +#ifndef _ROS_SERVICE_BadTwoInts_h +#define _ROS_SERVICE_BadTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char BADTWOINTS[] = "rospy_tutorials/BadTwoInts"; + + class BadTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int32_t b; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "29bb5c7dea8bf822f53e94b0ee5a3a56"; }; + + }; + + class BadTwoIntsResponse : public ros::Msg + { + public: + int32_t sum; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "0ba699c25c9418c0366f3595c0c8e8ec"; }; + + }; + + class BadTwoInts { + public: + typedef BadTwoIntsRequest Request; + typedef BadTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/Floats.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/Floats.h new file mode 100755 index 0000000..654f3f0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/Floats.h @@ -0,0 +1,72 @@ +#ifndef _ROS_rospy_tutorials_Floats_h +#define _ROS_rospy_tutorials_Floats_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + + class Floats : public ros::Msg + { + public: + uint8_t data_length; + float st_data; + float * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "rospy_tutorials/Floats"; }; + const char * getMD5(){ return "420cd38b6b071cd49f2970c3e2cee511"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/HeaderString.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/HeaderString.h new file mode 100755 index 0000000..d8ef4eb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rospy_tutorials/HeaderString.h @@ -0,0 +1,53 @@ +#ifndef _ROS_rospy_tutorials_HeaderString_h +#define _ROS_rospy_tutorials_HeaderString_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rospy_tutorials +{ + + class HeaderString : public ros::Msg + { + public: + std_msgs::Header header; + char * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_data = strlen( (const char*) this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "rospy_tutorials/HeaderString"; }; + const char * getMD5(){ return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_arduino/Adc.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_arduino/Adc.h new file mode 100755 index 0000000..2a2ea0b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_arduino/Adc.h @@ -0,0 +1,76 @@ +#ifndef _ROS_rosserial_arduino_Adc_h +#define _ROS_rosserial_arduino_Adc_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + + class Adc : public ros::Msg + { + public: + uint16_t adc0; + uint16_t adc1; + uint16_t adc2; + uint16_t adc3; + uint16_t adc4; + uint16_t adc5; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->adc0 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc0 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc0); + *(outbuffer + offset + 0) = (this->adc1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc1 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc1); + *(outbuffer + offset + 0) = (this->adc2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc2 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc2); + *(outbuffer + offset + 0) = (this->adc3 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc3 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc3); + *(outbuffer + offset + 0) = (this->adc4 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc4 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc4); + *(outbuffer + offset + 0) = (this->adc5 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc5 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc5); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->adc0 = ((uint16_t) (*(inbuffer + offset))); + this->adc0 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc0); + this->adc1 = ((uint16_t) (*(inbuffer + offset))); + this->adc1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc1); + this->adc2 = ((uint16_t) (*(inbuffer + offset))); + this->adc2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc2); + this->adc3 = ((uint16_t) (*(inbuffer + offset))); + this->adc3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc3); + this->adc4 = ((uint16_t) (*(inbuffer + offset))); + this->adc4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc4); + this->adc5 = ((uint16_t) (*(inbuffer + offset))); + this->adc5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc5); + return offset; + } + + const char * getType(){ return "rosserial_arduino/Adc"; }; + const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_arduino/Test.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_arduino/Test.h new file mode 100755 index 0000000..f271a34 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_arduino/Test.h @@ -0,0 +1,92 @@ +#ifndef _ROS_SERVICE_Test_h +#define _ROS_SERVICE_Test_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + +static const char TEST[] = "rosserial_arduino/Test"; + + class TestRequest : public ros::Msg + { + public: + char * input; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_input = strlen( (const char*) this->input); + memcpy(outbuffer + offset, &length_input, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->input, length_input); + offset += length_input; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_input; + memcpy(&length_input, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_input; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_input-1]=0; + this->input = (char *)(inbuffer + offset-1); + offset += length_input; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "39e92f1778057359c64c7b8a7d7b19de"; }; + + }; + + class TestResponse : public ros::Msg + { + public: + char * output; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_output = strlen( (const char*) this->output); + memcpy(outbuffer + offset, &length_output, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_output; + memcpy(&length_output, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_output; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_output-1]=0; + this->output = (char *)(inbuffer + offset-1); + offset += length_output; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class Test { + public: + typedef TestRequest Request; + typedef TestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/Log.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/Log.h new file mode 100755 index 0000000..9356b52 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/Log.h @@ -0,0 +1,59 @@ +#ifndef _ROS_rosserial_msgs_Log_h +#define _ROS_rosserial_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class Log : public ros::Msg + { + public: + uint8_t level; + char * msg; + enum { ROSDEBUG = 0 }; + enum { INFO = 1 }; + enum { WARN = 2 }; + enum { ERROR = 3 }; + enum { FATAL = 4 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_msg = strlen( (const char*) this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->level = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->level); + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + return offset; + } + + const char * getType(){ return "rosserial_msgs/Log"; }; + const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h new file mode 100755 index 0000000..df10fdf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_RequestMessageInfo_h +#define _ROS_SERVICE_RequestMessageInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo"; + + class RequestMessageInfoRequest : public ros::Msg + { + public: + char * type; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_type = strlen( (const char*) this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class RequestMessageInfoResponse : public ros::Msg + { + public: + char * md5; + char * definition; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_md5 = strlen( (const char*) this->md5); + memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5, length_md5); + offset += length_md5; + uint32_t length_definition = strlen( (const char*) this->definition); + memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->definition, length_definition); + offset += length_definition; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_md5; + memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5-1]=0; + this->md5 = (char *)(inbuffer + offset-1); + offset += length_md5; + uint32_t length_definition; + memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_definition; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_definition-1]=0; + this->definition = (char *)(inbuffer + offset-1); + offset += length_definition; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; }; + + }; + + class RequestMessageInfo { + public: + typedef RequestMessageInfoRequest Request; + typedef RequestMessageInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/RequestParam.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/RequestParam.h new file mode 100755 index 0000000..ff76cd8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/RequestParam.h @@ -0,0 +1,184 @@ +#ifndef _ROS_SERVICE_RequestParam_h +#define _ROS_SERVICE_RequestParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTPARAM[] = "rosserial_msgs/RequestParam"; + + class RequestParamRequest : public ros::Msg + { + public: + char * name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class RequestParamResponse : public ros::Msg + { + public: + uint8_t ints_length; + int32_t st_ints; + int32_t * ints; + uint8_t floats_length; + float st_floats; + float * floats; + uint8_t strings_length; + char* st_strings; + char* * strings; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_intsi; + u_intsi.real = this->ints[i]; + *(outbuffer + offset + 0) = (u_intsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints[i]); + } + *(outbuffer + offset++) = floats_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_floatsi; + u_floatsi.real = this->floats[i]; + *(outbuffer + offset + 0) = (u_floatsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_floatsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_floatsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_floatsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats[i]); + } + *(outbuffer + offset++) = strings_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_stringsi = strlen( (const char*) this->strings[i]); + memcpy(outbuffer + offset, &length_stringsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->strings[i], length_stringsi); + offset += length_stringsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (int32_t*)realloc(this->ints, ints_lengthT * sizeof(int32_t)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ints; + u_st_ints.base = 0; + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ints = u_st_ints.real; + offset += sizeof(this->st_ints); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(int32_t)); + } + uint8_t floats_lengthT = *(inbuffer + offset++); + if(floats_lengthT > floats_length) + this->floats = (float*)realloc(this->floats, floats_lengthT * sizeof(float)); + offset += 3; + floats_length = floats_lengthT; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_st_floats; + u_st_floats.base = 0; + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_floats = u_st_floats.real; + offset += sizeof(this->st_floats); + memcpy( &(this->floats[i]), &(this->st_floats), sizeof(float)); + } + uint8_t strings_lengthT = *(inbuffer + offset++); + if(strings_lengthT > strings_length) + this->strings = (char**)realloc(this->strings, strings_lengthT * sizeof(char*)); + offset += 3; + strings_length = strings_lengthT; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_st_strings; + memcpy(&length_st_strings, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_strings; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_strings-1]=0; + this->st_strings = (char *)(inbuffer + offset-1); + offset += length_st_strings; + memcpy( &(this->strings[i]), &(this->st_strings), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "9f0e98bda65981986ddf53afa7a40e49"; }; + + }; + + class RequestParam { + public: + typedef RequestParamRequest Request; + typedef RequestParamResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/TopicInfo.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/TopicInfo.h new file mode 100755 index 0000000..34caf52 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/rosserial_msgs/TopicInfo.h @@ -0,0 +1,115 @@ +#ifndef _ROS_rosserial_msgs_TopicInfo_h +#define _ROS_rosserial_msgs_TopicInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class TopicInfo : public ros::Msg + { + public: + uint16_t topic_id; + char * topic_name; + char * message_type; + char * md5sum; + int32_t buffer_size; + enum { ID_PUBLISHER = 0 }; + enum { ID_SUBSCRIBER = 1 }; + enum { ID_SERVICE_SERVER = 2 }; + enum { ID_SERVICE_CLIENT = 4 }; + enum { ID_PARAMETER_REQUEST = 6 }; + enum { ID_LOG = 7 }; + enum { ID_TIME = 10 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topic_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topic_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->topic_id); + uint32_t length_topic_name = strlen( (const char*) this->topic_name); + memcpy(outbuffer + offset, &length_topic_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic_name, length_topic_name); + offset += length_topic_name; + uint32_t length_message_type = strlen( (const char*) this->message_type); + memcpy(outbuffer + offset, &length_message_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message_type, length_message_type); + offset += length_message_type; + uint32_t length_md5sum = strlen( (const char*) this->md5sum); + memcpy(outbuffer + offset, &length_md5sum, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5sum, length_md5sum); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.real = this->buffer_size; + *(outbuffer + offset + 0) = (u_buffer_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buffer_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buffer_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buffer_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buffer_size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->topic_id = ((uint16_t) (*(inbuffer + offset))); + this->topic_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->topic_id); + uint32_t length_topic_name; + memcpy(&length_topic_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic_name-1]=0; + this->topic_name = (char *)(inbuffer + offset-1); + offset += length_topic_name; + uint32_t length_message_type; + memcpy(&length_message_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_type-1]=0; + this->message_type = (char *)(inbuffer + offset-1); + offset += length_message_type; + uint32_t length_md5sum; + memcpy(&length_md5sum, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5sum; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5sum-1]=0; + this->md5sum = (char *)(inbuffer + offset-1); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.base = 0; + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->buffer_size = u_buffer_size.real; + offset += sizeof(this->buffer_size); + return offset; + } + + const char * getType(){ return "rosserial_msgs/TopicInfo"; }; + const char * getMD5(){ return "0ad51f88fc44892f8c10684077646005"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/CameraInfo.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/CameraInfo.h new file mode 100755 index 0000000..3e70791 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/CameraInfo.h @@ -0,0 +1,239 @@ +#ifndef _ROS_sensor_msgs_CameraInfo_h +#define _ROS_sensor_msgs_CameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace sensor_msgs +{ + + class CameraInfo : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + char * distortion_model; + uint8_t D_length; + float st_D; + float * D; + float K[9]; + float R[9]; + float P[12]; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_distortion_model = strlen( (const char*) this->distortion_model); + memcpy(outbuffer + offset, &length_distortion_model, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->distortion_model, length_distortion_model); + offset += length_distortion_model; + *(outbuffer + offset++) = D_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < D_length; i++){ + int32_t * val_Di = (int32_t *) &(this->D[i]); + int32_t exp_Di = (((*val_Di)>>23)&255); + if(exp_Di != 0) + exp_Di += 1023-127; + int32_t sig_Di = *val_Di; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_Di<<5) & 0xff; + *(outbuffer + offset++) = (sig_Di>>3) & 0xff; + *(outbuffer + offset++) = (sig_Di>>11) & 0xff; + *(outbuffer + offset++) = ((exp_Di<<4) & 0xF0) | ((sig_Di>>19)&0x0F); + *(outbuffer + offset++) = (exp_Di>>4) & 0x7F; + if(this->D[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + unsigned char * K_val = (unsigned char *) this->K; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_Ki = (int32_t *) &(this->K[i]); + int32_t exp_Ki = (((*val_Ki)>>23)&255); + if(exp_Ki != 0) + exp_Ki += 1023-127; + int32_t sig_Ki = *val_Ki; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_Ki<<5) & 0xff; + *(outbuffer + offset++) = (sig_Ki>>3) & 0xff; + *(outbuffer + offset++) = (sig_Ki>>11) & 0xff; + *(outbuffer + offset++) = ((exp_Ki<<4) & 0xF0) | ((sig_Ki>>19)&0x0F); + *(outbuffer + offset++) = (exp_Ki>>4) & 0x7F; + if(this->K[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + unsigned char * R_val = (unsigned char *) this->R; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_Ri = (int32_t *) &(this->R[i]); + int32_t exp_Ri = (((*val_Ri)>>23)&255); + if(exp_Ri != 0) + exp_Ri += 1023-127; + int32_t sig_Ri = *val_Ri; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_Ri<<5) & 0xff; + *(outbuffer + offset++) = (sig_Ri>>3) & 0xff; + *(outbuffer + offset++) = (sig_Ri>>11) & 0xff; + *(outbuffer + offset++) = ((exp_Ri<<4) & 0xF0) | ((sig_Ri>>19)&0x0F); + *(outbuffer + offset++) = (exp_Ri>>4) & 0x7F; + if(this->R[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + unsigned char * P_val = (unsigned char *) this->P; + for( uint8_t i = 0; i < 12; i++){ + int32_t * val_Pi = (int32_t *) &(this->P[i]); + int32_t exp_Pi = (((*val_Pi)>>23)&255); + if(exp_Pi != 0) + exp_Pi += 1023-127; + int32_t sig_Pi = *val_Pi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_Pi<<5) & 0xff; + *(outbuffer + offset++) = (sig_Pi>>3) & 0xff; + *(outbuffer + offset++) = (sig_Pi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_Pi<<4) & 0xF0) | ((sig_Pi>>19)&0x0F); + *(outbuffer + offset++) = (exp_Pi>>4) & 0x7F; + if(this->P[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_distortion_model; + memcpy(&length_distortion_model, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_distortion_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_distortion_model-1]=0; + this->distortion_model = (char *)(inbuffer + offset-1); + offset += length_distortion_model; + uint8_t D_lengthT = *(inbuffer + offset++); + if(D_lengthT > D_length) + this->D = (float*)realloc(this->D, D_lengthT * sizeof(float)); + offset += 3; + D_length = D_lengthT; + for( uint8_t i = 0; i < D_length; i++){ + uint32_t * val_st_D = (uint32_t*) &(this->st_D); + offset += 3; + *val_st_D = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_D |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_D |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_D |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_D = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_D |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_D !=0) + *val_st_D |= ((exp_st_D)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_D = -this->st_D; + memcpy( &(this->D[i]), &(this->st_D), sizeof(float)); + } + uint8_t * K_val = (uint8_t*) this->K; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_Ki = (uint32_t*) &(this->K[i]); + offset += 3; + *val_Ki = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_Ki |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_Ki |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_Ki |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_Ki = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_Ki |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_Ki !=0) + *val_Ki |= ((exp_Ki)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->K[i] = -this->K[i]; + } + uint8_t * R_val = (uint8_t*) this->R; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_Ri = (uint32_t*) &(this->R[i]); + offset += 3; + *val_Ri = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_Ri |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_Ri |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_Ri |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_Ri = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_Ri |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_Ri !=0) + *val_Ri |= ((exp_Ri)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->R[i] = -this->R[i]; + } + uint8_t * P_val = (uint8_t*) this->P; + for( uint8_t i = 0; i < 12; i++){ + uint32_t * val_Pi = (uint32_t*) &(this->P[i]); + offset += 3; + *val_Pi = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_Pi |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_Pi |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_Pi |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_Pi = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_Pi |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_Pi !=0) + *val_Pi |= ((exp_Pi)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->P[i] = -this->P[i]; + } + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "sensor_msgs/CameraInfo"; }; + const char * getMD5(){ return "c9a58c1b0b154e0e6da7578cb991d214"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h new file mode 100755 index 0000000..de0fa4d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h @@ -0,0 +1,87 @@ +#ifndef _ROS_sensor_msgs_ChannelFloat32_h +#define _ROS_sensor_msgs_ChannelFloat32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class ChannelFloat32 : public ros::Msg + { + public: + char * name; + uint8_t values_length; + float st_values; + float * values; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/ChannelFloat32"; }; + const char * getMD5(){ return "3d40139cdd33dfedcb71ffeeeb42ae7f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/CompressedImage.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/CompressedImage.h new file mode 100755 index 0000000..f4c79e1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/CompressedImage.h @@ -0,0 +1,74 @@ +#ifndef _ROS_sensor_msgs_CompressedImage_h +#define _ROS_sensor_msgs_CompressedImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class CompressedImage : public ros::Msg + { + public: + std_msgs::Header header; + char * format; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_format = strlen( (const char*) this->format); + memcpy(outbuffer + offset, &length_format, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_format; + memcpy(&length_format, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_format-1]=0; + this->format = (char *)(inbuffer + offset-1); + offset += length_format; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/CompressedImage"; }; + const char * getMD5(){ return "8f7a12909da2c9d3332d540a0977563f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/FluidPressure.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/FluidPressure.h new file mode 100755 index 0000000..3b40ee8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/FluidPressure.h @@ -0,0 +1,90 @@ +#ifndef _ROS_sensor_msgs_FluidPressure_h +#define _ROS_sensor_msgs_FluidPressure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class FluidPressure : public ros::Msg + { + public: + std_msgs::Header header; + float fluid_pressure; + float variance; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + int32_t * val_fluid_pressure = (int32_t *) &(this->fluid_pressure); + int32_t exp_fluid_pressure = (((*val_fluid_pressure)>>23)&255); + if(exp_fluid_pressure != 0) + exp_fluid_pressure += 1023-127; + int32_t sig_fluid_pressure = *val_fluid_pressure; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_fluid_pressure<<5) & 0xff; + *(outbuffer + offset++) = (sig_fluid_pressure>>3) & 0xff; + *(outbuffer + offset++) = (sig_fluid_pressure>>11) & 0xff; + *(outbuffer + offset++) = ((exp_fluid_pressure<<4) & 0xF0) | ((sig_fluid_pressure>>19)&0x0F); + *(outbuffer + offset++) = (exp_fluid_pressure>>4) & 0x7F; + if(this->fluid_pressure < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_variance = (int32_t *) &(this->variance); + int32_t exp_variance = (((*val_variance)>>23)&255); + if(exp_variance != 0) + exp_variance += 1023-127; + int32_t sig_variance = *val_variance; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_variance<<5) & 0xff; + *(outbuffer + offset++) = (sig_variance>>3) & 0xff; + *(outbuffer + offset++) = (sig_variance>>11) & 0xff; + *(outbuffer + offset++) = ((exp_variance<<4) & 0xF0) | ((sig_variance>>19)&0x0F); + *(outbuffer + offset++) = (exp_variance>>4) & 0x7F; + if(this->variance < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t * val_fluid_pressure = (uint32_t*) &(this->fluid_pressure); + offset += 3; + *val_fluid_pressure = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_fluid_pressure |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_fluid_pressure |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_fluid_pressure |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_fluid_pressure = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_fluid_pressure |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_fluid_pressure !=0) + *val_fluid_pressure |= ((exp_fluid_pressure)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->fluid_pressure = -this->fluid_pressure; + uint32_t * val_variance = (uint32_t*) &(this->variance); + offset += 3; + *val_variance = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_variance = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_variance !=0) + *val_variance |= ((exp_variance)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->variance = -this->variance; + return offset; + } + + const char * getType(){ return "sensor_msgs/FluidPressure"; }; + const char * getMD5(){ return "804dc5cea1c5306d6a2eb80b9833befe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Illuminance.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Illuminance.h new file mode 100755 index 0000000..4877eac --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Illuminance.h @@ -0,0 +1,90 @@ +#ifndef _ROS_sensor_msgs_Illuminance_h +#define _ROS_sensor_msgs_Illuminance_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Illuminance : public ros::Msg + { + public: + std_msgs::Header header; + float illuminance; + float variance; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + int32_t * val_illuminance = (int32_t *) &(this->illuminance); + int32_t exp_illuminance = (((*val_illuminance)>>23)&255); + if(exp_illuminance != 0) + exp_illuminance += 1023-127; + int32_t sig_illuminance = *val_illuminance; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_illuminance<<5) & 0xff; + *(outbuffer + offset++) = (sig_illuminance>>3) & 0xff; + *(outbuffer + offset++) = (sig_illuminance>>11) & 0xff; + *(outbuffer + offset++) = ((exp_illuminance<<4) & 0xF0) | ((sig_illuminance>>19)&0x0F); + *(outbuffer + offset++) = (exp_illuminance>>4) & 0x7F; + if(this->illuminance < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_variance = (int32_t *) &(this->variance); + int32_t exp_variance = (((*val_variance)>>23)&255); + if(exp_variance != 0) + exp_variance += 1023-127; + int32_t sig_variance = *val_variance; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_variance<<5) & 0xff; + *(outbuffer + offset++) = (sig_variance>>3) & 0xff; + *(outbuffer + offset++) = (sig_variance>>11) & 0xff; + *(outbuffer + offset++) = ((exp_variance<<4) & 0xF0) | ((sig_variance>>19)&0x0F); + *(outbuffer + offset++) = (exp_variance>>4) & 0x7F; + if(this->variance < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t * val_illuminance = (uint32_t*) &(this->illuminance); + offset += 3; + *val_illuminance = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_illuminance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_illuminance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_illuminance |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_illuminance = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_illuminance |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_illuminance !=0) + *val_illuminance |= ((exp_illuminance)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->illuminance = -this->illuminance; + uint32_t * val_variance = (uint32_t*) &(this->variance); + offset += 3; + *val_variance = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_variance = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_variance !=0) + *val_variance |= ((exp_variance)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->variance = -this->variance; + return offset; + } + + const char * getType(){ return "sensor_msgs/Illuminance"; }; + const char * getMD5(){ return "8cf5febb0952fca9d650c3d11a81a188"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Image.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Image.h new file mode 100755 index 0000000..e951719 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Image.h @@ -0,0 +1,112 @@ +#ifndef _ROS_sensor_msgs_Image_h +#define _ROS_sensor_msgs_Image_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Image : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + char * encoding; + uint8_t is_bigendian; + uint32_t step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_encoding = strlen( (const char*) this->encoding); + memcpy(outbuffer + offset, &length_encoding, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->encoding, length_encoding); + offset += length_encoding; + *(outbuffer + offset + 0) = (this->is_bigendian >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->step >> (8 * 3)) & 0xFF; + offset += sizeof(this->step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_encoding; + memcpy(&length_encoding, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_encoding; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_encoding-1]=0; + this->encoding = (char *)(inbuffer + offset-1); + offset += length_encoding; + this->is_bigendian = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->is_bigendian); + this->step = ((uint32_t) (*(inbuffer + offset))); + this->step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Image"; }; + const char * getMD5(){ return "060021388200f6f0f447d0fcd9c64743"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Imu.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Imu.h new file mode 100755 index 0000000..b37e788 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Imu.h @@ -0,0 +1,145 @@ +#ifndef _ROS_sensor_msgs_Imu_h +#define _ROS_sensor_msgs_Imu_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class Imu : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion orientation; + float orientation_covariance[9]; + geometry_msgs::Vector3 angular_velocity; + float angular_velocity_covariance[9]; + geometry_msgs::Vector3 linear_acceleration; + float linear_acceleration_covariance[9]; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + unsigned char * orientation_covariance_val = (unsigned char *) this->orientation_covariance; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_orientation_covariancei = (int32_t *) &(this->orientation_covariance[i]); + int32_t exp_orientation_covariancei = (((*val_orientation_covariancei)>>23)&255); + if(exp_orientation_covariancei != 0) + exp_orientation_covariancei += 1023-127; + int32_t sig_orientation_covariancei = *val_orientation_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_orientation_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_orientation_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_orientation_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_orientation_covariancei<<4) & 0xF0) | ((sig_orientation_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_orientation_covariancei>>4) & 0x7F; + if(this->orientation_covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + offset += this->angular_velocity.serialize(outbuffer + offset); + unsigned char * angular_velocity_covariance_val = (unsigned char *) this->angular_velocity_covariance; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_angular_velocity_covariancei = (int32_t *) &(this->angular_velocity_covariance[i]); + int32_t exp_angular_velocity_covariancei = (((*val_angular_velocity_covariancei)>>23)&255); + if(exp_angular_velocity_covariancei != 0) + exp_angular_velocity_covariancei += 1023-127; + int32_t sig_angular_velocity_covariancei = *val_angular_velocity_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_angular_velocity_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_angular_velocity_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_angular_velocity_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_angular_velocity_covariancei<<4) & 0xF0) | ((sig_angular_velocity_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_angular_velocity_covariancei>>4) & 0x7F; + if(this->angular_velocity_covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + offset += this->linear_acceleration.serialize(outbuffer + offset); + unsigned char * linear_acceleration_covariance_val = (unsigned char *) this->linear_acceleration_covariance; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_linear_acceleration_covariancei = (int32_t *) &(this->linear_acceleration_covariance[i]); + int32_t exp_linear_acceleration_covariancei = (((*val_linear_acceleration_covariancei)>>23)&255); + if(exp_linear_acceleration_covariancei != 0) + exp_linear_acceleration_covariancei += 1023-127; + int32_t sig_linear_acceleration_covariancei = *val_linear_acceleration_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_linear_acceleration_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_linear_acceleration_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_linear_acceleration_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_linear_acceleration_covariancei<<4) & 0xF0) | ((sig_linear_acceleration_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_linear_acceleration_covariancei>>4) & 0x7F; + if(this->linear_acceleration_covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + uint8_t * orientation_covariance_val = (uint8_t*) this->orientation_covariance; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_orientation_covariancei = (uint32_t*) &(this->orientation_covariance[i]); + offset += 3; + *val_orientation_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_orientation_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_orientation_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_orientation_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_orientation_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_orientation_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_orientation_covariancei !=0) + *val_orientation_covariancei |= ((exp_orientation_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->orientation_covariance[i] = -this->orientation_covariance[i]; + } + offset += this->angular_velocity.deserialize(inbuffer + offset); + uint8_t * angular_velocity_covariance_val = (uint8_t*) this->angular_velocity_covariance; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_angular_velocity_covariancei = (uint32_t*) &(this->angular_velocity_covariance[i]); + offset += 3; + *val_angular_velocity_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_angular_velocity_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_angular_velocity_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_angular_velocity_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_angular_velocity_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_angular_velocity_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_angular_velocity_covariancei !=0) + *val_angular_velocity_covariancei |= ((exp_angular_velocity_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->angular_velocity_covariance[i] = -this->angular_velocity_covariance[i]; + } + offset += this->linear_acceleration.deserialize(inbuffer + offset); + uint8_t * linear_acceleration_covariance_val = (uint8_t*) this->linear_acceleration_covariance; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_linear_acceleration_covariancei = (uint32_t*) &(this->linear_acceleration_covariance[i]); + offset += 3; + *val_linear_acceleration_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_linear_acceleration_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_linear_acceleration_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_linear_acceleration_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_linear_acceleration_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_linear_acceleration_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_linear_acceleration_covariancei !=0) + *val_linear_acceleration_covariancei |= ((exp_linear_acceleration_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->linear_acceleration_covariance[i] = -this->linear_acceleration_covariance[i]; + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Imu"; }; + const char * getMD5(){ return "6a62c6daae103f4ff57a132d6f95cec2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JointState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JointState.h new file mode 100755 index 0000000..dfa1f0c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JointState.h @@ -0,0 +1,195 @@ +#ifndef _ROS_sensor_msgs_JointState_h +#define _ROS_sensor_msgs_JointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class JointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t effort_length; + float st_effort; + float * effort; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen( (const char*) this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + int32_t * val_positioni = (int32_t *) &(this->position[i]); + int32_t exp_positioni = (((*val_positioni)>>23)&255); + if(exp_positioni != 0) + exp_positioni += 1023-127; + int32_t sig_positioni = *val_positioni; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_positioni<<5) & 0xff; + *(outbuffer + offset++) = (sig_positioni>>3) & 0xff; + *(outbuffer + offset++) = (sig_positioni>>11) & 0xff; + *(outbuffer + offset++) = ((exp_positioni<<4) & 0xF0) | ((sig_positioni>>19)&0x0F); + *(outbuffer + offset++) = (exp_positioni>>4) & 0x7F; + if(this->position[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + int32_t * val_velocityi = (int32_t *) &(this->velocity[i]); + int32_t exp_velocityi = (((*val_velocityi)>>23)&255); + if(exp_velocityi != 0) + exp_velocityi += 1023-127; + int32_t sig_velocityi = *val_velocityi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_velocityi<<5) & 0xff; + *(outbuffer + offset++) = (sig_velocityi>>3) & 0xff; + *(outbuffer + offset++) = (sig_velocityi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_velocityi<<4) & 0xF0) | ((sig_velocityi>>19)&0x0F); + *(outbuffer + offset++) = (exp_velocityi>>4) & 0x7F; + if(this->velocity[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + int32_t * val_efforti = (int32_t *) &(this->effort[i]); + int32_t exp_efforti = (((*val_efforti)>>23)&255); + if(exp_efforti != 0) + exp_efforti += 1023-127; + int32_t sig_efforti = *val_efforti; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_efforti<<5) & 0xff; + *(outbuffer + offset++) = (sig_efforti>>3) & 0xff; + *(outbuffer + offset++) = (sig_efforti>>11) & 0xff; + *(outbuffer + offset++) = ((exp_efforti<<4) & 0xF0) | ((sig_efforti>>19)&0x0F); + *(outbuffer + offset++) = (exp_efforti>>4) & 0x7F; + if(this->effort[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + uint32_t * val_st_position = (uint32_t*) &(this->st_position); + offset += 3; + *val_st_position = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_position |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_position |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_position = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_position |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_position !=0) + *val_st_position |= ((exp_st_position)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_position = -this->st_position; + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + uint32_t * val_st_velocity = (uint32_t*) &(this->st_velocity); + offset += 3; + *val_st_velocity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_velocity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_velocity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_velocity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_velocity !=0) + *val_st_velocity |= ((exp_st_velocity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_velocity = -this->st_velocity; + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + uint32_t * val_st_effort = (uint32_t*) &(this->st_effort); + offset += 3; + *val_st_effort = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_effort = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_effort !=0) + *val_st_effort |= ((exp_st_effort)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_effort = -this->st_effort; + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JointState"; }; + const char * getMD5(){ return "3066dcd76a6cfaef579bd0f34173e9fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Joy.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Joy.h new file mode 100755 index 0000000..8ec12c5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Joy.h @@ -0,0 +1,114 @@ +#ifndef _ROS_sensor_msgs_Joy_h +#define _ROS_sensor_msgs_Joy_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Joy : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t axes_length; + float st_axes; + float * axes; + uint8_t buttons_length; + int32_t st_buttons; + int32_t * buttons; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = axes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_axesi; + u_axesi.real = this->axes[i]; + *(outbuffer + offset + 0) = (u_axesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_axesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_axesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_axesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->axes[i]); + } + *(outbuffer + offset++) = buttons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_buttonsi; + u_buttonsi.real = this->buttons[i]; + *(outbuffer + offset + 0) = (u_buttonsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buttonsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buttonsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buttonsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t axes_lengthT = *(inbuffer + offset++); + if(axes_lengthT > axes_length) + this->axes = (float*)realloc(this->axes, axes_lengthT * sizeof(float)); + offset += 3; + axes_length = axes_lengthT; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_st_axes; + u_st_axes.base = 0; + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_axes = u_st_axes.real; + offset += sizeof(this->st_axes); + memcpy( &(this->axes[i]), &(this->st_axes), sizeof(float)); + } + uint8_t buttons_lengthT = *(inbuffer + offset++); + if(buttons_lengthT > buttons_length) + this->buttons = (int32_t*)realloc(this->buttons, buttons_lengthT * sizeof(int32_t)); + offset += 3; + buttons_length = buttons_lengthT; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_buttons; + u_st_buttons.base = 0; + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_buttons = u_st_buttons.real; + offset += sizeof(this->st_buttons); + memcpy( &(this->buttons[i]), &(this->st_buttons), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Joy"; }; + const char * getMD5(){ return "5a9ea5f83505693b71e785041e67a8bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JoyFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JoyFeedback.h new file mode 100755 index 0000000..7ad6c95 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JoyFeedback.h @@ -0,0 +1,69 @@ +#ifndef _ROS_sensor_msgs_JoyFeedback_h +#define _ROS_sensor_msgs_JoyFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class JoyFeedback : public ros::Msg + { + public: + uint8_t type; + uint8_t id; + float intensity; + enum { TYPE_LED = 0 }; + enum { TYPE_RUMBLE = 1 }; + enum { TYPE_BUZZER = 2 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.real = this->intensity; + *(outbuffer + offset + 0) = (u_intensity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.base = 0; + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->intensity = u_intensity.real; + offset += sizeof(this->intensity); + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedback"; }; + const char * getMD5(){ return "f4dcd73460360d98f36e55ee7f2e46f1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h new file mode 100755 index 0000000..c022020 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h @@ -0,0 +1,54 @@ +#ifndef _ROS_sensor_msgs_JoyFeedbackArray_h +#define _ROS_sensor_msgs_JoyFeedbackArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JoyFeedback.h" + +namespace sensor_msgs +{ + + class JoyFeedbackArray : public ros::Msg + { + public: + uint8_t array_length; + sensor_msgs::JoyFeedback st_array; + sensor_msgs::JoyFeedback * array; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = array_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->array[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t array_lengthT = *(inbuffer + offset++); + if(array_lengthT > array_length) + this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback)); + offset += 3; + array_length = array_lengthT; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->st_array.deserialize(inbuffer + offset); + memcpy( &(this->array[i]), &(this->st_array), sizeof(sensor_msgs::JoyFeedback)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedbackArray"; }; + const char * getMD5(){ return "cde5730a895b1fc4dee6f91b754b213d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/LaserEcho.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/LaserEcho.h new file mode 100755 index 0000000..9f8f6cb --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/LaserEcho.h @@ -0,0 +1,72 @@ +#ifndef _ROS_sensor_msgs_LaserEcho_h +#define _ROS_sensor_msgs_LaserEcho_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class LaserEcho : public ros::Msg + { + public: + uint8_t echoes_length; + float st_echoes; + float * echoes; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = echoes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_echoesi; + u_echoesi.real = this->echoes[i]; + *(outbuffer + offset + 0) = (u_echoesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_echoesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_echoesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_echoesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->echoes[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t echoes_lengthT = *(inbuffer + offset++); + if(echoes_lengthT > echoes_length) + this->echoes = (float*)realloc(this->echoes, echoes_lengthT * sizeof(float)); + offset += 3; + echoes_length = echoes_lengthT; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_st_echoes; + u_st_echoes.base = 0; + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_echoes = u_st_echoes.real; + offset += sizeof(this->st_echoes); + memcpy( &(this->echoes[i]), &(this->st_echoes), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserEcho"; }; + const char * getMD5(){ return "8bc5ae449b200fba4d552b4225586696"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/LaserScan.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/LaserScan.h new file mode 100755 index 0000000..2e09c95 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/LaserScan.h @@ -0,0 +1,268 @@ +#ifndef _ROS_sensor_msgs_LaserScan_h +#define _ROS_sensor_msgs_LaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class LaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + float st_ranges; + float * ranges; + uint8_t intensities_length; + float st_intensities; + float * intensities; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_rangesi; + u_rangesi.real = this->ranges[i]; + *(outbuffer + offset + 0) = (u_rangesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rangesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rangesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rangesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges[i]); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_intensitiesi; + u_intensitiesi.real = this->intensities[i]; + *(outbuffer + offset + 0) = (u_intensitiesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensitiesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensitiesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensitiesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (float*)realloc(this->ranges, ranges_lengthT * sizeof(float)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_st_ranges; + u_st_ranges.base = 0; + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ranges = u_st_ranges.real; + offset += sizeof(this->st_ranges); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(float)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (float*)realloc(this->intensities, intensities_lengthT * sizeof(float)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_st_intensities; + u_st_intensities.base = 0; + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_intensities = u_st_intensities.real; + offset += sizeof(this->st_intensities); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserScan"; }; + const char * getMD5(){ return "90c7ef2dc6895d81024acba2ac42f369"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MagneticField.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MagneticField.h new file mode 100755 index 0000000..e61e0a8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MagneticField.h @@ -0,0 +1,74 @@ +#ifndef _ROS_sensor_msgs_MagneticField_h +#define _ROS_sensor_msgs_MagneticField_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class MagneticField : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 magnetic_field; + float magnetic_field_covariance[9]; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->magnetic_field.serialize(outbuffer + offset); + unsigned char * magnetic_field_covariance_val = (unsigned char *) this->magnetic_field_covariance; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_magnetic_field_covariancei = (int32_t *) &(this->magnetic_field_covariance[i]); + int32_t exp_magnetic_field_covariancei = (((*val_magnetic_field_covariancei)>>23)&255); + if(exp_magnetic_field_covariancei != 0) + exp_magnetic_field_covariancei += 1023-127; + int32_t sig_magnetic_field_covariancei = *val_magnetic_field_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_magnetic_field_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_magnetic_field_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_magnetic_field_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_magnetic_field_covariancei<<4) & 0xF0) | ((sig_magnetic_field_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_magnetic_field_covariancei>>4) & 0x7F; + if(this->magnetic_field_covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->magnetic_field.deserialize(inbuffer + offset); + uint8_t * magnetic_field_covariance_val = (uint8_t*) this->magnetic_field_covariance; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_magnetic_field_covariancei = (uint32_t*) &(this->magnetic_field_covariance[i]); + offset += 3; + *val_magnetic_field_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_magnetic_field_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_magnetic_field_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_magnetic_field_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_magnetic_field_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_magnetic_field_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_magnetic_field_covariancei !=0) + *val_magnetic_field_covariancei |= ((exp_magnetic_field_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->magnetic_field_covariance[i] = -this->magnetic_field_covariance[i]; + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MagneticField"; }; + const char * getMD5(){ return "2f3b0b43eed0c9501de0fa3ff89a45aa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h new file mode 100755 index 0000000..02de97b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h @@ -0,0 +1,129 @@ +#ifndef _ROS_sensor_msgs_MultiDOFJointState_h +#define _ROS_sensor_msgs_MultiDOFJointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace sensor_msgs +{ + + class MultiDOFJointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiDOFJointState"; }; + const char * getMD5(){ return "690f272f0640d2631c305eeb8301e59d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h new file mode 100755 index 0000000..92a9e11 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h @@ -0,0 +1,231 @@ +#ifndef _ROS_sensor_msgs_MultiEchoLaserScan_h +#define _ROS_sensor_msgs_MultiEchoLaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/LaserEcho.h" + +namespace sensor_msgs +{ + + class MultiEchoLaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + sensor_msgs::LaserEcho st_ranges; + sensor_msgs::LaserEcho * ranges; + uint8_t intensities_length; + sensor_msgs::LaserEcho st_intensities; + sensor_msgs::LaserEcho * intensities; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->ranges[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->intensities[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->st_ranges.deserialize(inbuffer + offset); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(sensor_msgs::LaserEcho)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->st_intensities.deserialize(inbuffer + offset); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(sensor_msgs::LaserEcho)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiEchoLaserScan"; }; + const char * getMD5(){ return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/NavSatFix.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/NavSatFix.h new file mode 100755 index 0000000..819fae4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/NavSatFix.h @@ -0,0 +1,161 @@ +#ifndef _ROS_sensor_msgs_NavSatFix_h +#define _ROS_sensor_msgs_NavSatFix_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/NavSatStatus.h" + +namespace sensor_msgs +{ + + class NavSatFix : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::NavSatStatus status; + float latitude; + float longitude; + float altitude; + float position_covariance[9]; + uint8_t position_covariance_type; + enum { COVARIANCE_TYPE_UNKNOWN = 0 }; + enum { COVARIANCE_TYPE_APPROXIMATED = 1 }; + enum { COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 }; + enum { COVARIANCE_TYPE_KNOWN = 3 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + int32_t * val_latitude = (int32_t *) &(this->latitude); + int32_t exp_latitude = (((*val_latitude)>>23)&255); + if(exp_latitude != 0) + exp_latitude += 1023-127; + int32_t sig_latitude = *val_latitude; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_latitude<<5) & 0xff; + *(outbuffer + offset++) = (sig_latitude>>3) & 0xff; + *(outbuffer + offset++) = (sig_latitude>>11) & 0xff; + *(outbuffer + offset++) = ((exp_latitude<<4) & 0xF0) | ((sig_latitude>>19)&0x0F); + *(outbuffer + offset++) = (exp_latitude>>4) & 0x7F; + if(this->latitude < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_longitude = (int32_t *) &(this->longitude); + int32_t exp_longitude = (((*val_longitude)>>23)&255); + if(exp_longitude != 0) + exp_longitude += 1023-127; + int32_t sig_longitude = *val_longitude; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_longitude<<5) & 0xff; + *(outbuffer + offset++) = (sig_longitude>>3) & 0xff; + *(outbuffer + offset++) = (sig_longitude>>11) & 0xff; + *(outbuffer + offset++) = ((exp_longitude<<4) & 0xF0) | ((sig_longitude>>19)&0x0F); + *(outbuffer + offset++) = (exp_longitude>>4) & 0x7F; + if(this->longitude < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_altitude = (int32_t *) &(this->altitude); + int32_t exp_altitude = (((*val_altitude)>>23)&255); + if(exp_altitude != 0) + exp_altitude += 1023-127; + int32_t sig_altitude = *val_altitude; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_altitude<<5) & 0xff; + *(outbuffer + offset++) = (sig_altitude>>3) & 0xff; + *(outbuffer + offset++) = (sig_altitude>>11) & 0xff; + *(outbuffer + offset++) = ((exp_altitude<<4) & 0xF0) | ((sig_altitude>>19)&0x0F); + *(outbuffer + offset++) = (exp_altitude>>4) & 0x7F; + if(this->altitude < 0) *(outbuffer + offset -1) |= 0x80; + unsigned char * position_covariance_val = (unsigned char *) this->position_covariance; + for( uint8_t i = 0; i < 9; i++){ + int32_t * val_position_covariancei = (int32_t *) &(this->position_covariance[i]); + int32_t exp_position_covariancei = (((*val_position_covariancei)>>23)&255); + if(exp_position_covariancei != 0) + exp_position_covariancei += 1023-127; + int32_t sig_position_covariancei = *val_position_covariancei; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_position_covariancei<<5) & 0xff; + *(outbuffer + offset++) = (sig_position_covariancei>>3) & 0xff; + *(outbuffer + offset++) = (sig_position_covariancei>>11) & 0xff; + *(outbuffer + offset++) = ((exp_position_covariancei<<4) & 0xF0) | ((sig_position_covariancei>>19)&0x0F); + *(outbuffer + offset++) = (exp_position_covariancei>>4) & 0x7F; + if(this->position_covariance[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset + 0) = (this->position_covariance_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->position_covariance_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + uint32_t * val_latitude = (uint32_t*) &(this->latitude); + offset += 3; + *val_latitude = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_latitude |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_latitude |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_latitude |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_latitude = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_latitude |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_latitude !=0) + *val_latitude |= ((exp_latitude)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->latitude = -this->latitude; + uint32_t * val_longitude = (uint32_t*) &(this->longitude); + offset += 3; + *val_longitude = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_longitude |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_longitude |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_longitude |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_longitude = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_longitude |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_longitude !=0) + *val_longitude |= ((exp_longitude)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->longitude = -this->longitude; + uint32_t * val_altitude = (uint32_t*) &(this->altitude); + offset += 3; + *val_altitude = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_altitude |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_altitude |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_altitude |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_altitude = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_altitude |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_altitude !=0) + *val_altitude |= ((exp_altitude)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->altitude = -this->altitude; + uint8_t * position_covariance_val = (uint8_t*) this->position_covariance; + for( uint8_t i = 0; i < 9; i++){ + uint32_t * val_position_covariancei = (uint32_t*) &(this->position_covariance[i]); + offset += 3; + *val_position_covariancei = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_position_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_position_covariancei |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_position_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_position_covariancei = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_position_covariancei |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_position_covariancei !=0) + *val_position_covariancei |= ((exp_position_covariancei)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->position_covariance[i] = -this->position_covariance[i]; + } + this->position_covariance_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->position_covariance_type); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatFix"; }; + const char * getMD5(){ return "2d3a8cd499b9b4a0249fb98fd05cfa48"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/NavSatStatus.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/NavSatStatus.h new file mode 100755 index 0000000..7fb2bb0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/NavSatStatus.h @@ -0,0 +1,65 @@ +#ifndef _ROS_sensor_msgs_NavSatStatus_h +#define _ROS_sensor_msgs_NavSatStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class NavSatStatus : public ros::Msg + { + public: + int8_t status; + uint16_t service; + enum { STATUS_NO_FIX = -1 }; + enum { STATUS_FIX = 0 }; + enum { STATUS_SBAS_FIX = 1 }; + enum { STATUS_GBAS_FIX = 2 }; + enum { SERVICE_GPS = 1 }; + enum { SERVICE_GLONASS = 2 }; + enum { SERVICE_COMPASS = 4 }; + enum { SERVICE_GALILEO = 8 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.real = this->status; + *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; + offset += sizeof(this->service); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.base = 0; + u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->status = u_status.real; + offset += sizeof(this->status); + this->service = ((uint16_t) (*(inbuffer + offset))); + this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->service); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointCloud.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointCloud.h new file mode 100755 index 0000000..f04381c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointCloud.h @@ -0,0 +1,78 @@ +#ifndef _ROS_sensor_msgs_PointCloud_h +#define _ROS_sensor_msgs_PointCloud_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "sensor_msgs/ChannelFloat32.h" + +namespace sensor_msgs +{ + + class PointCloud : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + uint8_t channels_length; + sensor_msgs::ChannelFloat32 st_channels; + sensor_msgs::ChannelFloat32 * channels; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = channels_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->channels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + uint8_t channels_lengthT = *(inbuffer + offset++); + if(channels_lengthT > channels_length) + this->channels = (sensor_msgs::ChannelFloat32*)realloc(this->channels, channels_lengthT * sizeof(sensor_msgs::ChannelFloat32)); + offset += 3; + channels_length = channels_lengthT; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->st_channels.deserialize(inbuffer + offset); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(sensor_msgs::ChannelFloat32)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud"; }; + const char * getMD5(){ return "d8e9c3f5afbdd8a130fd1d2763945fca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointCloud2.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointCloud2.h new file mode 100755 index 0000000..e898147 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointCloud2.h @@ -0,0 +1,155 @@ +#ifndef _ROS_sensor_msgs_PointCloud2_h +#define _ROS_sensor_msgs_PointCloud2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointField.h" + +namespace sensor_msgs +{ + + class PointCloud2 : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + uint8_t fields_length; + sensor_msgs::PointField st_fields; + sensor_msgs::PointField * fields; + bool is_bigendian; + uint32_t point_step; + uint32_t row_step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + bool is_dense; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset++) = fields_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->fields[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.real = this->is_bigendian; + *(outbuffer + offset + 0) = (u_is_bigendian.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->point_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->point_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->point_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->point_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->point_step); + *(outbuffer + offset + 0) = (this->row_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->row_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->row_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->row_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->row_step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.real = this->is_dense; + *(outbuffer + offset + 0) = (u_is_dense.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_dense); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint8_t fields_lengthT = *(inbuffer + offset++); + if(fields_lengthT > fields_length) + this->fields = (sensor_msgs::PointField*)realloc(this->fields, fields_lengthT * sizeof(sensor_msgs::PointField)); + offset += 3; + fields_length = fields_lengthT; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->st_fields.deserialize(inbuffer + offset); + memcpy( &(this->fields[i]), &(this->st_fields), sizeof(sensor_msgs::PointField)); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.base = 0; + u_is_bigendian.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_bigendian = u_is_bigendian.real; + offset += sizeof(this->is_bigendian); + this->point_step = ((uint32_t) (*(inbuffer + offset))); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->point_step); + this->row_step = ((uint32_t) (*(inbuffer + offset))); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->row_step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.base = 0; + u_is_dense.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_dense = u_is_dense.real; + offset += sizeof(this->is_dense); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud2"; }; + const char * getMD5(){ return "1158d486dd51d683ce2f1be655c3c181"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointField.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointField.h new file mode 100755 index 0000000..4521f74 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/PointField.h @@ -0,0 +1,84 @@ +#ifndef _ROS_sensor_msgs_PointField_h +#define _ROS_sensor_msgs_PointField_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class PointField : public ros::Msg + { + public: + char * name; + uint32_t offset; + uint8_t datatype; + uint32_t count; + enum { INT8 = 1 }; + enum { UINT8 = 2 }; + enum { INT16 = 3 }; + enum { UINT16 = 4 }; + enum { INT32 = 5 }; + enum { UINT32 = 6 }; + enum { FLOAT32 = 7 }; + enum { FLOAT64 = 8 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->datatype >> (8 * 0)) & 0xFF; + offset += sizeof(this->datatype); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->count >> (8 * 3)) & 0xFF; + offset += sizeof(this->count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + this->offset = ((uint32_t) (*(inbuffer + offset))); + this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->offset); + this->datatype = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->datatype); + this->count = ((uint32_t) (*(inbuffer + offset))); + this->count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->count); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointField"; }; + const char * getMD5(){ return "268eacb2962780ceac86cbd17e328150"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Range.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Range.h new file mode 100755 index 0000000..445a733 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Range.h @@ -0,0 +1,133 @@ +#ifndef _ROS_sensor_msgs_Range_h +#define _ROS_sensor_msgs_Range_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Range : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t radiation_type; + float field_of_view; + float min_range; + float max_range; + float range; + enum { ULTRASOUND = 0 }; + enum { INFRARED = 1 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->radiation_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.real = this->field_of_view; + *(outbuffer + offset + 0) = (u_field_of_view.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_field_of_view.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_field_of_view.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_field_of_view.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.real = this->min_range; + *(outbuffer + offset + 0) = (u_min_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.real = this->max_range; + *(outbuffer + offset + 0) = (u_max_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.real = this->range; + *(outbuffer + offset + 0) = (u_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->radiation_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.base = 0; + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->field_of_view = u_field_of_view.real; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.base = 0; + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_range = u_min_range.real; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.base = 0; + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_range = u_max_range.real; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.base = 0; + u_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range = u_range.real; + offset += sizeof(this->range); + return offset; + } + + const char * getType(){ return "sensor_msgs/Range"; }; + const char * getMD5(){ return "c005c34273dc426c67a020a87bc24148"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h new file mode 100755 index 0000000..7f60d0a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h @@ -0,0 +1,94 @@ +#ifndef _ROS_sensor_msgs_RegionOfInterest_h +#define _ROS_sensor_msgs_RegionOfInterest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class RegionOfInterest : public ros::Msg + { + public: + uint32_t x_offset; + uint32_t y_offset; + uint32_t height; + uint32_t width; + bool do_rectify; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->x_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->x_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->x_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->x_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->x_offset); + *(outbuffer + offset + 0) = (this->y_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->y_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->y_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->y_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->y_offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.real = this->do_rectify; + *(outbuffer + offset + 0) = (u_do_rectify.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->do_rectify); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->x_offset = ((uint32_t) (*(inbuffer + offset))); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->x_offset); + this->y_offset = ((uint32_t) (*(inbuffer + offset))); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->y_offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.base = 0; + u_do_rectify.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->do_rectify = u_do_rectify.real; + offset += sizeof(this->do_rectify); + return offset; + } + + const char * getType(){ return "sensor_msgs/RegionOfInterest"; }; + const char * getMD5(){ return "bdb633039d588fcccb441a4d43ccfe09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h new file mode 100755 index 0000000..b539361 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h @@ -0,0 +1,90 @@ +#ifndef _ROS_sensor_msgs_RelativeHumidity_h +#define _ROS_sensor_msgs_RelativeHumidity_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class RelativeHumidity : public ros::Msg + { + public: + std_msgs::Header header; + float relative_humidity; + float variance; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + int32_t * val_relative_humidity = (int32_t *) &(this->relative_humidity); + int32_t exp_relative_humidity = (((*val_relative_humidity)>>23)&255); + if(exp_relative_humidity != 0) + exp_relative_humidity += 1023-127; + int32_t sig_relative_humidity = *val_relative_humidity; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_relative_humidity<<5) & 0xff; + *(outbuffer + offset++) = (sig_relative_humidity>>3) & 0xff; + *(outbuffer + offset++) = (sig_relative_humidity>>11) & 0xff; + *(outbuffer + offset++) = ((exp_relative_humidity<<4) & 0xF0) | ((sig_relative_humidity>>19)&0x0F); + *(outbuffer + offset++) = (exp_relative_humidity>>4) & 0x7F; + if(this->relative_humidity < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_variance = (int32_t *) &(this->variance); + int32_t exp_variance = (((*val_variance)>>23)&255); + if(exp_variance != 0) + exp_variance += 1023-127; + int32_t sig_variance = *val_variance; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_variance<<5) & 0xff; + *(outbuffer + offset++) = (sig_variance>>3) & 0xff; + *(outbuffer + offset++) = (sig_variance>>11) & 0xff; + *(outbuffer + offset++) = ((exp_variance<<4) & 0xF0) | ((sig_variance>>19)&0x0F); + *(outbuffer + offset++) = (exp_variance>>4) & 0x7F; + if(this->variance < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t * val_relative_humidity = (uint32_t*) &(this->relative_humidity); + offset += 3; + *val_relative_humidity = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_relative_humidity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_relative_humidity |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_relative_humidity |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_relative_humidity = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_relative_humidity |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_relative_humidity !=0) + *val_relative_humidity |= ((exp_relative_humidity)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->relative_humidity = -this->relative_humidity; + uint32_t * val_variance = (uint32_t*) &(this->variance); + offset += 3; + *val_variance = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_variance = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_variance !=0) + *val_variance |= ((exp_variance)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->variance = -this->variance; + return offset; + } + + const char * getType(){ return "sensor_msgs/RelativeHumidity"; }; + const char * getMD5(){ return "8730015b05955b7e992ce29a2678d90f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h new file mode 100755 index 0000000..f6c3dcf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetCameraInfo_h +#define _ROS_SERVICE_SetCameraInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" + +namespace sensor_msgs +{ + +static const char SETCAMERAINFO[] = "sensor_msgs/SetCameraInfo"; + + class SetCameraInfoRequest : public ros::Msg + { + public: + sensor_msgs::CameraInfo camera_info; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "ee34be01fdeee563d0d99cd594d5581d"; }; + + }; + + class SetCameraInfoResponse : public ros::Msg + { + public: + bool success; + char * status_message; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen( (const char*) this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetCameraInfo { + public: + typedef SetCameraInfoRequest Request; + typedef SetCameraInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Temperature.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Temperature.h new file mode 100755 index 0000000..792449d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/Temperature.h @@ -0,0 +1,90 @@ +#ifndef _ROS_sensor_msgs_Temperature_h +#define _ROS_sensor_msgs_Temperature_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Temperature : public ros::Msg + { + public: + std_msgs::Header header; + float temperature; + float variance; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + int32_t * val_temperature = (int32_t *) &(this->temperature); + int32_t exp_temperature = (((*val_temperature)>>23)&255); + if(exp_temperature != 0) + exp_temperature += 1023-127; + int32_t sig_temperature = *val_temperature; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_temperature<<5) & 0xff; + *(outbuffer + offset++) = (sig_temperature>>3) & 0xff; + *(outbuffer + offset++) = (sig_temperature>>11) & 0xff; + *(outbuffer + offset++) = ((exp_temperature<<4) & 0xF0) | ((sig_temperature>>19)&0x0F); + *(outbuffer + offset++) = (exp_temperature>>4) & 0x7F; + if(this->temperature < 0) *(outbuffer + offset -1) |= 0x80; + int32_t * val_variance = (int32_t *) &(this->variance); + int32_t exp_variance = (((*val_variance)>>23)&255); + if(exp_variance != 0) + exp_variance += 1023-127; + int32_t sig_variance = *val_variance; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_variance<<5) & 0xff; + *(outbuffer + offset++) = (sig_variance>>3) & 0xff; + *(outbuffer + offset++) = (sig_variance>>11) & 0xff; + *(outbuffer + offset++) = ((exp_variance<<4) & 0xF0) | ((sig_variance>>19)&0x0F); + *(outbuffer + offset++) = (exp_variance>>4) & 0x7F; + if(this->variance < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t * val_temperature = (uint32_t*) &(this->temperature); + offset += 3; + *val_temperature = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_temperature |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_temperature |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_temperature |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_temperature = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_temperature |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_temperature !=0) + *val_temperature |= ((exp_temperature)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->temperature = -this->temperature; + uint32_t * val_variance = (uint32_t*) &(this->variance); + offset += 3; + *val_variance = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_variance |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_variance = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_variance |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_variance !=0) + *val_variance |= ((exp_variance)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->variance = -this->variance; + return offset; + } + + const char * getType(){ return "sensor_msgs/Temperature"; }; + const char * getMD5(){ return "ff71b307acdbe7c871a5a6d7ed359100"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/TimeReference.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/TimeReference.h new file mode 100755 index 0000000..b7de276 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/sensor_msgs/TimeReference.h @@ -0,0 +1,75 @@ +#ifndef _ROS_sensor_msgs_TimeReference_h +#define _ROS_sensor_msgs_TimeReference_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace sensor_msgs +{ + + class TimeReference : public ros::Msg + { + public: + std_msgs::Header header; + ros::Time time_ref; + char * source; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_ref.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.sec); + *(outbuffer + offset + 0) = (this->time_ref.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.nsec); + uint32_t length_source = strlen( (const char*) this->source); + memcpy(outbuffer + offset, &length_source, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source, length_source); + offset += length_source; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->time_ref.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.sec); + this->time_ref.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.nsec); + uint32_t length_source; + memcpy(&length_source, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source-1]=0; + this->source = (char *)(inbuffer + offset-1); + offset += length_source; + return offset; + } + + const char * getType(){ return "sensor_msgs/TimeReference"; }; + const char * getMD5(){ return "fded64a0265108ba86c3d38fb11c0c16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/Mesh.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/Mesh.h new file mode 100755 index 0000000..a8d2509 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/Mesh.h @@ -0,0 +1,74 @@ +#ifndef _ROS_shape_msgs_Mesh_h +#define _ROS_shape_msgs_Mesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/MeshTriangle.h" +#include "geometry_msgs/Point.h" + +namespace shape_msgs +{ + + class Mesh : public ros::Msg + { + public: + uint8_t triangles_length; + shape_msgs::MeshTriangle st_triangles; + shape_msgs::MeshTriangle * triangles; + uint8_t vertices_length; + geometry_msgs::Point st_vertices; + geometry_msgs::Point * vertices; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = triangles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->triangles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->vertices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t triangles_lengthT = *(inbuffer + offset++); + if(triangles_lengthT > triangles_length) + this->triangles = (shape_msgs::MeshTriangle*)realloc(this->triangles, triangles_lengthT * sizeof(shape_msgs::MeshTriangle)); + offset += 3; + triangles_length = triangles_lengthT; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->st_triangles.deserialize(inbuffer + offset); + memcpy( &(this->triangles[i]), &(this->st_triangles), sizeof(shape_msgs::MeshTriangle)); + } + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (geometry_msgs::Point*)realloc(this->vertices, vertices_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->st_vertices.deserialize(inbuffer + offset); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Mesh"; }; + const char * getMD5(){ return "1ffdae9486cd3316a121c578b47a85cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/MeshTriangle.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/MeshTriangle.h new file mode 100755 index 0000000..0f9c9a1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/MeshTriangle.h @@ -0,0 +1,51 @@ +#ifndef _ROS_shape_msgs_MeshTriangle_h +#define _ROS_shape_msgs_MeshTriangle_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class MeshTriangle : public ros::Msg + { + public: + uint32_t vertex_indices[3]; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + unsigned char * vertex_indices_val = (unsigned char *) this->vertex_indices; + for( uint8_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->vertex_indices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertex_indices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertex_indices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertex_indices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t * vertex_indices_val = (uint8_t*) this->vertex_indices; + for( uint8_t i = 0; i < 3; i++){ + this->vertex_indices[i] = ((uint32_t) (*(inbuffer + offset))); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + const char * getType(){ return "shape_msgs/MeshTriangle"; }; + const char * getMD5(){ return "23688b2e6d2de3d32fe8af104a903253"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/Plane.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/Plane.h new file mode 100755 index 0000000..be2e6d1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/Plane.h @@ -0,0 +1,66 @@ +#ifndef _ROS_shape_msgs_Plane_h +#define _ROS_shape_msgs_Plane_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class Plane : public ros::Msg + { + public: + float coef[4]; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + unsigned char * coef_val = (unsigned char *) this->coef; + for( uint8_t i = 0; i < 4; i++){ + int32_t * val_coefi = (int32_t *) &(this->coef[i]); + int32_t exp_coefi = (((*val_coefi)>>23)&255); + if(exp_coefi != 0) + exp_coefi += 1023-127; + int32_t sig_coefi = *val_coefi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_coefi<<5) & 0xff; + *(outbuffer + offset++) = (sig_coefi>>3) & 0xff; + *(outbuffer + offset++) = (sig_coefi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_coefi<<4) & 0xF0) | ((sig_coefi>>19)&0x0F); + *(outbuffer + offset++) = (exp_coefi>>4) & 0x7F; + if(this->coef[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t * coef_val = (uint8_t*) this->coef; + for( uint8_t i = 0; i < 4; i++){ + uint32_t * val_coefi = (uint32_t*) &(this->coef[i]); + offset += 3; + *val_coefi = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_coefi |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_coefi |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_coefi |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_coefi = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_coefi |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_coefi !=0) + *val_coefi |= ((exp_coefi)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->coef[i] = -this->coef[i]; + } + return offset; + } + + const char * getType(){ return "shape_msgs/Plane"; }; + const char * getMD5(){ return "2c1b92ed8f31492f8e73f6a4a44ca796"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/SolidPrimitive.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/SolidPrimitive.h new file mode 100755 index 0000000..76fe9dc --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/shape_msgs/SolidPrimitive.h @@ -0,0 +1,93 @@ +#ifndef _ROS_shape_msgs_SolidPrimitive_h +#define _ROS_shape_msgs_SolidPrimitive_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class SolidPrimitive : public ros::Msg + { + public: + uint8_t type; + uint8_t dimensions_length; + float st_dimensions; + float * dimensions; + enum { BOX = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { CONE = 4 }; + enum { BOX_X = 0 }; + enum { BOX_Y = 1 }; + enum { BOX_Z = 2 }; + enum { SPHERE_RADIUS = 0 }; + enum { CYLINDER_HEIGHT = 0 }; + enum { CYLINDER_RADIUS = 1 }; + enum { CONE_HEIGHT = 0 }; + enum { CONE_RADIUS = 1 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = dimensions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dimensions_length; i++){ + int32_t * val_dimensionsi = (int32_t *) &(this->dimensions[i]); + int32_t exp_dimensionsi = (((*val_dimensionsi)>>23)&255); + if(exp_dimensionsi != 0) + exp_dimensionsi += 1023-127; + int32_t sig_dimensionsi = *val_dimensionsi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_dimensionsi<<5) & 0xff; + *(outbuffer + offset++) = (sig_dimensionsi>>3) & 0xff; + *(outbuffer + offset++) = (sig_dimensionsi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_dimensionsi<<4) & 0xF0) | ((sig_dimensionsi>>19)&0x0F); + *(outbuffer + offset++) = (exp_dimensionsi>>4) & 0x7F; + if(this->dimensions[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t dimensions_lengthT = *(inbuffer + offset++); + if(dimensions_lengthT > dimensions_length) + this->dimensions = (float*)realloc(this->dimensions, dimensions_lengthT * sizeof(float)); + offset += 3; + dimensions_length = dimensions_lengthT; + for( uint8_t i = 0; i < dimensions_length; i++){ + uint32_t * val_st_dimensions = (uint32_t*) &(this->st_dimensions); + offset += 3; + *val_st_dimensions = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_dimensions |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_dimensions |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_dimensions |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_dimensions = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_dimensions |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_dimensions !=0) + *val_st_dimensions |= ((exp_st_dimensions)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_dimensions = -this->st_dimensions; + memcpy( &(this->dimensions[i]), &(this->st_dimensions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/SolidPrimitive"; }; + const char * getMD5(){ return "d8f8cbc74c5ff283fca29569ccefb45d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h new file mode 100755 index 0000000..1f8d3b0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h @@ -0,0 +1,95 @@ +#ifndef _ROS_smach_msgs_SmachContainerInitialStatusCmd_h +#define _ROS_smach_msgs_SmachContainerInitialStatusCmd_h + +#include +#include +#include +#include "ros/msg.h" + +namespace smach_msgs +{ + + class SmachContainerInitialStatusCmd : public ros::Msg + { + public: + char * path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + char * local_data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_path = strlen( (const char*) this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen( (const char*) this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + uint32_t length_local_data = strlen( (const char*) this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerInitialStatusCmd"; }; + const char * getMD5(){ return "45f8cf31fc29b829db77f23001f788d6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h new file mode 100755 index 0000000..9885dba --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h @@ -0,0 +1,145 @@ +#ifndef _ROS_smach_msgs_SmachContainerStatus_h +#define _ROS_smach_msgs_SmachContainerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStatus : public ros::Msg + { + public: + std_msgs::Header header; + char * path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + uint8_t active_states_length; + char* st_active_states; + char* * active_states; + char * local_data; + char * info; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen( (const char*) this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen( (const char*) this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + *(outbuffer + offset++) = active_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_active_statesi = strlen( (const char*) this->active_states[i]); + memcpy(outbuffer + offset, &length_active_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->active_states[i], length_active_statesi); + offset += length_active_statesi; + } + uint32_t length_local_data = strlen( (const char*) this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + uint32_t length_info = strlen( (const char*) this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint8_t active_states_lengthT = *(inbuffer + offset++); + if(active_states_lengthT > active_states_length) + this->active_states = (char**)realloc(this->active_states, active_states_lengthT * sizeof(char*)); + offset += 3; + active_states_length = active_states_lengthT; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_st_active_states; + memcpy(&length_st_active_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_active_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_active_states-1]=0; + this->st_active_states = (char *)(inbuffer + offset-1); + offset += length_st_active_states; + memcpy( &(this->active_states[i]), &(this->st_active_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStatus"; }; + const char * getMD5(){ return "5ba2bb79ac19e3842d562a191f2a675b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h new file mode 100755 index 0000000..62252d6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h @@ -0,0 +1,208 @@ +#ifndef _ROS_smach_msgs_SmachContainerStructure_h +#define _ROS_smach_msgs_SmachContainerStructure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStructure : public ros::Msg + { + public: + std_msgs::Header header; + char * path; + uint8_t children_length; + char* st_children; + char* * children; + uint8_t internal_outcomes_length; + char* st_internal_outcomes; + char* * internal_outcomes; + uint8_t outcomes_from_length; + char* st_outcomes_from; + char* * outcomes_from; + uint8_t outcomes_to_length; + char* st_outcomes_to; + char* * outcomes_to; + uint8_t container_outcomes_length; + char* st_container_outcomes; + char* * container_outcomes; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen( (const char*) this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = children_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_childreni = strlen( (const char*) this->children[i]); + memcpy(outbuffer + offset, &length_childreni, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->children[i], length_childreni); + offset += length_childreni; + } + *(outbuffer + offset++) = internal_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_internal_outcomesi = strlen( (const char*) this->internal_outcomes[i]); + memcpy(outbuffer + offset, &length_internal_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); + offset += length_internal_outcomesi; + } + *(outbuffer + offset++) = outcomes_from_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_outcomes_fromi = strlen( (const char*) this->outcomes_from[i]); + memcpy(outbuffer + offset, &length_outcomes_fromi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); + offset += length_outcomes_fromi; + } + *(outbuffer + offset++) = outcomes_to_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_outcomes_toi = strlen( (const char*) this->outcomes_to[i]); + memcpy(outbuffer + offset, &length_outcomes_toi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); + offset += length_outcomes_toi; + } + *(outbuffer + offset++) = container_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_container_outcomesi = strlen( (const char*) this->container_outcomes[i]); + memcpy(outbuffer + offset, &length_container_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); + offset += length_container_outcomesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t children_lengthT = *(inbuffer + offset++); + if(children_lengthT > children_length) + this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); + offset += 3; + children_length = children_lengthT; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_st_children; + memcpy(&length_st_children, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_children; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_children-1]=0; + this->st_children = (char *)(inbuffer + offset-1); + offset += length_st_children; + memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); + } + uint8_t internal_outcomes_lengthT = *(inbuffer + offset++); + if(internal_outcomes_lengthT > internal_outcomes_length) + this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); + offset += 3; + internal_outcomes_length = internal_outcomes_lengthT; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_st_internal_outcomes; + memcpy(&length_st_internal_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_internal_outcomes-1]=0; + this->st_internal_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_internal_outcomes; + memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); + } + uint8_t outcomes_from_lengthT = *(inbuffer + offset++); + if(outcomes_from_lengthT > outcomes_from_length) + this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); + offset += 3; + outcomes_from_length = outcomes_from_lengthT; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_st_outcomes_from; + memcpy(&length_st_outcomes_from, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_from-1]=0; + this->st_outcomes_from = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_from; + memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); + } + uint8_t outcomes_to_lengthT = *(inbuffer + offset++); + if(outcomes_to_lengthT > outcomes_to_length) + this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); + offset += 3; + outcomes_to_length = outcomes_to_lengthT; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_st_outcomes_to; + memcpy(&length_st_outcomes_to, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_to-1]=0; + this->st_outcomes_to = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_to; + memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); + } + uint8_t container_outcomes_lengthT = *(inbuffer + offset++); + if(container_outcomes_lengthT > container_outcomes_length) + this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); + offset += 3; + container_outcomes_length = container_outcomes_lengthT; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_st_container_outcomes; + memcpy(&length_st_container_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_container_outcomes-1]=0; + this->st_container_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_container_outcomes; + memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; + const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Bool.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Bool.h new file mode 100755 index 0000000..b58eb5f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Bool.h @@ -0,0 +1,50 @@ +#ifndef _ROS_std_msgs_Bool_h +#define _ROS_std_msgs_Bool_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Bool : public ros::Msg + { + public: + bool data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Bool"; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Byte.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Byte.h new file mode 100755 index 0000000..8cdf01f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Byte.h @@ -0,0 +1,50 @@ +#ifndef _ROS_std_msgs_Byte_h +#define _ROS_std_msgs_Byte_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Byte : public ros::Msg + { + public: + int8_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Byte"; }; + const char * getMD5(){ return "ad736a2e8818154c487bb80fe42ce43b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/ByteMultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/ByteMultiArray.h new file mode 100755 index 0000000..3e1208d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/ByteMultiArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_std_msgs_ByteMultiArray_h +#define _ROS_std_msgs_ByteMultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class ByteMultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/ByteMultiArray"; }; + const char * getMD5(){ return "70ea476cbcfd65ac2f68f3cda1e891fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Char.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Char.h new file mode 100755 index 0000000..e1d723e --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Char.h @@ -0,0 +1,39 @@ +#ifndef _ROS_std_msgs_Char_h +#define _ROS_std_msgs_Char_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Char : public ros::Msg + { + public: + uint8_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Char"; }; + const char * getMD5(){ return "1bf77f25acecdedba0e224b162199717"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/ColorRGBA.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/ColorRGBA.h new file mode 100755 index 0000000..49c72f4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/ColorRGBA.h @@ -0,0 +1,122 @@ +#ifndef _ROS_std_msgs_ColorRGBA_h +#define _ROS_std_msgs_ColorRGBA_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class ColorRGBA : public ros::Msg + { + public: + float r; + float g; + float b; + float a; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.real = this->r; + *(outbuffer + offset + 0) = (u_r.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.real = this->g; + *(outbuffer + offset + 0) = (u_g.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_g.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_g.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_g.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->a); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.base = 0; + u_r.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r = u_r.real; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.base = 0; + u_g.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->g = u_g.real; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->a = u_a.real; + offset += sizeof(this->a); + return offset; + } + + const char * getType(){ return "std_msgs/ColorRGBA"; }; + const char * getMD5(){ return "a29a96539573343b1310c73607334b00"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Duration.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Duration.h new file mode 100755 index 0000000..732d034 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Duration.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Duration_h +#define _ROS_std_msgs_Duration_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace std_msgs +{ + + class Duration : public ros::Msg + { + public: + ros::Duration data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Duration"; }; + const char * getMD5(){ return "3e286caf4241d664e55f3ad380e2ae46"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Empty.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Empty.h new file mode 100755 index 0000000..5b31e1c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Empty.h @@ -0,0 +1,34 @@ +#ifndef _ROS_std_msgs_Empty_h +#define _ROS_std_msgs_Empty_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Empty : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "std_msgs/Empty"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float32.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float32.h new file mode 100755 index 0000000..a653732 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float32.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Float32_h +#define _ROS_std_msgs_Float32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float32 : public ros::Msg + { + public: + float data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Float32"; }; + const char * getMD5(){ return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float32MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float32MultiArray.h new file mode 100755 index 0000000..4d14679 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float32MultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_Float32MultiArray_h +#define _ROS_std_msgs_Float32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float32MultiArray"; }; + const char * getMD5(){ return "6a40e0ffa6a17a503ac3f8616991b1f6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float64.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float64.h new file mode 100755 index 0000000..53d44c3 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float64.h @@ -0,0 +1,60 @@ +#ifndef _ROS_std_msgs_Float64_h +#define _ROS_std_msgs_Float64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float64 : public ros::Msg + { + public: + float data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + int32_t * val_data = (int32_t *) &(this->data); + int32_t exp_data = (((*val_data)>>23)&255); + if(exp_data != 0) + exp_data += 1023-127; + int32_t sig_data = *val_data; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_data<<5) & 0xff; + *(outbuffer + offset++) = (sig_data>>3) & 0xff; + *(outbuffer + offset++) = (sig_data>>11) & 0xff; + *(outbuffer + offset++) = ((exp_data<<4) & 0xF0) | ((sig_data>>19)&0x0F); + *(outbuffer + offset++) = (exp_data>>4) & 0x7F; + if(this->data < 0) *(outbuffer + offset -1) |= 0x80; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t * val_data = (uint32_t*) &(this->data); + offset += 3; + *val_data = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_data |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_data |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_data |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_data = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_data |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_data !=0) + *val_data |= ((exp_data)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->data = -this->data; + return offset; + } + + const char * getType(){ return "std_msgs/Float64"; }; + const char * getMD5(){ return "fdb28210bfa9d7c91146260178d9a584"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float64MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float64MultiArray.h new file mode 100755 index 0000000..fee95e0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Float64MultiArray.h @@ -0,0 +1,80 @@ +#ifndef _ROS_std_msgs_Float64MultiArray_h +#define _ROS_std_msgs_Float64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + int32_t * val_datai = (int32_t *) &(this->data[i]); + int32_t exp_datai = (((*val_datai)>>23)&255); + if(exp_datai != 0) + exp_datai += 1023-127; + int32_t sig_datai = *val_datai; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_datai<<5) & 0xff; + *(outbuffer + offset++) = (sig_datai>>3) & 0xff; + *(outbuffer + offset++) = (sig_datai>>11) & 0xff; + *(outbuffer + offset++) = ((exp_datai<<4) & 0xF0) | ((sig_datai>>19)&0x0F); + *(outbuffer + offset++) = (exp_datai>>4) & 0x7F; + if(this->data[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + uint32_t * val_st_data = (uint32_t*) &(this->st_data); + offset += 3; + *val_st_data = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_data |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_data |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_data |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_data = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_data |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_data !=0) + *val_st_data |= ((exp_st_data)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_data = -this->st_data; + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float64MultiArray"; }; + const char * getMD5(){ return "4b7d974086d4060e7db4613a7e6c3ba4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Header.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Header.h new file mode 100755 index 0000000..bc2aa41 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Header.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Header_h +#define _ROS_std_msgs_Header_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Header : public ros::Msg + { + public: + uint32_t seq; + ros::Time stamp; + char * frame_id; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq); + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id = strlen( (const char*) this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->seq = ((uint32_t) (*(inbuffer + offset))); + this->seq |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->seq); + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + const char * getType(){ return "std_msgs/Header"; }; + const char * getMD5(){ return "2176decaecbce78abc3b96ef049fabed"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int16.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int16.h new file mode 100755 index 0000000..43e2716 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int16.h @@ -0,0 +1,52 @@ +#ifndef _ROS_std_msgs_Int16_h +#define _ROS_std_msgs_Int16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int16 : public ros::Msg + { + public: + int16_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int16"; }; + const char * getMD5(){ return "8524586e34fbd7cb1c08c5f5f1ca0e57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int16MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int16MultiArray.h new file mode 100755 index 0000000..991a5f0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int16MultiArray.h @@ -0,0 +1,72 @@ +#ifndef _ROS_std_msgs_Int16MultiArray_h +#define _ROS_std_msgs_Int16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int16_t st_data; + int16_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int16MultiArray"; }; + const char * getMD5(){ return "d9338d7f523fcb692fae9d0a0e9f067c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int32.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int32.h new file mode 100755 index 0000000..c0769c7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int32.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Int32_h +#define _ROS_std_msgs_Int32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int32 : public ros::Msg + { + public: + int32_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int32"; }; + const char * getMD5(){ return "da5909fbe378aeaf85e547e830cc1bb7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int32MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int32MultiArray.h new file mode 100755 index 0000000..e749933 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int32MultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_Int32MultiArray_h +#define _ROS_std_msgs_Int32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int32_t st_data; + int32_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int32MultiArray"; }; + const char * getMD5(){ return "1d99f79f8b325b44fee908053e9c945b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int64.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int64.h new file mode 100755 index 0000000..9271315 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int64.h @@ -0,0 +1,64 @@ +#ifndef _ROS_std_msgs_Int64_h +#define _ROS_std_msgs_Int64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int64 : public ros::Msg + { + public: + int64_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_data.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_data.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_data.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_data.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int64"; }; + const char * getMD5(){ return "34add168574510e6e17f5d23ecc077ef"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int64MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int64MultiArray.h new file mode 100755 index 0000000..c5018b5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int64MultiArray.h @@ -0,0 +1,84 @@ +#ifndef _ROS_std_msgs_Int64MultiArray_h +#define _ROS_std_msgs_Int64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int64_t st_data; + int64_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int64MultiArray"; }; + const char * getMD5(){ return "54865aa6c65be0448113a2afc6a49270"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int8.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int8.h new file mode 100755 index 0000000..a1615ef --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int8.h @@ -0,0 +1,50 @@ +#ifndef _ROS_std_msgs_Int8_h +#define _ROS_std_msgs_Int8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int8 : public ros::Msg + { + public: + int8_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int8"; }; + const char * getMD5(){ return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int8MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int8MultiArray.h new file mode 100755 index 0000000..704a8d0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Int8MultiArray.h @@ -0,0 +1,70 @@ +#ifndef _ROS_std_msgs_Int8MultiArray_h +#define _ROS_std_msgs_Int8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int8MultiArray"; }; + const char * getMD5(){ return "d7c1af35a1b4781bbe79e03dd94b7c13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/MultiArrayDimension.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/MultiArrayDimension.h new file mode 100755 index 0000000..8e594d9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/MultiArrayDimension.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_MultiArrayDimension_h +#define _ROS_std_msgs_MultiArrayDimension_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class MultiArrayDimension : public ros::Msg + { + public: + char * label; + uint32_t size; + uint32_t stride; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_label = strlen( (const char*) this->label); + memcpy(outbuffer + offset, &length_label, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + *(outbuffer + offset + 0) = (this->stride >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stride >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stride >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stride >> (8 * 3)) & 0xFF; + offset += sizeof(this->stride); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_label; + memcpy(&length_label, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + this->size = ((uint32_t) (*(inbuffer + offset))); + this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size); + this->stride = ((uint32_t) (*(inbuffer + offset))); + this->stride |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stride |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stride |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stride); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayDimension"; }; + const char * getMD5(){ return "4cd0c83a8683deae40ecdac60e53bfa8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/MultiArrayLayout.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/MultiArrayLayout.h new file mode 100755 index 0000000..18aa979 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/MultiArrayLayout.h @@ -0,0 +1,65 @@ +#ifndef _ROS_std_msgs_MultiArrayLayout_h +#define _ROS_std_msgs_MultiArrayLayout_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayDimension.h" + +namespace std_msgs +{ + + class MultiArrayLayout : public ros::Msg + { + public: + uint8_t dim_length; + std_msgs::MultiArrayDimension st_dim; + std_msgs::MultiArrayDimension * dim; + uint32_t data_offset; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = dim_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->dim[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->data_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t dim_lengthT = *(inbuffer + offset++); + if(dim_lengthT > dim_length) + this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); + offset += 3; + dim_length = dim_lengthT; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->st_dim.deserialize(inbuffer + offset); + memcpy( &(this->dim[i]), &(this->st_dim), sizeof(std_msgs::MultiArrayDimension)); + } + this->data_offset = ((uint32_t) (*(inbuffer + offset))); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_offset); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayLayout"; }; + const char * getMD5(){ return "0fed2a11c13e11c5571b4e2a995a91a3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/String.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/String.h new file mode 100755 index 0000000..502b40c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/String.h @@ -0,0 +1,49 @@ +#ifndef _ROS_std_msgs_String_h +#define _ROS_std_msgs_String_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class String : public ros::Msg + { + public: + char * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_data = strlen( (const char*) this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "std_msgs/String"; }; + const char * getMD5(){ return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Time.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Time.h new file mode 100755 index 0000000..97bf5c7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/Time.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_Time_h +#define _ROS_std_msgs_Time_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Time : public ros::Msg + { + public: + ros::Time data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Time"; }; + const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt16.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt16.h new file mode 100755 index 0000000..9569629 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt16.h @@ -0,0 +1,41 @@ +#ifndef _ROS_std_msgs_UInt16_h +#define _ROS_std_msgs_UInt16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt16 : public ros::Msg + { + public: + uint16_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint16_t) (*(inbuffer + offset))); + this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt16"; }; + const char * getMD5(){ return "1df79edf208b629fe6b81923a544552d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt16MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt16MultiArray.h new file mode 100755 index 0000000..f713484 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt16MultiArray.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_UInt16MultiArray_h +#define _ROS_std_msgs_UInt16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint16_t st_data; + uint16_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint16_t*)realloc(this->data, data_lengthT * sizeof(uint16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint16_t) (*(inbuffer + offset))); + this->st_data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt16MultiArray"; }; + const char * getMD5(){ return "52f264f1c973c4b73790d384c6cb4484"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt32.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt32.h new file mode 100755 index 0000000..6a4546b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt32.h @@ -0,0 +1,45 @@ +#ifndef _ROS_std_msgs_UInt32_h +#define _ROS_std_msgs_UInt32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt32 : public ros::Msg + { + public: + uint32_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint32_t) (*(inbuffer + offset))); + this->data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt32"; }; + const char * getMD5(){ return "304a39449588c7f8ce2df6e8001c5fce"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt32MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt32MultiArray.h new file mode 100755 index 0000000..8faeed7 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt32MultiArray.h @@ -0,0 +1,65 @@ +#ifndef _ROS_std_msgs_UInt32MultiArray_h +#define _ROS_std_msgs_UInt32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint32_t st_data; + uint32_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint32_t) (*(inbuffer + offset))); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt32MultiArray"; }; + const char * getMD5(){ return "4d6a180abc9be191b96a7eda6c8a233d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt64.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt64.h new file mode 100755 index 0000000..02468f0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt64.h @@ -0,0 +1,56 @@ +#ifndef _ROS_std_msgs_UInt64_h +#define _ROS_std_msgs_UInt64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt64 : public ros::Msg + { + public: + uint64_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt64"; }; + const char * getMD5(){ return "1b2a79973e8bf53d7b53acb71299cb57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt64MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt64MultiArray.h new file mode 100755 index 0000000..c562c66 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt64MultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_UInt64MultiArray_h +#define _ROS_std_msgs_UInt64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint64_t st_data; + uint64_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint64_t*)realloc(this->data, data_lengthT * sizeof(uint64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt64MultiArray"; }; + const char * getMD5(){ return "6088f127afb1d6c72927aa1247e945af"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt8.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt8.h new file mode 100755 index 0000000..85dcfd6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt8.h @@ -0,0 +1,39 @@ +#ifndef _ROS_std_msgs_UInt8_h +#define _ROS_std_msgs_UInt8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt8 : public ros::Msg + { + public: + uint8_t data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt8"; }; + const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt8MultiArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt8MultiArray.h new file mode 100755 index 0000000..8633016 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_msgs/UInt8MultiArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_std_msgs_UInt8MultiArray_h +#define _ROS_std_msgs_UInt8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt8MultiArray"; }; + const char * getMD5(){ return "82373f1612381bb6ee473b5cd6f5d89c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/std_srvs/Empty.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_srvs/Empty.h new file mode 100755 index 0000000..114a99a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/std_srvs/Empty.h @@ -0,0 +1,62 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char EMPTY[] = "std_srvs/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/stereo_msgs/DisparityImage.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/stereo_msgs/DisparityImage.h new file mode 100755 index 0000000..2d0505c --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/stereo_msgs/DisparityImage.h @@ -0,0 +1,156 @@ +#ifndef _ROS_stereo_msgs_DisparityImage_h +#define _ROS_stereo_msgs_DisparityImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace stereo_msgs +{ + + class DisparityImage : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::Image image; + float f; + float T; + sensor_msgs::RegionOfInterest valid_window; + float min_disparity; + float max_disparity; + float delta_d; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.real = this->f; + *(outbuffer + offset + 0) = (u_f.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_f.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_f.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_f.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.real = this->T; + *(outbuffer + offset + 0) = (u_T.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_T.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_T.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_T.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->T); + offset += this->valid_window.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.real = this->min_disparity; + *(outbuffer + offset + 0) = (u_min_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.real = this->max_disparity; + *(outbuffer + offset + 0) = (u_max_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.real = this->delta_d; + *(outbuffer + offset + 0) = (u_delta_d.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delta_d.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delta_d.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delta_d.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delta_d); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.base = 0; + u_f.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->f = u_f.real; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.base = 0; + u_T.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->T = u_T.real; + offset += sizeof(this->T); + offset += this->valid_window.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.base = 0; + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_disparity = u_min_disparity.real; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.base = 0; + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_disparity = u_max_disparity.real; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.base = 0; + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delta_d = u_delta_d.real; + offset += sizeof(this->delta_d); + return offset; + } + + const char * getType(){ return "stereo_msgs/DisparityImage"; }; + const char * getMD5(){ return "04a177815f75271039fa21f16acad8c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/array_test/array_test.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/array_test/array_test.pde new file mode 100755 index 0000000..8aa72de --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/array_test/array_test.pde @@ -0,0 +1,49 @@ +/* + * rosserial::geometry_msgs::PoseArray Test + * Sums an array, publishes sum + */ + +#include +#include +#include + + +ros::NodeHandle nh; + + +bool set_; + + +geometry_msgs::Pose sum_msg; +ros::Publisher p("sum", &sum_msg); + +void messageCb(const geometry_msgs::PoseArray& msg){ + sum_msg.position.x = 0; + sum_msg.position.y = 0; + sum_msg.position.z = 0; + for(int i = 0; i < msg.poses_length; i++) + { + sum_msg.position.x += msg.poses[i].position.x; + sum_msg.position.y += msg.poses[i].position.y; + sum_msg.position.z += msg.poses[i].position.z; + } + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber s("poses",messageCb); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(s); + nh.advertise(p); +} + +void loop() +{ + p.publish(&sum_msg); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/float64_test/float64_test.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/float64_test/float64_test.pde new file mode 100755 index 0000000..41a6f4a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/float64_test/float64_test.pde @@ -0,0 +1,38 @@ +/* + * rosserial::std_msgs::Float64 Test + * Receives a Float64 input, subtracts 1.0, and publishes it + */ + +#include +#include + + +ros::NodeHandle nh; + +float x; + +void messageCb( const std_msgs::Float64& msg){ + x = msg.data - 1.0; + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +std_msgs::Float64 test; +ros::Subscriber s("your_topic", &messageCb); +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); + nh.subscribe(s); +} + +void loop() +{ + test.data = x; + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/time_test/time_test.pde b/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/time_test/time_test.pde new file mode 100755 index 0000000..c5fa739 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tests/time_test/time_test.pde @@ -0,0 +1,30 @@ +/* + * rosserial::std_msgs::Time Test + * Publishes current time + */ + +#include +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Time test; +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); +} + +void loop() +{ + test.data = nh.now(); + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/FrameGraph.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/FrameGraph.h new file mode 100755 index 0000000..06f4f0a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/FrameGraph.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf +{ + +static const char FRAMEGRAPH[] = "tf/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + char * dot_graph; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_dot_graph = strlen( (const char*) this->dot_graph); + memcpy(outbuffer + offset, &length_dot_graph, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->dot_graph, length_dot_graph); + offset += length_dot_graph; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_dot_graph; + memcpy(&length_dot_graph, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dot_graph; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dot_graph-1]=0; + this->dot_graph = (char *)(inbuffer + offset-1); + offset += length_dot_graph; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/tf.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/tf.h new file mode 100755 index 0000000..c84c127 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/tf.h @@ -0,0 +1,56 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TF_H_ +#define ROS_TF_H_ + +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + geometry_msgs::Quaternion createQuaternionFromYaw(double yaw) + { + geometry_msgs::Quaternion q; + q.x = 0; + q.y = 0; + q.z = sin(yaw * 0.5); + q.w = cos(yaw * 0.5); + return q; + } + +} + +#endif + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/tfMessage.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/tfMessage.h new file mode 100755 index 0000000..683f792 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/tfMessage.h @@ -0,0 +1,54 @@ +#ifndef _ROS_tf_tfMessage_h +#define _ROS_tf_tfMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + class tfMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf/tfMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/transform_broadcaster.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/transform_broadcaster.h new file mode 100755 index 0000000..817eaba --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf/transform_broadcaster.h @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TRANSFORM_BROADCASTER_H_ +#define ROS_TRANSFORM_BROADCASTER_H_ + +#include "tfMessage.h" + +namespace tf +{ + + class TransformBroadcaster + { + public: + TransformBroadcaster() : publisher_("/tf", &internal_msg) {} + + void init(ros::NodeHandle &nh) + { + nh.advertise(publisher_); + } + + void sendTransform(geometry_msgs::TransformStamped &transform) + { + internal_msg.transforms_length = 1; + internal_msg.transforms = &transform; + publisher_.publish(&internal_msg); + } + + private: + tf::tfMessage internal_msg; + ros::Publisher publisher_; + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/FrameGraph.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/FrameGraph.h new file mode 100755 index 0000000..38542ac --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/FrameGraph.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + +static const char FRAMEGRAPH[] = "tf2_msgs/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + char * frame_yaml; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_yaml = strlen( (const char*) this->frame_yaml); + memcpy(outbuffer + offset, &length_frame_yaml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_yaml, length_frame_yaml); + offset += length_frame_yaml; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_yaml; + memcpy(&length_frame_yaml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_yaml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_yaml-1]=0; + this->frame_yaml = (char *)(inbuffer + offset-1); + offset += length_frame_yaml; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "437ea58e9463815a0d511c7326b686b0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h new file mode 100755 index 0000000..3d7abc2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_tf2_msgs_LookupTransformAction_h +#define _ROS_tf2_msgs_LookupTransformAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "tf2_msgs/LookupTransformActionGoal.h" +#include "tf2_msgs/LookupTransformActionResult.h" +#include "tf2_msgs/LookupTransformActionFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformAction : public ros::Msg + { + public: + tf2_msgs::LookupTransformActionGoal action_goal; + tf2_msgs::LookupTransformActionResult action_result; + tf2_msgs::LookupTransformActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformAction"; }; + const char * getMD5(){ return "7ee01ba91a56c2245c610992dbaa3c37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h new file mode 100755 index 0000000..df64f72 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionFeedback_h +#define _ROS_tf2_msgs_LookupTransformActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h new file mode 100755 index 0000000..2acacd0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionGoal_h +#define _ROS_tf2_msgs_LookupTransformActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "tf2_msgs/LookupTransformGoal.h" + +namespace tf2_msgs +{ + + class LookupTransformActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + tf2_msgs::LookupTransformGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionGoal"; }; + const char * getMD5(){ return "f2e7bcdb75c847978d0351a13e699da5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h new file mode 100755 index 0000000..b0abda8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionResult_h +#define _ROS_tf2_msgs_LookupTransformActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformResult.h" + +namespace tf2_msgs +{ + + class LookupTransformActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionResult"; }; + const char * getMD5(){ return "ac26ce75a41384fa8bb4dc10f491ab90"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h new file mode 100755 index 0000000..5fb9b0a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h @@ -0,0 +1,34 @@ +#ifndef _ROS_tf2_msgs_LookupTransformFeedback_h +#define _ROS_tf2_msgs_LookupTransformFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class LookupTransformFeedback : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h new file mode 100755 index 0000000..46a295a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h @@ -0,0 +1,160 @@ +#ifndef _ROS_tf2_msgs_LookupTransformGoal_h +#define _ROS_tf2_msgs_LookupTransformGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace tf2_msgs +{ + + class LookupTransformGoal : public ros::Msg + { + public: + char * target_frame; + char * source_frame; + ros::Time source_time; + ros::Duration timeout; + ros::Time target_time; + char * fixed_frame; + bool advanced; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_target_frame = strlen( (const char*) this->target_frame); + memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + uint32_t length_source_frame = strlen( (const char*) this->source_frame); + memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source_frame, length_source_frame); + offset += length_source_frame; + *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.sec); + *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.nsec); + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->target_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.sec); + *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame = strlen( (const char*) this->fixed_frame); + memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.real = this->advanced; + *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->advanced); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_target_frame; + memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + uint32_t length_source_frame; + memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source_frame-1]=0; + this->source_frame = (char *)(inbuffer + offset-1); + offset += length_source_frame; + this->source_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.sec); + this->source_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.nsec); + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->target_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.sec); + this->target_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame; + memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_fixed_frame-1]=0; + this->fixed_frame = (char *)(inbuffer + offset-1); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.base = 0; + u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->advanced = u_advanced.real; + offset += sizeof(this->advanced); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformGoal"; }; + const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h new file mode 100755 index 0000000..738b15a --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h @@ -0,0 +1,42 @@ +#ifndef _ROS_tf2_msgs_LookupTransformResult_h +#define _ROS_tf2_msgs_LookupTransformResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" +#include "tf2_msgs/TF2Error.h" + +namespace tf2_msgs +{ + + class LookupTransformResult : public ros::Msg + { + public: + geometry_msgs::TransformStamped transform; + tf2_msgs::TF2Error error; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->transform.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->transform.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformResult"; }; + const char * getMD5(){ return "3fe5db6a19ca9cfb675418c5ad875c36"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/TF2Error.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/TF2Error.h new file mode 100755 index 0000000..f26e640 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/TF2Error.h @@ -0,0 +1,61 @@ +#ifndef _ROS_tf2_msgs_TF2Error_h +#define _ROS_tf2_msgs_TF2Error_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class TF2Error : public ros::Msg + { + public: + uint8_t error; + char * error_string; + enum { NO_ERROR = 0 }; + enum { LOOKUP_ERROR = 1 }; + enum { CONNECTIVITY_ERROR = 2 }; + enum { EXTRAPOLATION_ERROR = 3 }; + enum { INVALID_ARGUMENT_ERROR = 4 }; + enum { TIMEOUT_ERROR = 5 }; + enum { TRANSFORM_ERROR = 6 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + uint32_t length_error_string = strlen( (const char*) this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "tf2_msgs/TF2Error"; }; + const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/TFMessage.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/TFMessage.h new file mode 100755 index 0000000..e399ddf --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/tf2_msgs/TFMessage.h @@ -0,0 +1,54 @@ +#ifndef _ROS_tf2_msgs_TFMessage_h +#define _ROS_tf2_msgs_TFMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_msgs +{ + + class TFMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf2_msgs/TFMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/theora_image_transport/Packet.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/theora_image_transport/Packet.h new file mode 100755 index 0000000..11650a4 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/theora_image_transport/Packet.h @@ -0,0 +1,163 @@ +#ifndef _ROS_theora_image_transport_Packet_h +#define _ROS_theora_image_transport_Packet_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace theora_image_transport +{ + + class Packet : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + int32_t b_o_s; + int32_t e_o_s; + int64_t granulepos; + int64_t packetno; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.real = this->b_o_s; + *(outbuffer + offset + 0) = (u_b_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.real = this->e_o_s; + *(outbuffer + offset + 0) = (u_e_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_e_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_e_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_e_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.real = this->granulepos; + *(outbuffer + offset + 0) = (u_granulepos.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_granulepos.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_granulepos.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_granulepos.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_granulepos.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_granulepos.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_granulepos.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_granulepos.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.real = this->packetno; + *(outbuffer + offset + 0) = (u_packetno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_packetno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_packetno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_packetno.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_packetno.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_packetno.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_packetno.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_packetno.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->packetno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.base = 0; + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b_o_s = u_b_o_s.real; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.base = 0; + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->e_o_s = u_e_o_s.real; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.base = 0; + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->granulepos = u_granulepos.real; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.base = 0; + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->packetno = u_packetno.real; + offset += sizeof(this->packetno); + return offset; + } + + const char * getType(){ return "theora_image_transport/Packet"; }; + const char * getMD5(){ return "33ac4e14a7cff32e7e0d65f18bb410f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/time.cpp b/case_study/arduino_lab/group_01/original/lib/ros_lib/time.cpp new file mode 100755 index 0000000..9b3f10d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/time.cpp @@ -0,0 +1,70 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ros.h" +#include "ros/time.h" + +namespace ros +{ + void normalizeSecNSec(unsigned long& sec, unsigned long& nsec){ + unsigned long nsec_part= nsec % 1000000000UL; + unsigned long sec_part = nsec / 1000000000UL; + sec += sec_part; + nsec = nsec_part; + } + + Time& Time::fromNSec(long t) + { + sec = t / 1000000000; + nsec = t % 1000000000; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator +=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator -=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } + +} diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxAdd.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxAdd.h new file mode 100755 index 0000000..6f33df2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxAdd.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_MuxAdd_h +#define _ROS_SERVICE_MuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXADD[] = "topic_tools/MuxAdd"; + + class MuxAddRequest : public ros::Msg + { + public: + char * topic; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen( (const char*) this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxAddResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxAdd { + public: + typedef MuxAddRequest Request; + typedef MuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxDelete.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxDelete.h new file mode 100755 index 0000000..5a815e9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxDelete.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_MuxDelete_h +#define _ROS_SERVICE_MuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXDELETE[] = "topic_tools/MuxDelete"; + + class MuxDeleteRequest : public ros::Msg + { + public: + char * topic; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen( (const char*) this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxDeleteResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxDelete { + public: + typedef MuxDeleteRequest Request; + typedef MuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxList.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxList.h new file mode 100755 index 0000000..4294539 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxList.h @@ -0,0 +1,93 @@ +#ifndef _ROS_SERVICE_MuxList_h +#define _ROS_SERVICE_MuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXLIST[] = "topic_tools/MuxList"; + + class MuxListRequest : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen( (const char*) this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class MuxList { + public: + typedef MuxListRequest Request; + typedef MuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxSelect.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxSelect.h new file mode 100755 index 0000000..39b1ae2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/topic_tools/MuxSelect.h @@ -0,0 +1,92 @@ +#ifndef _ROS_SERVICE_MuxSelect_h +#define _ROS_SERVICE_MuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXSELECT[] = "topic_tools/MuxSelect"; + + class MuxSelectRequest : public ros::Msg + { + public: + char * topic; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen( (const char*) this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxSelectResponse : public ros::Msg + { + public: + char * prev_topic; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen( (const char*) this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class MuxSelect { + public: + typedef MuxSelectRequest Request; + typedef MuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h new file mode 100755 index 0000000..d3edf78 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h @@ -0,0 +1,89 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectory_h +#define _ROS_trajectory_msgs_JointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class JointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::JointTrajectoryPoint st_points; + trajectory_msgs::JointTrajectoryPoint * points; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::JointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectory"; }; + const char * getMD5(){ return "65b4f94a94d1ed67169da35a02f33d3f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h new file mode 100755 index 0000000..3a370a1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h @@ -0,0 +1,224 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectoryPoint_h +#define _ROS_trajectory_msgs_JointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class JointTrajectoryPoint : public ros::Msg + { + public: + uint8_t positions_length; + float st_positions; + float * positions; + uint8_t velocities_length; + float st_velocities; + float * velocities; + uint8_t accelerations_length; + float st_accelerations; + float * accelerations; + uint8_t effort_length; + float st_effort; + float * effort; + ros::Duration time_from_start; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < positions_length; i++){ + int32_t * val_positionsi = (int32_t *) &(this->positions[i]); + int32_t exp_positionsi = (((*val_positionsi)>>23)&255); + if(exp_positionsi != 0) + exp_positionsi += 1023-127; + int32_t sig_positionsi = *val_positionsi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_positionsi<<5) & 0xff; + *(outbuffer + offset++) = (sig_positionsi>>3) & 0xff; + *(outbuffer + offset++) = (sig_positionsi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_positionsi<<4) & 0xF0) | ((sig_positionsi>>19)&0x0F); + *(outbuffer + offset++) = (exp_positionsi>>4) & 0x7F; + if(this->positions[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + int32_t * val_velocitiesi = (int32_t *) &(this->velocities[i]); + int32_t exp_velocitiesi = (((*val_velocitiesi)>>23)&255); + if(exp_velocitiesi != 0) + exp_velocitiesi += 1023-127; + int32_t sig_velocitiesi = *val_velocitiesi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_velocitiesi<<5) & 0xff; + *(outbuffer + offset++) = (sig_velocitiesi>>3) & 0xff; + *(outbuffer + offset++) = (sig_velocitiesi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_velocitiesi<<4) & 0xF0) | ((sig_velocitiesi>>19)&0x0F); + *(outbuffer + offset++) = (exp_velocitiesi>>4) & 0x7F; + if(this->velocities[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + int32_t * val_accelerationsi = (int32_t *) &(this->accelerations[i]); + int32_t exp_accelerationsi = (((*val_accelerationsi)>>23)&255); + if(exp_accelerationsi != 0) + exp_accelerationsi += 1023-127; + int32_t sig_accelerationsi = *val_accelerationsi; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_accelerationsi<<5) & 0xff; + *(outbuffer + offset++) = (sig_accelerationsi>>3) & 0xff; + *(outbuffer + offset++) = (sig_accelerationsi>>11) & 0xff; + *(outbuffer + offset++) = ((exp_accelerationsi<<4) & 0xF0) | ((sig_accelerationsi>>19)&0x0F); + *(outbuffer + offset++) = (exp_accelerationsi>>4) & 0x7F; + if(this->accelerations[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + int32_t * val_efforti = (int32_t *) &(this->effort[i]); + int32_t exp_efforti = (((*val_efforti)>>23)&255); + if(exp_efforti != 0) + exp_efforti += 1023-127; + int32_t sig_efforti = *val_efforti; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = (sig_efforti<<5) & 0xff; + *(outbuffer + offset++) = (sig_efforti>>3) & 0xff; + *(outbuffer + offset++) = (sig_efforti>>11) & 0xff; + *(outbuffer + offset++) = ((exp_efforti<<4) & 0xF0) | ((sig_efforti>>19)&0x0F); + *(outbuffer + offset++) = (exp_efforti>>4) & 0x7F; + if(this->effort[i] < 0) *(outbuffer + offset -1) |= 0x80; + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t positions_lengthT = *(inbuffer + offset++); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + offset += 3; + positions_length = positions_lengthT; + for( uint8_t i = 0; i < positions_length; i++){ + uint32_t * val_st_positions = (uint32_t*) &(this->st_positions); + offset += 3; + *val_st_positions = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_positions |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_positions |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_positions |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_positions = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_positions |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_positions !=0) + *val_st_positions |= ((exp_st_positions)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_positions = -this->st_positions; + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + uint32_t * val_st_velocities = (uint32_t*) &(this->st_velocities); + offset += 3; + *val_st_velocities = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_velocities |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_velocities |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_velocities |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_velocities = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_velocities |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_velocities !=0) + *val_st_velocities |= ((exp_st_velocities)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_velocities = -this->st_velocities; + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + uint32_t * val_st_accelerations = (uint32_t*) &(this->st_accelerations); + offset += 3; + *val_st_accelerations = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_accelerations |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_accelerations |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_accelerations |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_accelerations = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_accelerations |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_accelerations !=0) + *val_st_accelerations |= ((exp_st_accelerations)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_accelerations = -this->st_accelerations; + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + uint32_t * val_st_effort = (uint32_t*) &(this->st_effort); + offset += 3; + *val_st_effort = ((uint32_t)(*(inbuffer + offset++))>>5 & 0x07); + *val_st_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<3; + *val_st_effort |= ((uint32_t)(*(inbuffer + offset++)) & 0xff)<<11; + *val_st_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x0f)<<19; + uint32_t exp_st_effort = ((uint32_t)(*(inbuffer + offset++))&0xf0)>>4; + exp_st_effort |= ((uint32_t)(*(inbuffer + offset)) & 0x7f)<<4; + if(exp_st_effort !=0) + *val_st_effort |= ((exp_st_effort)-1023+127)<<23; + if( ((*(inbuffer+offset++)) & 0x80) > 0) this->st_effort = -this->st_effort; + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectoryPoint"; }; + const char * getMD5(){ return "f3cd1e1c4d320c79d6985c904ae5dcd3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h new file mode 100755 index 0000000..9dc2da2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h @@ -0,0 +1,89 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectory_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/MultiDOFJointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::MultiDOFJointTrajectoryPoint st_points; + trajectory_msgs::MultiDOFJointTrajectoryPoint * points; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen( (const char*) this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::MultiDOFJointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectory"; }; + const char * getMD5(){ return "ef145a45a5f47b77b7f5cdde4b16c942"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h new file mode 100755 index 0000000..7075735 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h @@ -0,0 +1,115 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectoryPoint : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t velocities_length; + geometry_msgs::Twist st_velocities; + geometry_msgs::Twist * velocities; + uint8_t accelerations_length; + geometry_msgs::Twist st_accelerations; + geometry_msgs::Twist * accelerations; + ros::Duration time_from_start; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->velocities[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->accelerations[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (geometry_msgs::Twist*)realloc(this->velocities, velocities_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->st_velocities.deserialize(inbuffer + offset); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(geometry_msgs::Twist)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (geometry_msgs::Twist*)realloc(this->accelerations, accelerations_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->st_accelerations.deserialize(inbuffer + offset); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(geometry_msgs::Twist)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectoryPoint"; }; + const char * getMD5(){ return "3ebe08d1abd5b65862d50e09430db776"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeAction.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeAction.h new file mode 100755 index 0000000..f1efd57 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeAction.h @@ -0,0 +1,46 @@ +#ifndef _ROS_turtle_actionlib_ShapeAction_h +#define _ROS_turtle_actionlib_ShapeAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "turtle_actionlib/ShapeActionGoal.h" +#include "turtle_actionlib/ShapeActionResult.h" +#include "turtle_actionlib/ShapeActionFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeAction : public ros::Msg + { + public: + turtle_actionlib::ShapeActionGoal action_goal; + turtle_actionlib::ShapeActionResult action_result; + turtle_actionlib::ShapeActionFeedback action_feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeAction"; }; + const char * getMD5(){ return "d73b17d6237a925511f5d7727a1dc903"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h new file mode 100755 index 0000000..4de2750 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h @@ -0,0 +1,46 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionFeedback_h +#define _ROS_turtle_actionlib_ShapeActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeFeedback feedback; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h new file mode 100755 index 0000000..43eafe3 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h @@ -0,0 +1,46 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionGoal_h +#define _ROS_turtle_actionlib_ShapeActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "turtle_actionlib/ShapeGoal.h" + +namespace turtle_actionlib +{ + + class ShapeActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + turtle_actionlib::ShapeGoal goal; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionGoal"; }; + const char * getMD5(){ return "dbfccd187f2ec9c593916447ffd6cc77"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h new file mode 100755 index 0000000..2a53fec --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h @@ -0,0 +1,46 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionResult_h +#define _ROS_turtle_actionlib_ShapeActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeResult.h" + +namespace turtle_actionlib +{ + + class ShapeActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeResult result; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionResult"; }; + const char * getMD5(){ return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h new file mode 100755 index 0000000..06148e5 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h @@ -0,0 +1,34 @@ +#ifndef _ROS_turtle_actionlib_ShapeFeedback_h +#define _ROS_turtle_actionlib_ShapeFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeFeedback : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h new file mode 100755 index 0000000..87b0c78 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h @@ -0,0 +1,78 @@ +#ifndef _ROS_turtle_actionlib_ShapeGoal_h +#define _ROS_turtle_actionlib_ShapeGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeGoal : public ros::Msg + { + public: + int32_t edges; + float radius; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.real = this->edges; + *(outbuffer + offset + 0) = (u_edges.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_edges.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_edges.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_edges.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.real = this->radius; + *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.base = 0; + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->edges = u_edges.real; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.base = 0; + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->radius = u_radius.real; + offset += sizeof(this->radius); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeGoal"; }; + const char * getMD5(){ return "3b9202ab7292cebe5a95ab2bf6b9c091"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeResult.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeResult.h new file mode 100755 index 0000000..c71b34d --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/ShapeResult.h @@ -0,0 +1,78 @@ +#ifndef _ROS_turtle_actionlib_ShapeResult_h +#define _ROS_turtle_actionlib_ShapeResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeResult : public ros::Msg + { + public: + float interior_angle; + float apothem; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.real = this->interior_angle; + *(outbuffer + offset + 0) = (u_interior_angle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_interior_angle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_interior_angle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_interior_angle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.real = this->apothem; + *(outbuffer + offset + 0) = (u_apothem.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_apothem.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_apothem.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_apothem.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->apothem); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.base = 0; + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->interior_angle = u_interior_angle.real; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.base = 0; + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->apothem = u_apothem.real; + offset += sizeof(this->apothem); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeResult"; }; + const char * getMD5(){ return "b06c6e2225f820dbc644270387cd1a7c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/Velocity.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/Velocity.h new file mode 100755 index 0000000..f2b8280 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtle_actionlib/Velocity.h @@ -0,0 +1,78 @@ +#ifndef _ROS_turtle_actionlib_Velocity_h +#define _ROS_turtle_actionlib_Velocity_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class Velocity : public ros::Msg + { + public: + float linear; + float angular; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return "turtle_actionlib/Velocity"; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Color.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Color.h new file mode 100755 index 0000000..1ea6af2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Color.h @@ -0,0 +1,49 @@ +#ifndef _ROS_turtlesim_Color_h +#define _ROS_turtlesim_Color_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Color : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "turtlesim/Color"; }; + const char * getMD5(){ return "353891e354491c51aabe32df673fb446"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Kill.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Kill.h new file mode 100755 index 0000000..393f1e6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Kill.h @@ -0,0 +1,77 @@ +#ifndef _ROS_SERVICE_Kill_h +#define _ROS_SERVICE_Kill_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char KILL[] = "turtlesim/Kill"; + + class KillRequest : public ros::Msg + { + public: + char * name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class KillResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Kill { + public: + typedef KillRequest Request; + typedef KillResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Pose.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Pose.h new file mode 100755 index 0000000..503c073 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Pose.h @@ -0,0 +1,144 @@ +#ifndef _ROS_turtlesim_Pose_h +#define _ROS_turtlesim_Pose_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Pose : public ros::Msg + { + public: + float x; + float y; + float theta; + float linear_velocity; + float angular_velocity; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.real = this->linear_velocity; + *(outbuffer + offset + 0) = (u_linear_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.real = this->angular_velocity; + *(outbuffer + offset + 0) = (u_angular_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.base = 0; + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear_velocity = u_linear_velocity.real; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.base = 0; + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular_velocity = u_angular_velocity.real; + offset += sizeof(this->angular_velocity); + return offset; + } + + const char * getType(){ return "turtlesim/Pose"; }; + const char * getMD5(){ return "863b248d5016ca62ea2e895ae5265cf9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/SetPen.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/SetPen.h new file mode 100755 index 0000000..a626049 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/SetPen.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_SetPen_h +#define _ROS_SERVICE_SetPen_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SETPEN[] = "turtlesim/SetPen"; + + class SetPenRequest : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t width; + uint8_t off; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->off >> (8 * 0)) & 0xFF; + offset += sizeof(this->off); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + this->width = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->width); + this->off = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->off); + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "9f452acce566bf0c0954594f69a8e41b"; }; + + }; + + class SetPenResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPen { + public: + typedef SetPenRequest Request; + typedef SetPenResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Spawn.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Spawn.h new file mode 100755 index 0000000..3192395 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/Spawn.h @@ -0,0 +1,158 @@ +#ifndef _ROS_SERVICE_Spawn_h +#define _ROS_SERVICE_Spawn_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SPAWN[] = "turtlesim/Spawn"; + + class SpawnRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + char * name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "57f001c49ab7b11d699f8606c1f4f7ff"; }; + + }; + + class SpawnResponse : public ros::Msg + { + public: + char * name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class Spawn { + public: + typedef SpawnRequest Request; + typedef SpawnResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/TeleportAbsolute.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/TeleportAbsolute.h new file mode 100755 index 0000000..ab0a30f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/TeleportAbsolute.h @@ -0,0 +1,128 @@ +#ifndef _ROS_SERVICE_TeleportAbsolute_h +#define _ROS_SERVICE_TeleportAbsolute_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; + + class TeleportAbsoluteRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "a130bc60ee6513855dc62ea83fcc5b20"; }; + + }; + + class TeleportAbsoluteResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportAbsolute { + public: + typedef TeleportAbsoluteRequest Request; + typedef TeleportAbsoluteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/TeleportRelative.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/TeleportRelative.h new file mode 100755 index 0000000..d5b881f --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/turtlesim/TeleportRelative.h @@ -0,0 +1,106 @@ +#ifndef _ROS_SERVICE_TeleportRelative_h +#define _ROS_SERVICE_TeleportRelative_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTRELATIVE[] = "turtlesim/TeleportRelative"; + + class TeleportRelativeRequest : public ros::Msg + { + public: + float linear; + float angular; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + + class TeleportRelativeResponse : public ros::Msg + { + public: + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportRelative { + public: + typedef TeleportRelativeRequest Request; + typedef TeleportRelativeResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/ImageMarker.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/ImageMarker.h new file mode 100755 index 0000000..6469d32 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/ImageMarker.h @@ -0,0 +1,224 @@ +#ifndef _ROS_visualization_msgs_ImageMarker_h +#define _ROS_visualization_msgs_ImageMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace visualization_msgs +{ + + class ImageMarker : public ros::Msg + { + public: + std_msgs::Header header; + char * ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Point position; + float scale; + std_msgs::ColorRGBA outline_color; + uint8_t filled; + std_msgs::ColorRGBA fill_color; + ros::Duration lifetime; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t outline_colors_length; + std_msgs::ColorRGBA st_outline_colors; + std_msgs::ColorRGBA * outline_colors; + enum { CIRCLE = 0 }; + enum { LINE_STRIP = 1 }; + enum { LINE_LIST = 2 }; + enum { POLYGON = 3 }; + enum { POINTS = 4 }; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen( (const char*) this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->position.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + offset += this->outline_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->filled >> (8 * 0)) & 0xFF; + offset += sizeof(this->filled); + offset += this->fill_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = outline_colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->position.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + offset += this->outline_color.deserialize(inbuffer + offset); + this->filled = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->filled); + offset += this->fill_color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t outline_colors_lengthT = *(inbuffer + offset++); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + outline_colors_length = outline_colors_lengthT; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->st_outline_colors.deserialize(inbuffer + offset); + memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/ImageMarker"; }; + const char * getMD5(){ return "1de93c67ec8858b831025a08fbf1b35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h new file mode 100755 index 0000000..69d4509 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h @@ -0,0 +1,134 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarker_h +#define _ROS_visualization_msgs_InteractiveMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "visualization_msgs/MenuEntry.h" +#include "visualization_msgs/InteractiveMarkerControl.h" + +namespace visualization_msgs +{ + + class InteractiveMarker : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + char * name; + char * description; + float scale; + uint8_t menu_entries_length; + visualization_msgs::MenuEntry st_menu_entries; + visualization_msgs::MenuEntry * menu_entries; + uint8_t controls_length; + visualization_msgs::InteractiveMarkerControl st_controls; + visualization_msgs::InteractiveMarkerControl * controls; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_description = strlen( (const char*) this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + *(outbuffer + offset++) = menu_entries_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->menu_entries[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = controls_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->controls[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + uint8_t menu_entries_lengthT = *(inbuffer + offset++); + if(menu_entries_lengthT > menu_entries_length) + this->menu_entries = (visualization_msgs::MenuEntry*)realloc(this->menu_entries, menu_entries_lengthT * sizeof(visualization_msgs::MenuEntry)); + offset += 3; + menu_entries_length = menu_entries_lengthT; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->st_menu_entries.deserialize(inbuffer + offset); + memcpy( &(this->menu_entries[i]), &(this->st_menu_entries), sizeof(visualization_msgs::MenuEntry)); + } + uint8_t controls_lengthT = *(inbuffer + offset++); + if(controls_lengthT > controls_length) + this->controls = (visualization_msgs::InteractiveMarkerControl*)realloc(this->controls, controls_lengthT * sizeof(visualization_msgs::InteractiveMarkerControl)); + offset += 3; + controls_length = controls_lengthT; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->st_controls.deserialize(inbuffer + offset); + memcpy( &(this->controls[i]), &(this->st_controls), sizeof(visualization_msgs::InteractiveMarkerControl)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarker"; }; + const char * getMD5(){ return "311bd5f6cd6a20820ac0ba84315f4e22"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h new file mode 100755 index 0000000..af36fa9 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h @@ -0,0 +1,143 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerControl_h +#define _ROS_visualization_msgs_InteractiveMarkerControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Quaternion.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerControl : public ros::Msg + { + public: + char * name; + geometry_msgs::Quaternion orientation; + uint8_t orientation_mode; + uint8_t interaction_mode; + bool always_visible; + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + bool independent_marker_orientation; + char * description; + enum { INHERIT = 0 }; + enum { FIXED = 1 }; + enum { VIEW_FACING = 2 }; + enum { NONE = 0 }; + enum { MENU = 1 }; + enum { BUTTON = 2 }; + enum { MOVE_AXIS = 3 }; + enum { MOVE_PLANE = 4 }; + enum { ROTATE_AXIS = 5 }; + enum { MOVE_ROTATE = 6 }; + enum { MOVE_3D = 7 }; + enum { ROTATE_3D = 8 }; + enum { MOVE_ROTATE_3D = 9 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += this->orientation.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->orientation_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->orientation_mode); + *(outbuffer + offset + 0) = (this->interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.real = this->always_visible; + *(outbuffer + offset + 0) = (u_always_visible.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->always_visible); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.real = this->independent_marker_orientation; + *(outbuffer + offset + 0) = (u_independent_marker_orientation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description = strlen( (const char*) this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += this->orientation.deserialize(inbuffer + offset); + this->orientation_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->orientation_mode); + this->interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.base = 0; + u_always_visible.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->always_visible = u_always_visible.real; + offset += sizeof(this->always_visible); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.base = 0; + u_independent_marker_orientation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->independent_marker_orientation = u_independent_marker_orientation.real; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerControl"; }; + const char * getMD5(){ return "e3a939c98cdd4f709d8e1dec2a9c3f37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h new file mode 100755 index 0000000..fd5c8ea --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h @@ -0,0 +1,129 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerFeedback_h +#define _ROS_visualization_msgs_InteractiveMarkerFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerFeedback : public ros::Msg + { + public: + std_msgs::Header header; + char * client_id; + char * marker_name; + char * control_name; + uint8_t event_type; + geometry_msgs::Pose pose; + uint32_t menu_entry_id; + geometry_msgs::Point mouse_point; + bool mouse_point_valid; + enum { KEEP_ALIVE = 0 }; + enum { POSE_UPDATE = 1 }; + enum { MENU_SELECT = 2 }; + enum { BUTTON_CLICK = 3 }; + enum { MOUSE_DOWN = 4 }; + enum { MOUSE_UP = 5 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_client_id = strlen( (const char*) this->client_id); + memcpy(outbuffer + offset, &length_client_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->client_id, length_client_id); + offset += length_client_id; + uint32_t length_marker_name = strlen( (const char*) this->marker_name); + memcpy(outbuffer + offset, &length_marker_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + uint32_t length_control_name = strlen( (const char*) this->control_name); + memcpy(outbuffer + offset, &length_control_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->control_name, length_control_name); + offset += length_control_name; + *(outbuffer + offset + 0) = (this->event_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->event_type); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->menu_entry_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menu_entry_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menu_entry_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menu_entry_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.real = this->mouse_point_valid; + *(outbuffer + offset + 0) = (u_mouse_point_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_client_id; + memcpy(&length_client_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client_id-1]=0; + this->client_id = (char *)(inbuffer + offset-1); + offset += length_client_id; + uint32_t length_marker_name; + memcpy(&length_marker_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + uint32_t length_control_name; + memcpy(&length_control_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_control_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_control_name-1]=0; + this->control_name = (char *)(inbuffer + offset-1); + offset += length_control_name; + this->event_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->event_type); + offset += this->pose.deserialize(inbuffer + offset); + this->menu_entry_id = ((uint32_t) (*(inbuffer + offset))); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.base = 0; + u_mouse_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mouse_point_valid = u_mouse_point_valid.real; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerFeedback"; }; + const char * getMD5(){ return "ab0f1eee058667e28c19ff3ffc3f4b78"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h new file mode 100755 index 0000000..eb1b2cd --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h @@ -0,0 +1,91 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerInit_h +#define _ROS_visualization_msgs_InteractiveMarkerInit_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerInit : public ros::Msg + { + public: + char * server_id; + uint64_t seq_num; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen( (const char*) this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerInit"; }; + const char * getMD5(){ return "aa2f1dcea79533d1710675195653028d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h new file mode 100755 index 0000000..b6a89f1 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h @@ -0,0 +1,57 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerPose_h +#define _ROS_visualization_msgs_InteractiveMarkerPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerPose : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + char * name; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen( (const char*) this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerPose"; }; + const char * getMD5(){ return "a6e6833209a196a38d798dadb02c81f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h new file mode 100755 index 0000000..fa2010b --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h @@ -0,0 +1,149 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerUpdate_h +#define _ROS_visualization_msgs_InteractiveMarkerUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" +#include "visualization_msgs/InteractiveMarkerPose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerUpdate : public ros::Msg + { + public: + char * server_id; + uint64_t seq_num; + uint8_t type; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + uint8_t poses_length; + visualization_msgs::InteractiveMarkerPose st_poses; + visualization_msgs::InteractiveMarkerPose * poses; + uint8_t erases_length; + char* st_erases; + char* * erases; + enum { KEEP_ALIVE = 0 }; + enum { UPDATE = 1 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen( (const char*) this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = erases_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_erasesi = strlen( (const char*) this->erases[i]); + memcpy(outbuffer + offset, &length_erasesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->erases[i], length_erasesi); + offset += length_erasesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (visualization_msgs::InteractiveMarkerPose*)realloc(this->poses, poses_lengthT * sizeof(visualization_msgs::InteractiveMarkerPose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(visualization_msgs::InteractiveMarkerPose)); + } + uint8_t erases_lengthT = *(inbuffer + offset++); + if(erases_lengthT > erases_length) + this->erases = (char**)realloc(this->erases, erases_lengthT * sizeof(char*)); + offset += 3; + erases_length = erases_lengthT; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_st_erases; + memcpy(&length_st_erases, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_erases; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_erases-1]=0; + this->st_erases = (char *)(inbuffer + offset-1); + offset += length_st_erases; + memcpy( &(this->erases[i]), &(this->st_erases), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerUpdate"; }; + const char * getMD5(){ return "83e22f99d3b31fde725e0a338200e036"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/Marker.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/Marker.h new file mode 100755 index 0000000..ef7ffa8 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/Marker.h @@ -0,0 +1,269 @@ +#ifndef _ROS_visualization_msgs_Marker_h +#define _ROS_visualization_msgs_Marker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class Marker : public ros::Msg + { + public: + std_msgs::Header header; + char * ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Pose pose; + geometry_msgs::Vector3 scale; + std_msgs::ColorRGBA color; + ros::Duration lifetime; + bool frame_locked; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t colors_length; + std_msgs::ColorRGBA st_colors; + std_msgs::ColorRGBA * colors; + char * text; + char * mesh_resource; + bool mesh_use_embedded_materials; + enum { ARROW = 0 }; + enum { CUBE = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { LINE_STRIP = 4 }; + enum { LINE_LIST = 5 }; + enum { CUBE_LIST = 6 }; + enum { SPHERE_LIST = 7 }; + enum { POINTS = 8 }; + enum { TEXT_VIEW_FACING = 9 }; + enum { MESH_RESOURCE = 10 }; + enum { TRIANGLE_LIST = 11 }; + enum { ADD = 0 }; + enum { MODIFY = 0 }; + enum { DELETE = 2 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen( (const char*) this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->pose.serialize(outbuffer + offset); + offset += this->scale.serialize(outbuffer + offset); + offset += this->color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.real = this->frame_locked; + *(outbuffer + offset + 0) = (u_frame_locked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame_locked); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + uint32_t length_text = strlen( (const char*) this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_mesh_resource = strlen( (const char*) this->mesh_resource); + memcpy(outbuffer + offset, &length_mesh_resource, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.real = this->mesh_use_embedded_materials; + *(outbuffer + offset + 0) = (u_mesh_use_embedded_materials.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->scale.deserialize(inbuffer + offset); + offset += this->color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.base = 0; + u_frame_locked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->frame_locked = u_frame_locked.real; + offset += sizeof(this->frame_locked); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t colors_lengthT = *(inbuffer + offset++); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + colors_length = colors_lengthT; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->st_colors.deserialize(inbuffer + offset); + memcpy( &(this->colors[i]), &(this->st_colors), sizeof(std_msgs::ColorRGBA)); + } + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + uint32_t length_mesh_resource; + memcpy(&length_mesh_resource, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.base = 0; + u_mesh_use_embedded_materials.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mesh_use_embedded_materials = u_mesh_use_embedded_materials.real; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + const char * getType(){ return "visualization_msgs/Marker"; }; + const char * getMD5(){ return "18326976df9d29249efc939e00342cde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/MarkerArray.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/MarkerArray.h new file mode 100755 index 0000000..a3643e0 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/MarkerArray.h @@ -0,0 +1,54 @@ +#ifndef _ROS_visualization_msgs_MarkerArray_h +#define _ROS_visualization_msgs_MarkerArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class MarkerArray : public ros::Msg + { + public: + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/MarkerArray"; }; + const char * getMD5(){ return "90da67007c26525f655c1c269094e39f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/MenuEntry.h b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/MenuEntry.h new file mode 100755 index 0000000..b867ea2 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/lib/ros_lib/visualization_msgs/MenuEntry.h @@ -0,0 +1,94 @@ +#ifndef _ROS_visualization_msgs_MenuEntry_h +#define _ROS_visualization_msgs_MenuEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace visualization_msgs +{ + + class MenuEntry : public ros::Msg + { + public: + uint32_t id; + uint32_t parent_id; + char * title; + char * command; + uint8_t command_type; + enum { FEEDBACK = 0 }; + enum { ROSRUN = 1 }; + enum { ROSLAUNCH = 2 }; + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->parent_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parent_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parent_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parent_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent_id); + uint32_t length_title = strlen( (const char*) this->title); + memcpy(outbuffer + offset, &length_title, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_command = strlen( (const char*) this->command); + memcpy(outbuffer + offset, &length_command, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + *(outbuffer + offset + 0) = (this->command_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->command_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->id = ((uint32_t) (*(inbuffer + offset))); + this->id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->id); + this->parent_id = ((uint32_t) (*(inbuffer + offset))); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parent_id); + uint32_t length_title; + memcpy(&length_title, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + uint32_t length_command; + memcpy(&length_command, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + this->command_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->command_type); + return offset; + } + + const char * getType(){ return "visualization_msgs/MenuEntry"; }; + const char * getMD5(){ return "b90ec63024573de83b57aa93eb39be2d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_01/original/output.txt b/case_study/arduino_lab/group_01/original/output.txt new file mode 100755 index 0000000..dd349af --- /dev/null +++ b/case_study/arduino_lab/group_01/original/output.txt @@ -0,0 +1,8 @@ +============================= test session starts ============================== +platform linux -- Python 3.4.3, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 +rootdir: /home/qianqianzhu/test_robot, inifile: +collected 5 items + +../../../../run_test.py ..... [100%] + +========================== 5 passed in 55.64 seconds =========================== diff --git a/case_study/arduino_lab/group_01/original/platformio.ini b/case_study/arduino_lab/group_01/original/platformio.ini new file mode 100755 index 0000000..9be67b6 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/platformio.ini @@ -0,0 +1,19 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +env_default = megaADK + +[env:megaADK] +platform = atmelavr +framework = arduino +board = megaADK +upload_port = /dev/ttyACM0 +test_speed = 57600 + diff --git a/case_study/arduino_lab/group_01/original/speed_log.txt b/case_study/arduino_lab/group_01/original/speed_log.txt new file mode 100755 index 0000000..8635e01 --- /dev/null +++ b/case_study/arduino_lab/group_01/original/speed_log.txt @@ -0,0 +1,3112 @@ +00,0,0 +0,0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 diff --git a/case_study/arduino_lab/group_01/original/src/.robotbase_1.ino.swp b/case_study/arduino_lab/group_01/original/src/.robotbase_1.ino.swp new file mode 100755 index 0000000..8fc9929 Binary files /dev/null and b/case_study/arduino_lab/group_01/original/src/.robotbase_1.ino.swp differ diff --git a/case_study/arduino_lab/group_01/original/src/robotbase_1.ino b/case_study/arduino_lab/group_01/original/src/robotbase_1.ino new file mode 100755 index 0000000..ed5b1ef --- /dev/null +++ b/case_study/arduino_lab/group_01/original/src/robotbase_1.ino @@ -0,0 +1,129 @@ +/** + * Group number: 1 + * Student 1: + * Stefan Breetveld, 4374657 + * Student 2: + * David Viteri, 4580958 + */ + +#include +#include +#include +#include +//Node Laptop-Robot class & Serial config +class NewHardware : public ArduinoHardware { + public: NewHardware() : ArduinoHardware (&Serial1 ,57600) { } ; +}; ros::NodeHandle_ nh; + +// Define used pins. +int servo_left = 6; int servo_right = 2; int trig_US = 23; int echo_US = 22; +// Declare safety variables. +int safe_distance, com_ok = 1; +unsigned long duration, distance; //us & cm +int flag_US, counter = 0; +float left_speed, right_speed; + +// Update information from the ultrasonic sensor +void update_US(){ + digitalWrite(trig_US, LOW); + delayMicroseconds(2); + digitalWrite(trig_US, HIGH); + delayMicroseconds(10); + digitalWrite(trig_US, LOW); + duration = pulseIn(echo_US, HIGH); + + distance = (duration*17)/1000; + if (distance > 25) + safe_distance = 1; + else + safe_distance = 0; +} + +// Convert twist message to +void update_servos(const geometry_msgs::Twist& message){ + TCNT2 = 0x00; + counter = 0; + com_ok = 1; + right_speed = message.linear.x; + left_speed = message.linear.y; + +} + +// write the appropriate signal to the engines +void signal_servos() { + if(safe_distance & com_ok){ + analogWrite(servo_right, right_speed); + analogWrite(servo_left, left_speed); + } + else{ + analogWrite(servo_right, 0); + analogWrite(servo_left, 0); + } +} + +//Twist geometry_msgs subscription +ros::Subscriber sub("cmd_vel", &update_servos ); +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +// Initialize pins on the arduino +void setup() +{ + Serial.begin(9600); + pinMode(7, OUTPUT); + pinMode(24, OUTPUT); + pinMode(servo_left, OUTPUT); + pinMode(3, OUTPUT); + pinMode(25, OUTPUT); + pinMode(servo_right, OUTPUT); + pinMode(trig_US, OUTPUT); + pinMode(echo_US, INPUT); + pinMode(13, OUTPUT); + + digitalWrite(24, HIGH); + digitalWrite(25, HIGH); + digitalWrite(6, LOW); + + nh.initNode(); + nh.subscribe(sub); + nh.advertise(chatter); + noInterrupts(); + + //timer 2 config + TCCR2A = 0; + TCCR2B = 0; + TCCR2A |= (1 << WGM21); + TCCR2B |= (1 << CS22) | (1 << CS21) | (1 << CS20);//fclk/1024 + OCR2A = 0xff;//Registro del Timer: 0-255 + TIMSK2 |= (1 << OCIE2A); + + interrupts(); +} + +// Core arduino loop. called continously. +void loop() +{ + Serial.println(counter); + if(flag_US){//every 16.38ms + update_US(); + flag_US=0; + } + signal_servos(); + //update_servos: automatically + nh.spinOnce(); + +} + +// Timer interrupt +ISR (TIMER2_COMPA_vect) // timer2 overflow interrupt +{ + if(counter%3) {//every 49ms + flag_US = 1; + } + + if(counter >= 30)//.5 secs + com_ok=0; + + counter++; + +} diff --git a/case_study/arduino_lab/group_01/robotbase_1/robotbase_1.ino b/case_study/arduino_lab/group_01/robotbase_1/robotbase_1.ino new file mode 100755 index 0000000..ed5b1ef --- /dev/null +++ b/case_study/arduino_lab/group_01/robotbase_1/robotbase_1.ino @@ -0,0 +1,129 @@ +/** + * Group number: 1 + * Student 1: + * Stefan Breetveld, 4374657 + * Student 2: + * David Viteri, 4580958 + */ + +#include +#include +#include +#include +//Node Laptop-Robot class & Serial config +class NewHardware : public ArduinoHardware { + public: NewHardware() : ArduinoHardware (&Serial1 ,57600) { } ; +}; ros::NodeHandle_ nh; + +// Define used pins. +int servo_left = 6; int servo_right = 2; int trig_US = 23; int echo_US = 22; +// Declare safety variables. +int safe_distance, com_ok = 1; +unsigned long duration, distance; //us & cm +int flag_US, counter = 0; +float left_speed, right_speed; + +// Update information from the ultrasonic sensor +void update_US(){ + digitalWrite(trig_US, LOW); + delayMicroseconds(2); + digitalWrite(trig_US, HIGH); + delayMicroseconds(10); + digitalWrite(trig_US, LOW); + duration = pulseIn(echo_US, HIGH); + + distance = (duration*17)/1000; + if (distance > 25) + safe_distance = 1; + else + safe_distance = 0; +} + +// Convert twist message to +void update_servos(const geometry_msgs::Twist& message){ + TCNT2 = 0x00; + counter = 0; + com_ok = 1; + right_speed = message.linear.x; + left_speed = message.linear.y; + +} + +// write the appropriate signal to the engines +void signal_servos() { + if(safe_distance & com_ok){ + analogWrite(servo_right, right_speed); + analogWrite(servo_left, left_speed); + } + else{ + analogWrite(servo_right, 0); + analogWrite(servo_left, 0); + } +} + +//Twist geometry_msgs subscription +ros::Subscriber sub("cmd_vel", &update_servos ); +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +// Initialize pins on the arduino +void setup() +{ + Serial.begin(9600); + pinMode(7, OUTPUT); + pinMode(24, OUTPUT); + pinMode(servo_left, OUTPUT); + pinMode(3, OUTPUT); + pinMode(25, OUTPUT); + pinMode(servo_right, OUTPUT); + pinMode(trig_US, OUTPUT); + pinMode(echo_US, INPUT); + pinMode(13, OUTPUT); + + digitalWrite(24, HIGH); + digitalWrite(25, HIGH); + digitalWrite(6, LOW); + + nh.initNode(); + nh.subscribe(sub); + nh.advertise(chatter); + noInterrupts(); + + //timer 2 config + TCCR2A = 0; + TCCR2B = 0; + TCCR2A |= (1 << WGM21); + TCCR2B |= (1 << CS22) | (1 << CS21) | (1 << CS20);//fclk/1024 + OCR2A = 0xff;//Registro del Timer: 0-255 + TIMSK2 |= (1 << OCIE2A); + + interrupts(); +} + +// Core arduino loop. called continously. +void loop() +{ + Serial.println(counter); + if(flag_US){//every 16.38ms + update_US(); + flag_US=0; + } + signal_servos(); + //update_servos: automatically + nh.spinOnce(); + +} + +// Timer interrupt +ISR (TIMER2_COMPA_vect) // timer2 overflow interrupt +{ + if(counter%3) {//every 49ms + flag_US = 1; + } + + if(counter >= 30)//.5 secs + com_ok=0; + + counter++; + +} diff --git a/case_study/arduino_lab/group_01/run.sh b/case_study/arduino_lab/group_01/run.sh new file mode 100755 index 0000000..8477c80 --- /dev/null +++ b/case_study/arduino_lab/group_01/run.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +#rm -f mut*/output.txt +#cd original +#platformio run -t upload +#python3 -m pytest ~/test_robot/run_test.py | tee "output.txt" +#cd .. + +for mut_dir in $(ls -d mut*/); do + echo $mut_dir + cd $mut_dir + platformio run -t upload + python3 -m pytest ~/test_robot/run_test.py -x| tee "output.txt" + cd .. + mv $mut_dir executed +done + +#egrep -lir --include=*.txt "FAILED" . > "failed.txt" diff --git a/case_study/arduino_lab/group_01/run_test.py b/case_study/arduino_lab/group_01/run_test.py new file mode 100755 index 0000000..8b36578 --- /dev/null +++ b/case_study/arduino_lab/group_01/run_test.py @@ -0,0 +1,119 @@ +import subprocess,os,signal +import serial,io,time +import pytest +import string +from operator import add + +#----------------------------- +# test helper functions +#----------------------------- +def send_image(image_path): + # source ros file + output = subprocess.check_output('source /home/qianqianzhu/image_transport_ws/devel/setup.bash;env -0' + ,shell=True, executable="/bin/bash") + # replace env + #os.environ.clear() + lines = output.decode().split('\0') + for line in lines: + (key, _, value) = line.partition("=") + os.environ[key] = value + + #image = '/home/qianqianzhu/Pictures/straight.jpg' + #image = '/home/qianqianzhu/Pictures/left.jpg' + #image = '/home/qianqianzhu/Pictures/right.jpeg' + ros_command = 'rosrun image_transport_tutorial my_publisher '+ image_path + pro = subprocess.Popen(ros_command,shell=True,preexec_fn=os.setsid) + + # record pwm + subprocess.call('rm -f speed_log.txt',shell=True) + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + filename = 'speed_log.txt' # log file to save data in + + with serial.Serial(device,baud) as serialPort, open(filename,'wb') as outFile: + print("start recording serial...") + timer = time.time() + while(time.time()-timer<=10): + line = serialPort.readline() # must send \n! get a line of log + #print (line) # show line on screen + outFile.write(line) # write line of text to file + outFile.flush() # make sure it actually gets written out + print("stop recording serial...") + + # stop sending an image + os.killpg(os.getpgid(pro.pid), signal.SIGTERM) + + # read speed from pwm log + f = open(filename,"rb") + + total = [0,0,0,0] + #print("hello") + + for line in f: + if len(line) == 9: + line = line.decode('utf-8') + columns = line.strip().split(',') + if len(columns) == 4: + delta = list(map(int,columns)) + total = list(map(add,total,delta)) + #print(total) + f.close() + return total + +def send_ultrasensor(signal): + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + with serial.Serial(device,baud,timeout=5) as ard: + time.sleep(0.5) # wait for Arduino + # Serial write section + ard.flush() + print ("send STOP signal!") + ard.write(str.encode(signal)) + time.sleep(0.5) + +#----------------------------- +# test cases +#----------------------------- +def test_straight(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/straight.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed == pytest.approx(right_speed,rel=5e-2) + +def test_turn_left(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/left.jpeg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed < right_speed + +def test_turn_right(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/right.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed > right_speed + +def test_stop_obstacle(): + send_ultrasensor("stop") + image_path = '/home/qianqianzhu/Pictures/straight.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed == 0 + assert right_speed == 0 + +def test_stop_no_image(): + send_ultrasensor("go") + image_path = '' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed == 0 + assert right_speed == 0 + + diff --git a/case_study/arduino_lab/group_07/.pytest_cache/v/cache/lastfailed b/case_study/arduino_lab/group_07/.pytest_cache/v/cache/lastfailed new file mode 100755 index 0000000..9e26dfe --- /dev/null +++ b/case_study/arduino_lab/group_07/.pytest_cache/v/cache/lastfailed @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/failed.txt b/case_study/arduino_lab/group_07/failed.txt new file mode 100755 index 0000000..26b3025 --- /dev/null +++ b/case_study/arduino_lab/group_07/failed.txt @@ -0,0 +1,79 @@ +./executed/mut14/output.txt +./executed/mut1/output.txt +./executed/mut85/output.txt +./executed/mut71/output.txt +./executed/mut2/output.txt +./executed/mut73/output.txt +./executed/mut63/output.txt +./executed/mut90/output.txt +./executed/mut75/output.txt +./executed/mut60/output.txt +./executed/mut23/output.txt +./executed/mut15/output.txt +./executed/mut8/output.txt +./executed/mut93/output.txt +./executed/mut67/output.txt +./executed/mut80/output.txt +./executed/mut53/output.txt +./executed/mut12/output.txt +./executed/mut81/output.txt +./executed/mut7/output.txt +./executed/mut26/output.txt +./executed/mut83/output.txt +./executed/mut41/output.txt +./executed/mut98/output.txt +./executed/mut11/output.txt +./executed/mut17/output.txt +./executed/mut42/output.txt +./executed/mut39/output.txt +./executed/mut77/output.txt +./executed/mut96/output.txt +./executed/mut79/output.txt +./executed/mut27/output.txt +./executed/mut24/output.txt +./executed/mut82/output.txt +./executed/mut40/output.txt +./executed/mut74/output.txt +./executed/mut87/output.txt +./executed/mut102/output.txt +./executed/mut61/output.txt +./executed/mut62/output.txt +./executed/mut86/output.txt +./executed/mut20/output.txt +./executed/mut5/output.txt +./executed/mut88/output.txt +./executed/mut68/output.txt +./executed/mut9/output.txt +./executed/mut49/output.txt +./executed/mut78/output.txt +./executed/mut13/output.txt +./executed/mut32/output.txt +./executed/mut44/output.txt +./executed/mut10/output.txt +./executed/mut31/output.txt +./executed/mut64/output.txt +./executed/mut22/output.txt +./executed/mut25/output.txt +./executed/mut52/output.txt +./executed/mut66/output.txt +./executed/mut84/output.txt +./executed/mut0/output.txt +./executed/mut70/output.txt +./executed/mut6/output.txt +./executed/mut69/output.txt +./executed/mut19/output.txt +./executed/mut65/output.txt +./executed/mut51/output.txt +./executed/mut29/output.txt +./executed/mut48/output.txt +./executed/mut92/output.txt +./executed/mut4/output.txt +./executed/mut103/output.txt +./executed/mut107/output.txt +./executed/mut16/output.txt +./executed/mut50/output.txt +./executed/mut35/output.txt +./executed/mut36/output.txt +./executed/mut104/output.txt +./executed/mut76/output.txt +./executed/mut72/output.txt diff --git a/case_study/arduino_lab/group_07/linefollower_7.cpp b/case_study/arduino_lab/group_07/linefollower_7.cpp new file mode 100755 index 0000000..a29dff1 --- /dev/null +++ b/case_study/arduino_lab/group_07/linefollower_7.cpp @@ -0,0 +1,180 @@ +#include +#include +#include +#include +#include +#include +#include + +static const std::string OPENCV_WINDOW = "Image window"; +static const unsigned int MINIMUM_LINE_WIDTH = 10; +static const unsigned int MAXIMUM_LINE_WIDTH = 200; +static const unsigned int IMAGE_SIZE_X = 600; +static const unsigned int IMAGE_SIZE_Y = 800; +static const int THRESHOLD_VALUE = 63; +static const int ROI_X_OFFSET = 10; +static const int ROBOT_SPEED = 125; + +//Structure that represents a line +typedef struct Line { + int left; + int right; +} Line; + +class ImageConverter { + ros::NodeHandle nh_; + image_transport::ImageTransport it_; + image_transport::Subscriber image_sub_; + image_transport::Publisher image_pub_; + ros::Publisher cmd_vel_pub_; + geometry_msgs::Twist message; + +public: + ImageConverter() + : it_(nh_) { + // Subscribe to input video feed and publish output video feed + image_sub_ = it_.subscribe("/camera/image", 1, + &ImageConverter::imageCb, this); + image_pub_ = it_.advertise("/image_converter/output_video", 1); + cmd_vel_pub_ = nh_.advertise("/cmd_vel", 1); + + + cv::namedWindow(OPENCV_WINDOW); + } + + ~ImageConverter() { + cv::destroyWindow(OPENCV_WINDOW); + } + + void imageCb(const sensor_msgs::ImageConstPtr &msg) { + cv_bridge::CvImagePtr cv_ptr; + try { + cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::BGR8); + } + catch (cv_bridge::Exception &e) { + ROS_ERROR("cv_bridge exception: %s", e.what()); + return; + } + + cv::Mat rotation; + cv::Mat standard; + cv::Mat gray; + cv::Mat blur; + cv::Mat threshold; + cv::Mat noise; + + // Rotate the image 90 degrees + cv::transpose(cv_ptr->image, rotation); + cv::flip(rotation, rotation, 1); + + // Resize the image + cv::resize(rotation, standard, cv::Size(IMAGE_SIZE_X, IMAGE_SIZE_Y), 0, 0, 1); + + /* + * Check if image has been received. + */ + if (rotation.cols > 60) { + // Define Region of interest + cv::Rect rectangle(ROI_X_OFFSET, 6 * standard.rows / 8, standard.cols - 2 * ROI_X_OFFSET, standard.rows / 8); + cv::Mat region(standard, rectangle); + + // Make region gray + cv::cvtColor(region, gray, CV_BGR2GRAY); + + // Blur + cv::GaussianBlur(gray, blur, cv::Size(9, 9), 0, 0, 0); + + // Threshold + cv::threshold(blur, threshold, THRESHOLD_VALUE, 255, cv::THRESH_BINARY); + + // Remove any noise left + int morphSize = 2; + cv::Mat element = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(2 * morphSize + 1, 2 * morphSize + 1), + cv::Point(morphSize, morphSize)); + cv::morphologyEx(threshold, noise, cv::MORPH_CLOSE, element, cv::Point(-1, -1), 1); + + /* + * Find all the lines and select the best one. + */ + std::vector lineVector; + int lineWidth = 0; + int beginLine = 0; + + for (int i = 0; i < noise.cols; i++) { + int sumOfCol = 0; + for (int j = 0; j < noise.rows; j++) { + if (noise.at(j, i)) { + sumOfCol++; + } + } + // When white + if (sumOfCol > noise.rows / 2) { + if (lineWidth > MINIMUM_LINE_WIDTH && lineWidth < MAXIMUM_LINE_WIDTH) { + Line line; + line.left = beginLine; + line.right = i - 1; + lineVector.push_back(line); + } + lineWidth = 0; + } + // When black + else { + if (lineWidth == 0) { + beginLine = i; + } + lineWidth++; + } + } + + // Check if there might be a line that does not contain a transition back to white. + if (lineWidth > MINIMUM_LINE_WIDTH && lineWidth < MAXIMUM_LINE_WIDTH) { + Line line; + line.left = beginLine; + line.right = noise.cols - 1; + lineVector.push_back(line); + } + + int bestLine = 0; + std::vector::iterator v = lineVector.begin(); + + // Select the best line out of all lines found. + while (v != lineVector.end()) { + cv::line(standard, cv::Point(ROI_X_OFFSET + v->left, 6 * standard.rows / 8), + cv::Point(ROI_X_OFFSET + v->left, 7 * standard.rows / 8), CV_RGB(255, 0, 0)); + cv::line(standard, cv::Point(ROI_X_OFFSET + v->right, 6 * standard.rows / 8), + cv::Point(ROI_X_OFFSET + v->right, 7 * standard.rows / 8), CV_RGB(255, 0, 0)); + int middle = (v->left + v->right) / 2; + if (std::abs(middle - noise.cols / 2) < std::abs(bestLine - noise.cols / 2)) { + bestLine = middle; + } + v++; + } + + // When a line has been found, display the best line on screen and publish a twist message for it. + if (bestLine) { + cv::line(standard, cv::Point(ROI_X_OFFSET + bestLine, 6 * standard.rows / 8), + cv::Point(ROI_X_OFFSET + bestLine, 7 * standard.rows / 8), CV_RGB(0, 0, 255)); + message.linear.x = ROBOT_SPEED; + message.angular.z = (bestLine - noise.cols / 2) * 90 / (noise.cols / 2); + cmd_vel_pub_.publish(message); + } + + // Draw region of interest on screen with green. + cv::rectangle(standard, rectangle, CV_RGB(0, 255, 0)); + } + + // Update GUI Window + cv::imshow(OPENCV_WINDOW, standard); + cv::waitKey(10); + + // Output modified video stream + image_pub_.publish(cv_ptr->toImageMsg()); + } +}; + +int main(int argc, char **argv) { + ros::init(argc, argv, "image_converter"); + ImageConverter ic; + ros::spin(); + return 0; +} diff --git a/case_study/arduino_lab/group_07/mutation_info.txt b/case_study/arduino_lab/group_07/mutation_info.txt new file mode 100755 index 0000000..3d39a41 --- /dev/null +++ b/case_study/arduino_lab/group_07/mutation_info.txt @@ -0,0 +1,66 @@ +Mutation 0:pin_surround_replacement:pinMode(1, OUTPUT); in Line 69 +Mutation 1:pin_surround_replacement:pinMode(3, OUTPUT); in Line 69 +Mutation 2:pin_func_replacement:pinMode(2,INPUT); in Line 69 +Mutation 3:pin_surround_replacement:pinMode(1, INPUT); in Line 70 +Mutation 4:pin_surround_replacement:pinMode(3, INPUT); in Line 70 +Mutation 5:pin_func_replacement:pinMode(2,OUTPUT); in Line 70 +Mutation 6:pull_resis_replacement:pinMode(2,INPUT_PULLUP); in Line 70 +Mutation 7:pin_surround_replacement:pinMode(1, OUTPUT); in Line 71 +Mutation 8:pin_surround_replacement:pinMode(3, OUTPUT); in Line 71 +Mutation 9:pin_func_replacement:pinMode(2,INPUT); in Line 71 +Mutation 10:pin_surround_replacement:pinMode(1, OUTPUT); in Line 72 +Mutation 11:pin_surround_replacement:pinMode(3, OUTPUT); in Line 72 +Mutation 12:pin_func_replacement:pinMode(2,INPUT); in Line 72 +Mutation 13:pin_surround_replacement:pinMode(1, OUTPUT); in Line 73 +Mutation 14:pin_surround_replacement:pinMode(3, OUTPUT); in Line 73 +Mutation 15:pin_func_replacement:pinMode(2,INPUT); in Line 73 +Mutation 16:pin_surround_replacement:pinMode(1, OUTPUT); in Line 74 +Mutation 17:pin_surround_replacement:pinMode(3, OUTPUT); in Line 74 +Mutation 18:pin_func_replacement:pinMode(2,INPUT); in Line 74 +Mutation 19:pin_surround_replacement:pinMode(1, OUTPUT); in Line 75 +Mutation 20:pin_surround_replacement:pinMode(3, OUTPUT); in Line 75 +Mutation 21:pin_func_replacement:pinMode(2,INPUT); in Line 75 +Mutation 22:pin_surround_replacement:pinMode(1, OUTPUT); in Line 76 +Mutation 23:pin_surround_replacement:pinMode(3, OUTPUT); in Line 76 +Mutation 24:pin_func_replacement:pinMode(2,INPUT); in Line 76 +Mutation 25:pin_surround_replacement:pinMode(12, OUTPUT); in Line 77 +Mutation 26:pin_func_replacement:pinMode(13,INPUT); in Line 77 +Mutation 27:pin_surround_replacement:digitalWrite(1, ( LOW)); in Line 80 +Mutation 28:pin_surround_replacement:digitalWrite(3, ( LOW)); in Line 80 +Mutation 29:pin_value_replacement:digitalWrite(2, !( LOW)); in Line 80 +Mutation 30:output_stmt_deletion: in Line 80 +Mutation 31:pin_surround_replacement:digitalWrite(1, ( LOW)); in Line 81 +Mutation 32:pin_surround_replacement:digitalWrite(3, ( LOW)); in Line 81 +Mutation 33:pin_value_replacement:digitalWrite(2, !( LOW)); in Line 81 +Mutation 34:output_stmt_deletion: in Line 81 +Mutation 35:pin_surround_replacement:digitalWrite(12, (obstacle)); in Line 136 +Mutation 36:pin_value_replacement:digitalWrite(13, !(obstacle)); in Line 136 +Mutation 37:output_stmt_deletion: in Line 136 +Mutation 38:pin_surround_replacement:digitalWrite(1, ( LOW)); in Line 151 +Mutation 39:pin_surround_replacement:digitalWrite(3, ( LOW)); in Line 151 +Mutation 40:pin_value_replacement:digitalWrite(2, !( LOW)); in Line 151 +Mutation 41:output_stmt_deletion: in Line 151 +Mutation 42:pin_surround_replacement:digitalWrite(1, ( HIGH)); in Line 153 +Mutation 43:pin_surround_replacement:digitalWrite(3, ( HIGH)); in Line 153 +Mutation 44:pin_value_replacement:digitalWrite(2, !( HIGH)); in Line 153 +Mutation 45:output_stmt_deletion: in Line 153 +Mutation 46:pin_surround_replacement:digitalWrite(1, ( LOW)); in Line 155 +Mutation 47:pin_surround_replacement:digitalWrite(3, ( LOW)); in Line 155 +Mutation 48:pin_value_replacement:digitalWrite(2, !( LOW)); in Line 155 +Mutation 49:output_stmt_deletion: in Line 155 +Mutation 50:pin_surround_replacement:dist = (1, ( HIGH)); in Line 156 +Mutation 51:pin_surround_replacement:dist = (3, ( HIGH)); in Line 156 +Mutation 52:pin_value_replacement:dist = (2, !( HIGH)); in Line 156 +Mutation 53:pin_surround_replacement:digitalWrite(1, ( HIGH)); in Line 214 +Mutation 54:pin_surround_replacement:digitalWrite(3, ( HIGH)); in Line 214 +Mutation 55:pin_value_replacement:digitalWrite(2, !( HIGH)); in Line 214 +Mutation 56:output_stmt_deletion: in Line 214 +Mutation 57:pin_surround_replacement:digitalWrite(1, ( HIGH)); in Line 219 +Mutation 58:pin_surround_replacement:digitalWrite(3, ( HIGH)); in Line 219 +Mutation 59:pin_value_replacement:digitalWrite(2, !( HIGH)); in Line 219 +Mutation 60:output_stmt_deletion: in Line 219 +Mutation 61:pin_surround_replacement:digitalWrite(1, ( LOW)); in Line 224 +Mutation 62:pin_surround_replacement:digitalWrite(3, ( LOW)); in Line 224 +Mutation 63:pin_value_replacement:digitalWrite(2, !( LOW)); in Line 224 +Mutation 64:output_stmt_deletion: in Line 224 + diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/.sconsign.dblite b/case_study/arduino_lab/group_07/original/.pioenvs/.sconsign.dblite new file mode 100755 index 0000000..47f57ec Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/.sconsign.dblite differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/do-not-modify-files-here.url b/case_study/arduino_lab/group_07/original/.pioenvs/do-not-modify-files-here.url new file mode 100755 index 0000000..4d15482 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.pioenvs/do-not-modify-files-here.url @@ -0,0 +1,3 @@ + +[InternetShortcut] +URL=http://docs.platformio.org/page/projectconf/section_platformio.html#build-dir diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/CDC.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/CDC.o new file mode 100755 index 0000000..3766842 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/CDC.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o new file mode 100755 index 0000000..2cd51b0 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o new file mode 100755 index 0000000..444a82c Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o new file mode 100755 index 0000000..22f5227 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o new file mode 100755 index 0000000..cd4ceb4 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o new file mode 100755 index 0000000..5fc530f Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o new file mode 100755 index 0000000..8d51b92 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o new file mode 100755 index 0000000..045c069 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Print.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Print.o new file mode 100755 index 0000000..9025ff0 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Print.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Stream.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Stream.o new file mode 100755 index 0000000..7e38a29 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Stream.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Tone.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Tone.o new file mode 100755 index 0000000..dea29c0 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/Tone.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o new file mode 100755 index 0000000..bad543c Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o new file mode 100755 index 0000000..e764687 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WMath.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WMath.o new file mode 100755 index 0000000..db974a4 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WMath.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WString.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WString.o new file mode 100755 index 0000000..8bcb2a4 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/WString.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o new file mode 100755 index 0000000..d4fb133 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/abi.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/abi.o new file mode 100755 index 0000000..6798bbe Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/abi.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/hooks.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/hooks.o new file mode 100755 index 0000000..8a53518 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/hooks.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/main.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/main.o new file mode 100755 index 0000000..2048448 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/main.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/new.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/new.o new file mode 100755 index 0000000..39027ad Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/new.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring.o new file mode 100755 index 0000000..c85b323 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o new file mode 100755 index 0000000..f2fe479 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o new file mode 100755 index 0000000..cc9bd73 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o new file mode 100755 index 0000000..00fe2df Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o new file mode 100755 index 0000000..edccfb6 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/firmware.elf b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/firmware.elf new file mode 100755 index 0000000..2299291 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/firmware.elf differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/firmware.hex b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/firmware.hex new file mode 100755 index 0000000..d318d65 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/firmware.hex @@ -0,0 +1,877 @@ +:100000000C94BD010C94EE010C94EE010C94EE01E5 +:100010000C94EE010C94EE010C94EE010C94EE01A4 +:100020000C94EE010C94EE010C94EE010C94EE0194 +:100030000C94EE010C94EE010C94EE010C94EE0184 +:100040000C94EE010C94EE010C94EE010C94EE0174 +:100050000C94EE010C94EE010C94EE010C945D12E4 +:100060000C94EE010C9419100C94EF0F0C94EE010B +:100070000C94EE010C94EE010C94EE010C94EE0144 +:100080000C94EE010C94EE010C94EE010C94EE0134 +:100090000C94C50F0C949B0F0C94EE010C94EE0184 +:1000A0000C94EE010C94EE010C94EE010C94EE0114 +:1000B0000C94EE010C94EE010C94EE010C94EE0104 +:1000C0000C94EE010C94EE010C94EE010C94EE01F4 +:1000D0000C94EE010C94EE010C94EE010C94EE01E4 +:1000E0000C94EE01D910DC10CB10CF10D3101311EB +:1000F000E010E410EA10EE10F210F810FC100011FD +:10010000131106110A110E118C1191119611A011E3 +:10011000AA112312B411BC11C411CE11D811E211CD +:10012000F111FB11231205120F1219120C94E21196 +:100130000C94F0010C94180F0C9447020C94D811F5 +:100140000C9438020C94E0100C94F8100C940504F4 +:100150000C945B020C9423120C947C060C945703B1 +:100160000C94F1110C94D3100C9452060C94F102DF +:100170000C942C070C9462040C9405120C94A0119E +:100180000C9411040C94D9100C945C040C943E054E +:100190000C9413110C940E040C945C070C944405FD +:1001A0000C944D140C94F2090C94AA020C94F00EC9 +:1001B0000C94B4110C9419120C9448030C944B0336 +:1001C0000C9491110C94AA110C948C110C940011A4 +:1001D0000C9452030C940B040C940A110C94FB1114 +:1001E0000C9417040C943D080C9406110C945F04B5 +:1001F0000C94CE110C9469020C94C4110C940F123F +:100200000C940E110C948A050C9441050C949611D3 +:100210000C94BC110C94510E0C941A040C94060B03 +:100220000C9402040C94CB100C94DC100C94CF10A2 +:100230000C9498060C94FC100C9408040C94E41094 +:100240000C9414040C944E030C94F2100C94EE10C5 +:100250000C94EA100C94B007000020002300260044 +:1002600029002C002F0032000001000003010601CC +:10027000090100002100240027002A002D00300081 +:10028000330001010000040107010A0100002200FF +:10029000250028002B002E00310034000201000050 +:1002A000050108010B0105050505070508080808F3 +:1002B000020202020A0A08080404040401010101FE +:1002C00001010101030303030303030304070707F9 +:1002D0000C0C0C0C0C0C0C0C02020202060606069E +:1002E000060606060B0B0B0B0B0B0B0B010210206B +:1002F000200808102040102040800201020108045C +:1003000002010102040810204080804020100804EF +:100310000201800402018040201008040201080448 +:10032000020101020408102040800102040810208C +:10033000408000000A0B02090C0D0E08070304019F +:1003400000000000000000000000000000000000AD +:10035000000000000000000000000000000012117A +:10036000100000000000000000000000000000007D +:1003700000000000000000004D1411241FBECFEF4C +:10038000D1E2DEBFCDBF00E00CBF14E0A0E0B2E0E0 +:10039000E8EAF4E300E00BBF02C007900D92AA3038 +:1003A000B107D9F72AE0AAE0B4E001C01D92A63354 +:1003B000B207E1F711E0CDEBD1E000E006C02197F4 +:1003C0000109802FFE010E94BA15CC3BD10780E0C5 +:1003D0000807A9F70E94EC120C94521A0C94000022 +:1003E000CF92DF92EF92FF920F931F93CF93DF9301 +:1003F0006C017A018B01C0E0D0E0CE15DF0589F0F9 +:10040000D8016D918D01D601ED91FC910190F081A3 +:10041000E02DC6011995892B11F47E0102C02196A9 +:10042000ECCFC701DF91CF911F910F91FF90EF901B +:10043000DF90CF900895FC01A089B1898C91A689A5 +:10044000B78982FD0FC09C91818D8F5F8F73228D44 +:10045000821749F0218DDF01A20FB11D5D969C939B +:10046000818F08958C910895089580E090E008951B +:10047000FC01538D448D252F30E0842F90E0821BAA +:10048000930B541710F0CF96089501970895FC012F +:10049000918D828D981761F0828DDF01A80FB11DBB +:1004A0005D968C91928D9F5F9F73928F90E00895DF +:1004B0008FEF9FEF0895FC01918D828D981731F099 +:1004C000828DE80FF11D858D90E008958FEF9FEFED +:1004D0000895FC01918D228D892F90E0805C9F4FC3 +:1004E000821B91098F73992708958FEB94E00E94E6 +:1004F000690221E0892B09F420E0822F089582E22D +:1005000094E00E94690221E0892B09F420E0822F07 +:100510000895FC01848DDF01A80FB11DA35ABF4FC0 +:100520002C91848D90E001968F739927848FA689F2 +:10053000B7892C93A089B1898C9180648C93938D19 +:10054000848D981306C00288F389E02D80818F7D09 +:1005500080830895EF92FF920F931F93CF93DF93C1 +:10056000EC0181E0888F9B8D8C8D981305C0E88904 +:10057000F989808185FD24C0F62E0B8D10E00F5F78 +:100580001F4F0F731127E02E8C8DE8120CC00FB691 +:1005900007FCFACFE889F989808185FFF5CFCE0184 +:1005A0000E948902F1CF8B8DFE01E80FF11DE35A05 +:1005B000FF4FF0820B8FEA89FB898081806207C040 +:1005C000EE89FF896083E889F9898081806480836E +:1005D00081E090E0DF91CF911F910F91FF90EF901C +:1005E0000895CF93DF93EC01888D8823C9F0EA89C1 +:1005F000FB89808185FD05C0A889B9898C9186FD1C +:100600000FC00FB607FCF5CF808185FFF2CFA88918 +:10061000B9898C9185FFEDCFCE010E948902E7CF89 +:10062000DF91CF91089580E090E0892B21F00E9426 +:100630007F02811121C080E090E0892B21F00E948F +:10064000750281111CC080E090E0892B41F080E0B0 +:1006500090E0892B21F00E940000811113C080E0FE +:1006600090E0892BA1F080E090E0892B81F00E943E +:10067000000081110AC008950E940000DCCF0E9492 +:100680000000E1CF0E940000EACF0C940000089522 +:100690008EE992E008958FEB92E00895FC0186A127 +:1006A00097A10895FC01EE57FB4F808108958F922A +:1006B0009F92AF92BF92CF92DF92EF92FF920F93F1 +:1006C0001F93CF93DF9300D01F921F92CDB7DEB759 +:1006D0008C016B0164E6C616D1043CF0FC01EE57B8 +:1006E000FB4F8081882309F478C0DA01ED91FC91F9 +:1006F0000190F081E02DB801655E7D4FCA0119952A +:100700009C017801BCEEEB1ABDEFFB0A4FEFF7013D +:1007100040834EEF319640833196808331969083AB +:100720003196890F809580833196C082D801A65E6C +:10073000BD4FDC9265E070E040E050E0C9010796F3 +:100740006817790730F4A1914A0F511D6F5F7F4FF1 +:10075000F7CF6901F8E0CF0ED11C800F911FFC018B +:10076000EC5EFD4F4095408341E0C41642E0D40664 +:10077000C1F056014701D80112968D919C911397B3 +:10078000F40161914F01DC01ED91FC910190F08148 +:10079000E02D1995C4018E199F098C159D055CF3F8 +:1007A0001EC08EE392E09A83898383E08B8383ED7E +:1007B00092E09D838C83D801ED91FC910190F081B2 +:1007C000E02DAE014F5F5F4F67E070E0C801199503 +:1007D000AA24AA94BB24BA9402C0A12CB12CC501AE +:1007E0000F900F900F900F900F90DF91CF911F916E +:1007F0000F91FF90EF90DF90CF90BF90AF909F90C0 +:100800008F9008958EE992E008958FEB92E008951D +:100810008CE093E008958DE293E0089583E493E003 +:10082000089586E092E0089584E693E0089585E8CF +:1008300093E00895AF92BF92CF92DF92EF92FF9232 +:100840000F931F93CF93DF935C01EB018881F50138 +:10085000828389819A81AB81BC81FB0135966C01D1 +:100860007D0125E0C20ED11CE11CF11C8F01061B8D +:10087000170B20E030E00C151D052E053F0538F460 +:1008800041919F0122503109E9014883EFCFFB01DB +:10089000E80FF91F14826C5F7F4FF5017483638347 +:1008A0000596DF91CF911F910F91FF90EF90DF9010 +:1008B000CF90BF90AF90089588E993E0089589EBB9 +:1008C00093E008956F927F928F929F92AF92BF9222 +:1008D000CF92DF92EF92FF920F931F93CF93DF930C +:1008E000DC01FB01808190E013969C938E9312971C +:1008F0002181922B13969C938E93129702811381E0 +:10090000248135815B0186E0A80EB11C6801790164 +:10091000C6E0CC0ED11CE11CF11CA5014E1B5F0BE7 +:1009200060E070E04C155D056E057F0540F4E50163 +:1009300049915E01CE010297EC014883EECFEF01B1 +:10094000C00FD11F1D82CF01059615969C938E93E3 +:100950001497EF01C00FD11F4E815F8168857985A3 +:10096000065F1F4F3F01600E711E6801012E000CD3 +:10097000EE08FF08C40ED51EE61EF71E43018E1AB0 +:100980009F0AA12CB12C8C149D04AE04BF0440F42A +:10099000E30129913E01CE010297EC012883EECFBD +:1009A000400F511F9F01240F351FC9010197EC0112 +:1009B0001882C80101978E0F9F1F17969C938E93E4 +:1009C0001697E90188809980AA80BB804C5F5F4FB1 +:1009D0003F01640E751E8A01052E000C220B330B9D +:1009E000080D191D2A1D3B1D6301CE1ADF0AE12CDB +:1009F000F12CC016D106E206F30640F4E30169913A +:100A00003E01CE010297EC016883EECFCA01880D4A +:100A1000991D8F01080F191F980121503109E90113 +:100A20001882BA0161507109E60FF71F1996FC93FD +:100A3000EE931897F8012181428150E060E070E068 +:100A4000BA0155274427522B2081422B2381722B38 +:100A50001A964D935D936D937C931D970496DF9149 +:100A6000CF911F910F91FF90EF90DF90CF90BF90AB +:100A7000AF909F908F907F906F90089582ED93E05C +:100A8000089583EF93E00895FC01DB014C9150E061 +:100A900060E070E0428353836483758311968C9188 +:100AA0001197582B428353836483758312968C91DC +:100AB0001297682B428353836483758313968C91BA +:100AC0001397782B428353836483758314964C91D8 +:100AD000149750E060E070E0468357836087718729 +:100AE00015968C911597582B46835783608771878D +:100AF00016968C911697682B46835783608771876B +:100B000017968C91782B468357836087718788E08E +:100B100090E00895DC01FB0112968C91129780837E +:100B200013968C911397818314968C9114978283DA +:100B300015968C911597838316968C9116978483BE +:100B400017968C911797858318968C9118978683A2 +:100B500019968C91878388E090E008958F929F92F8 +:100B6000AF92BF92CF92DF92EF92FF920F931F93BB +:100B7000FC01DB01C380C294C69427E0C2228C2C06 +:100B8000912CA12CB12C8D929D92AD92BC92139779 +:100B9000C480D12CE12CF12C33E0CC0CDD1CEE1CFC +:100BA000FF1C3A95D1F7C828D928EA28FB28CD920E +:100BB000DD92ED92FC921397058110E020E030E089 +:100BC0004BE0000F111F221F331F4A95D1F7C02A97 +:100BD000D12AE22AF32ACD92DD92ED92FC9213976C +:100BE00006810F7010E020E030E053E1000F111F8C +:100BF000221F331F5A95D1F70C291D292E293F2971 +:100C00000D931D932D933C931397868182958F703E +:100C100047814F7750E060E070E094E0440F551F4B +:100C2000661F771F9A95D1F7482B4115510561052D +:100C30007105A1F0405853406109710997E1440FD3 +:100C4000551F661F771F9A95D1F7402B512B622BAA +:100C5000732B4D935D936D937C93139747814078ED +:100C600050E060E070E0742F6627552744270D910F +:100C70001D912D913C911397402B512B622B732B7F +:100C80004D935D936D937C93139788E090E01F9153 +:100C90000F91FF90EF90DF90CF90BF90AF909F901B +:100CA0008F900895EF92FF920F931F93CF93DF934E +:100CB0008C017B01BC016E5F7F4FC7010E94AE05B6 +:100CC000EC01B8016A5F7F4FC7018C0F9D1F0E9426 +:100CD000AE05C80FD91FB801665F7F4FC7018C0FE3 +:100CE0009D1F0E94AE058C0F9D1FDF91CF911F911C +:100CF0000F91FF90EF900895EF92FF920F931F9343 +:100D0000CF93DF937C01EB0102960E9452068C0187 +:100D1000BE01680F791FC70140960E945206800FDE +:100D2000911FDF91CF911F910F91FF90EF90089548 +:100D30000F931F93CF93DF938C01EC012696CE0186 +:100D40000E947C06D8019496ED91FC919597CE0176 +:100D5000DF91CF911F910F9119948F929F92AF9233 +:100D6000BF92CF92DF92EF92FF920F931F93CF9398 +:100D7000DF93EC01CB01BA018B019C0147E1359572 +:100D80002795179507954A95D1F7112722273327DD +:100D9000011511052105310521F000581C4F2F4F79 +:100DA0003F4F188219821A826B017C0145E0CC0CFE +:100DB000DD1CEE1CFF1C4A95D1F7CB826B017C0138 +:100DC00053E0F594E794D794C7945A95D1F7CC8221 +:100DD0006B017C01EBE0F594E794D794C794EA9516 +:100DE000D1F7CD8268017901F4E0CC0CDD1CEE1C5A +:100DF000FF1CFA95D1F74B015C01A3E1B594A794D0 +:100E000097948794AA95D1F7482D4F70C42ACE8223 +:100E100068017901B4E0F594E794D794C794BA9542 +:100E2000D1F720E030E0A9010E945D1687FD02C0E5 +:100E3000CF8203C00C2D00680F8388E090E0DF9123 +:100E4000CF911F910F91FF90EF90DF90CF90BF90C7 +:100E5000AF909F908F900895EF92FF920F931F9302 +:100E6000CF93DF937C018B01FC014281538164812C +:100E70007581C8010E94AD06EC01F70146815781DA +:100E800060857185C8018C0F9D1F0E94AD06C80F3B +:100E9000D91FF7014285538564857585C8018C0F7C +:100EA0009D1F0E94AD068C0F9D1FDF91CF911F915A +:100EB0000F91FF90EF900895EF92FF920F931F9381 +:100EC000CF93DF937C01EB0102960E942C078C01EB +:100ED000BE01680F791FC70140960E942C07800F42 +:100EE000911FDF91CF911F910F91FF90EF90089587 +:100EF0000F931F93CF93DF93CDB7DEB72A970FB62B +:100F0000F894DEBF0FBECDBF8C0182E392E09A83DE +:100F100089831B821C821D821E821F82188619866D +:100F20001A86D801ED91FC910190F081E02DAE017F +:100F30004F5F5F4F6AE070E0C80119950E9451123F +:100F4000F80160877187828793872A960FB6F89495 +:100F5000DEBF0FBECDBFDF91CF911F910F910895DE +:100F60000E941719CF92DF92EF92FF920F931F9377 +:100F700060E087E10E94AA1061E087E10E94AA1068 +:100F800060E087E10E94AA10E2E0F3E06491ECEBFC +:100F9000F2E0E491F0E0EE0FFF1FE85AFD4F85917B +:100FA000949100E412E42FE030E0462F0E94A71253 +:100FB000611571058105910549F0DC01CB010196B0 +:100FC000A11DB11DBC01CD019F7003C060E070E0A8 +:100FD000CB010E940A1720E030E040E05FE30E946E +:100FE000C11720E030E048EE51E40E9462166B0128 +:100FF0007C0120E030E040E251E40E945D1687FD74 +:1010000023C020E030E040EA51E4C701B6010E946D +:101010005D1687FD1DC020E030E040EF51E4C701C0 +:10102000B6010E945D1687FD18C020E030E040E266 +:1010300052E4C701B6010E945D1687FD13C060E04F +:1010400070E080E89FE312C060E070E0CB010EC06A +:1010500066E676E686E29FE309C060E070E080E441 +:101060009FE304C06AE979E989E59FE31F910F9145 +:10107000FF90EF90DF90CF9008954F925F926F9224 +:101080007F928F929F92AF92BF92CF92DF92EF9218 +:10109000FF92CF93DF93EC0161E088E10E94AA10F8 +:1010A00061E089E10E94AA100E94B2072B013C0175 +:1010B00060931E0470931F04809320049093210476 +:1010C0000E94511260931A0470931B0480931C04B5 +:1010D00090931D048A8C9B8CAC8CBD8C20E030E0FE +:1010E00040E251ECC501B4010E945D16CC80DD8068 +:1010F000EE80FF8087FF68C0A5019401C501B4019F +:101100000E94F1159B01AC01C701B6010E94F115C7 +:101110004B015C0120E030E0A9010E945D1687FFD1 +:1011200003C0812C912C54011092160410921704C4 +:101130001092180410921904A5019401C701B60178 +:101140000E94F01520E030E040E05FE30E94C1170C +:101150009B01AC01C501B4010E94F1156B017C013A +:10116000A30192010E94C1172B013C01C0921204FD +:10117000D0921304E0921404F092150460E070E041 +:1011800083E00E946311C301B2010E94D41682E081 +:101190000E94631180920A0490920B04A0920C04A6 +:1011A000B0920D0410920E0410920F0410921004CD +:1011B0001092110460E070E087E00E946311C501A5 +:1011C000B4010E94D416BDC020E030E040E251E4FA +:1011D000C501B4010E94BC1718160CF069C0A50126 +:1011E0009401C501B4010E94F1159B01AC01C70136 +:1011F000B6010E94F0154B015C0120E030E0A9012E +:101200000E945D1687FF03C0812C912C540110921F +:101210000E0410920F041092100410921104A501F4 +:101220009401C701B6010E94F01520E030E040E0D3 +:101230005FE30E94C1179B01AC01C501B4010E948C +:10124000F1156B017C01A30192010E94C1172B01D2 +:101250003C01C0920A04D0920B04E0920C04F0927C +:101260000D0460E070E087E00E946311C301B201E9 +:101270000E94D41686E00E9463118092120490921C +:101280001304A0921404B092150410921604109244 +:101290001704109218041092190460E070E083E0C3 +:1012A0000E946311C501B4010E94D41682E08AC075 +:1012B000A3019201C701B6010E94C1174B015C0155 +:1012C00020E030E0A901C701B6010E94BC17181642 +:1012D000D4F510921604109217041092180410926C +:1012E0001904C0921204D0921304E0921404F092F4 +:1012F000150460E070E083E00E946311C501B40151 +:101300000E94D4166B017C0182E00E94631110924E +:101310000E0410920F0410921004109211048C818C +:101320009D81AE81BF8180930A0490930B04A093AA +:101330000C04B0930D0460E070E087E00E9463113C +:10134000B60186E03FC0F7FAF094F7F8F094C09247 +:101350001604D0921704E0921804F0921904109227 +:10136000120410921304109214041092150460E0F9 +:1013700070E082E00E946311C501B40190580E94A0 +:10138000D4166B017C0183E00E9463118C819D81E6 +:10139000AE81BF81B05880930E0490930F04A09348 +:1013A0001004B093110410920A0410920B041092CE +:1013B0000C0410920D0460E070E086E00E9463115E +:1013C000B60187E0DF91CF91FF90EF90DF90CF9053 +:1013D000BF90AF909F908F907F906F905F904F9055 +:1013E0000C9463114F925F926F927F928F929F92B3 +:1013F000AF92BF92CF92DF92EF92FF920F931F9323 +:10140000CF93DF93EC017B01DB011C918A81811773 +:1014100050F4B4E01B9FB00111248F8198850E9485 +:101420002E1898878F831A83F701379680E024E07F +:1014300030E06E0193E0C90ED11C9A8189010C5FE6 +:101440001F4F891790F5408150E060E070E0742FE5 +:101450006627552744279F0123503109D9019C91C4 +:10146000492B2F5F3F4FD9019C91592B2F5F3F4F45 +:10147000D9019C91692B4B835C836D837E8398019A +:101480004F815885B4E08B9F400D511D1124D6012A +:101490008D909D90AD90BC90DA018D929D92AD9211 +:1014A000BC9213978F5F3496C8CFF701E20FF31FFA +:1014B000B08089858B1550F4B4E0BB9EB001112437 +:1014C0008E859F850E942E189F878E87B98640E063 +:1014D000BE01665F7F4F8985F701E00FF11F0C5F4A +:1014E0001F4F481720F55181828190E0A0E0B0E0C5 +:1014F000DC0199278827952B5081852B2381B22BDE +:101500008A879B87AC87BD87AE85BF85E4E04E9F09 +:10151000A00DB11D1124FB0180809180A280B380B9 +:101520008D929D92AD92BC9213974F5FD4CFB080B5 +:1015300088898B1550F46B2D70E0660F771F8B89AF +:101540009C890E942E189C8B8B8BB88A90E06E0130 +:10155000F1E1CF0ED11C8889981708F045C0F7013A +:10156000E00FF11F408151816281738198012C5FEE +:101570003F4FF701E20FF31F4901032E000CAA08A9 +:10158000BB08840E951EA61EB71E8F010E191F09DB +:101590002801612C712C481459046A047B0438F426 +:1015A00081918F0102501109D8018C93EECF420F27 +:1015B000531FF701E40FF51F3197108221503109B5 +:1015C0002E0D3F1D3A8B298B8A012B898C89E22FA6 +:1015D000F82FE90FF11DE90FF11DD6012D913C9176 +:1015E000318320839F5FB7CFC801DF91CF911F91D7 +:1015F0000F91FF90EF90DF90CF90BF90AF909F90B2 +:101600008F907F906F905F904F9008952F923F92B0 +:101610004F925F926F927F928F929F92AF92BF9202 +:10162000CF92DF92EF92FF920F931F93CF93DF93AE +:10163000CDB7DEB7A8970FB6F894DEBF0FBECDBF0B +:101640008C010E9451122B013C01980129573B4FFC +:101650003C8B2B8BF90180819181A281B381A30105 +:101660009201281B390B4A0B5B0BDA01C901893F38 +:101670009A42A105B10510F035971082780148E82B +:10168000E41A4BEFF40AD7018D919C91892B79F0E4 +:10169000F801E557FB4F80819181A281B3818415C8 +:1016A0009505A605B70518F4F70111821082980177 +:1016B00020583B4F388B2F87A80144585B4F5A8BDB +:1016C000498BC80144969E8B8D8BD801AE57BB4F7A +:1016D000BA8FA98FF801E057FB4FF8A3EF8F215F76 +:1016E0003F4F3AA329A3180136E8231A3BEF330AE8 +:1016F0004E5F5F4F588F4F8B89589B4F9CA38BA396 +:10170000A30192012C5E3F4F4F4F5F4F2DA33EA38D +:101710004FA358A7D80112968D919C911397DC0185 +:10172000ED91FC910284F385E02D19959C0197FDC4 +:1017300077C2EF85F88980819181820F931F918311 +:101740008083D7014D915C9147305105C9F4EF89F1 +:10175000F88D80819181AC014F5F5F4F5183408351 +:10176000F801E80FF91F248BD1018D919C911197FD +:1017700001978D939C93892B69F688E090E033C0A4 +:101780004115510541F52F3F310589F481E090E085 +:10179000D7018D939C932DA13EA14FA158A5ABA13C +:1017A000BCA12D933D934D935C931397B3CF0E94AF +:1017B0005112DC01CB0184199509A609B7090697D6 +:1017C000A105B10508F4A6CFF801EE57FB4F108232 +:1017D0008EEF9FEF4DC241305105A9F42E3F3105E8 +:1017E00031F482E090E0F7019183808393CFD701B9 +:1017F0001D921C92E98DFA8D808181118BCFC801D9 +:101800000E94780787CF4230510589F4D1012D938A +:101810003C93EF89F88D1182108283E090E0D7012C +:101820008D939C93EF85F8893183208373CF433068 +:10183000510569F4322F2227D1018D919C91119786 +:10184000280F391F2D933C9384E090E0CCCF443097 +:10185000510589F460E071E00E9484158F3F910585 +:1018600031F485E090E0D7018D939C9353CFF7013D +:10187000118210824FCF4530510571F4A989BA8980 +:101880002D933C9386E090E0F70191838083AF85B0 +:10189000B8892D933C933ECF4630510599F4322FB1 +:1018A0002227E989FA8980819181280F391F3183A4 +:1018B000208387E090E0D7018D939C93F101808194 +:1018C000918159CF4830510509F024CFD7011D929D +:1018D0001C9260E071E00E9484158F3F910509F031 +:1018E00019CFE989FA8980819181009709F0C7C0F1 +:1018F000C8010E94780786E292E09A8389831C825D +:101900001B828BE093E09E838D8398878F839A87D9 +:1019100089871B861C861D861E865801FCEEAF1A21 +:10192000FBEFBF0A68012AEBC21A2BEFD20AD501DE +:10193000ED91FC913097D9F1848195819C838B83C3 +:10194000808191819E838D8382819381DC01ED91E1 +:10195000FC910480F581E02D199598878F83D5013E +:10196000ED91FC9182819381DC01ED91FC910680E7 +:10197000F781E02D19959A87898720E032E040E0D1 +:1019800050E02B873C874D875E87D8018D919C91D5 +:10199000F501A081B18118966D917C911997DC01B8 +:1019A000ED91FC91AE014F5F5F4FC8011995B2E018 +:1019B000AB0EB11CAC14BD0409F0B9CF812C92E080 +:1019C000992EA12CB12CF601A081B1811097E1F1E3 +:1019D00012968D919C9113979C838B8314968D9175 +:1019E0009C9115979E838D83ED91FC9111970480B6 +:1019F000F581E02DCD01199598878F83D6018D91C2 +:101A00009C91DC01ED91FC910680F781E02D199508 +:101A10009A8789878B869C86AD86BE86D801ED9194 +:101A2000FC9120803180F60180819181DC01ED9173 +:101A3000FC910280F381E02D1995AE014F5F5F4F5D +:101A4000BC01C801F1011995F2E0CF0ED11CCE14F2 +:101A5000DF0409F0B8CFF801EE57FB4F81E0808337 +:101A600031964082518262827382AB89BC894D92E9 +:101A70005D926D927C9213978FEF9FEFF9C08A3041 +:101A8000910509F0A2C082E392E09A8389831B82C8 +:101A90001C821D821E821F82188619861A860E9449 +:101AA0005112F80180849184A284B3849B01AC011B +:101AB000281939094A095B0949015A016D897E894A +:101AC000CE0101960E944405C501B40128EE33E021 +:101AD00040E050E00E9498158B809C80AD80BE80D5 +:101AE000820E931EA41EB51E8B829C82AD82BE8286 +:101AF0009B01AC0160E472E48FE090E00E947415F9 +:101B00008F809884A984BA84DC01CB01880D991D4B +:101B1000AA1DBB1D8F839887A987BA870E9451127F +:101B20008F809884A984BA8436E3931A35E6A30A91 +:101B300034ECB30A28EE33E040E050E00E94981500 +:101B40002B8F3C8F4D8F5E8F9B01AC0160E472E464 +:101B50008FE090E00E947415A5019401261B370BBD +:101B6000480B590BCA01B9018B809C80AD80BE80A7 +:101B700031E0831A9108A108B1082B8D3C8D4D8D61 +:101B80005E8D821A930AA40AB50A20E03AEC4AE96B +:101B90005BE30E949815820E931EA41EB51ED80109 +:101BA0001C968D929D92AD92BC921F97F801608B0E +:101BB000718B828B938B0E945112AB89BC896D9380 +:101BC0007D938D939C931397A5CD8630910559F401 +:101BD0006D897E898F8D98A10E94F20981E0E9A12B +:101BE000FAA1808397CD8B30910521F4A98DBA8D10 +:101BF0001C9290CDFC01E154FE4FEE0FFF1FE00F51 +:101C0000F11F80819181009709F484CDDC01ED9171 +:101C1000FC910190F081E02D6D897E8919957ACD36 +:101C2000F801EE57FB4F8081882301F17801BDE771 +:101C3000EB1ABBEFFB0AF70180819181A281B3818E +:101C4000A3019201281B390B4A0B5B0BDA01C90176 +:101C5000853C9940A105B10548F0C8010E9478076C +:101C6000D7014D925D926D927C92139780E090E047 +:101C7000A8960FB6F894DEBF0FBECDBFDF91CF910F +:101C80001F910F91FF90EF90DF90CF90BF90AF909A +:101C90009F908F907F906F905F904F903F902F908C +:101CA0000895BF92CF92DF92EF92FF920F931F930E +:101CB000CF93DF93EC018B018A81FB01808311823A +:101CC00012821382DB01179680E0E4E0F0E09A8153 +:101CD0009F012C5F3F4F8917B8F4EF81F88594E09E +:101CE000899FE00DF11D1124708151814281938102 +:101CF000FD013397708331965083319640839C93D6 +:101D0000F9018F5F1496E3CF8985E00FF11F80837F +:101D100011821282138280E09985F801E20FF31F8D +:101D20002C5F3F4F8917B0F4AE85BF8594E0899F43 +:101D3000A00DB11D11246C9111965C911197129612 +:101D40004C91129713969C916083518342839383A5 +:101D50008F5FE2CF8889808311821282C90113824A +:101D6000B12C2889B21690F5EB2DF0E0EE0FFF1F95 +:101D7000AB89BC89AE0FBF1F2D913C91D9010D904D +:101D80000020E9F711976D01C21AD30AD801A80FF4 +:101D9000B91FA60160E070E04D935D936D937C9355 +:101DA00013977C0124E0E20EF11C8B899C89E80FDB +:101DB000F91F60817181A601C8018E0D9F1D0E94CF +:101DC0001C19C6018E0D9F1DB394CBCFDF91CF910F +:101DD0001F910F91FF90EF90DF90CF90BF900895EB +:101DE000CF93DF93DC01FB0112968C9112978083D5 +:101DF00013968D919C911497EC0109900020E9F7BE +:101E00002197C81BD90BAE0160E070E0418352837B +:101E10006383748313966D917C911497AE01CF0107 +:101E200005960E941C19CE010596DF91CF91089569 +:101E3000CF92DF92EF92FF920F931F93CF93DF9396 +:101E40007C01EB01FC018281888383818983A481E9 +:101E5000B581FD0101900020E9F731976F01CA1AA1 +:101E6000DB0AC601A0E0B0E08A839B83AC83BD831C +:101E7000F70164817581A601CE0106960E941C19A6 +:101E8000F701A681B781FD0101900020E9F73197A4 +:101E90008F010A1B1B0BFE01EC0DFD1DC801A0E00C +:101EA000B0E086839783A087B187FAE0CF0ED11C7C +:101EB000F70166817781A801CE018C0D9D1D0E94DE +:101EC0001C190C0D1D1DF701A085B185FD010190A8 +:101ED0000020E9F731976F01CA1ADB0AFE01E00F13 +:101EE000F11FC601A0E0B0E080839183A283B38399 +:101EF0000C5F1F4FF70160857185A601CE01800F31 +:101F0000911F0E941C190C0D1D1DF7014285238590 +:101F100094858585C00FD11F488329839A838B833D +:101F2000C8010496DF91CF911F910F91FF90EF9020 +:101F3000DF90CF9008951F920F920FB60F92112449 +:101F40000BB60F922F933F934F935F936F937F93B3 +:101F50008F939F93AF93BF93EF93FF938FEB94E097 +:101F60000E948902FF91EF91BF91AF919F918F9154 +:101F70007F916F915F914F913F912F910F900BBE89 +:101F80000F900FBE0F901F9018951F920F920FB6D3 +:101F90000F9211240BB60F922F933F934F935F93A1 +:101FA0006F937F938F939F93AF93BF93EF93FF9321 +:101FB0008FEB94E00E941B02FF91EF91BF91AF91D4 +:101FC0009F918F917F916F915F914F913F912F9151 +:101FD0000F900BBE0F900FBE0F901F9018951F9281 +:101FE0000F920FB60F9211240BB60F922F933F93BF +:101FF0004F935F936F937F938F939F93AF93BF9311 +:10200000EF93FF9382E294E00E948902FF91EF91A7 +:10201000BF91AF919F918F917F916F915F914F9100 +:102020003F912F910F900BBE0F900FBE0F901F90FE +:1020300018951F920F920FB60F9211240BB60F92A4 +:102040002F933F934F935F936F937F938F939F93C0 +:10205000AF93BF93EF93FF9382E294E00E941B0241 +:10206000FF91EF91BF91AF919F918F917F916F9170 +:102070005F914F913F912F910F900BBE0F900FBE2C +:102080000F901F901895CF92DF92EF92FF920F93CF +:102090001F93CF93DF93EC016A017B01E889F989F3 +:1020A00082E080834115514E61057105B1F060E019 +:1020B00079E08DE390E0A70196010E9498158901CF +:1020C0009A01015011092109310936952795179573 +:1020D0000795980101151041A8F0E889F989108247 +:1020E00060E874E88EE190E0A70196010E949815DF +:1020F000DA01C9010197A109B109B695A79597958C +:1021000087959C01EC85FD853083EE85FF852083D6 +:10211000188EEC89FD8986E08083EA89FB898081BD +:1021200080618083EA89FB89808188608083EA8975 +:10213000FB89808180688083EA89FB8980818F7D2B +:102140008083DF91CF911F910F91FF90EF90DF90EF +:10215000CF900895362F90E0FC01EE5CFC4F449147 +:10216000FC01E451FD4F2491FC01EA55FD4F94918F +:10217000992309F46BC0442309F455C050E0FA01D7 +:102180003197E231F10508F04EC08827EE58FF4F35 +:102190008F4F0C94BA15809180008F7707C0809183 +:1021A00080008F7D03C080918000877F80938000B6 +:1021B0003AC084B58F7702C084B58F7D84BD33C0AB +:1021C0008091B0008F7703C08091B0008F7D8093A5 +:1021D000B00029C0809190008F7707C08091900057 +:1021E0008F7D03C080919000877F809390001BC0FB +:1021F0008091A0008F7707C08091A0008F7D03C0E1 +:102200008091A000877F8093A0000DC08091200165 +:102210008F7707C0809120018F7D03C080912001BE +:10222000877F80932001E92FF0E0EE0FFF1FE45736 +:10223000FD4FA591B4918FB7F894EC91311103C083 +:1022400020952E2301C02E2B2C938FBF0895CF9362 +:10225000DF9390E0FC01E451FD4F2491FC01EA552D +:10226000FD4F8491882361F190E0880F991FFC0154 +:10227000EE58FD4FC591D491FC01E457FD4FA59157 +:10228000B491611109C09FB7F89488812095822389 +:102290008883EC912E230BC0623061F49FB7F894D1 +:1022A0003881822F809583238883EC912E2B2C9369 +:1022B0009FBF06C08FB7F894E8812E2B28838FBF6D +:1022C000DF91CF9108951F93CF93DF93182FEB01E8 +:1022D00061E00E942711209711F460E004C0CF3F15 +:1022E000D10539F461E0812FDF91CF911F910C94DA +:1022F000AA10E12FF0E0EE5CFC4FE4914E2F50E08D +:10230000FA013197E231F10508F09DC08827EC57BA +:10231000FF4F8F4F0C94BA1584B5806884BDC7BD3C +:1023200097C084B5806284BDC8BD92C08091800092 +:10233000806880938000D0938900C093880088C013 +:1023400080918000806280938000D0938B00C09346 +:102350008A007EC080918000886080938000D09346 +:102360008D00C0938C0074C08091B0008068809311 +:10237000B000C093B3006CC08091B00080628093C5 +:10238000B000C093B40064C08091900080688093D6 +:102390009000D0939900C09398005AC0809190000B +:1023A000806280939000D0939B00C0939A0050C0AD +:1023B00080919000886080939000D0939D00C0939E +:1023C0009C0046C08091A00080688093A00080910E +:1023D000A0008F7B8093A000D093A900C093A80099 +:1023E00037C08091A00080628093A000D093AB00A2 +:1023F000C093AA002DC08091A00088608093A000A7 +:10240000D093AD00C093AC0023C0809120018068C0 +:1024100080932001D0932901C093280119C0809195 +:102420002001806280932001D0932B01C0932A0168 +:102430000FC080912001886080932001D0932D01EE +:10244000C0932C0105C0C038D1050CF04BCF45CF4F +:10245000DF91CF911F9108953FB7F89480912E0A94 +:1024600090912F0AA091300AB091310A26B5A89B0D +:1024700005C02F3F19F00196A11DB11D3FBFBA2F16 +:10248000A92F982F8827820F911DA11DB11DBC0176 +:10249000CD0142E0660F771F881F991F4A95D1F73B +:1024A00008952FB7F89460912A0A70912B0A8091B1 +:1024B0002C0A90912D0A2FBF08951F920F920FB6EC +:1024C0000F9211242F933F938F939F93AF93BF93BA +:1024D00080912A0A90912B0AA0912C0AB0912D0A82 +:1024E0003091290A23E0230F2D3720F40196A11DF6 +:1024F000B11D05C026E8230F0296A11DB11D209332 +:10250000290A80932A0A90932B0AA0932C0AB0934D +:102510002D0A80912E0A90912F0AA091300AB09135 +:10252000310A0196A11DB11D80932E0A90932F0AA6 +:10253000A093300AB093310ABF91AF919F918F91D0 +:102540003F912F910F900FBE0F901F901895CF9233 +:10255000DF92EF92FF920F931F93E82FF92F05C0A0 +:10256000015011092109310961F1908196239417D5 +:10257000B9F305C0015011092109310911F1908108 +:1025800096239413F7CFC12CD12CE12CF12C0AC047 +:102590008FEFC81AD80AE80AF80A0C151D052E058F +:1025A0003F0579F080818623841791F36C2D7D2D72 +:1025B0008E2D9F2D1F910F91FF90EF90DF90CF9068 +:1025C000089560E070E080E090E01F910F91FF902F +:1025D000EF90DF90CF900895789484B5826084BDA9 +:1025E00084B5816084BD85B5826085BD85B5816017 +:1025F00085BD80916E00816080936E001092810095 +:10260000809181008260809381008091810081604F +:102610008093810080918000816080938000809110 +:10262000B10084608093B1008091B000816080939C +:10263000B000809191008260809391008091910020 +:1026400081608093910080919000816080939000E0 +:102650008091A10082608093A1008091A10081609F +:102660008093A1008091A00081608093A000809160 +:1026700021018260809321018091210181608093FA +:1026800021018091200181608093200180917A0056 +:10269000846080937A0080917A00826080937A00CF +:1026A00080917A00816080937A0080917A008068BE +:1026B00080937A001092C10040E855E260E070E03B +:1026C00082E294E00E94431061E08DE00E942711B5 +:1026D00061E087E10E94271160E086E10E942711F6 +:1026E00061E087E00E94271161E086E00E942711E7 +:1026F00061E088E10E94271161E089E10E942711D1 +:1027000061E082E00E94271161E083E00E942711CE +:10271000409160055091610560916205709163057B +:1027200080915E0590915F050E9443101092D5093B +:102730001092D4091092D7091092D6091092DB0991 +:102740001092DA091092D9091092D809E2EAF9E058 +:1027500080E090E021913191232B81F4FC01EE0F78 +:10276000FF1FEE55F64F21E03AE0318320838C596C +:102770009F4F9093040A8093030A04C00196893105 +:10278000910541F70E94B20760931E0470931F04E5 +:1027900080932004909321040E945112DC01CB010C +:1027A000885E9340A109B109C0901A04D0901B041F +:1027B000E0901C04F0901D04C816D906EA06FB063A +:1027C00040F410921E0410921F04109220041092E4 +:1027D0002104C0901E04D0901F04E0902004F090CB +:1027E000210420911604309117044091180450914F +:1027F0001904C701B6010E94C1170E94D41683E0D4 +:102800000E9463112091120430911304409114042A +:1028100050911504C701B6010E94C1170E94D41639 +:1028200082E00E94631120910E0430910F044091C8 +:10283000100450911104C701B6010E94C1170E94F3 +:10284000D41687E00E94631120910A0430910B0492 +:1028500040910C0450910D04C701B6010E94C117AC +:102860000E94D41686E00E9463118CE595E00E94D8 +:10287000060B0E942C126B017C010E942C12DC01C1 +:10288000CB018C199D09AE09BF09883E9340A10573 +:10289000B10598F30E94130375CF1092C2041092F1 +:1028A000C10448EE53E060E070E04093C3045093ED +:1028B000C4046093C5047093C6048AE492E09093C4 +:1028C000C0048093BF042DEC30E03093CC042093FF +:1028D000CB042CEC30E03093CE042093CD0428ECD4 +:1028E00030E03093D0042093CF0429EC30E03093D3 +:1028F000D2042093D1042AEC30E03093D404209306 +:10290000D3042EEC30E03093D6042093D5041092FB +:10291000D8041092D9041092DA041092DB041092B9 +:1029200025041092240440932604509327046093B6 +:10293000280470932904909323048093220485EC47 +:1029400090E090932F0480932E0484EC90E0909379 +:1029500031048093300480EC90E0909333048093B2 +:10296000320481EC90E0909335048093340482EC3F +:1029700090E0909337048093360486EC90E0909337 +:1029800039048093380410923B0410923C04109256 +:102990003D0410923E0486E992E09093020A8093EF +:1029A000010A8EE792E09093080A8093070A82E773 +:1029B00092E090930A0A8093090A10920B0A1092EF +:1029C0000C0A10920D0A10920E0A10920F0A109221 +:1029D000100A1092110A1092120A1092130A109201 +:1029E000140A1092150A1092160A9093180A8093EE +:1029F000170A1092190A10921A0A10921B0A1092C2 +:102A00001C0A10921D0A10921E0A10921F0A1092A0 +:102A1000200A1092210A1092220A1092230A109280 +:102A2000240A8DE398E09093260A8093250A81E09A +:102A300090E09093280A8093270A81E094E0909395 +:102A4000060A8093050A88E692E090935D058093DC +:102A50005C058FEB94E090935F0580935E0580E0CA +:102A600091EEA0E0B0E08093600590936105A093A3 +:102A70006205B09363051092DE098CE592E09093B5 +:102A8000ED098093EC091092EE091092F40910926E +:102A9000F3091092F5091092FB091092FA091092AD +:102AA000FC091092000A1092FF09E0E7F9E0119288 +:102AB000119289E0E23AF807D1F7E2EAF9E01192DF +:102AC000119289E0E43DF807D1F7E0E7F5E01192D3 +:102AD00087E0E037F807D9F7E0E7F7E0119289E0FF +:102AE000E037F807D9F70895DB018F939F930E9491 +:102AF000C215BF91AF91A29F800D911DA39F900D14 +:102B0000B29F900D1124089597FB072E16F40094A0 +:102B100007D077FD09D00E94CD1507FC05D03EF403 +:102B2000909581959F4F0895709561957F4F089579 +:102B3000A1E21A2EAA1BBB1BFD010DC0AA1FBB1FC1 +:102B4000EE1FFF1FA217B307E407F50720F0A21B33 +:102B5000B30BE40BF50B661F771F881F991F1A94A0 +:102B600069F760957095809590959B01AC01BD01CA +:102B7000CF010895EE0FFF1F881F8BBF0790F691BE +:102B8000E02D19940E94E115A59F900DB49F900D22 +:102B9000A49F800D911D11240895AA1BBB1B51E118 +:102BA00007C0AA1FBB1FA617B70710F0A61BB70BBD +:102BB000881F991F5A95A9F780959095BC01CD0162 +:102BC0000895A29FB001B39FC001A39F700D811D06 +:102BD0001124911DB29F700D811D1124911D089526 +:102BE0005058BB27AA270E9408160C9482170E94EF +:102BF000741738F00E947B1720F039F49F3F19F4C6 +:102C000026F40C9471170EF4E095E7FB0C946B1707 +:102C1000E92F0E94931758F3BA17620773078407C6 +:102C2000950720F079F4A6F50C94B5170EF4E0950D +:102C30000B2EBA2FA02D0B01B90190010C01CA0176 +:102C4000A0011124FF27591B99F0593F50F4503E21 +:102C500068F11A16F040A22F232F342F4427585F13 +:102C6000F3CF469537952795A795F0405395C9F72B +:102C70007EF41F16BA0B620B730B840BBAF09150E3 +:102C8000A1F0FF0FBB1F661F771F881FC2F70EC082 +:102C9000BA0F621F731F841F48F487957795679555 +:102CA000B795F7959E3F08F0B0CF9395880F08F041 +:102CB0009927EE0F9795879508950E94471708F476 +:102CC00081E008950E9476160C9482170E947B176B +:102CD00058F00E94741740F029F45F3F29F00C94DB +:102CE0006B1751110C94B6170C9471170E9493171F +:102CF00068F39923B1F3552391F3951B550BBB272B +:102D0000AA2762177307840738F09F5F5F4F220F6F +:102D1000331F441FAA1FA9F335D00E2E3AF0E0E866 +:102D200032D091505040E695001CCAF72BD0FE2FB0 +:102D300029D0660F771F881FBB1F26173707480744 +:102D4000AB07B0E809F0BB0B802DBF01FF279358FC +:102D50005F4F3AF09E3F510578F00C946B170C943E +:102D6000B6175F3FE4F3983ED4F386957795679561 +:102D7000B795F7959F5FC9F7880F911D9695879531 +:102D800097F90895E1E0660F771F881FBB1F621750 +:102D900073078407BA0720F0621B730B840BBA0B0E +:102DA000EE1F88F7E09508950E94DB166894B11134 +:102DB0000C94B61708950E949B1788F09F5798F0BF +:102DC000B92F9927B751B0F0E1F0660F771F881F30 +:102DD000991F1AF0BA95C9F714C0B13091F00E944A +:102DE000B517B1E008950C94B517672F782F882791 +:102DF000B85F39F0B93FCCF3869577956795B39571 +:102E0000D9F73EF490958095709561957F4F8F4FDF +:102E10009F4F0895E89409C097FB3EF490958095E4 +:102E2000709561957F4F8F4F9F4F9923A9F0F92F90 +:102E300096E9BB279395F695879577956795B7950E +:102E4000F111F8CFFAF4BB0F11F460FF1BC06F5FF4 +:102E50007F4F8F4F9F4F16C0882311F096E911C006 +:102E6000772321F09EE8872F762F05C0662371F027 +:102E700096E8862F70E060E02AF09A95660F771F3B +:102E8000881FDAF7880F9695879597F90895990F17 +:102E90000008550FAA0BE0E8FEEF16161706E80724 +:102EA000F907C0F012161306E407F50798F0621B45 +:102EB000730B840B950B39F40A2661F0232B242B1A +:102EC000252B21F408950A2609F4A140A6958FEF39 +:102ED000811D811D089597F99F6780E870E060E08B +:102EE00008959FEF80EC089500240A9416161706A3 +:102EF00018060906089500240A94121613061406EB +:102F000005060895092E0394000C11F4882352F04D +:102F1000BB0F40F4BF2B11F460FF04C06F5F7F4F05 +:102F20008F4F9F4F089557FD9058440F551F59F0EC +:102F30005F3F71F04795880F97FB991F61F09F3FA6 +:102F400079F087950895121613061406551FF2CFCF +:102F50004695F1DF08C0161617061806991FF1CF1F +:102F600086957105610508940895E894BB27662746 +:102F70007727CB0197F908950E94471708F48FEF40 +:102F800008950E94D4170C9482170E94741738F089 +:102F90000E947B1720F0952311F00C946B170C9472 +:102FA000711711240C94B6170E94931770F3959F14 +:102FB000C1F3950F50E0551F629FF001729FBB2730 +:102FC000F00DB11D639FAA27F00DB11DAA1F649FCC +:102FD0006627B00DA11D661F829F2227B00DA11D7F +:102FE000621F739FB00DA11D621F839FA00D611D05 +:102FF000221F749F3327A00D611D231F849F600D26 +:10300000211D822F762F6A2F11249F5750409AF04E +:10301000F1F088234AF0EE0FFF1FBB1F661F771FDA +:10302000881F91505040A9F79E3F510580F00C94A5 +:103030006B170C94B6175F3FE4F3983ED4F3869574 +:1030400077956795B795F795E7959F5FC1F7FE2B45 +:10305000880F911D9695879597F908956F927F92A5 +:103060008F929F92AF92BF92CF92DF92EF92FF9298 +:103070000F931F93CF93DF93EC01009789F4CB015B +:10308000DF91CF911F910F91FF90EF90DF90CF9044 +:10309000BF90AF909F908F907F906F900C94251968 +:1030A000FC01E60FF71F9C0122503109E217F307DC +:1030B00008F4ACC0D9010D911C91119706171707A0 +:1030C000B0F00530110508F49FC0C80104978617B9 +:1030D000970708F499C002501109061B170B0193BA +:1030E00011936D937C93CF010E94BA198DC05B013F +:1030F000A01AB10A4C01800E911EA091340AB09121 +:10310000350A40E050E0E12CF12C109709F44AC058 +:10311000A815B905D1F56D907C901197630182E0F7 +:10312000C80ED11CCA14DB0480F1A3014A195B0943 +:103130006A0182E0C80ED11C1296BC9012971396B9 +:10314000AC91B5E0CB16D10440F0B282A383518399 +:103150004083D9016D937C930AC00E5F1F4FC3015A +:10316000800F911FF90191838083EB2DFA2FE114D9 +:10317000F10431F0D7011396FC93EE93129744C0FB +:10318000F093350AE093340A3FC08D919C911197DA +:103190004817590708F4AC017D0112960D90BC91B7 +:1031A000A02DB3CF8091320A9091330A88159905EA +:1031B000E1F446175707C8F480910002909101028C +:1031C000009741F48DB79EB74091040250910502DB +:1031D000841B950BE817F907C8F4F093330AE093C2 +:1031E000320AF901718360830FC0CB010E94251957 +:1031F0007C01009759F0A801BE010E941C19CE0164 +:103200000E94BA19C70104C0CE0102C080E090E05C +:10321000DF91CF911F910F91FF90EF90DF90CF90B2 +:10322000BF90AF909F908F907F906F90089581E0B6 +:1032300090E0F8940C94521AFB01DC0102C001905A +:103240000D9241505040D8F70895CF93DF938230CC +:10325000910510F482E090E0E091340AF091350A93 +:1032600020E030E0C0E0D0E0309711F140815181A2 +:1032700048175907C0F04817590761F482819381B4 +:10328000209719F09B838A832BC09093350A8093F3 +:10329000340A26C02115310519F04217530718F4D6 +:1032A0009A01BE01DF01EF010280F381E02DDCCF46 +:1032B0002115310509F1281B390B2430310590F413 +:1032C00012968D919C9113976115710521F0FB0168 +:1032D0009383828304C09093350A8093340AFD015E +:1032E000329644C0FD01E20FF31F81939193225067 +:1032F00031092D933C933AC02091320A3091330A20 +:10330000232B41F420910202309103023093330ABF +:103310002093320A209100023091010221153105DB +:1033200041F42DB73EB74091040250910502241B91 +:10333000350BE091320AF091330AE217F307A0F45B +:103340002E1B3F0B2817390778F0AC014E5F5F4FFB +:103350002417350748F04E0F5F1F5093330A4093F0 +:10336000320A8193919302C0E0E0F0E0CF01DF9157 +:10337000CF9108950F931F93CF93DF93009709F494 +:103380008CC0FC013297138212820091340A109192 +:10339000350A0115110581F420813181820F931FB7 +:1033A0002091320A3091330A2817390779F5F093C2 +:1033B000330AE093320A71C0D80140E050E0AE1702 +:1033C000BF0750F412962D913C911397AD01211532 +:1033D000310509F1D901F3CF9D01DA01338322834D +:1033E00060817181860F971F8217930769F4EC0142 +:1033F00028813981260F371F2E5F3F4F318320836D +:103400008A819B8193838283452B29F4F093350A2B +:10341000E093340A42C01396FC93EE931297ED01A9 +:10342000499159919E01240F351FE217F30771F45A +:1034300080819181840F951F029611969C938E93A3 +:103440008281938113969C938E931297E0E0F0E033 +:10345000D80112968D919C911397009719F0F8015D +:103460008C01F6CF8D919C9198012E5F3F4F820F7A +:10347000931F2091320A3091330A2817390769F4D3 +:10348000309729F41092350A1092340A02C0138240 +:1034900012821093330A0093320ADF91CF911F9169 +:0834A0000F910895F894FFCF8D +:1034A8000000360A8000726F7373657269616C5F21 +:1034B8006D7367732F5265717565737450617261AE +:1034C8006D0000000000180F62045F045C04000037 +:1034D80000008A05440541053E0500000000F00E85 +:1034E8001A041704140400000000AA02F0013802AC +:1034F800F102690247025B0200000000510EF20966 +:1035080011040E04000000005703060B52030000CC +:1035180000002C0752060B040804000000005C079A +:103528007C060504020400000000B007B007B007DD +:10353800B0070000000098064E034B0348033966A5 +:103548003139356638383132343666646661323737 +:1035580039386431643365656263613834610067A2 +:10356800656F6D657472795F6D7367732F547769D2 +:103578007374004D6573736167652066726F6D20A3 +:103588006465766963652064726F707065643A205B +:103598006D657373616765206C617267657220740D +:1035A80068616E206275666665722E003461383413 +:1035B80032623635663431333038346463326231DE +:1035C8003066623438346561376631370067656F55 +:1035D8006D657472795F6D7367732F566563746F69 +:1035E8007233003966306539386264613635393886 +:1035F8003139383664646635336166613761343031 +:1036080065343900313161626437333163323539B9 +:10361800333332363163643631383362643132647D +:103628003632393500726F7373657269616C5F6D1C +:103638007367732F4C6F67003061643531663838B3 +:10364800666334343839326638633130363834306A +:10365800373736343630303500726F7373657269B8 +:10366800616C5F6D7367732F546F706963496E6621 +:103678006F00636437313636633734633535326308 +:10368800333131666263633266653561376263324E +:103698003839007374645F6D7367732F54696D658F +:0A36A80000636D645F76656C00003E +:00000001FF diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libFrameworkArduino.a b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libFrameworkArduino.a new file mode 100755 index 0000000..0631fb3 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libFrameworkArduino.a differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a new file mode 100755 index 0000000..8b277f0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a @@ -0,0 +1 @@ +! diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/libros_lib.a b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/libros_lib.a new file mode 100755 index 0000000..ef2e963 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/libros_lib.a differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/ros_lib/duration.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/ros_lib/duration.o new file mode 100755 index 0000000..8c919c5 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/ros_lib/duration.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/ros_lib/time.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/ros_lib/time.o new file mode 100755 index 0000000..bda19f9 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/libe28/ros_lib/time.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/src/robotbase_07.ino.o b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/src/robotbase_07.ino.o new file mode 100755 index 0000000..d54cf61 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/.pioenvs/megaADK/src/robotbase_07.ino.o differ diff --git a/case_study/arduino_lab/group_07/original/.pioenvs/structure.hash b/case_study/arduino_lab/group_07/original/.pioenvs/structure.hash new file mode 100755 index 0000000..c5fe9bd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.pioenvs/structure.hash @@ -0,0 +1 @@ +01a863cb75dd3a832229e52628eb88ca4509f220 \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/.library.json b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/.library.json new file mode 100755 index 0000000..fd306ef --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/.library.json @@ -0,0 +1,39 @@ +{ + "name": "Timer", + "repository": { + "url": "https://github.com/JChristensen/Timer.git", + "type": "git" + }, + "platforms": [ + "atmelavr" + ], + "frameworks": [ + "arduino" + ], + "version": "7b408e8131", + "authors": [ + { + "url": null, + "maintainer": true, + "email": null, + "name": "Jack Christensen" + }, + { + "url": null, + "maintainer": false, + "email": null, + "name": "Simon Monk" + }, + { + "url": null, + "maintainer": false, + "email": null, + "name": "Damian Philipp" + } + ], + "keywords": [ + "timer" + ], + "id": 75, + "description": "Timer Library" +} \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Event.cpp b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Event.cpp new file mode 100755 index 0000000..6ef838d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Event.cpp @@ -0,0 +1,65 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// For Arduino 1.0 and earlier +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + +#include "Event.h" + +Event::Event(void) +{ + eventType = EVENT_NONE; +} + +void Event::update(void) +{ + unsigned long now = millis(); + update(now); +} + +void Event::update(unsigned long now) +{ + if (now - lastEventTime >= period) + { + switch (eventType) + { + case EVENT_EVERY: + (*callback)(); + break; + + case EVENT_OSCILLATE: + pinState = ! pinState; + digitalWrite(pin, pinState); + break; + } + lastEventTime = now; + count++; + } + if (repeatCount > -1 && count >= repeatCount) + { + eventType = EVENT_NONE; + } +} diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Event.h b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Event.h new file mode 100755 index 0000000..2f64d3f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Event.h @@ -0,0 +1,49 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef Event_h +#define Event_h + +#include + +#define EVENT_NONE 0 +#define EVENT_EVERY 1 +#define EVENT_OSCILLATE 2 + +class Event +{ + +public: + Event(void); + void update(void); + void update(unsigned long now); + int8_t eventType; + unsigned long period; + int repeatCount; + uint8_t pin; + uint8_t pinState; + void (*callback)(void); + unsigned long lastEventTime; + int count; +}; + +#endif diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/ReadMe.txt b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/ReadMe.txt new file mode 100755 index 0000000..5b08895 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/ReadMe.txt @@ -0,0 +1,29 @@ +1.0 by Simon Monk +Library as downloaded 02Feb2012 22:55 UTC from http://srmonk.blogspot.com/2012/01/arduino-timer-library.html + +1.1 by Jack Christensen +Changed data types of variables and functions: + o event types and indexes changed from int to int8_t. + o periods and durations changed from lon to unsigned long. + o update() and stop() functions typed as void, since they return nothing. + o pin numbers and pin values changed from int to uint8_t, this agrees with digitalWrite(). + o added return values to Timer::pulse() and Timer::oscillate(uint8_t, unsigned long, uint8_t). + o changed test in Event::update() to use subtraction to avoid rollover issues. + o Updated keywords.txt file to include all functions. + +1.2 by Damian Philipp + o Added a range check to Timer::stop() to avoid memory corruption. + o Added constants to : + - NO_TIMER_AVAILABLE: Signals that while an event was to be queued, no free timer could be found. + - TIMER_NOT_AN_EVENT: Can be used to flag a variable that *might* contain a timer ID as + *not* containing a timer ID + o Replaced a bunch of magic numbers in by the above constants + o Added several comments + o Added Timer::pulseImmediate(). pulseImmediate sets the pin to the specified value for the given + duration. After the duration, the pin is set to !value. + +1.3 by Jack Christensen + o Added "blink2" example illustrating flashing two LEDs at different rates. + o 19Oct2013: This is the last v1.x release. It will continue to be available on GitHub + as a branch named v1.3. Future development will continue with Sandy Walsh's v2.0 which + can pass context (timer ID, etc.) to the callback functions. \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Timer.cpp b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Timer.cpp new file mode 100755 index 0000000..9c8b889 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Timer.cpp @@ -0,0 +1,138 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// For Arduino 1.0 and earlier +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + +#include "Timer.h" + +Timer::Timer(void) +{ +} + +int8_t Timer::every(unsigned long period, void (*callback)(), int repeatCount) +{ + int8_t i = findFreeEventIndex(); + if (i == -1) return -1; + + _events[i].eventType = EVENT_EVERY; + _events[i].period = period; + _events[i].repeatCount = repeatCount; + _events[i].callback = callback; + _events[i].lastEventTime = millis(); + _events[i].count = 0; + return i; +} + +int8_t Timer::every(unsigned long period, void (*callback)()) +{ + return every(period, callback, -1); // - means forever +} + +int8_t Timer::after(unsigned long period, void (*callback)()) +{ + return every(period, callback, 1); +} + +int8_t Timer::oscillate(uint8_t pin, unsigned long period, uint8_t startingValue, int repeatCount) +{ + int8_t i = findFreeEventIndex(); + if (i == NO_TIMER_AVAILABLE) return NO_TIMER_AVAILABLE; + + _events[i].eventType = EVENT_OSCILLATE; + _events[i].pin = pin; + _events[i].period = period; + _events[i].pinState = startingValue; + digitalWrite(pin, startingValue); + _events[i].repeatCount = repeatCount * 2; // full cycles not transitions + _events[i].lastEventTime = millis(); + _events[i].count = 0; + return i; +} + +int8_t Timer::oscillate(uint8_t pin, unsigned long period, uint8_t startingValue) +{ + return oscillate(pin, period, startingValue, -1); // forever +} + +/** + * This method will generate a pulse of !startingValue, occuring period after the + * call of this method and lasting for period. The Pin will be left in !startingValue. + */ +int8_t Timer::pulse(uint8_t pin, unsigned long period, uint8_t startingValue) +{ + return oscillate(pin, period, startingValue, 1); // once +} + +/** + * This method will generate a pulse of startingValue, starting immediately and of + * length period. The pin will be left in the !startingValue state + */ +int8_t Timer::pulseImmediate(uint8_t pin, unsigned long period, uint8_t pulseValue) +{ + int8_t id(oscillate(pin, period, pulseValue, 1)); + // now fix the repeat count + if (id >= 0 && id < MAX_NUMBER_OF_EVENTS) { + _events[id].repeatCount = 1; + } + return id; +} + + +void Timer::stop(int8_t id) +{ + if (id >= 0 && id < MAX_NUMBER_OF_EVENTS) { + _events[id].eventType = EVENT_NONE; + } +} + +void Timer::update(void) +{ + unsigned long now = millis(); + update(now); +} + +void Timer::update(unsigned long now) +{ + for (int8_t i = 0; i < MAX_NUMBER_OF_EVENTS; i++) + { + if (_events[i].eventType != EVENT_NONE) + { + _events[i].update(now); + } + } +} +int8_t Timer::findFreeEventIndex(void) +{ + for (int8_t i = 0; i < MAX_NUMBER_OF_EVENTS; i++) + { + if (_events[i].eventType == EVENT_NONE) + { + return i; + } + } + return NO_TIMER_AVAILABLE; +} diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Timer.h b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Timer.h new file mode 100755 index 0000000..dd5ce93 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/Timer.h @@ -0,0 +1,67 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef Timer_h +#define Timer_h + +#include +#include "Event.h" + +#define MAX_NUMBER_OF_EVENTS (10) + +#define TIMER_NOT_AN_EVENT (-2) +#define NO_TIMER_AVAILABLE (-1) + +class Timer +{ + +public: + Timer(void); + + int8_t every(unsigned long period, void (*callback)(void)); + int8_t every(unsigned long period, void (*callback)(void), int repeatCount); + int8_t after(unsigned long duration, void (*callback)(void)); + int8_t oscillate(uint8_t pin, unsigned long period, uint8_t startingValue); + int8_t oscillate(uint8_t pin, unsigned long period, uint8_t startingValue, int repeatCount); + + /** + * This method will generate a pulse of !startingValue, occuring period after the + * call of this method and lasting for period. The Pin will be left in !startingValue. + */ + int8_t pulse(uint8_t pin, unsigned long period, uint8_t startingValue); + + /** + * This method will generate a pulse of pulseValue, starting immediately and of + * length period. The pin will be left in the !pulseValue state + */ + int8_t pulseImmediate(uint8_t pin, unsigned long period, uint8_t pulseValue); + void stop(int8_t id); + void update(void); + void update(unsigned long now); + +protected: + Event _events[MAX_NUMBER_OF_EVENTS]; + int8_t findFreeEventIndex(void); + +}; + +#endif diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/blink2/blink2.ino b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/blink2/blink2.ino new file mode 100755 index 0000000..e9080a4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/blink2/blink2.ino @@ -0,0 +1,29 @@ +//Flash two LEDs at different rates using Simon Monk's Timer library +//http://www.doctormonk.com/2012/01/arduino-timer-library.html +// +//Jack Christensen 30Sep2013 +// +//Beerware license: Free for any and all purposes, but if you find it +//useful AND we actually meet someday, you can buy me a beer! + +#include "Timer.h" //http://github.com/JChristensen/Timer + +const int LED1 = 8; //connect one LED to this pin (with appropriate current-limiting resistor of course) +const int LED2 = 9; //connect another LED to this pin (don't forget the resistor) +const unsigned long PERIOD1 = 1000; //one second +const unsigned long PERIOD2 = 10000; //ten seconds +Timer t; //instantiate the timer object + +void setup(void) +{ + pinMode(LED1, OUTPUT); + pinMode(LED2, OUTPUT); + t.oscillate(LED1, PERIOD1, HIGH); + t.oscillate(LED2, PERIOD2, HIGH); +} + +void loop(void) +{ + t.update(); +} + diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/kitchen_sink/kitchen_sink.pde b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/kitchen_sink/kitchen_sink.pde new file mode 100755 index 0000000..991bcb4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/kitchen_sink/kitchen_sink.pde @@ -0,0 +1,42 @@ +#include "Timer.h" + +Timer t; + +int ledEvent; + +void setup() +{ + Serial.begin(9600); + int tickEvent = t.every(2000, doSomething); + Serial.print("2 second tick started id="); + Serial.println(tickEvent); + + pinMode(13, OUTPUT); + ledEvent = t.oscillate(13, 50, HIGH); + Serial.print("LED event started id="); + Serial.println(ledEvent); + + int afterEvent = t.after(10000, doAfter); + Serial.print("After event started id="); + Serial.println(afterEvent); + +} + +void loop() +{ + t.update(); +} + +void doSomething() +{ + Serial.print("2 second tick: millis()="); + Serial.println(millis()); +} + + +void doAfter() +{ + Serial.println("stop the led event"); + t.stop(ledEvent); + t.oscillate(13, 500, HIGH, 5); +} diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/pin_high_10_mins/pin_high_10_mins.pde b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/pin_high_10_mins/pin_high_10_mins.pde new file mode 100755 index 0000000..2a175a8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/pin_high_10_mins/pin_high_10_mins.pde @@ -0,0 +1,17 @@ +#include "Timer.h" + +Timer t; +int pin = 13; + +void setup() +{ + pinMode(pin, OUTPUT); + t.pulse(pin, 10 * 1000UL, HIGH); // 10 seconds + // t.pulse(pin, 10 * 60 * 1000UL, HIGH); // 10 minutes +} + +void loop() +{ + t.update(); +} + diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/read_A0_flashLED/read_A0_flashLED.pde b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/read_A0_flashLED/read_A0_flashLED.pde new file mode 100755 index 0000000..e103e37 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/examples/read_A0_flashLED/read_A0_flashLED.pde @@ -0,0 +1,22 @@ +#include "Timer.h" + +Timer t; +int pin = 13; + +void setup() +{ + Serial.begin(9600); + pinMode(pin, OUTPUT); + t.oscillate(pin, 100, LOW); + t.every(1000, takeReading); +} + +void loop() +{ + t.update(); +} + +void takeReading() +{ + Serial.println(analogRead(0)); +} diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/keywords.txt b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/keywords.txt new file mode 100755 index 0000000..a5107b8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/keywords.txt @@ -0,0 +1,31 @@ +####################################### +# Syntax Coloring Map For Timer Library +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +Timer KEYWORD1 +Event KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +every KEYWORD2 +after KEYWORD2 +oscillate KEYWORD2 +pulse KEYWORD2 +pulseImmediate KEYWORD2 +stop KEYWORD2 +update KEYWORD2 +findFreeEventIndex KEYWORD2 + +####################################### +# Instances (KEYWORD2) +####################################### + +####################################### +# Constants (LITERAL1) +####################################### diff --git a/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/library.json b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/library.json new file mode 100755 index 0000000..636f3c1 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/.piolibdeps/Timer_ID75/library.json @@ -0,0 +1,25 @@ +{ + "name": "Timer", + "keywords": "timer", + "description": "Timer Library", + "repository": + { + "type": "git", + "url": "https://github.com/JChristensen/Timer.git" + }, + "authors": + [ + { + "name": "Jack Christensen", + "maintainer": true + }, + { + "name": "Simon Monk" + }, + { + "name": "Damian Philipp" + } + ], + "frameworks": "arduino", + "platforms": "atmelavr" +} diff --git a/case_study/arduino_lab/group_07/original/README.rst b/case_study/arduino_lab/group_07/original/README.rst new file mode 100755 index 0000000..fc64cfa --- /dev/null +++ b/case_study/arduino_lab/group_07/original/README.rst @@ -0,0 +1,29 @@ +.. Copyright (c) 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to test PlatformIO based project +==================================== + +1. `Install PlatformIO Core `_ +2. Download `examples source code `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-examples/unit-testing/wiring-blink + + # Test project + > platformio test + + # Test specific environment + > platformio test -e uno diff --git a/case_study/arduino_lab/group_07/original/lib/readme.txt b/case_study/arduino_lab/group_07/original/lib/readme.txt new file mode 100755 index 0000000..dbadc3d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/readme.txt @@ -0,0 +1,36 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| |--Foo +| | |- Foo.c +| | |- Foo.h +| |- readme.txt --> THIS FILE +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ArduinoHardware.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ArduinoHardware.h new file mode 100755 index 0000000..0f7ff6b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ArduinoHardware.h @@ -0,0 +1,106 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_ARDUINO_HARDWARE_H_ +#define ROS_ARDUINO_HARDWARE_H_ + +#if ARDUINO>=100 + #include // Arduino 1.0 +#else + #include // Arduino 0022 +#endif + +#if defined(__MK20DX128__) || defined(__MK20DX256__) + #include // Teensy 3.0 and 3.1 + #define SERIAL_CLASS usb_serial_class +#elif defined(_SAM3XA_) + #include // Arduino Due + #define SERIAL_CLASS UARTClass +#elif defined(USE_USBCON) + // Arduino Leonardo USB Serial Port + #define SERIAL_CLASS Serial_ +#else + #include // Arduino AVR + #define SERIAL_CLASS HardwareSerial +#endif + +class ArduinoHardware { + public: + ArduinoHardware(SERIAL_CLASS* io , long baud= 57600){ + iostream = io; + baud_ = baud; + } + ArduinoHardware() + { +#if defined(USBCON) and !(defined(USE_USBCON)) + /* Leonardo support */ + iostream = &Serial1; +#else + iostream = &Serial; +#endif + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h){ + this->iostream = iostream; + this->baud_ = h.baud_; + } + + void setBaud(long baud){ + this->baud_= baud; + } + + int getBaud(){return baud_;} + + void init(){ +#if defined(USE_USBCON) + // Startup delay as a fail-safe to upload a new sketch + delay(3000); +#endif + iostream->begin(baud_); + } + + int read(){return iostream->read();}; + void write(uint8_t* data, int length){ + for(int i=0; iwrite(data[i]); + } + + unsigned long time(){return millis();} + + protected: + SERIAL_CLASS* iostream; + long baud_; +}; + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestAction.h new file mode 100755 index 0000000..7777571 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestAction_h +#define _ROS_actionlib_TestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestActionGoal.h" +#include "actionlib/TestActionResult.h" +#include "actionlib/TestActionFeedback.h" + +namespace actionlib +{ + + class TestAction : public ros::Msg + { + public: + actionlib::TestActionGoal action_goal; + actionlib::TestActionResult action_result; + actionlib::TestActionFeedback action_feedback; + + TestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestAction"; }; + const char * getMD5(){ return "991e87a72802262dfbe5d1b3cf6efc9a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionFeedback.h new file mode 100755 index 0000000..347d3f7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionFeedback_h +#define _ROS_actionlib_TestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestFeedback.h" + +namespace actionlib +{ + + class TestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestFeedback feedback; + + TestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionFeedback"; }; + const char * getMD5(){ return "6d3d0bf7fb3dda24779c010a9f3eb7cb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionGoal.h new file mode 100755 index 0000000..2ab1238 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionGoal_h +#define _ROS_actionlib_TestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestGoal.h" + +namespace actionlib +{ + + class TestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestGoal goal; + + TestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionGoal"; }; + const char * getMD5(){ return "348369c5b403676156094e8c159720bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionResult.h new file mode 100755 index 0000000..d7e388c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionResult_h +#define _ROS_actionlib_TestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestResult.h" + +namespace actionlib +{ + + class TestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestResult result; + + TestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionResult"; }; + const char * getMD5(){ return "3d669e3a63aa986c667ea7b0f46ce85e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestFeedback.h new file mode 100755 index 0000000..380f785 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestFeedback.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestFeedback_h +#define _ROS_actionlib_TestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestFeedback : public ros::Msg + { + public: + int32_t feedback; + + TestFeedback(): + feedback(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.real = this->feedback; + *(outbuffer + offset + 0) = (u_feedback.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_feedback.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_feedback.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_feedback.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->feedback); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.base = 0; + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->feedback = u_feedback.real; + offset += sizeof(this->feedback); + return offset; + } + + const char * getType(){ return "actionlib/TestFeedback"; }; + const char * getMD5(){ return "49ceb5b32ea3af22073ede4a0328249e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestGoal.h new file mode 100755 index 0000000..4e2d676 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestGoal_h +#define _ROS_actionlib_TestGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestGoal : public ros::Msg + { + public: + int32_t goal; + + TestGoal(): + goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.real = this->goal; + *(outbuffer + offset + 0) = (u_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.base = 0; + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->goal = u_goal.real; + offset += sizeof(this->goal); + return offset; + } + + const char * getType(){ return "actionlib/TestGoal"; }; + const char * getMD5(){ return "18df0149936b7aa95588e3862476ebde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestAction.h new file mode 100755 index 0000000..2117590 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestAction_h +#define _ROS_actionlib_TestRequestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestRequestActionGoal.h" +#include "actionlib/TestRequestActionResult.h" +#include "actionlib/TestRequestActionFeedback.h" + +namespace actionlib +{ + + class TestRequestAction : public ros::Msg + { + public: + actionlib::TestRequestActionGoal action_goal; + actionlib::TestRequestActionResult action_result; + actionlib::TestRequestActionFeedback action_feedback; + + TestRequestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestAction"; }; + const char * getMD5(){ return "dc44b1f4045dbf0d1db54423b3b86b30"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h new file mode 100755 index 0000000..ce98e9b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionFeedback_h +#define _ROS_actionlib_TestRequestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestFeedback.h" + +namespace actionlib +{ + + class TestRequestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestFeedback feedback; + + TestRequestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionGoal.h new file mode 100755 index 0000000..563b22f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionGoal_h +#define _ROS_actionlib_TestRequestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestRequestGoal.h" + +namespace actionlib +{ + + class TestRequestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestRequestGoal goal; + + TestRequestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionGoal"; }; + const char * getMD5(){ return "1889556d3fef88f821c7cb004e4251f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionResult.h new file mode 100755 index 0000000..67e32a4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionResult_h +#define _ROS_actionlib_TestRequestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestResult.h" + +namespace actionlib +{ + + class TestRequestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestResult result; + + TestRequestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionResult"; }; + const char * getMD5(){ return "0476d1fdf437a3a6e7d6d0e9f5561298"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestFeedback.h new file mode 100755 index 0000000..f1fc247 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TestRequestFeedback_h +#define _ROS_actionlib_TestRequestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestFeedback : public ros::Msg + { + public: + + TestRequestFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TestRequestFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestGoal.h new file mode 100755 index 0000000..8fd822e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestGoal.h @@ -0,0 +1,207 @@ +#ifndef _ROS_actionlib_TestRequestGoal_h +#define _ROS_actionlib_TestRequestGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace actionlib +{ + + class TestRequestGoal : public ros::Msg + { + public: + int32_t terminate_status; + bool ignore_cancel; + const char* result_text; + int32_t the_result; + bool is_simple_client; + ros::Duration delay_accept; + ros::Duration delay_terminate; + ros::Duration pause_status; + enum { TERMINATE_SUCCESS = 0 }; + enum { TERMINATE_ABORTED = 1 }; + enum { TERMINATE_REJECTED = 2 }; + enum { TERMINATE_LOSE = 3 }; + enum { TERMINATE_DROP = 4 }; + enum { TERMINATE_EXCEPTION = 5 }; + + TestRequestGoal(): + terminate_status(0), + ignore_cancel(0), + result_text(""), + the_result(0), + is_simple_client(0), + delay_accept(), + delay_terminate(), + pause_status() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.real = this->terminate_status; + *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.real = this->ignore_cancel; + *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text = strlen(this->result_text); + memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->result_text, length_result_text); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.real = this->is_simple_client; + *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_client); + *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.sec); + *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.nsec); + *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.sec); + *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.nsec); + *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.sec); + *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.base = 0; + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terminate_status = u_terminate_status.real; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.base = 0; + u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ignore_cancel = u_ignore_cancel.real; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text; + memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result_text-1]=0; + this->result_text = (char *)(inbuffer + offset-1); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.base = 0; + u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_client = u_is_simple_client.real; + offset += sizeof(this->is_simple_client); + this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.sec); + this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.nsec); + this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.sec); + this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.nsec); + this->pause_status.sec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.sec); + this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.nsec); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestGoal"; }; + const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestResult.h new file mode 100755 index 0000000..27b1425 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestRequestResult.h @@ -0,0 +1,78 @@ +#ifndef _ROS_actionlib_TestRequestResult_h +#define _ROS_actionlib_TestRequestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestResult : public ros::Msg + { + public: + int32_t the_result; + bool is_simple_server; + + TestRequestResult(): + the_result(0), + is_simple_server(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.real = this->is_simple_server; + *(outbuffer + offset + 0) = (u_is_simple_server.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_server); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.base = 0; + u_is_simple_server.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_server = u_is_simple_server.real; + offset += sizeof(this->is_simple_server); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestResult"; }; + const char * getMD5(){ return "61c2364524499c7c5017e2f3fce7ba06"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestResult.h new file mode 100755 index 0000000..a0bd838 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TestResult.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestResult_h +#define _ROS_actionlib_TestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestResult : public ros::Msg + { + public: + int32_t result; + + TestResult(): + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->result = u_result.real; + offset += sizeof(this->result); + return offset; + } + + const char * getType(){ return "actionlib/TestResult"; }; + const char * getMD5(){ return "034a8e20d6a306665e3a5b340fab3f09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsAction.h new file mode 100755 index 0000000..18ac4d8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsAction_h +#define _ROS_actionlib_TwoIntsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TwoIntsActionGoal.h" +#include "actionlib/TwoIntsActionResult.h" +#include "actionlib/TwoIntsActionFeedback.h" + +namespace actionlib +{ + + class TwoIntsAction : public ros::Msg + { + public: + actionlib::TwoIntsActionGoal action_goal; + actionlib::TwoIntsActionResult action_result; + actionlib::TwoIntsActionFeedback action_feedback; + + TwoIntsAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsAction"; }; + const char * getMD5(){ return "6d1aa538c4bd6183a2dfb7fcac41ee50"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h new file mode 100755 index 0000000..1df0fba --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionFeedback_h +#define _ROS_actionlib_TwoIntsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsFeedback.h" + +namespace actionlib +{ + + class TwoIntsActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsFeedback feedback; + + TwoIntsActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h new file mode 100755 index 0000000..dc3e013 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionGoal_h +#define _ROS_actionlib_TwoIntsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TwoIntsGoal.h" + +namespace actionlib +{ + + class TwoIntsActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TwoIntsGoal goal; + + TwoIntsActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionGoal"; }; + const char * getMD5(){ return "684a2db55d6ffb8046fb9d6764ce0860"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionResult.h new file mode 100755 index 0000000..f6d3397 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionResult_h +#define _ROS_actionlib_TwoIntsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsResult.h" + +namespace actionlib +{ + + class TwoIntsActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsResult result; + + TwoIntsActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionResult"; }; + const char * getMD5(){ return "3ba7dea8b8cddcae4528ade4ef74b6e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsFeedback.h new file mode 100755 index 0000000..3789c4d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TwoIntsFeedback_h +#define _ROS_actionlib_TwoIntsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsFeedback : public ros::Msg + { + public: + + TwoIntsFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsGoal.h new file mode 100755 index 0000000..1fb5639 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsGoal.h @@ -0,0 +1,100 @@ +#ifndef _ROS_actionlib_TwoIntsGoal_h +#define _ROS_actionlib_TwoIntsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsGoal : public ros::Msg + { + public: + int64_t a; + int64_t b; + + TwoIntsGoal(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsGoal"; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsResult.h new file mode 100755 index 0000000..901a523 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib/TwoIntsResult.h @@ -0,0 +1,69 @@ +#ifndef _ROS_actionlib_TwoIntsResult_h +#define _ROS_actionlib_TwoIntsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsResult : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResult(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsResult"; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalID.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalID.h new file mode 100755 index 0000000..989dc6b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalID.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_msgs_GoalID_h +#define _ROS_actionlib_msgs_GoalID_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace actionlib_msgs +{ + + class GoalID : public ros::Msg + { + public: + ros::Time stamp; + const char* id; + + GoalID(): + stamp(), + id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalID"; }; + const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalStatus.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalStatus.h new file mode 100755 index 0000000..b728926 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalStatus.h @@ -0,0 +1,75 @@ +#ifndef _ROS_actionlib_msgs_GoalStatus_h +#define _ROS_actionlib_msgs_GoalStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_msgs/GoalID.h" + +namespace actionlib_msgs +{ + + class GoalStatus : public ros::Msg + { + public: + actionlib_msgs::GoalID goal_id; + uint8_t status; + const char* text; + enum { PENDING = 0 }; + enum { ACTIVE = 1 }; + enum { PREEMPTED = 2 }; + enum { SUCCEEDED = 3 }; + enum { ABORTED = 4 }; + enum { REJECTED = 5 }; + enum { PREEMPTING = 6 }; + enum { RECALLING = 7 }; + enum { RECALLED = 8 }; + enum { LOST = 9 }; + + GoalStatus(): + goal_id(), + status(0), + text("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->goal_id.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->goal_id.deserialize(inbuffer + offset); + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatus"; }; + const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h new file mode 100755 index 0000000..8bff742 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_actionlib_msgs_GoalStatusArray_h +#define _ROS_actionlib_msgs_GoalStatusArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" + +namespace actionlib_msgs +{ + + class GoalStatusArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_list_length; + actionlib_msgs::GoalStatus st_status_list; + actionlib_msgs::GoalStatus * status_list; + + GoalStatusArray(): + header(), + status_list_length(0), status_list(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_list_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->status_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_list_lengthT = *(inbuffer + offset++); + if(status_list_lengthT > status_list_length) + this->status_list = (actionlib_msgs::GoalStatus*)realloc(this->status_list, status_list_lengthT * sizeof(actionlib_msgs::GoalStatus)); + offset += 3; + status_list_length = status_list_lengthT; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->st_status_list.deserialize(inbuffer + offset); + memcpy( &(this->status_list[i]), &(this->st_status_list), sizeof(actionlib_msgs::GoalStatus)); + } + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatusArray"; }; + const char * getMD5(){ return "8b2b82f13216d0a8ea88bd3af735e619"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h new file mode 100755 index 0000000..65a963d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingAction_h +#define _ROS_actionlib_tutorials_AveragingAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/AveragingActionGoal.h" +#include "actionlib_tutorials/AveragingActionResult.h" +#include "actionlib_tutorials/AveragingActionFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingAction : public ros::Msg + { + public: + actionlib_tutorials::AveragingActionGoal action_goal; + actionlib_tutorials::AveragingActionResult action_result; + actionlib_tutorials::AveragingActionFeedback action_feedback; + + AveragingAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingAction"; }; + const char * getMD5(){ return "628678f2b4fa6a5951746a4a2d39e716"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h new file mode 100755 index 0000000..97fda36 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionFeedback_h +#define _ROS_actionlib_tutorials_AveragingActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingFeedback feedback; + + AveragingActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionFeedback"; }; + const char * getMD5(){ return "78a4a09241b1791069223ae7ebd5b16b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h new file mode 100755 index 0000000..4b225e9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionGoal_h +#define _ROS_actionlib_tutorials_AveragingActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/AveragingGoal.h" + +namespace actionlib_tutorials +{ + + class AveragingActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::AveragingGoal goal; + + AveragingActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionGoal"; }; + const char * getMD5(){ return "1561825b734ebd6039851c501e3fb570"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h new file mode 100755 index 0000000..e4d5128 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionResult_h +#define _ROS_actionlib_tutorials_AveragingActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingResult.h" + +namespace actionlib_tutorials +{ + + class AveragingActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingResult result; + + AveragingActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionResult"; }; + const char * getMD5(){ return "8672cb489d347580acdcd05c5d497497"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h new file mode 100755 index 0000000..a987900 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h @@ -0,0 +1,130 @@ +#ifndef _ROS_actionlib_tutorials_AveragingFeedback_h +#define _ROS_actionlib_tutorials_AveragingFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingFeedback : public ros::Msg + { + public: + int32_t sample; + float data; + float mean; + float std_dev; + + AveragingFeedback(): + sample(0), + data(0), + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.real = this->sample; + *(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.base = 0; + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sample = u_sample.real; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; }; + const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h new file mode 100755 index 0000000..5b631c5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_tutorials_AveragingGoal_h +#define _ROS_actionlib_tutorials_AveragingGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingGoal : public ros::Msg + { + public: + int32_t samples; + + AveragingGoal(): + samples(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.real = this->samples; + *(outbuffer + offset + 0) = (u_samples.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_samples.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_samples.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_samples.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.base = 0; + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->samples = u_samples.real; + offset += sizeof(this->samples); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingGoal"; }; + const char * getMD5(){ return "32c9b10ef9b253faa93b93f564762c8f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h new file mode 100755 index 0000000..ce08c43 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_actionlib_tutorials_AveragingResult_h +#define _ROS_actionlib_tutorials_AveragingResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingResult : public ros::Msg + { + public: + float mean; + float std_dev; + + AveragingResult(): + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingResult"; }; + const char * getMD5(){ return "d5c7decf6df75ffb4367a05c1bcc7612"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h new file mode 100755 index 0000000..9432e1c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciAction_h +#define _ROS_actionlib_tutorials_FibonacciAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/FibonacciActionGoal.h" +#include "actionlib_tutorials/FibonacciActionResult.h" +#include "actionlib_tutorials/FibonacciActionFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciAction : public ros::Msg + { + public: + actionlib_tutorials::FibonacciActionGoal action_goal; + actionlib_tutorials::FibonacciActionResult action_result; + actionlib_tutorials::FibonacciActionFeedback action_feedback; + + FibonacciAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciAction"; }; + const char * getMD5(){ return "f59df5767bf7634684781c92598b2406"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h new file mode 100755 index 0000000..3a1e341 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionFeedback_h +#define _ROS_actionlib_tutorials_FibonacciActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciFeedback feedback; + + FibonacciActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionFeedback"; }; + const char * getMD5(){ return "73b8497a9f629a31c0020900e4148f07"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h new file mode 100755 index 0000000..459561c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionGoal_h +#define _ROS_actionlib_tutorials_FibonacciActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/FibonacciGoal.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::FibonacciGoal goal; + + FibonacciActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionGoal"; }; + const char * getMD5(){ return "006871c7fa1d0e3d5fe2226bf17b2a94"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h new file mode 100755 index 0000000..14ed870 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionResult_h +#define _ROS_actionlib_tutorials_FibonacciActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciResult.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciResult result; + + FibonacciActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionResult"; }; + const char * getMD5(){ return "bee73a9fe29ae25e966e105f5553dd03"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h new file mode 100755 index 0000000..5a09ac1 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciFeedback_h +#define _ROS_actionlib_tutorials_FibonacciFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciFeedback : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciFeedback(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciFeedback"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h new file mode 100755 index 0000000..3cec227 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciGoal_h +#define _ROS_actionlib_tutorials_FibonacciGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciGoal : public ros::Msg + { + public: + int32_t order; + + FibonacciGoal(): + order(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.real = this->order; + *(outbuffer + offset + 0) = (u_order.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_order.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_order.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_order.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->order); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.base = 0; + u_order.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->order = u_order.real; + offset += sizeof(this->order); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciGoal"; }; + const char * getMD5(){ return "6889063349a00b249bd1661df429d822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h new file mode 100755 index 0000000..db15770 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciResult_h +#define _ROS_actionlib_tutorials_FibonacciResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciResult : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciResult(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciResult"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/bond/Constants.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/bond/Constants.h new file mode 100755 index 0000000..9594342 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/bond/Constants.h @@ -0,0 +1,44 @@ +#ifndef _ROS_bond_Constants_h +#define _ROS_bond_Constants_h + +#include +#include +#include +#include "ros/msg.h" + +namespace bond +{ + + class Constants : public ros::Msg + { + public: + enum { DEAD_PUBLISH_PERIOD = 0.05 }; + enum { DEFAULT_CONNECT_TIMEOUT = 10.0 }; + enum { DEFAULT_HEARTBEAT_TIMEOUT = 4.0 }; + enum { DEFAULT_DISCONNECT_TIMEOUT = 2.0 }; + enum { DEFAULT_HEARTBEAT_PERIOD = 1.0 }; + enum { DISABLE_HEARTBEAT_TIMEOUT_PARAM = /bond_disable_heartbeat_timeout }; + + Constants() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "bond/Constants"; }; + const char * getMD5(){ return "6fc594dc1d7bd7919077042712f8c8b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/bond/Status.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/bond/Status.h new file mode 100755 index 0000000..1fdb04a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/bond/Status.h @@ -0,0 +1,138 @@ +#ifndef _ROS_bond_Status_h +#define _ROS_bond_Status_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace bond +{ + + class Status : public ros::Msg + { + public: + std_msgs::Header header; + const char* id; + const char* instance_id; + bool active; + float heartbeat_timeout; + float heartbeat_period; + + Status(): + header(), + id(""), + instance_id(""), + active(0), + heartbeat_timeout(0), + heartbeat_period(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + uint32_t length_instance_id = strlen(this->instance_id); + memcpy(outbuffer + offset, &length_instance_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->instance_id, length_instance_id); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.real = this->active; + *(outbuffer + offset + 0) = (u_active.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.real = this->heartbeat_timeout; + *(outbuffer + offset + 0) = (u_heartbeat_timeout.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_timeout.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_timeout.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_timeout.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.real = this->heartbeat_period; + *(outbuffer + offset + 0) = (u_heartbeat_period.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_period.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_period.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_period.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_period); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + uint32_t length_instance_id; + memcpy(&length_instance_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_instance_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_instance_id-1]=0; + this->instance_id = (char *)(inbuffer + offset-1); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.base = 0; + u_active.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->active = u_active.real; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.base = 0; + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_timeout = u_heartbeat_timeout.real; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.base = 0; + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_period = u_heartbeat_period.real; + offset += sizeof(this->heartbeat_period); + return offset; + } + + const char * getType(){ return "bond/Status"; }; + const char * getMD5(){ return "eacc84bf5d65b6777d4c50f463dfb9c8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h new file mode 100755 index 0000000..aa36c45 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryAction_h +#define _ROS_control_msgs_FollowJointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/FollowJointTrajectoryActionGoal.h" +#include "control_msgs/FollowJointTrajectoryActionResult.h" +#include "control_msgs/FollowJointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryAction : public ros::Msg + { + public: + control_msgs::FollowJointTrajectoryActionGoal action_goal; + control_msgs::FollowJointTrajectoryActionResult action_result; + control_msgs::FollowJointTrajectoryActionFeedback action_feedback; + + FollowJointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryAction"; }; + const char * getMD5(){ return "bc4f9b743838566551c0390c65f1a248"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h new file mode 100755 index 0000000..bf9b2c6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryFeedback feedback; + + FollowJointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "d8920dc4eae9fc107e00999cce4be641"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h new file mode 100755 index 0000000..de889cb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/FollowJointTrajectoryGoal.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::FollowJointTrajectoryGoal goal; + + FollowJointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionGoal"; }; + const char * getMD5(){ return "cff5c1d533bf2f82dd0138d57f4304bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h new file mode 100755 index 0000000..252abb3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionResult_h +#define _ROS_control_msgs_FollowJointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryResult.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryResult result; + + FollowJointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionResult"; }; + const char * getMD5(){ return "c4fb3b000dc9da4fd99699380efcc5d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h new file mode 100755 index 0000000..50c5466 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h @@ -0,0 +1,88 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryFeedback : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + FollowJointTrajectoryFeedback(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryFeedback"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h new file mode 100755 index 0000000..2a8f9b1 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h @@ -0,0 +1,107 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "control_msgs/JointTolerance.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + uint8_t path_tolerance_length; + control_msgs::JointTolerance st_path_tolerance; + control_msgs::JointTolerance * path_tolerance; + uint8_t goal_tolerance_length; + control_msgs::JointTolerance st_goal_tolerance; + control_msgs::JointTolerance * goal_tolerance; + ros::Duration goal_time_tolerance; + + FollowJointTrajectoryGoal(): + trajectory(), + path_tolerance_length(0), path_tolerance(NULL), + goal_tolerance_length(0), goal_tolerance(NULL), + goal_time_tolerance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset++) = path_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->path_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = goal_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->goal_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->goal_time_tolerance.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.sec); + *(outbuffer + offset + 0) = (this->goal_time_tolerance.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + uint8_t path_tolerance_lengthT = *(inbuffer + offset++); + if(path_tolerance_lengthT > path_tolerance_length) + this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + path_tolerance_length = path_tolerance_lengthT; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->st_path_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->path_tolerance[i]), &(this->st_path_tolerance), sizeof(control_msgs::JointTolerance)); + } + uint8_t goal_tolerance_lengthT = *(inbuffer + offset++); + if(goal_tolerance_lengthT > goal_tolerance_length) + this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + goal_tolerance_length = goal_tolerance_lengthT; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->st_goal_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->goal_tolerance[i]), &(this->st_goal_tolerance), sizeof(control_msgs::JointTolerance)); + } + this->goal_time_tolerance.sec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.sec); + this->goal_time_tolerance.nsec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryGoal"; }; + const char * getMD5(){ return "69636787b6ecbde4d61d711979bc7ecb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h new file mode 100755 index 0000000..0d55930 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h @@ -0,0 +1,83 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryResult_h +#define _ROS_control_msgs_FollowJointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryResult : public ros::Msg + { + public: + int32_t error_code; + const char* error_string; + enum { SUCCESSFUL = 0 }; + enum { INVALID_GOAL = -1 }; + enum { INVALID_JOINTS = -2 }; + enum { OLD_HEADER_TIMESTAMP = -3 }; + enum { PATH_TOLERANCE_VIOLATED = -4 }; + enum { GOAL_TOLERANCE_VIOLATED = -5 }; + + FollowJointTrajectoryResult(): + error_code(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryResult"; }; + const char * getMD5(){ return "493383b18409bfb604b4e26c676401d2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommand.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommand.h new file mode 100755 index 0000000..a2f65e0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommand.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommand_h +#define _ROS_control_msgs_GripperCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommand : public ros::Msg + { + public: + float position; + float max_effort; + + GripperCommand(): + position(0), + max_effort(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_effort); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_effort)); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommand"; }; + const char * getMD5(){ return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandAction.h new file mode 100755 index 0000000..111229e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandAction_h +#define _ROS_control_msgs_GripperCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommandActionGoal.h" +#include "control_msgs/GripperCommandActionResult.h" +#include "control_msgs/GripperCommandActionFeedback.h" + +namespace control_msgs +{ + + class GripperCommandAction : public ros::Msg + { + public: + control_msgs::GripperCommandActionGoal action_goal; + control_msgs::GripperCommandActionResult action_result; + control_msgs::GripperCommandActionFeedback action_feedback; + + GripperCommandAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandAction"; }; + const char * getMD5(){ return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h new file mode 100755 index 0000000..14f3771 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionFeedback_h +#define _ROS_control_msgs_GripperCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandFeedback.h" + +namespace control_msgs +{ + + class GripperCommandActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandFeedback feedback; + + GripperCommandActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionFeedback"; }; + const char * getMD5(){ return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h new file mode 100755 index 0000000..8a09301 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionGoal_h +#define _ROS_control_msgs_GripperCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/GripperCommandGoal.h" + +namespace control_msgs +{ + + class GripperCommandActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::GripperCommandGoal goal; + + GripperCommandActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionGoal"; }; + const char * getMD5(){ return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h new file mode 100755 index 0000000..1a7ea75 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionResult_h +#define _ROS_control_msgs_GripperCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandResult.h" + +namespace control_msgs +{ + + class GripperCommandActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandResult result; + + GripperCommandActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionResult"; }; + const char * getMD5(){ return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h new file mode 100755 index 0000000..efc889b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h @@ -0,0 +1,80 @@ +#ifndef _ROS_control_msgs_GripperCommandFeedback_h +#define _ROS_control_msgs_GripperCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandFeedback : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandFeedback(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandFeedback"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandGoal.h new file mode 100755 index 0000000..aec6aa2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandGoal.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_GripperCommandGoal_h +#define _ROS_control_msgs_GripperCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommand.h" + +namespace control_msgs +{ + + class GripperCommandGoal : public ros::Msg + { + public: + control_msgs::GripperCommand command; + + GripperCommandGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandGoal"; }; + const char * getMD5(){ return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandResult.h new file mode 100755 index 0000000..7fb51df --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/GripperCommandResult.h @@ -0,0 +1,80 @@ +#ifndef _ROS_control_msgs_GripperCommandResult_h +#define _ROS_control_msgs_GripperCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandResult : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandResult(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandResult"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointControllerState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointControllerState.h new file mode 100755 index 0000000..8de8213 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointControllerState.h @@ -0,0 +1,83 @@ +#ifndef _ROS_control_msgs_JointControllerState_h +#define _ROS_control_msgs_JointControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class JointControllerState : public ros::Msg + { + public: + std_msgs::Header header; + float set_point; + float process_value; + float process_value_dot; + float error; + float time_step; + float command; + float p; + float i; + float d; + float i_clamp; + + JointControllerState(): + header(), + set_point(0), + process_value(0), + process_value_dot(0), + error(0), + time_step(0), + command(0), + p(0), + i(0), + d(0), + i_clamp(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->set_point); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value_dot); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->command); + offset += serializeAvrFloat64(outbuffer + offset, this->p); + offset += serializeAvrFloat64(outbuffer + offset, this->i); + offset += serializeAvrFloat64(outbuffer + offset, this->d); + offset += serializeAvrFloat64(outbuffer + offset, this->i_clamp); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->set_point)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value_dot)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->command)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->p)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->d)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_clamp)); + return offset; + } + + const char * getType(){ return "control_msgs/JointControllerState"; }; + const char * getMD5(){ return "c0d034a7bf20aeb1c37f3eccb7992b69"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTolerance.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTolerance.h new file mode 100755 index 0000000..9593f37 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTolerance.h @@ -0,0 +1,66 @@ +#ifndef _ROS_control_msgs_JointTolerance_h +#define _ROS_control_msgs_JointTolerance_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTolerance : public ros::Msg + { + public: + const char* name; + float position; + float velocity; + float acceleration; + + JointTolerance(): + name(""), + position(0), + velocity(0), + acceleration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acceleration)); + return offset; + } + + const char * getType(){ return "control_msgs/JointTolerance"; }; + const char * getMD5(){ return "f544fe9c16cf04547e135dd6063ff5be"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h new file mode 100755 index 0000000..b619e9f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryAction_h +#define _ROS_control_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/JointTrajectoryActionGoal.h" +#include "control_msgs/JointTrajectoryActionResult.h" +#include "control_msgs/JointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + control_msgs::JointTrajectoryActionGoal action_goal; + control_msgs::JointTrajectoryActionResult action_result; + control_msgs::JointTrajectoryActionFeedback action_feedback; + + JointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryAction"; }; + const char * getMD5(){ return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h new file mode 100755 index 0000000..463a4e9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionFeedback_h +#define _ROS_control_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryFeedback feedback; + + JointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h new file mode 100755 index 0000000..fb2862d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionGoal_h +#define _ROS_control_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/JointTrajectoryGoal.h" + +namespace control_msgs +{ + + class JointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::JointTrajectoryGoal goal; + + JointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionGoal"; }; + const char * getMD5(){ return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h new file mode 100755 index 0000000..accb4d0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionResult_h +#define _ROS_control_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryResult.h" + +namespace control_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryResult result; + + JointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h new file mode 100755 index 0000000..f4bc6b8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,88 @@ +#ifndef _ROS_control_msgs_JointTrajectoryControllerState_h +#define _ROS_control_msgs_JointTrajectoryControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class JointTrajectoryControllerState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + JointTrajectoryControllerState(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryControllerState"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h new file mode 100755 index 0000000..9dfe808 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryFeedback_h +#define _ROS_control_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + JointTrajectoryFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h new file mode 100755 index 0000000..b0cacb7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_JointTrajectoryGoal_h +#define _ROS_control_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace control_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + + JointTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryGoal"; }; + const char * getMD5(){ return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h new file mode 100755 index 0000000..623ed9c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryResult_h +#define _ROS_control_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + + JointTrajectoryResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadAction.h new file mode 100755 index 0000000..a27be21 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadAction_h +#define _ROS_control_msgs_PointHeadAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/PointHeadActionGoal.h" +#include "control_msgs/PointHeadActionResult.h" +#include "control_msgs/PointHeadActionFeedback.h" + +namespace control_msgs +{ + + class PointHeadAction : public ros::Msg + { + public: + control_msgs::PointHeadActionGoal action_goal; + control_msgs::PointHeadActionResult action_result; + control_msgs::PointHeadActionFeedback action_feedback; + + PointHeadAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadAction"; }; + const char * getMD5(){ return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h new file mode 100755 index 0000000..8e04bd0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionFeedback_h +#define _ROS_control_msgs_PointHeadActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadFeedback.h" + +namespace control_msgs +{ + + class PointHeadActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadFeedback feedback; + + PointHeadActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionFeedback"; }; + const char * getMD5(){ return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h new file mode 100755 index 0000000..133d532 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionGoal_h +#define _ROS_control_msgs_PointHeadActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/PointHeadGoal.h" + +namespace control_msgs +{ + + class PointHeadActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::PointHeadGoal goal; + + PointHeadActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionGoal"; }; + const char * getMD5(){ return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionResult.h new file mode 100755 index 0000000..db855d2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionResult_h +#define _ROS_control_msgs_PointHeadActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadResult.h" + +namespace control_msgs +{ + + class PointHeadActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadResult result; + + PointHeadActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadFeedback.h new file mode 100755 index 0000000..4e78f2d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadFeedback.h @@ -0,0 +1,42 @@ +#ifndef _ROS_control_msgs_PointHeadFeedback_h +#define _ROS_control_msgs_PointHeadFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadFeedback : public ros::Msg + { + public: + float pointing_angle_error; + + PointHeadFeedback(): + pointing_angle_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->pointing_angle_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pointing_angle_error)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadFeedback"; }; + const char * getMD5(){ return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadGoal.h new file mode 100755 index 0000000..65ec646 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadGoal.h @@ -0,0 +1,91 @@ +#ifndef _ROS_control_msgs_PointHeadGoal_h +#define _ROS_control_msgs_PointHeadGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class PointHeadGoal : public ros::Msg + { + public: + geometry_msgs::PointStamped target; + geometry_msgs::Vector3 pointing_axis; + const char* pointing_frame; + ros::Duration min_duration; + float max_velocity; + + PointHeadGoal(): + target(), + pointing_axis(), + pointing_frame(""), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->target.serialize(outbuffer + offset); + offset += this->pointing_axis.serialize(outbuffer + offset); + uint32_t length_pointing_frame = strlen(this->pointing_frame); + memcpy(outbuffer + offset, &length_pointing_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame); + offset += length_pointing_frame; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + memcpy(&length_pointing_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pointing_frame-1]=0; + this->pointing_frame = (char *)(inbuffer + offset-1); + offset += length_pointing_frame; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadGoal"; }; + const char * getMD5(){ return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadResult.h new file mode 100755 index 0000000..53f789e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/PointHeadResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_PointHeadResult_h +#define _ROS_control_msgs_PointHeadResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadResult : public ros::Msg + { + public: + + PointHeadResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/QueryCalibrationState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/QueryCalibrationState.h new file mode 100755 index 0000000..b3c1bbf --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/QueryCalibrationState.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_QueryCalibrationState_h +#define _ROS_SERVICE_QueryCalibrationState_h +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + +static const char QUERYCALIBRATIONSTATE[] = "control_msgs/QueryCalibrationState"; + + class QueryCalibrationStateRequest : public ros::Msg + { + public: + + QueryCalibrationStateRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + bool is_calibrated; + + QueryCalibrationStateResponse(): + is_calibrated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h new file mode 100755 index 0000000..1859d7f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h @@ -0,0 +1,185 @@ +#ifndef _ROS_SERVICE_QueryTrajectoryState_h +#define _ROS_SERVICE_QueryTrajectoryState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace control_msgs +{ + +static const char QUERYTRAJECTORYSTATE[] = "control_msgs/QueryTrajectoryState"; + + class QueryTrajectoryStateRequest : public ros::Msg + { + public: + ros::Time time; + + QueryTrajectoryStateRequest(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t acceleration_length; + float st_acceleration; + float * acceleration; + + QueryTrajectoryStateResponse(): + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + acceleration_length(0), acceleration(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = acceleration_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t acceleration_lengthT = *(inbuffer + offset++); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + offset += 3; + acceleration_length = acceleration_lengthT; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_acceleration)); + memcpy( &(this->acceleration[i]), &(this->st_acceleration), sizeof(float)); + } + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h new file mode 100755 index 0000000..25bc0f6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionAction_h +#define _ROS_control_msgs_SingleJointPositionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/SingleJointPositionActionGoal.h" +#include "control_msgs/SingleJointPositionActionResult.h" +#include "control_msgs/SingleJointPositionActionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionAction : public ros::Msg + { + public: + control_msgs::SingleJointPositionActionGoal action_goal; + control_msgs::SingleJointPositionActionResult action_result; + control_msgs::SingleJointPositionActionFeedback action_feedback; + + SingleJointPositionAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionAction"; }; + const char * getMD5(){ return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h new file mode 100755 index 0000000..3cb7efd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionFeedback_h +#define _ROS_control_msgs_SingleJointPositionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionFeedback feedback; + + SingleJointPositionActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionFeedback"; }; + const char * getMD5(){ return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h new file mode 100755 index 0000000..1337710 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionGoal_h +#define _ROS_control_msgs_SingleJointPositionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/SingleJointPositionGoal.h" + +namespace control_msgs +{ + + class SingleJointPositionActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::SingleJointPositionGoal goal; + + SingleJointPositionActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionGoal"; }; + const char * getMD5(){ return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h new file mode 100755 index 0000000..8f11e6e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionResult_h +#define _ROS_control_msgs_SingleJointPositionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionResult.h" + +namespace control_msgs +{ + + class SingleJointPositionActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionResult result; + + SingleJointPositionActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h new file mode 100755 index 0000000..3c8dd15 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_control_msgs_SingleJointPositionFeedback_h +#define _ROS_control_msgs_SingleJointPositionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class SingleJointPositionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + float position; + float velocity; + float error; + + SingleJointPositionFeedback(): + header(), + position(0), + velocity(0), + error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionFeedback"; }; + const char * getMD5(){ return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h new file mode 100755 index 0000000..036c31c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h @@ -0,0 +1,69 @@ +#ifndef _ROS_control_msgs_SingleJointPositionGoal_h +#define _ROS_control_msgs_SingleJointPositionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class SingleJointPositionGoal : public ros::Msg + { + public: + float position; + ros::Duration min_duration; + float max_velocity; + + SingleJointPositionGoal(): + position(0), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionGoal"; }; + const char * getMD5(){ return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h new file mode 100755 index 0000000..7593425 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_SingleJointPositionResult_h +#define _ROS_control_msgs_SingleJointPositionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class SingleJointPositionResult : public ros::Msg + { + public: + + SingleJointPositionResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h new file mode 100755 index 0000000..0dbf042 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_AddDiagnostics_h +#define _ROS_SERVICE_AddDiagnostics_h +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + +static const char ADDDIAGNOSTICS[] = "diagnostic_msgs/AddDiagnostics"; + + class AddDiagnosticsRequest : public ros::Msg + { + public: + const char* load_namespace; + + AddDiagnosticsRequest(): + load_namespace("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_load_namespace = strlen(this->load_namespace); + memcpy(outbuffer + offset, &length_load_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->load_namespace, length_load_namespace); + offset += length_load_namespace; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_load_namespace; + memcpy(&length_load_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_load_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_load_namespace-1]=0; + this->load_namespace = (char *)(inbuffer + offset-1); + offset += length_load_namespace; + return offset; + } + + const char * getType(){ return ADDDIAGNOSTICS; }; + const char * getMD5(){ return "c26cf6e164288fbc6050d74f838bcdf0"; }; + + }; + + class AddDiagnosticsResponse : public ros::Msg + { + public: + bool success; + const char* message; + + AddDiagnosticsResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return ADDDIAGNOSTICS; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class AddDiagnostics { + public: + typedef AddDiagnosticsRequest Request; + typedef AddDiagnosticsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h new file mode 100755 index 0000000..d530b09 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticArray_h +#define _ROS_diagnostic_msgs_DiagnosticArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + + class DiagnosticArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + DiagnosticArray(): + header(), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticArray"; }; + const char * getMD5(){ return "60810da900de1dd6ddd437c3503511da"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h new file mode 100755 index 0000000..4cf2e88 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h @@ -0,0 +1,128 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticStatus_h +#define _ROS_diagnostic_msgs_DiagnosticStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/KeyValue.h" + +namespace diagnostic_msgs +{ + + class DiagnosticStatus : public ros::Msg + { + public: + int8_t level; + const char* name; + const char* message; + const char* hardware_id; + uint8_t values_length; + diagnostic_msgs::KeyValue st_values; + diagnostic_msgs::KeyValue * values; + enum { OK = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + enum { STALE = 3 }; + + DiagnosticStatus(): + level(0), + name(""), + message(""), + hardware_id(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_hardware_id = strlen(this->hardware_id); + memcpy(outbuffer + offset, &length_hardware_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->values[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + uint32_t length_hardware_id; + memcpy(&length_hardware_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_id-1]=0; + this->hardware_id = (char *)(inbuffer + offset-1); + offset += length_hardware_id; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (diagnostic_msgs::KeyValue*)realloc(this->values, values_lengthT * sizeof(diagnostic_msgs::KeyValue)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->st_values.deserialize(inbuffer + offset); + memcpy( &(this->values[i]), &(this->st_values), sizeof(diagnostic_msgs::KeyValue)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticStatus"; }; + const char * getMD5(){ return "d0ce08bc6e5ba34c7754f563a9cabaf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/KeyValue.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/KeyValue.h new file mode 100755 index 0000000..7b48800 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/KeyValue.h @@ -0,0 +1,70 @@ +#ifndef _ROS_diagnostic_msgs_KeyValue_h +#define _ROS_diagnostic_msgs_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + + class KeyValue : public ros::Msg + { + public: + const char* key; + const char* value; + + KeyValue(): + key(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_key = strlen(this->key); + memcpy(outbuffer + offset, &length_key, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->key, length_key); + offset += length_key; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_key; + memcpy(&length_key, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_key; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_key-1]=0; + this->key = (char *)(inbuffer + offset-1); + offset += length_key; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "diagnostic_msgs/KeyValue"; }; + const char * getMD5(){ return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/SelfTest.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/SelfTest.h new file mode 100755 index 0000000..50b599d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/diagnostic_msgs/SelfTest.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_SelfTest_h +#define _ROS_SERVICE_SelfTest_h +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + +static const char SELFTEST[] = "diagnostic_msgs/SelfTest"; + + class SelfTestRequest : public ros::Msg + { + public: + + SelfTestRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SelfTestResponse : public ros::Msg + { + public: + const char* id; + int8_t passed; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + SelfTestResponse(): + id(""), + passed(0), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.real = this->passed; + *(outbuffer + offset + 0) = (u_passed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->passed); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.base = 0; + u_passed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->passed = u_passed.real; + offset += sizeof(this->passed); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "ac21b1bab7ab17546986536c22eb34e9"; }; + + }; + + class SelfTest { + public: + typedef SelfTestRequest Request; + typedef SelfTestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/ConfigString.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/ConfigString.h new file mode 100755 index 0000000..539ebcc --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/ConfigString.h @@ -0,0 +1,70 @@ +#ifndef _ROS_driver_base_ConfigString_h +#define _ROS_driver_base_ConfigString_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigString : public ros::Msg + { + public: + const char* name; + const char* value; + + ConfigString(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "driver_base/ConfigString"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/ConfigValue.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/ConfigValue.h new file mode 100755 index 0000000..33b32a0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/ConfigValue.h @@ -0,0 +1,58 @@ +#ifndef _ROS_driver_base_ConfigValue_h +#define _ROS_driver_base_ConfigValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigValue : public ros::Msg + { + public: + const char* name; + float value; + + ConfigValue(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + const char * getType(){ return "driver_base/ConfigValue"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/SensorLevels.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/SensorLevels.h new file mode 100755 index 0000000..4a4ffd2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/driver_base/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_driver_base_SensorLevels_h +#define _ROS_driver_base_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "driver_base/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/duration.cpp b/case_study/arduino_lab/group_07/original/lib/ros_lib/duration.cpp new file mode 100755 index 0000000..f471c33 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/duration.cpp @@ -0,0 +1,81 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSecSigned(int32_t &sec, int32_t &nsec) + { + int32_t nsec_part = nsec; + int32_t sec_part = sec; + + while (nsec_part > 1000000000L) + { + nsec_part -= 1000000000L; + ++sec_part; + } + while (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + sec = sec_part; + nsec = nsec_part; + } + + Duration& Duration::operator+=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator-=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator*=(double scale){ + sec *= scale; + nsec *= scale; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h new file mode 100755 index 0000000..23df990 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h @@ -0,0 +1,71 @@ +#ifndef _ROS_dynamic_reconfigure_BoolParameter_h +#define _ROS_dynamic_reconfigure_BoolParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class BoolParameter : public ros::Msg + { + public: + const char* name; + bool value; + + BoolParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/BoolParameter"; }; + const char * getMD5(){ return "23f05028c1a699fb83e22401228c3a9e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Config.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Config.h new file mode 100755 index 0000000..0658228 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Config.h @@ -0,0 +1,143 @@ +#ifndef _ROS_dynamic_reconfigure_Config_h +#define _ROS_dynamic_reconfigure_Config_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/BoolParameter.h" +#include "dynamic_reconfigure/IntParameter.h" +#include "dynamic_reconfigure/StrParameter.h" +#include "dynamic_reconfigure/DoubleParameter.h" +#include "dynamic_reconfigure/GroupState.h" + +namespace dynamic_reconfigure +{ + + class Config : public ros::Msg + { + public: + uint8_t bools_length; + dynamic_reconfigure::BoolParameter st_bools; + dynamic_reconfigure::BoolParameter * bools; + uint8_t ints_length; + dynamic_reconfigure::IntParameter st_ints; + dynamic_reconfigure::IntParameter * ints; + uint8_t strs_length; + dynamic_reconfigure::StrParameter st_strs; + dynamic_reconfigure::StrParameter * strs; + uint8_t doubles_length; + dynamic_reconfigure::DoubleParameter st_doubles; + dynamic_reconfigure::DoubleParameter * doubles; + uint8_t groups_length; + dynamic_reconfigure::GroupState st_groups; + dynamic_reconfigure::GroupState * groups; + + Config(): + bools_length(0), bools(NULL), + ints_length(0), ints(NULL), + strs_length(0), strs(NULL), + doubles_length(0), doubles(NULL), + groups_length(0), groups(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = bools_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->bools[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = strs_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->strs[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = doubles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->doubles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t bools_lengthT = *(inbuffer + offset++); + if(bools_lengthT > bools_length) + this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); + offset += 3; + bools_length = bools_lengthT; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->st_bools.deserialize(inbuffer + offset); + memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter)); + } + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->st_ints.deserialize(inbuffer + offset); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter)); + } + uint8_t strs_lengthT = *(inbuffer + offset++); + if(strs_lengthT > strs_length) + this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); + offset += 3; + strs_length = strs_lengthT; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->st_strs.deserialize(inbuffer + offset); + memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter)); + } + uint8_t doubles_lengthT = *(inbuffer + offset++); + if(doubles_lengthT > doubles_length) + this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); + offset += 3; + doubles_length = doubles_lengthT; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->st_doubles.deserialize(inbuffer + offset); + memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter)); + } + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState)); + } + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Config"; }; + const char * getMD5(){ return "958f16a05573709014982821e6822580"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h new file mode 100755 index 0000000..3720189 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h @@ -0,0 +1,72 @@ +#ifndef _ROS_dynamic_reconfigure_ConfigDescription_h +#define _ROS_dynamic_reconfigure_ConfigDescription_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Group.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + + class ConfigDescription : public ros::Msg + { + public: + uint8_t groups_length; + dynamic_reconfigure::Group st_groups; + dynamic_reconfigure::Group * groups; + dynamic_reconfigure::Config max; + dynamic_reconfigure::Config min; + dynamic_reconfigure::Config dflt; + + ConfigDescription(): + groups_length(0), groups(NULL), + max(), + min(), + dflt() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + offset += this->max.serialize(outbuffer + offset); + offset += this->min.serialize(outbuffer + offset); + offset += this->dflt.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::Group*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::Group)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::Group)); + } + offset += this->max.deserialize(inbuffer + offset); + offset += this->min.deserialize(inbuffer + offset); + offset += this->dflt.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ConfigDescription"; }; + const char * getMD5(){ return "757ce9d44ba8ddd801bb30bc456f946f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h new file mode 100755 index 0000000..1407bdb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h @@ -0,0 +1,58 @@ +#ifndef _ROS_dynamic_reconfigure_DoubleParameter_h +#define _ROS_dynamic_reconfigure_DoubleParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class DoubleParameter : public ros::Msg + { + public: + const char* name; + float value; + + DoubleParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/DoubleParameter"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Group.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Group.h new file mode 100755 index 0000000..8e4c957 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Group.h @@ -0,0 +1,137 @@ +#ifndef _ROS_dynamic_reconfigure_Group_h +#define _ROS_dynamic_reconfigure_Group_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/ParamDescription.h" + +namespace dynamic_reconfigure +{ + + class Group : public ros::Msg + { + public: + const char* name; + const char* type; + uint8_t parameters_length; + dynamic_reconfigure::ParamDescription st_parameters; + dynamic_reconfigure::ParamDescription * parameters; + int32_t parent; + int32_t id; + + Group(): + name(""), + type(""), + parameters_length(0), parameters(NULL), + parent(0), + id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = parameters_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t parameters_lengthT = *(inbuffer + offset++); + if(parameters_lengthT > parameters_length) + this->parameters = (dynamic_reconfigure::ParamDescription*)realloc(this->parameters, parameters_lengthT * sizeof(dynamic_reconfigure::ParamDescription)); + offset += 3; + parameters_length = parameters_lengthT; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(dynamic_reconfigure::ParamDescription)); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Group"; }; + const char * getMD5(){ return "9e8cd9e9423c94823db3614dd8b1cf7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/GroupState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/GroupState.h new file mode 100755 index 0000000..f2b137a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/GroupState.h @@ -0,0 +1,117 @@ +#ifndef _ROS_dynamic_reconfigure_GroupState_h +#define _ROS_dynamic_reconfigure_GroupState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class GroupState : public ros::Msg + { + public: + const char* name; + bool state; + int32_t id; + int32_t parent; + + GroupState(): + name(""), + state(0), + id(0), + parent(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.real = this->state; + *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.base = 0; + u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->state = u_state.real; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/GroupState"; }; + const char * getMD5(){ return "a2d87f51dc22930325041a2f8b1571f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h new file mode 100755 index 0000000..c9e90be --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h @@ -0,0 +1,77 @@ +#ifndef _ROS_dynamic_reconfigure_IntParameter_h +#define _ROS_dynamic_reconfigure_IntParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class IntParameter : public ros::Msg + { + public: + const char* name; + int32_t value; + + IntParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/IntParameter"; }; + const char * getMD5(){ return "65fedc7a0cbfb8db035e46194a350bf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h new file mode 100755 index 0000000..ed6a26e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h @@ -0,0 +1,114 @@ +#ifndef _ROS_dynamic_reconfigure_ParamDescription_h +#define _ROS_dynamic_reconfigure_ParamDescription_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class ParamDescription : public ros::Msg + { + public: + const char* name; + const char* type; + uint32_t level; + const char* description; + const char* edit_method; + + ParamDescription(): + name(""), + type(""), + level(0), + description(""), + edit_method("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->level >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->level >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->level >> (8 * 3)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_edit_method = strlen(this->edit_method); + memcpy(outbuffer + offset, &length_edit_method, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->edit_method, length_edit_method); + offset += length_edit_method; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + this->level = ((uint32_t) (*(inbuffer + offset))); + this->level |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->level |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->level |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->level); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + uint32_t length_edit_method; + memcpy(&length_edit_method, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_edit_method; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_edit_method-1]=0; + this->edit_method = (char *)(inbuffer + offset-1); + offset += length_edit_method; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ParamDescription"; }; + const char * getMD5(){ return "7434fcb9348c13054e0c3b267c8cb34d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h new file mode 100755 index 0000000..4f5f4fe --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h @@ -0,0 +1,79 @@ +#ifndef _ROS_SERVICE_Reconfigure_h +#define _ROS_SERVICE_Reconfigure_h +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + +static const char RECONFIGURE[] = "dynamic_reconfigure/Reconfigure"; + + class ReconfigureRequest : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureRequest(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class ReconfigureResponse : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureResponse(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class Reconfigure { + public: + typedef ReconfigureRequest Request; + typedef ReconfigureResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h new file mode 100755 index 0000000..8f85722 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_dynamic_reconfigure_SensorLevels_h +#define _ROS_dynamic_reconfigure_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h new file mode 100755 index 0000000..2cdabdb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h @@ -0,0 +1,70 @@ +#ifndef _ROS_dynamic_reconfigure_StrParameter_h +#define _ROS_dynamic_reconfigure_StrParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class StrParameter : public ros::Msg + { + public: + const char* name; + const char* value; + + StrParameter(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/StrParameter"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ADC/ADC.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ADC/ADC.pde new file mode 100755 index 0000000..a6cabe9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ADC/ADC.pde @@ -0,0 +1,52 @@ +/* + * rosserial ADC Example + * + * This is a poor man's Oscilloscope. It does not have the sampling + * rate or accuracy of a commerical scope, but it is great to get + * an analog value into ROS in a pinch. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +rosserial_arduino::Adc adc_msg; +ros::Publisher p("adc", &adc_msg); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); +} + +//We average the analog reading to elminate some of the noise +int averageAnalog(int pin){ + int v=0; + for(int i=0; i<4; i++) v+= analogRead(pin); + return v/4; +} + +long adc_timer; + +void loop() +{ + adc_msg.adc0 = averageAnalog(0); + adc_msg.adc1 = averageAnalog(1); + adc_msg.adc2 = averageAnalog(2); + adc_msg.adc3 = averageAnalog(3); + adc_msg.adc4 = averageAnalog(4); + adc_msg.adc5 = averageAnalog(5); + + p.publish(&adc_msg); + + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Blink/Blink.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Blink/Blink.pde new file mode 100755 index 0000000..4e9e185 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Blink/Blink.pde @@ -0,0 +1,29 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include + +ros::NodeHandle nh; + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/BlinkM/BlinkM.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/BlinkM/BlinkM.pde new file mode 100755 index 0000000..f54ea28 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/BlinkM/BlinkM.pde @@ -0,0 +1,162 @@ +/* +* RosSerial BlinkM Example +* This program shows how to control a blinkm +* from an arduino using RosSerial +*/ + +#include + + +#include +#include + + +//include Wire/ twi for the BlinkM +#include +extern "C" { +#include "utility/twi.h" +} + +#include "BlinkM_funcs.h" +const byte blinkm_addr = 0x09; //default blinkm address + + +void setLED( bool solid, char color) +{ + + if (solid) + { + switch (color) + { + + case 'w': // white + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0xff); + break; + + case 'r': //RED + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0); + break; + + case 'g':// Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0); + break; + + case 'b':// Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0xff); + break; + + case 'c':// Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0xff); + break; + + case 'm': // Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0xff); + break; + + case 'y': // yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0); + break; + + default: // Black + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0); + break; + } + } + + + else + { + switch (color) + { + case 'r': // Blink Red + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 3,0,0 ); + break; + case 'w': // Blink white + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 2,0,0 ); + break; + case 'g': // Blink Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 4,0,0 ); + break; + + case 'b': // Blink Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 5,0,0 ); + break; + + case 'c': //Blink Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 6,0,0 ); + break; + + case 'm': //Blink Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 7,0,0 ); + break; + + case 'y': //Blink Yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 8,0,0 ); + break; + + default: //OFF + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 9,0,0 ); + break; + } + + } +} + +void light_cb( const std_msgs::String& light_cmd){ + bool solid =false; + char color; + if (strlen( (const char* ) light_cmd.data) ==2 ){ + solid = (light_cmd.data[0] == 'S') || (light_cmd.data[0] == 's'); + color = light_cmd.data[1]; + } + else{ + solid= false; + color = light_cmd.data[0]; + } + + setLED(solid, color); +} + + + +ros::NodeHandle nh; +ros::Subscriber sub("blinkm" , light_cb); + + +void setup() +{ + + pinMode(13, OUTPUT); //set up the LED + + BlinkM_beginWithPower(); + delay(100); + BlinkM_stopScript(blinkm_addr); // turn off startup script + setLED(false, 0); //turn off the led + + nh.initNode(); + nh.subscribe(sub); + +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h new file mode 100755 index 0000000..94cabeb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h @@ -0,0 +1,440 @@ +/* + * BlinkM_funcs.h -- Arduino 'library' to control BlinkM + * -------------- + * + * + * Note: original version of this file lives with the BlinkMTester sketch + * + * Note: all the functions are declared 'static' because + * it saves about 1.5 kbyte in code space in final compiled sketch. + * A C++ library of this costs a 1kB more. + * + * 2007-8, Tod E. Kurt, ThingM, http://thingm.com/ + * + * version: 20081101 + * + * history: + * 20080101 - initial release + * 20080203 - added setStartupParam(), bugfix receiveBytes() from Dan Julio + * 20081101 - fixed to work with Arduino-0012, added MaxM commands, + * added test script read/write functions, cleaned up some functions + * 20090121 - added I2C bus scan functions, has dependencies on private + * functions inside Wire library, so might break in the future + * 20100420 - added BlinkM_startPower and _stopPower + * + */ + +#include + +extern "C" { +#include "utility/twi.h" // from Wire library, so we can do bus scanning +} + + +// format of light script lines: duration, command, arg1,arg2,arg3 +typedef struct _blinkm_script_line { + uint8_t dur; + uint8_t cmd[4]; // cmd,arg1,arg2,arg3 +} blinkm_script_line; + + +// Call this first (when powering BlinkM from a power supply) +static void BlinkM_begin() +{ + Wire.begin(); // join i2c bus (address optional for master) +} + +/* + * actually can't do this either, because twi_init() has THREE callocs in it too + * +static void BlinkM_reset() +{ + twi_init(); // can't just call Wire.begin() again because of calloc()s there +} +*/ + +// +// each call to twi_writeTo() should return 0 if device is there +// or other value (usually 2) if nothing is at that address +// +static void BlinkM_scanI2CBus(byte from, byte to, + void(*callback)(byte add, byte result) ) +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr = from; addr <= to; addr++ ) { + rc = twi_writeTo(addr, &data, 0, 1, 1); + callback( addr, rc ); + } +} + +// +// +static int8_t BlinkM_findFirstI2CDevice() +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr=1; addr < 120; addr++ ) { // only scan addrs 1-120 + rc = twi_writeTo(addr, &data, 0, 1, 1); + if( rc == 0 ) return addr; // found an address + } + return -1; // no device found in range given +} + +// FIXME: make this more Arduino-like +static void BlinkM_startPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC |= _BV(pwrpin) | _BV(gndpin); // make outputs + PORTC &=~ _BV(gndpin); + PORTC |= _BV(pwrpin); +} + +// FIXME: make this more Arduino-like +static void BlinkM_stopPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC &=~ (_BV(pwrpin) | _BV(gndpin)); +} + +// +static void BlinkM_startPower() +{ + BlinkM_startPowerWithPins( PORTC3, PORTC2 ); +} + +// +static void BlinkM_stopPower() +{ + BlinkM_stopPowerWithPins( PORTC3, PORTC2 ); +} + +// General version of BlinkM_beginWithPower(). +// Call this first when BlinkM is plugged directly into Arduino +static void BlinkM_beginWithPowerPins(byte pwrpin, byte gndpin) +{ + BlinkM_startPowerWithPins(pwrpin,gndpin); + delay(100); // wait for things to stabilize + Wire.begin(); +} + +// Call this first when BlinkM is plugged directly into Arduino +// FIXME: make this more Arduino-like +static void BlinkM_beginWithPower() +{ + BlinkM_beginWithPowerPins( PORTC3, PORTC2 ); +} + +// sends a generic command +static void BlinkM_sendCmd(byte addr, byte* cmd, int cmdlen) +{ + Wire.beginTransmission(addr); + for( byte i=0; idur = Wire.read(); + script_line->cmd[0] = Wire.read(); + script_line->cmd[1] = Wire.read(); + script_line->cmd[2] = Wire.read(); + script_line->cmd[3] = Wire.read(); +} + +// +static void BlinkM_writeScriptLine(byte addr, byte script_id, + byte pos, byte dur, + byte cmd, byte arg1, byte arg2, byte arg3) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing line:"); Serial.print(pos,DEC); + Serial.print(" with cmd:"); Serial.print(cmd); + Serial.print(" arg1:"); Serial.println(arg1,HEX); +#endif + Wire.beginTransmission(addr); + Wire.write('W'); + Wire.write(script_id); + Wire.write(pos); + Wire.write(dur); + Wire.write(cmd); + Wire.write(arg1); + Wire.write(arg2); + Wire.write(arg3); + Wire.endTransmission(); + +} + +// +static void BlinkM_writeScript(byte addr, byte script_id, + byte len, byte reps, + blinkm_script_line* lines) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing script to addr:"); Serial.print(addr,DEC); + Serial.print(", script_id:"); Serial.println(script_id,DEC); +#endif + for(byte i=0; i < len; i++) { + blinkm_script_line l = lines[i]; + BlinkM_writeScriptLine( addr, script_id, i, l.dur, + l.cmd[0], l.cmd[1], l.cmd[2], l.cmd[3]); + delay(20); // must wait for EEPROM to be programmed + } + BlinkM_setScriptLengthReps(addr, script_id, len, reps); +} + +// +static void BlinkM_setStartupParams(byte addr, byte mode, byte script_id, + byte reps, byte fadespeed, byte timeadj) +{ + Wire.beginTransmission(addr); + Wire.write('B'); + Wire.write(mode); // default 0x01 == Play script + Wire.write(script_id); // default 0x00 == script #0 + Wire.write(reps); // default 0x00 == repeat infinitely + Wire.write(fadespeed); // default 0x08 == usually overridden by sketch + Wire.write(timeadj); // default 0x00 == sometimes overridden by sketch + Wire.endTransmission(); +} + + +// Gets digital inputs of the BlinkM +// returns -1 on failure +static int BlinkM_getInputsO(byte addr) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)1); + if( Wire.available() ) { + byte b = Wire.read(); + return b; + } + return -1; +} + +// Gets digital inputs of the BlinkM +// stores them in passed in array +// returns -1 on failure +static int BlinkM_getInputs(byte addr, byte inputs[]) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)4); + while( Wire.available() < 4 ) ; // FIXME: wait until we get 4 bytes + + inputs[0] = Wire.read(); + inputs[1] = Wire.read(); + inputs[2] = Wire.read(); + inputs[3] = Wire.read(); + + return 0; +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Clapper/Clapper.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Clapper/Clapper.pde new file mode 100755 index 0000000..712b6f9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Clapper/Clapper.pde @@ -0,0 +1,94 @@ +/* + * rosserial Clapper Example + * + * This code is a very simple example of the kinds of + * custom sensors that you can easily set up with rosserial + * and Arduino. This code uses a microphone attached to + * analog pin 5 detect two claps (2 loud sounds). + * You can use this clapper, for example, to command a robot + * in the area to come do your bidding. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +std_msgs::Empty clap_msg; +ros::Publisher p("clap", &clap_msg); + +enum clapper_state { clap1, clap_one_waiting, pause, clap2}; +clapper_state clap; + +int volume_thresh = 200; //a clap sound needs to be: + //abs(clap_volume) > average noise + volume_thresh +int mic_pin = 5; +int adc_ave=0; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); + + //measure the average volume of the noise in the area + for (int i =0; i<10;i++) adc_ave += analogRead(mic_pin); + adc_ave /= 10; +} + +long event_timer; + +void loop() +{ + int mic_val = 0; + for(int i=0; i<4; i++) mic_val += analogRead(mic_pin); + + mic_val = mic_val/4-adc_ave; + + switch(clap){ + case clap1: + if (abs(mic_val) > volume_thresh){ + clap = clap_one_waiting; + event_timer = millis(); + } + break; + case clap_one_waiting: + if ( (abs(mic_val) < 30) && ( (millis() - event_timer) > 20 ) ) + { + clap= pause; + event_timer = millis(); + + } + break; + case pause: // make sure there is a pause between + // the loud sounds + if ( mic_val > volume_thresh) + { + clap = clap1; + + } + else if ( (millis()-event_timer)> 60) { + clap = clap2; + event_timer = millis(); + + } + break; + case clap2: + if (abs(mic_val) > volume_thresh){ //we have got a double clap! + clap = clap1; + p.publish(&clap_msg); + } + else if ( (millis()-event_timer)> 200) { + clap= clap1; // no clap detected, reset state machine + } + + break; + } + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde new file mode 100755 index 0000000..2474413 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde @@ -0,0 +1,28 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + */ + +#include +#include + +ros::NodeHandle nh; + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(1000); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/IrRanger/IrRanger.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/IrRanger/IrRanger.pde new file mode 100755 index 0000000..240b5a1 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/IrRanger/IrRanger.pde @@ -0,0 +1,64 @@ +/* + * rosserial IR Ranger Example + * + * This example is calibrated for the Sharp GP2D120XJ00F. + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "range_data", &range_msg); + +const int analog_pin = 0; +unsigned long range_timer; + +/* + * getRange() - samples the analog input from the ranger + * and converts it into meters. + */ +float getRange(int pin_num){ + int sample; + // Get data + sample = analogRead(pin_num)/4; + // if the ADC reading is too low, + // then we are really far away from anything + if(sample < 10) + return 254; // max range + // Magic numbers to get cm + sample= 1309/(sample-3); + return (sample - 1)/100; //convert to meters +} + +char frameid[] = "/ir_ranger"; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + range_msg.radiation_type = sensor_msgs::Range::INFRARED; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.01; + range_msg.min_range = 0.03; + range_msg.max_range = 0.4; + +} + +void loop() +{ + // publish the range value every 50 milliseconds + // since it takes that long for the sensor to stabilize + if ( (millis()-range_timer) > 50){ + range_msg.range = getRange(analog_pin); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_timer = millis() + 50; + } + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Logging/Logging.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Logging/Logging.pde new file mode 100755 index 0000000..400a9cd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Logging/Logging.pde @@ -0,0 +1,45 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + + +char debug[]= "debug statements"; +char info[] = "infos"; +char warn[] = "warnings"; +char error[] = "errors"; +char fatal[] = "fatalities"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + + nh.logdebug(debug); + nh.loginfo(info); + nh.logwarn(warn); + nh.logerror(error); + nh.logfatal(fatal); + + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Odom/Odom.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Odom/Odom.pde new file mode 100755 index 0000000..5841020 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Odom/Odom.pde @@ -0,0 +1,53 @@ +/* + * rosserial Planar Odometry Example + */ + +#include +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +double x = 1.0; +double y = 0.0; +double theta = 1.57; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + // drive in a circle + double dx = 0.2; + double dtheta = 0.18; + x += cos(theta)*dx*0.1; + y += sin(theta)*dx*0.1; + theta += dtheta*0.1; + if(theta > 3.14) + theta=-3.14; + + // tf odom->base_link + t.header.frame_id = odom; + t.child_frame_id = base_link; + + t.transform.translation.x = x; + t.transform.translation.y = y; + + t.transform.rotation = tf::createQuaternionFromYaw(theta); + t.header.stamp = nh.now(); + + broadcaster.sendTransform(t); + nh.spinOnce(); + + delay(10); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde new file mode 100755 index 0000000..75093a9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde @@ -0,0 +1,38 @@ +/* + * rosserial Service Client + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +ros::ServiceClient client("test_srv"); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.serviceClient(client); + nh.advertise(chatter); + while(!nh.connected()) nh.spinOnce(); + nh.loginfo("Startup complete"); +} + +void loop() +{ + Test::Request req; + Test::Response res; + req.input = hello; + client.call(req, res); + str_msg.data = res.output; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(100); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceClient/client.py b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceClient/client.py new file mode 100755 index 0000000..3b27bd5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceClient/client.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +""" +Sample code to use with ServiceClient.pde +""" + +import roslib; roslib.load_manifest("rosserial_arduino") +import rospy + +from rosserial_arduino.srv import * + +def callback(req): + print "The arduino is calling! Please send it a message:" + t = TestResponse() + t.output = raw_input() + return t + +rospy.init_node("service_client_test") +rospy.Service("test_srv", Test, callback) +rospy.spin() diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde new file mode 100755 index 0000000..2d3fd70 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde @@ -0,0 +1,40 @@ +/* + * rosserial Service Server + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +int i; +void callback(const Test::Request & req, Test::Response & res){ + if((i++)%2) + res.output = "hello"; + else + res.output = "world"; +} + +ros::ServiceServer server("test_srv",&callback); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertiseService(server); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServoControl/ServoControl.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServoControl/ServoControl.pde new file mode 100755 index 0000000..24db409 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/ServoControl/ServoControl.pde @@ -0,0 +1,49 @@ +/* + * rosserial Servo Control Example + * + * This sketch demonstrates the control of hobby R/C servos + * using ROS and the arduiono + * + * For the full tutorial write up, visit + * www.ros.org/wiki/rosserial_arduino_demos + * + * For more information on the Arduino Servo Library + * Checkout : + * http://www.arduino.cc/en/Reference/Servo + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif + +#include +#include +#include + +ros::NodeHandle nh; + +Servo servo; + +void servo_cb( const std_msgs::UInt16& cmd_msg){ + servo.write(cmd_msg.data); //set servo angle, should be from 0-180 + digitalWrite(13, HIGH-digitalRead(13)); //toggle led +} + + +ros::Subscriber sub("servo", servo_cb); + +void setup(){ + pinMode(13, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + servo.attach(9); //attach it to pin 9 +} + +void loop(){ + nh.spinOnce(); + delay(1); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Temperature/Temperature.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Temperature/Temperature.pde new file mode 100755 index 0000000..2c2f865 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Temperature/Temperature.pde @@ -0,0 +1,72 @@ +/* + * rosserial Temperature Sensor Example + * + * This tutorial demonstrates the usage of the + * Sparkfun TMP102 Digital Temperature Breakout board + * http://www.sparkfun.com/products/9418 + * + * Source Code Based off of: + * http://wiring.org.co/learning/libraries/tmp102sparkfun.html + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::Float32 temp_msg; +ros::Publisher pub_temp("temperature", &temp_msg); + + +// From the datasheet the BMP module address LSB distinguishes +// between read (1) and write (0) operations, corresponding to +// address 0x91 (read) and 0x90 (write). +// shift the address 1 bit right (0x91 or 0x90), the Wire library only needs the 7 +// most significant bits for the address 0x91 >> 1 = 0x48 +// 0x90 >> 1 = 0x48 (72) + +int sensorAddress = 0x91 >> 1; // From datasheet sensor address is 0x91 + // shift the address 1 bit right, the Wire library only needs the 7 + // most significant bits for the address + + +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + + nh.initNode(); + nh.advertise(pub_temp); + +} + +long publisher_timer; + +void loop() +{ + + if (millis() > publisher_timer) { + // step 1: request reading from sensor + Wire.requestFrom(sensorAddress,2); + delay(10); + if (2 <= Wire.available()) // if two bytes were received + { + byte msb; + byte lsb; + int temperature; + + msb = Wire.read(); // receive high byte (full degrees) + lsb = Wire.read(); // receive low byte (fraction degrees) + temperature = ((msb) << 4); // MSB + temperature |= (lsb >> 4); // LSB + + temp_msg.data = temperature*0.0625; + pub_temp.publish(&temp_msg); + } + + publisher_timer = millis() + 1000; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/TimeTF/TimeTF.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/TimeTF/TimeTF.pde new file mode 100755 index 0000000..16fbb70 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/TimeTF/TimeTF.pde @@ -0,0 +1,37 @@ +/* + * rosserial Time and TF Example + * Publishes a transform at current time + */ + +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + t.header.frame_id = odom; + t.child_frame_id = base_link; + t.transform.translation.x = 1.0; + t.transform.rotation.x = 0.0; + t.transform.rotation.y = 0.0; + t.transform.rotation.z = 0.0; + t.transform.rotation.w = 1.0; + t.header.stamp = nh.now(); + broadcaster.sendTransform(t); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde new file mode 100755 index 0000000..d5870cb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde @@ -0,0 +1,61 @@ +/* + * rosserial Ultrasound Example + * + * This example is for the Maxbotix Ultrasound rangers. + */ + +#include +#include +#include + +ros::NodeHandle nh; + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "/ultrasound", &range_msg); + +const int adc_pin = 0; + +char frameid[] = "/ultrasound"; + +float getRange_Ultrasound(int pin_num){ + int val = 0; + for(int i=0; i<4; i++) val += analogRead(pin_num); + float range = val; + return range /322.519685; // (0.0124023437 /4) ; //cvt to meters +} + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + + range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.1; // fake + range_msg.min_range = 0.0; + range_msg.max_range = 6.47; + + pinMode(8,OUTPUT); + digitalWrite(8, LOW); +} + + +long range_time; + +void loop() +{ + + //publish the adc value every 50 milliseconds + //since it takes that long for the sensor to stablize + if ( millis() >= range_time ){ + int r =0; + + range_msg.range = getRange_Ultrasound(5); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_time = millis() + 50; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/button_example/button_example.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/button_example/button_example.pde new file mode 100755 index 0000000..0404542 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/button_example/button_example.pde @@ -0,0 +1,61 @@ +/* + * Button Example for Rosserial + */ + +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Bool pushed_msg; +ros::Publisher pub_button("pushed", &pushed_msg); + +const int button_pin = 7; +const int led_pin = 13; + +bool last_reading; +long last_debounce_time=0; +long debounce_delay=50; +bool published = true; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_button); + + //initialize an LED output pin + //and a input pin for our push button + pinMode(led_pin, OUTPUT); + pinMode(button_pin, INPUT); + + //Enable the pullup resistor on the button + digitalWrite(button_pin, HIGH); + + //The button is a normally button + last_reading = ! digitalRead(button_pin); + +} + +void loop() +{ + + bool reading = ! digitalRead(button_pin); + + if (last_reading!= reading){ + last_debounce_time = millis(); + published = false; + } + + //if the button value has not changed for the debounce delay, we know its stable + if ( !published && (millis() - last_debounce_time) > debounce_delay) { + digitalWrite(led_pin, reading); + pushed_msg.data = reading; + pub_button.publish(&pushed_msg); + published = true; + } + + last_reading = reading; + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/pubsub/pubsub.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/pubsub/pubsub.pde new file mode 100755 index 0000000..753d8ed --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/examples/pubsub/pubsub.pde @@ -0,0 +1,40 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", messageCb ); + + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); + nh.subscribe(sub); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h new file mode 100755 index 0000000..7dd6bc0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_ApplyBodyWrench_h +#define _ROS_SERVICE_ApplyBodyWrench_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "geometry_msgs/Wrench.h" +#include "ros/time.h" +#include "geometry_msgs/Point.h" + +namespace gazebo_msgs +{ + +static const char APPLYBODYWRENCH[] = "gazebo_msgs/ApplyBodyWrench"; + + class ApplyBodyWrenchRequest : public ros::Msg + { + public: + const char* body_name; + const char* reference_frame; + geometry_msgs::Point reference_point; + geometry_msgs::Wrench wrench; + ros::Time start_time; + ros::Duration duration; + + ApplyBodyWrenchRequest(): + body_name(""), + reference_frame(""), + reference_point(), + wrench(), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + offset += this->reference_point.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + offset += this->reference_point.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "e37e6adf97eba5095baa77dffb71e5bd"; }; + + }; + + class ApplyBodyWrenchResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyBodyWrenchResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyBodyWrench { + public: + typedef ApplyBodyWrenchRequest Request; + typedef ApplyBodyWrenchResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h new file mode 100755 index 0000000..99e071c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_ApplyJointEffort_h +#define _ROS_SERVICE_ApplyJointEffort_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace gazebo_msgs +{ + +static const char APPLYJOINTEFFORT[] = "gazebo_msgs/ApplyJointEffort"; + + class ApplyJointEffortRequest : public ros::Msg + { + public: + const char* joint_name; + float effort; + ros::Time start_time; + ros::Duration duration; + + ApplyJointEffortRequest(): + joint_name(""), + effort(0), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2c3396ab9af67a509ecd2167a8fe41a2"; }; + + }; + + class ApplyJointEffortResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyJointEffortResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyJointEffort { + public: + typedef ApplyJointEffortRequest Request; + typedef ApplyJointEffortResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/BodyRequest.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/BodyRequest.h new file mode 100755 index 0000000..99dae8a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/BodyRequest.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_BodyRequest_h +#define _ROS_SERVICE_BodyRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char BODYREQUEST[] = "gazebo_msgs/BodyRequest"; + + class BodyRequestRequest : public ros::Msg + { + public: + const char* body_name; + + BodyRequestRequest(): + body_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "5eade9afe7f232d78005bd0cafeab755"; }; + + }; + + class BodyRequestResponse : public ros::Msg + { + public: + + BodyRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BodyRequest { + public: + typedef BodyRequestRequest Request; + typedef BodyRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ContactState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ContactState.h new file mode 100755 index 0000000..a1966f0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ContactState.h @@ -0,0 +1,172 @@ +#ifndef _ROS_gazebo_msgs_ContactState_h +#define _ROS_gazebo_msgs_ContactState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Wrench.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + + class ContactState : public ros::Msg + { + public: + const char* info; + const char* collision1_name; + const char* collision2_name; + uint8_t wrenches_length; + geometry_msgs::Wrench st_wrenches; + geometry_msgs::Wrench * wrenches; + geometry_msgs::Wrench total_wrench; + uint8_t contact_positions_length; + geometry_msgs::Vector3 st_contact_positions; + geometry_msgs::Vector3 * contact_positions; + uint8_t contact_normals_length; + geometry_msgs::Vector3 st_contact_normals; + geometry_msgs::Vector3 * contact_normals; + uint8_t depths_length; + float st_depths; + float * depths; + + ContactState(): + info(""), + collision1_name(""), + collision2_name(""), + wrenches_length(0), wrenches(NULL), + total_wrench(), + contact_positions_length(0), contact_positions(NULL), + contact_normals_length(0), contact_normals(NULL), + depths_length(0), depths(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + uint32_t length_collision1_name = strlen(this->collision1_name); + memcpy(outbuffer + offset, &length_collision1_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision1_name, length_collision1_name); + offset += length_collision1_name; + uint32_t length_collision2_name = strlen(this->collision2_name); + memcpy(outbuffer + offset, &length_collision2_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision2_name, length_collision2_name); + offset += length_collision2_name; + *(outbuffer + offset++) = wrenches_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->wrenches[i].serialize(outbuffer + offset); + } + offset += this->total_wrench.serialize(outbuffer + offset); + *(outbuffer + offset++) = contact_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->contact_positions[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = contact_normals_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->contact_normals[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = depths_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < depths_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->depths[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + uint32_t length_collision1_name; + memcpy(&length_collision1_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision1_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision1_name-1]=0; + this->collision1_name = (char *)(inbuffer + offset-1); + offset += length_collision1_name; + uint32_t length_collision2_name; + memcpy(&length_collision2_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision2_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision2_name-1]=0; + this->collision2_name = (char *)(inbuffer + offset-1); + offset += length_collision2_name; + uint8_t wrenches_lengthT = *(inbuffer + offset++); + if(wrenches_lengthT > wrenches_length) + this->wrenches = (geometry_msgs::Wrench*)realloc(this->wrenches, wrenches_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrenches_length = wrenches_lengthT; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->st_wrenches.deserialize(inbuffer + offset); + memcpy( &(this->wrenches[i]), &(this->st_wrenches), sizeof(geometry_msgs::Wrench)); + } + offset += this->total_wrench.deserialize(inbuffer + offset); + uint8_t contact_positions_lengthT = *(inbuffer + offset++); + if(contact_positions_lengthT > contact_positions_length) + this->contact_positions = (geometry_msgs::Vector3*)realloc(this->contact_positions, contact_positions_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_positions_length = contact_positions_lengthT; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->st_contact_positions.deserialize(inbuffer + offset); + memcpy( &(this->contact_positions[i]), &(this->st_contact_positions), sizeof(geometry_msgs::Vector3)); + } + uint8_t contact_normals_lengthT = *(inbuffer + offset++); + if(contact_normals_lengthT > contact_normals_length) + this->contact_normals = (geometry_msgs::Vector3*)realloc(this->contact_normals, contact_normals_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_normals_length = contact_normals_lengthT; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->st_contact_normals.deserialize(inbuffer + offset); + memcpy( &(this->contact_normals[i]), &(this->st_contact_normals), sizeof(geometry_msgs::Vector3)); + } + uint8_t depths_lengthT = *(inbuffer + offset++); + if(depths_lengthT > depths_length) + this->depths = (float*)realloc(this->depths, depths_lengthT * sizeof(float)); + offset += 3; + depths_length = depths_lengthT; + for( uint8_t i = 0; i < depths_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_depths)); + memcpy( &(this->depths[i]), &(this->st_depths), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactState"; }; + const char * getMD5(){ return "48c0ffb054b8c444f870cecea1ee50d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ContactsState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ContactsState.h new file mode 100755 index 0000000..38da01f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ContactsState.h @@ -0,0 +1,64 @@ +#ifndef _ROS_gazebo_msgs_ContactsState_h +#define _ROS_gazebo_msgs_ContactsState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/ContactState.h" + +namespace gazebo_msgs +{ + + class ContactsState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t states_length; + gazebo_msgs::ContactState st_states; + gazebo_msgs::ContactState * states; + + ContactsState(): + header(), + states_length(0), states(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t states_lengthT = *(inbuffer + offset++); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + offset += 3; + states_length = states_lengthT; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->st_states.deserialize(inbuffer + offset); + memcpy( &(this->states[i]), &(this->st_states), sizeof(gazebo_msgs::ContactState)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactsState"; }; + const char * getMD5(){ return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/DeleteModel.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/DeleteModel.h new file mode 100755 index 0000000..2c744d8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/DeleteModel.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_DeleteModel_h +#define _ROS_SERVICE_DeleteModel_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char DELETEMODEL[] = "gazebo_msgs/DeleteModel"; + + class DeleteModelRequest : public ros::Msg + { + public: + const char* model_name; + + DeleteModelRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class DeleteModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + DeleteModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteModel { + public: + typedef DeleteModelRequest Request; + typedef DeleteModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h new file mode 100755 index 0000000..361eae6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_GetJointProperties_h +#define _ROS_SERVICE_GetJointProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETJOINTPROPERTIES[] = "gazebo_msgs/GetJointProperties"; + + class GetJointPropertiesRequest : public ros::Msg + { + public: + const char* joint_name; + + GetJointPropertiesRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class GetJointPropertiesResponse : public ros::Msg + { + public: + uint8_t type; + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t position_length; + float st_position; + float * position; + uint8_t rate_length; + float st_rate; + float * rate; + bool success; + const char* status_message; + enum { REVOLUTE = 0 }; + enum { CONTINUOUS = 1 }; + enum { PRISMATIC = 2 }; + enum { FIXED = 3 }; + enum { BALL = 4 }; + enum { UNIVERSAL = 5 }; + + GetJointPropertiesResponse(): + type(0), + damping_length(0), damping(NULL), + position_length(0), position(NULL), + rate_length(0), rate(NULL), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = rate_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rate_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->rate[i]); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t rate_lengthT = *(inbuffer + offset++); + if(rate_lengthT > rate_length) + this->rate = (float*)realloc(this->rate, rate_lengthT * sizeof(float)); + offset += 3; + rate_length = rate_lengthT; + for( uint8_t i = 0; i < rate_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_rate)); + memcpy( &(this->rate[i]), &(this->st_rate), sizeof(float)); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "cd7b30a39faa372283dc94c5f6457f82"; }; + + }; + + class GetJointProperties { + public: + typedef GetJointPropertiesRequest Request; + typedef GetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h new file mode 100755 index 0000000..12ea8dc --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_GetLinkProperties_h +#define _ROS_SERVICE_GetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char GETLINKPROPERTIES[] = "gazebo_msgs/GetLinkProperties"; + + class GetLinkPropertiesRequest : public ros::Msg + { + public: + const char* link_name; + + GetLinkPropertiesRequest(): + link_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "7d82d60381f1b66a30f2157f60884345"; }; + + }; + + class GetLinkPropertiesResponse : public ros::Msg + { + public: + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + bool success; + const char* status_message; + + GetLinkPropertiesResponse(): + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "a8619f92d17cfcc3958c0fd13299443d"; }; + + }; + + class GetLinkProperties { + public: + typedef GetLinkPropertiesRequest Request; + typedef GetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetLinkState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetLinkState.h new file mode 100755 index 0000000..5e9ed3a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetLinkState.h @@ -0,0 +1,140 @@ +#ifndef _ROS_SERVICE_GetLinkState_h +#define _ROS_SERVICE_GetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char GETLINKSTATE[] = "gazebo_msgs/GetLinkState"; + + class GetLinkStateRequest : public ros::Msg + { + public: + const char* link_name; + const char* reference_frame; + + GetLinkStateRequest(): + link_name(""), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "7551675c30aaa71f7c288d4864552001"; }; + + }; + + class GetLinkStateResponse : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + bool success; + const char* status_message; + + GetLinkStateResponse(): + link_state(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "8ba55ad34f9c072e75c0de57b089753b"; }; + + }; + + class GetLinkState { + public: + typedef GetLinkStateRequest Request; + typedef GetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h new file mode 100755 index 0000000..3574fe5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h @@ -0,0 +1,296 @@ +#ifndef _ROS_SERVICE_GetModelProperties_h +#define _ROS_SERVICE_GetModelProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties"; + + class GetModelPropertiesRequest : public ros::Msg + { + public: + const char* model_name; + + GetModelPropertiesRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class GetModelPropertiesResponse : public ros::Msg + { + public: + const char* parent_model_name; + const char* canonical_body_name; + uint8_t body_names_length; + char* st_body_names; + char* * body_names; + uint8_t geom_names_length; + char* st_geom_names; + char* * geom_names; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t child_model_names_length; + char* st_child_model_names; + char* * child_model_names; + bool is_static; + bool success; + const char* status_message; + + GetModelPropertiesResponse(): + parent_model_name(""), + canonical_body_name(""), + body_names_length(0), body_names(NULL), + geom_names_length(0), geom_names(NULL), + joint_names_length(0), joint_names(NULL), + child_model_names_length(0), child_model_names(NULL), + is_static(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_parent_model_name = strlen(this->parent_model_name); + memcpy(outbuffer + offset, &length_parent_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); + offset += length_parent_model_name; + uint32_t length_canonical_body_name = strlen(this->canonical_body_name); + memcpy(outbuffer + offset, &length_canonical_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); + offset += length_canonical_body_name; + *(outbuffer + offset++) = body_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_body_namesi = strlen(this->body_names[i]); + memcpy(outbuffer + offset, &length_body_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); + offset += length_body_namesi; + } + *(outbuffer + offset++) = geom_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_geom_namesi = strlen(this->geom_names[i]); + memcpy(outbuffer + offset, &length_geom_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); + offset += length_geom_namesi; + } + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = child_model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_child_model_namesi = strlen(this->child_model_names[i]); + memcpy(outbuffer + offset, &length_child_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); + offset += length_child_model_namesi; + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.real = this->is_static; + *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_parent_model_name; + memcpy(&length_parent_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_model_name-1]=0; + this->parent_model_name = (char *)(inbuffer + offset-1); + offset += length_parent_model_name; + uint32_t length_canonical_body_name; + memcpy(&length_canonical_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_canonical_body_name-1]=0; + this->canonical_body_name = (char *)(inbuffer + offset-1); + offset += length_canonical_body_name; + uint8_t body_names_lengthT = *(inbuffer + offset++); + if(body_names_lengthT > body_names_length) + this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); + offset += 3; + body_names_length = body_names_lengthT; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_st_body_names; + memcpy(&length_st_body_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_body_names-1]=0; + this->st_body_names = (char *)(inbuffer + offset-1); + offset += length_st_body_names; + memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); + } + uint8_t geom_names_lengthT = *(inbuffer + offset++); + if(geom_names_lengthT > geom_names_length) + this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); + offset += 3; + geom_names_length = geom_names_lengthT; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_st_geom_names; + memcpy(&length_st_geom_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_geom_names-1]=0; + this->st_geom_names = (char *)(inbuffer + offset-1); + offset += length_st_geom_names; + memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); + } + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t child_model_names_lengthT = *(inbuffer + offset++); + if(child_model_names_lengthT > child_model_names_length) + this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); + offset += 3; + child_model_names_length = child_model_names_lengthT; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_st_child_model_names; + memcpy(&length_st_child_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_child_model_names-1]=0; + this->st_child_model_names = (char *)(inbuffer + offset-1); + offset += length_st_child_model_names; + memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.base = 0; + u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_static = u_is_static.real; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; + + }; + + class GetModelProperties { + public: + typedef GetModelPropertiesRequest Request; + typedef GetModelPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetModelState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetModelState.h new file mode 100755 index 0000000..799c432 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetModelState.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_GetModelState_h +#define _ROS_SERVICE_GetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + +static const char GETMODELSTATE[] = "gazebo_msgs/GetModelState"; + + class GetModelStateRequest : public ros::Msg + { + public: + const char* model_name; + const char* relative_entity_name; + + GetModelStateRequest(): + model_name(""), + relative_entity_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_relative_entity_name = strlen(this->relative_entity_name); + memcpy(outbuffer + offset, &length_relative_entity_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->relative_entity_name, length_relative_entity_name); + offset += length_relative_entity_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_relative_entity_name; + memcpy(&length_relative_entity_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_relative_entity_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_relative_entity_name-1]=0; + this->relative_entity_name = (char *)(inbuffer + offset-1); + offset += length_relative_entity_name; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "19d412713cefe4a67437e17a951e759e"; }; + + }; + + class GetModelStateResponse : public ros::Msg + { + public: + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + bool success; + const char* status_message; + + GetModelStateResponse(): + pose(), + twist(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "1f8f991dc94e0cb27fe61383e0f576bb"; }; + + }; + + class GetModelState { + public: + typedef GetModelStateRequest Request; + typedef GetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h new file mode 100755 index 0000000..9713896 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h @@ -0,0 +1,138 @@ +#ifndef _ROS_SERVICE_GetPhysicsProperties_h +#define _ROS_SERVICE_GetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char GETPHYSICSPROPERTIES[] = "gazebo_msgs/GetPhysicsProperties"; + + class GetPhysicsPropertiesRequest : public ros::Msg + { + public: + + GetPhysicsPropertiesRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPhysicsPropertiesResponse : public ros::Msg + { + public: + float time_step; + bool pause; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + bool success; + const char* status_message; + + GetPhysicsPropertiesResponse(): + time_step(0), + pause(0), + max_update_rate(0), + gravity(), + ode_config(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.real = this->pause; + *(outbuffer + offset + 0) = (u_pause.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pause); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.base = 0; + u_pause.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pause = u_pause.real; + offset += sizeof(this->pause); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "575a5e74786981b7df2e3afc567693a6"; }; + + }; + + class GetPhysicsProperties { + public: + typedef GetPhysicsPropertiesRequest Request; + typedef GetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h new file mode 100755 index 0000000..a179500 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h @@ -0,0 +1,156 @@ +#ifndef _ROS_SERVICE_GetWorldProperties_h +#define _ROS_SERVICE_GetWorldProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETWORLDPROPERTIES[] = "gazebo_msgs/GetWorldProperties"; + + class GetWorldPropertiesRequest : public ros::Msg + { + public: + + GetWorldPropertiesRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetWorldPropertiesResponse : public ros::Msg + { + public: + float sim_time; + uint8_t model_names_length; + char* st_model_names; + char* * model_names; + bool rendering_enabled; + bool success; + const char* status_message; + + GetWorldPropertiesResponse(): + sim_time(0), + model_names_length(0), model_names(NULL), + rendering_enabled(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->sim_time); + *(outbuffer + offset++) = model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen(this->model_names[i]); + memcpy(outbuffer + offset, &length_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_names[i], length_model_namesi); + offset += length_model_namesi; + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.real = this->rendering_enabled; + *(outbuffer + offset + 0) = (u_rendering_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sim_time)); + uint8_t model_names_lengthT = *(inbuffer + offset++); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + offset += 3; + model_names_length = model_names_lengthT; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + memcpy(&length_st_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_model_names-1]=0; + this->st_model_names = (char *)(inbuffer + offset-1); + offset += length_st_model_names; + memcpy( &(this->model_names[i]), &(this->st_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.base = 0; + u_rendering_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->rendering_enabled = u_rendering_enabled.real; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "36bb0f2eccf4d8be971410c22818ba3f"; }; + + }; + + class GetWorldProperties { + public: + typedef GetWorldPropertiesRequest Request; + typedef GetWorldPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/JointRequest.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/JointRequest.h new file mode 100755 index 0000000..17029cb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/JointRequest.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_JointRequest_h +#define _ROS_SERVICE_JointRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char JOINTREQUEST[] = "gazebo_msgs/JointRequest"; + + class JointRequestRequest : public ros::Msg + { + public: + const char* joint_name; + + JointRequestRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class JointRequestResponse : public ros::Msg + { + public: + + JointRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class JointRequest { + public: + typedef JointRequestRequest Request; + typedef JointRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/LinkState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/LinkState.h new file mode 100755 index 0000000..6c87024 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/LinkState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_gazebo_msgs_LinkState_h +#define _ROS_gazebo_msgs_LinkState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkState : public ros::Msg + { + public: + const char* link_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + LinkState(): + link_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkState"; }; + const char * getMD5(){ return "0818ebbf28ce3a08d48ab1eaa7309ebe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/LinkStates.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/LinkStates.h new file mode 100755 index 0000000..2dc1c83 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/LinkStates.h @@ -0,0 +1,112 @@ +#ifndef _ROS_gazebo_msgs_LinkStates_h +#define _ROS_gazebo_msgs_LinkStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + LinkStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ModelState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ModelState.h new file mode 100755 index 0000000..15ae191 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ModelState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_gazebo_msgs_ModelState_h +#define _ROS_gazebo_msgs_ModelState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelState : public ros::Msg + { + public: + const char* model_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + ModelState(): + model_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelState"; }; + const char * getMD5(){ return "9330fd35f2fcd82d457e54bd54e10593"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ModelStates.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ModelStates.h new file mode 100755 index 0000000..aeb9f21 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ModelStates.h @@ -0,0 +1,112 @@ +#ifndef _ROS_gazebo_msgs_ModelStates_h +#define _ROS_gazebo_msgs_ModelStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + ModelStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h new file mode 100755 index 0000000..1711110 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h @@ -0,0 +1,238 @@ +#ifndef _ROS_gazebo_msgs_ODEJointProperties_h +#define _ROS_gazebo_msgs_ODEJointProperties_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEJointProperties : public ros::Msg + { + public: + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t hiStop_length; + float st_hiStop; + float * hiStop; + uint8_t loStop_length; + float st_loStop; + float * loStop; + uint8_t erp_length; + float st_erp; + float * erp; + uint8_t cfm_length; + float st_cfm; + float * cfm; + uint8_t stop_erp_length; + float st_stop_erp; + float * stop_erp; + uint8_t stop_cfm_length; + float st_stop_cfm; + float * stop_cfm; + uint8_t fudge_factor_length; + float st_fudge_factor; + float * fudge_factor; + uint8_t fmax_length; + float st_fmax; + float * fmax; + uint8_t vel_length; + float st_vel; + float * vel; + + ODEJointProperties(): + damping_length(0), damping(NULL), + hiStop_length(0), hiStop(NULL), + loStop_length(0), loStop(NULL), + erp_length(0), erp(NULL), + cfm_length(0), cfm(NULL), + stop_erp_length(0), stop_erp(NULL), + stop_cfm_length(0), stop_cfm(NULL), + fudge_factor_length(0), fudge_factor(NULL), + fmax_length(0), fmax(NULL), + vel_length(0), vel(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = hiStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->hiStop[i]); + } + *(outbuffer + offset++) = loStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->loStop[i]); + } + *(outbuffer + offset++) = erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->erp[i]); + } + *(outbuffer + offset++) = cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cfm[i]); + } + *(outbuffer + offset++) = stop_erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_erp[i]); + } + *(outbuffer + offset++) = stop_cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_cfm[i]); + } + *(outbuffer + offset++) = fudge_factor_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fudge_factor[i]); + } + *(outbuffer + offset++) = fmax_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fmax[i]); + } + *(outbuffer + offset++) = vel_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vel_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->vel[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t hiStop_lengthT = *(inbuffer + offset++); + if(hiStop_lengthT > hiStop_length) + this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); + offset += 3; + hiStop_length = hiStop_lengthT; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_hiStop)); + memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); + } + uint8_t loStop_lengthT = *(inbuffer + offset++); + if(loStop_lengthT > loStop_length) + this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); + offset += 3; + loStop_length = loStop_lengthT; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_loStop)); + memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); + } + uint8_t erp_lengthT = *(inbuffer + offset++); + if(erp_lengthT > erp_length) + this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); + offset += 3; + erp_length = erp_lengthT; + for( uint8_t i = 0; i < erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_erp)); + memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); + } + uint8_t cfm_lengthT = *(inbuffer + offset++); + if(cfm_lengthT > cfm_length) + this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); + offset += 3; + cfm_length = cfm_lengthT; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_cfm)); + memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); + } + uint8_t stop_erp_lengthT = *(inbuffer + offset++); + if(stop_erp_lengthT > stop_erp_length) + this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); + offset += 3; + stop_erp_length = stop_erp_lengthT; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_erp)); + memcpy( &(this->stop_erp[i]), &(this->st_stop_erp), sizeof(float)); + } + uint8_t stop_cfm_lengthT = *(inbuffer + offset++); + if(stop_cfm_lengthT > stop_cfm_length) + this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); + offset += 3; + stop_cfm_length = stop_cfm_lengthT; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_cfm)); + memcpy( &(this->stop_cfm[i]), &(this->st_stop_cfm), sizeof(float)); + } + uint8_t fudge_factor_lengthT = *(inbuffer + offset++); + if(fudge_factor_lengthT > fudge_factor_length) + this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); + offset += 3; + fudge_factor_length = fudge_factor_lengthT; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fudge_factor)); + memcpy( &(this->fudge_factor[i]), &(this->st_fudge_factor), sizeof(float)); + } + uint8_t fmax_lengthT = *(inbuffer + offset++); + if(fmax_lengthT > fmax_length) + this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); + offset += 3; + fmax_length = fmax_lengthT; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fmax)); + memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); + } + uint8_t vel_lengthT = *(inbuffer + offset++); + if(vel_lengthT > vel_length) + this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); + offset += 3; + vel_length = vel_lengthT; + for( uint8_t i = 0; i < vel_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_vel)); + memcpy( &(this->vel[i]), &(this->st_vel), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEJointProperties"; }; + const char * getMD5(){ return "1b744c32a920af979f53afe2f9c3511f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h new file mode 100755 index 0000000..079d7bd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h @@ -0,0 +1,115 @@ +#ifndef _ROS_gazebo_msgs_ODEPhysics_h +#define _ROS_gazebo_msgs_ODEPhysics_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEPhysics : public ros::Msg + { + public: + bool auto_disable_bodies; + uint32_t sor_pgs_precon_iters; + uint32_t sor_pgs_iters; + float sor_pgs_w; + float sor_pgs_rms_error_tol; + float contact_surface_layer; + float contact_max_correcting_vel; + float cfm; + float erp; + uint32_t max_contacts; + + ODEPhysics(): + auto_disable_bodies(0), + sor_pgs_precon_iters(0), + sor_pgs_iters(0), + sor_pgs_w(0), + sor_pgs_rms_error_tol(0), + contact_surface_layer(0), + contact_max_correcting_vel(0), + cfm(0), + erp(0), + max_contacts(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.real = this->auto_disable_bodies; + *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->auto_disable_bodies); + *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_precon_iters); + *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_iters); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_w); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_rms_error_tol); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_surface_layer); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_max_correcting_vel); + offset += serializeAvrFloat64(outbuffer + offset, this->cfm); + offset += serializeAvrFloat64(outbuffer + offset, this->erp); + *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_contacts); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.base = 0; + u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->auto_disable_bodies = u_auto_disable_bodies.real; + offset += sizeof(this->auto_disable_bodies); + this->sor_pgs_precon_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_precon_iters); + this->sor_pgs_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_iters); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_w)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_rms_error_tol)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_surface_layer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_max_correcting_vel)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cfm)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->erp)); + this->max_contacts = ((uint32_t) (*(inbuffer + offset))); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->max_contacts); + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEPhysics"; }; + const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h new file mode 100755 index 0000000..1804fd4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_SetJointProperties_h +#define _ROS_SERVICE_SetJointProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEJointProperties.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTPROPERTIES[] = "gazebo_msgs/SetJointProperties"; + + class SetJointPropertiesRequest : public ros::Msg + { + public: + const char* joint_name; + gazebo_msgs::ODEJointProperties ode_joint_config; + + SetJointPropertiesRequest(): + joint_name(""), + ode_joint_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += this->ode_joint_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += this->ode_joint_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "331fd8f35fd27e3c1421175590258e26"; }; + + }; + + class SetJointPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointProperties { + public: + typedef SetJointPropertiesRequest Request; + typedef SetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h new file mode 100755 index 0000000..da5b3e9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_SetJointTrajectory_h +#define _ROS_SERVICE_SetJointTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTTRAJECTORY[] = "gazebo_msgs/SetJointTrajectory"; + + class SetJointTrajectoryRequest : public ros::Msg + { + public: + const char* model_name; + trajectory_msgs::JointTrajectory joint_trajectory; + geometry_msgs::Pose model_pose; + bool set_model_pose; + bool disable_physics_updates; + + SetJointTrajectoryRequest(): + model_name(""), + joint_trajectory(), + model_pose(), + set_model_pose(0), + disable_physics_updates(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->joint_trajectory.serialize(outbuffer + offset); + offset += this->model_pose.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.real = this->set_model_pose; + *(outbuffer + offset + 0) = (u_set_model_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.real = this->disable_physics_updates; + *(outbuffer + offset + 0) = (u_disable_physics_updates.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->joint_trajectory.deserialize(inbuffer + offset); + offset += this->model_pose.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.base = 0; + u_set_model_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->set_model_pose = u_set_model_pose.real; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.base = 0; + u_disable_physics_updates.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->disable_physics_updates = u_disable_physics_updates.real; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "649dd2eba5ffd358069238825f9f85ab"; }; + + }; + + class SetJointTrajectoryResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointTrajectoryResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointTrajectory { + public: + typedef SetJointTrajectoryRequest Request; + typedef SetJointTrajectoryResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h new file mode 100755 index 0000000..644164a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_SetLinkProperties_h +#define _ROS_SERVICE_SetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETLINKPROPERTIES[] = "gazebo_msgs/SetLinkProperties"; + + class SetLinkPropertiesRequest : public ros::Msg + { + public: + const char* link_name; + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + SetLinkPropertiesRequest(): + link_name(""), + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "68ac74a4be01b165bc305b5ccdc45e91"; }; + + }; + + class SetLinkPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkProperties { + public: + typedef SetLinkPropertiesRequest Request; + typedef SetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetLinkState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetLinkState.h new file mode 100755 index 0000000..dad0051 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetLinkState.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetLinkState_h +#define _ROS_SERVICE_SetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char SETLINKSTATE[] = "gazebo_msgs/SetLinkState"; + + class SetLinkStateRequest : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + + SetLinkStateRequest(): + link_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "22a2c757d56911b6f27868159e9a872d"; }; + + }; + + class SetLinkStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkState { + public: + typedef SetLinkStateRequest Request; + typedef SetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h new file mode 100755 index 0000000..5b963b4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h @@ -0,0 +1,187 @@ +#ifndef _ROS_SERVICE_SetModelConfiguration_h +#define _ROS_SERVICE_SetModelConfiguration_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char SETMODELCONFIGURATION[] = "gazebo_msgs/SetModelConfiguration"; + + class SetModelConfigurationRequest : public ros::Msg + { + public: + const char* model_name; + const char* urdf_param_name; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t joint_positions_length; + float st_joint_positions; + float * joint_positions; + + SetModelConfigurationRequest(): + model_name(""), + urdf_param_name(""), + joint_names_length(0), joint_names(NULL), + joint_positions_length(0), joint_positions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_urdf_param_name = strlen(this->urdf_param_name); + memcpy(outbuffer + offset, &length_urdf_param_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->urdf_param_name, length_urdf_param_name); + offset += length_urdf_param_name; + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = joint_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_positions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_urdf_param_name; + memcpy(&length_urdf_param_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_urdf_param_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_urdf_param_name-1]=0; + this->urdf_param_name = (char *)(inbuffer + offset-1); + offset += length_urdf_param_name; + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t joint_positions_lengthT = *(inbuffer + offset++); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + offset += 3; + joint_positions_length = joint_positions_lengthT; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_positions)); + memcpy( &(this->joint_positions[i]), &(this->st_joint_positions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "160eae60f51fabff255480c70afa289f"; }; + + }; + + class SetModelConfigurationResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelConfigurationResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelConfiguration { + public: + typedef SetModelConfigurationRequest Request; + typedef SetModelConfigurationResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetModelState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetModelState.h new file mode 100755 index 0000000..5d8222e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetModelState.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetModelState_h +#define _ROS_SERVICE_SetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ModelState.h" + +namespace gazebo_msgs +{ + +static const char SETMODELSTATE[] = "gazebo_msgs/SetModelState"; + + class SetModelStateRequest : public ros::Msg + { + public: + gazebo_msgs::ModelState model_state; + + SetModelStateRequest(): + model_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->model_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->model_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "cb042b0e91880f4661b29ea5b6234350"; }; + + }; + + class SetModelStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelState { + public: + typedef SetModelStateRequest Request; + typedef SetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h new file mode 100755 index 0000000..9a5534e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_SetPhysicsProperties_h +#define _ROS_SERVICE_SetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char SETPHYSICSPROPERTIES[] = "gazebo_msgs/SetPhysicsProperties"; + + class SetPhysicsPropertiesRequest : public ros::Msg + { + public: + float time_step; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + + SetPhysicsPropertiesRequest(): + time_step(0), + max_update_rate(0), + gravity(), + ode_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "abd9f82732b52b92e9d6bb36e6a82452"; }; + + }; + + class SetPhysicsPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetPhysicsPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetPhysicsProperties { + public: + typedef SetPhysicsPropertiesRequest Request; + typedef SetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SpawnModel.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SpawnModel.h new file mode 100755 index 0000000..8eeb9c9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/SpawnModel.h @@ -0,0 +1,172 @@ +#ifndef _ROS_SERVICE_SpawnModel_h +#define _ROS_SERVICE_SpawnModel_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SPAWNMODEL[] = "gazebo_msgs/SpawnModel"; + + class SpawnModelRequest : public ros::Msg + { + public: + const char* model_name; + const char* model_xml; + const char* robot_namespace; + geometry_msgs::Pose initial_pose; + const char* reference_frame; + + SpawnModelRequest(): + model_name(""), + model_xml(""), + robot_namespace(""), + initial_pose(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_model_xml = strlen(this->model_xml); + memcpy(outbuffer + offset, &length_model_xml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_xml, length_model_xml); + offset += length_model_xml; + uint32_t length_robot_namespace = strlen(this->robot_namespace); + memcpy(outbuffer + offset, &length_robot_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->robot_namespace, length_robot_namespace); + offset += length_robot_namespace; + offset += this->initial_pose.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_model_xml; + memcpy(&length_model_xml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_xml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_xml-1]=0; + this->model_xml = (char *)(inbuffer + offset-1); + offset += length_model_xml; + uint32_t length_robot_namespace; + memcpy(&length_robot_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_namespace-1]=0; + this->robot_namespace = (char *)(inbuffer + offset-1); + offset += length_robot_namespace; + offset += this->initial_pose.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "6d0eba5753761cd57e6263a056b79930"; }; + + }; + + class SpawnModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SpawnModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SpawnModel { + public: + typedef SpawnModelRequest Request; + typedef SpawnModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/WorldState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/WorldState.h new file mode 100755 index 0000000..9ea0ae6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/gazebo_msgs/WorldState.h @@ -0,0 +1,138 @@ +#ifndef _ROS_gazebo_msgs_WorldState_h +#define _ROS_gazebo_msgs_WorldState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace gazebo_msgs +{ + + class WorldState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + WorldState(): + header(), + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/WorldState"; }; + const char * getMD5(){ return "de1a9de3ab7ba97ac0e9ec01a4eb481e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Accel.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Accel.h new file mode 100755 index 0000000..c3bedcf --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Accel.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Accel_h +#define _ROS_geometry_msgs_Accel_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Accel : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Accel(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Accel"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelStamped.h new file mode 100755 index 0000000..121060d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_AccelStamped_h +#define _ROS_geometry_msgs_AccelStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Accel accel; + + AccelStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelStamped"; }; + const char * getMD5(){ return "d8a98a5d81351b6eb0578c78557e7659"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h new file mode 100755 index 0000000..89f39d0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovariance_h +#define _ROS_geometry_msgs_AccelWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelWithCovariance : public ros::Msg + { + public: + geometry_msgs::Accel accel; + float covariance[36]; + + AccelWithCovariance(): + accel(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->accel.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->accel.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovariance"; }; + const char * getMD5(){ return "ad5a718d699c6be72a02b8d6a139f334"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h new file mode 100755 index 0000000..d548139 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovarianceStamped_h +#define _ROS_geometry_msgs_AccelWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/AccelWithCovariance.h" + +namespace geometry_msgs +{ + + class AccelWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::AccelWithCovariance accel; + + AccelWithCovarianceStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovarianceStamped"; }; + const char * getMD5(){ return "96adb295225031ec8d57fb4251b0a886"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Inertia.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Inertia.h new file mode 100755 index 0000000..c7f719a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Inertia.h @@ -0,0 +1,71 @@ +#ifndef _ROS_geometry_msgs_Inertia_h +#define _ROS_geometry_msgs_Inertia_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Inertia : public ros::Msg + { + public: + float m; + geometry_msgs::Vector3 com; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + Inertia(): + m(0), + com(), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->m); + offset += this->com.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m)); + offset += this->com.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Inertia"; }; + const char * getMD5(){ return "1d26e4bb6c83ff141c5cf0d883c2b0fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/InertiaStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/InertiaStamped.h new file mode 100755 index 0000000..33cb756 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/InertiaStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_InertiaStamped_h +#define _ROS_geometry_msgs_InertiaStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Inertia.h" + +namespace geometry_msgs +{ + + class InertiaStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Inertia inertia; + + InertiaStamped(): + header(), + inertia() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->inertia.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->inertia.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/InertiaStamped"; }; + const char * getMD5(){ return "ddee48caeab5a966c5e8d166654a9ac7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Point.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Point.h new file mode 100755 index 0000000..92e1b42 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Point.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Point_h +#define _ROS_geometry_msgs_Point_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point : public ros::Msg + { + public: + float x; + float y; + float z; + + Point(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Point32.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Point32.h new file mode 100755 index 0000000..15be573 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Point32.h @@ -0,0 +1,107 @@ +#ifndef _ROS_geometry_msgs_Point32_h +#define _ROS_geometry_msgs_Point32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point32 : public ros::Msg + { + public: + float x; + float y; + float z; + + Point32(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point32"; }; + const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PointStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PointStamped.h new file mode 100755 index 0000000..76cb588 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PointStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PointStamped_h +#define _ROS_geometry_msgs_PointStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace geometry_msgs +{ + + class PointStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Point point; + + PointStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PointStamped"; }; + const char * getMD5(){ return "c63aecb41bfdfd6b7e1fac37c7cbe7bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Polygon.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Polygon.h new file mode 100755 index 0000000..1d99362 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Polygon.h @@ -0,0 +1,59 @@ +#ifndef _ROS_geometry_msgs_Polygon_h +#define _ROS_geometry_msgs_Polygon_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point32.h" + +namespace geometry_msgs +{ + + class Polygon : public ros::Msg + { + public: + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + + Polygon(): + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/Polygon"; }; + const char * getMD5(){ return "cd60a26494a087f577976f0329fa120e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PolygonStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PolygonStamped.h new file mode 100755 index 0000000..1f90c35 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PolygonStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PolygonStamped_h +#define _ROS_geometry_msgs_PolygonStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Polygon.h" + +namespace geometry_msgs +{ + + class PolygonStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Polygon polygon; + + PolygonStamped(): + header(), + polygon() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PolygonStamped"; }; + const char * getMD5(){ return "c6be8f7dc3bee7fe9e8d296070f53340"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Pose.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Pose.h new file mode 100755 index 0000000..facec0f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Pose.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Pose_h +#define _ROS_geometry_msgs_Pose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Pose : public ros::Msg + { + public: + geometry_msgs::Point position; + geometry_msgs::Quaternion orientation; + + Pose(): + position(), + orientation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose"; }; + const char * getMD5(){ return "e45d45a5a1ce597b249e23fb30fc871f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Pose2D.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Pose2D.h new file mode 100755 index 0000000..a011718 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Pose2D.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Pose2D_h +#define _ROS_geometry_msgs_Pose2D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Pose2D : public ros::Msg + { + public: + float x; + float y; + float theta; + + Pose2D(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->theta)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose2D"; }; + const char * getMD5(){ return "938fa65709584ad8e77d238529be13b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseArray.h new file mode 100755 index 0000000..e7a5050 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_PoseArray_h +#define _ROS_geometry_msgs_PoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::Pose st_poses; + geometry_msgs::Pose * poses; + + PoseArray(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseArray"; }; + const char * getMD5(){ return "916c28c5764443f268b296bb671b9d97"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseStamped.h new file mode 100755 index 0000000..ae466ab --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PoseStamped_h +#define _ROS_geometry_msgs_PoseStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + + PoseStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseStamped"; }; + const char * getMD5(){ return "d3812c3cbc69362b77dc0b19b345f8f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h new file mode 100755 index 0000000..d2091e6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovariance_h +#define _ROS_geometry_msgs_PoseWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseWithCovariance : public ros::Msg + { + public: + geometry_msgs::Pose pose; + float covariance[36]; + + PoseWithCovariance(): + pose(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovariance"; }; + const char * getMD5(){ return "c23e848cf1b7533a8d7c259073a97e6f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h new file mode 100755 index 0000000..586a930 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovarianceStamped_h +#define _ROS_geometry_msgs_PoseWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" + +namespace geometry_msgs +{ + + class PoseWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::PoseWithCovariance pose; + + PoseWithCovarianceStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovarianceStamped"; }; + const char * getMD5(){ return "953b798c0f514ff060a53a3498ce6246"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Quaternion.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Quaternion.h new file mode 100755 index 0000000..69cddbe --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Quaternion.h @@ -0,0 +1,54 @@ +#ifndef _ROS_geometry_msgs_Quaternion_h +#define _ROS_geometry_msgs_Quaternion_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Quaternion : public ros::Msg + { + public: + float x; + float y; + float z; + float w; + + Quaternion(): + x(0), + y(0), + z(0), + w(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->w); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->w)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Quaternion"; }; + const char * getMD5(){ return "a779879fadf0160734f906b8c19c7004"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h new file mode 100755 index 0000000..c2e0fcf --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_QuaternionStamped_h +#define _ROS_geometry_msgs_QuaternionStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class QuaternionStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion quaternion; + + QuaternionStamped(): + header(), + quaternion() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->quaternion.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->quaternion.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/QuaternionStamped"; }; + const char * getMD5(){ return "e57f1e547e0e1fd13504588ffc8334e2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Transform.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Transform.h new file mode 100755 index 0000000..94cf738 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Transform.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Transform_h +#define _ROS_geometry_msgs_Transform_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Transform : public ros::Msg + { + public: + geometry_msgs::Vector3 translation; + geometry_msgs::Quaternion rotation; + + Transform(): + translation(), + rotation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->translation.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->translation.deserialize(inbuffer + offset); + offset += this->rotation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Transform"; }; + const char * getMD5(){ return "ac9eff44abf714214112b05d54a3cf9b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TransformStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TransformStamped.h new file mode 100755 index 0000000..d42125e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TransformStamped.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_TransformStamped_h +#define _ROS_geometry_msgs_TransformStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" + +namespace geometry_msgs +{ + + class TransformStamped : public ros::Msg + { + public: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::Transform transform; + + TransformStamped(): + header(), + child_frame_id(""), + transform() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->transform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->transform.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TransformStamped"; }; + const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Twist.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Twist.h new file mode 100755 index 0000000..6133c64 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Twist.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Twist_h +#define _ROS_geometry_msgs_Twist_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Twist : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Twist(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Twist"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistStamped.h new file mode 100755 index 0000000..bf39940 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_TwistStamped_h +#define _ROS_geometry_msgs_TwistStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Twist twist; + + TwistStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistStamped"; }; + const char * getMD5(){ return "98d34b0043a2093cf9d9345ab6eef12e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h new file mode 100755 index 0000000..c30e300 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovariance_h +#define _ROS_geometry_msgs_TwistWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistWithCovariance : public ros::Msg + { + public: + geometry_msgs::Twist twist; + float covariance[36]; + + TwistWithCovariance(): + twist(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovariance"; }; + const char * getMD5(){ return "1fe8a28e6890a4cc3ae4c3ca5c7d82e6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h new file mode 100755 index 0000000..5ea6c8e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovarianceStamped_h +#define _ROS_geometry_msgs_TwistWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace geometry_msgs +{ + + class TwistWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::TwistWithCovariance twist; + + TwistWithCovarianceStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovarianceStamped"; }; + const char * getMD5(){ return "8927a1a12fb2607ceea095b2dc440a96"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Vector3.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Vector3.h new file mode 100755 index 0000000..af3f253 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Vector3.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Vector3_h +#define _ROS_geometry_msgs_Vector3_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Vector3 : public ros::Msg + { + public: + float x; + float y; + float z; + + Vector3(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h new file mode 100755 index 0000000..589d571 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Vector3Stamped_h +#define _ROS_geometry_msgs_Vector3Stamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Vector3Stamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 vector; + + Vector3Stamped(): + header(), + vector() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3Stamped"; }; + const char * getMD5(){ return "7b324c7325e683bf02a9b14b01090ec7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Wrench.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Wrench.h new file mode 100755 index 0000000..d95bf1b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/Wrench.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Wrench_h +#define _ROS_geometry_msgs_Wrench_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Wrench : public ros::Msg + { + public: + geometry_msgs::Vector3 force; + geometry_msgs::Vector3 torque; + + Wrench(): + force(), + torque() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->force.serialize(outbuffer + offset); + offset += this->torque.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->force.deserialize(inbuffer + offset); + offset += this->torque.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Wrench"; }; + const char * getMD5(){ return "4f539cf138b23283b520fd271b567936"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/WrenchStamped.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/WrenchStamped.h new file mode 100755 index 0000000..86becdc --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/geometry_msgs/WrenchStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_WrenchStamped_h +#define _ROS_geometry_msgs_WrenchStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Wrench.h" + +namespace geometry_msgs +{ + + class WrenchStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Wrench wrench; + + WrenchStamped(): + header(), + wrench() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/WrenchStamped"; }; + const char * getMD5(){ return "d78d3cb249ce23087ade7e7d0c40cfa7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/laser_assembler/AssembleScans.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/laser_assembler/AssembleScans.h new file mode 100755 index 0000000..eda9160 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/laser_assembler/AssembleScans.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_AssembleScans_h +#define _ROS_SERVICE_AssembleScans_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "sensor_msgs/PointCloud.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS[] = "laser_assembler/AssembleScans"; + + class AssembleScansRequest : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + AssembleScansRequest(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScansResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud cloud; + + AssembleScansResponse(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "4217b28a903e4ad7869a83b3653110ff"; }; + + }; + + class AssembleScans { + public: + typedef AssembleScansRequest Request; + typedef AssembleScansResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/laser_assembler/AssembleScans2.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/laser_assembler/AssembleScans2.h new file mode 100755 index 0000000..244f919 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/laser_assembler/AssembleScans2.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_AssembleScans2_h +#define _ROS_SERVICE_AssembleScans2_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" +#include "ros/time.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS2[] = "laser_assembler/AssembleScans2"; + + class AssembleScans2Request : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + AssembleScans2Request(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScans2Response : public ros::Msg + { + public: + sensor_msgs::PointCloud2 cloud; + + AssembleScans2Response(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; + + }; + + class AssembleScans2 { + public: + typedef AssembleScans2Request Request; + typedef AssembleScans2Response Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetMapROI.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetMapROI.h new file mode 100755 index 0000000..68e5053 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetMapROI.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_GetMapROI_h +#define _ROS_SERVICE_GetMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + +static const char GETMAPROI[] = "map_msgs/GetMapROI"; + + class GetMapROIRequest : public ros::Msg + { + public: + float x; + float y; + float l_x; + float l_y; + + GetMapROIRequest(): + x(0), + y(0), + l_x(0), + l_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "43c2ff8f45af555c0eaf070c401e9a47"; }; + + }; + + class GetMapROIResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid sub_map; + + GetMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "4d1986519c00d81967d2891a606b234c"; }; + + }; + + class GetMapROI { + public: + typedef GetMapROIRequest Request; + typedef GetMapROIResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetPointMap.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetPointMap.h new file mode 100755 index 0000000..3f7cfbe --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetPointMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_GetPointMap_h +#define _ROS_SERVICE_GetPointMap_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAP[] = "map_msgs/GetPointMap"; + + class GetPointMapRequest : public ros::Msg + { + public: + + GetPointMapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPointMapResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 map; + + GetPointMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "b84fbb39505086eb6a62d933c75cb7b4"; }; + + }; + + class GetPointMap { + public: + typedef GetPointMapRequest Request; + typedef GetPointMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetPointMapROI.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetPointMapROI.h new file mode 100755 index 0000000..6ecbddf --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/GetPointMapROI.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_GetPointMapROI_h +#define _ROS_SERVICE_GetPointMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAPROI[] = "map_msgs/GetPointMapROI"; + + class GetPointMapROIRequest : public ros::Msg + { + public: + float x; + float y; + float z; + float r; + float l_x; + float l_y; + float l_z; + + GetPointMapROIRequest(): + x(0), + y(0), + z(0), + r(0), + l_x(0), + l_y(0), + l_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->r); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->r)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_z)); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "895f7e437a9a6dd225316872b187a303"; }; + + }; + + class GetPointMapROIResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 sub_map; + + GetPointMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "313769f8b0e724525c6463336cbccd63"; }; + + }; + + class GetPointMapROI { + public: + typedef GetPointMapROIRequest Request; + typedef GetPointMapROIResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h new file mode 100755 index 0000000..b86417d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h @@ -0,0 +1,146 @@ +#ifndef _ROS_map_msgs_OccupancyGridUpdate_h +#define _ROS_map_msgs_OccupancyGridUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace map_msgs +{ + + class OccupancyGridUpdate : public ros::Msg + { + public: + std_msgs::Header header; + int32_t x; + int32_t y; + uint32_t width; + uint32_t height; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGridUpdate(): + header(), + x(0), + y(0), + width(0), + height(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "map_msgs/OccupancyGridUpdate"; }; + const char * getMD5(){ return "b295be292b335c34718bd939deebe1c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/PointCloud2Update.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/PointCloud2Update.h new file mode 100755 index 0000000..116f2eb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/PointCloud2Update.h @@ -0,0 +1,62 @@ +#ifndef _ROS_map_msgs_PointCloud2Update_h +#define _ROS_map_msgs_PointCloud2Update_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + + class PointCloud2Update : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t type; + sensor_msgs::PointCloud2 points; + enum { ADD = 0 }; + enum { DELETE = 1 }; + + PointCloud2Update(): + header(), + type(0), + points() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->type >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->type >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->type >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + offset += this->points.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->type = ((uint32_t) (*(inbuffer + offset))); + this->type |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->type |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->type |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->type); + offset += this->points.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "map_msgs/PointCloud2Update"; }; + const char * getMD5(){ return "6c58e4f249ae9cd2b24fb1ee0f99195e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMap.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMap.h new file mode 100755 index 0000000..7e9e9e0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMap.h @@ -0,0 +1,51 @@ +#ifndef _ROS_map_msgs_ProjectedMap_h +#define _ROS_map_msgs_ProjectedMap_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + + class ProjectedMap : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + float min_z; + float max_z; + + ProjectedMap(): + map(), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + const char * getType(){ return "map_msgs/ProjectedMap"; }; + const char * getMD5(){ return "7bbe8f96e45089681dc1ea7d023cbfca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h new file mode 100755 index 0000000..993c9fa --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h @@ -0,0 +1,78 @@ +#ifndef _ROS_map_msgs_ProjectedMapInfo_h +#define _ROS_map_msgs_ProjectedMapInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace map_msgs +{ + + class ProjectedMapInfo : public ros::Msg + { + public: + const char* frame_id; + float x; + float y; + float width; + float height; + float min_z; + float max_z; + + ProjectedMapInfo(): + frame_id(""), + x(0), + y(0), + width(0), + height(0), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + const char * getType(){ return "map_msgs/ProjectedMapInfo"; }; + const char * getMD5(){ return "2dc10595ae94de23f22f8a6d2a0eef7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h new file mode 100755 index 0000000..0f48d32 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_ProjectedMapsInfo_h +#define _ROS_SERVICE_ProjectedMapsInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char PROJECTEDMAPSINFO[] = "map_msgs/ProjectedMapsInfo"; + + class ProjectedMapsInfoRequest : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + ProjectedMapsInfoRequest(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class ProjectedMapsInfoResponse : public ros::Msg + { + public: + + ProjectedMapsInfoResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ProjectedMapsInfo { + public: + typedef ProjectedMapsInfoRequest Request; + typedef ProjectedMapsInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/SaveMap.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/SaveMap.h new file mode 100755 index 0000000..e5db8c2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/SaveMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_SaveMap_h +#define _ROS_SERVICE_SaveMap_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/String.h" + +namespace map_msgs +{ + +static const char SAVEMAP[] = "map_msgs/SaveMap"; + + class SaveMapRequest : public ros::Msg + { + public: + std_msgs::String filename; + + SaveMapRequest(): + filename() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->filename.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->filename.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "716e25f9d9dc76ceba197f93cbf05dc7"; }; + + }; + + class SaveMapResponse : public ros::Msg + { + public: + + SaveMapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SaveMap { + public: + typedef SaveMapRequest Request; + typedef SaveMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/SetMapProjections.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/SetMapProjections.h new file mode 100755 index 0000000..ff344fb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/map_msgs/SetMapProjections.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_SetMapProjections_h +#define _ROS_SERVICE_SetMapProjections_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char SETMAPPROJECTIONS[] = "map_msgs/SetMapProjections"; + + class SetMapProjectionsRequest : public ros::Msg + { + public: + + SetMapProjectionsRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetMapProjectionsResponse : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + SetMapProjectionsResponse(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class SetMapProjections { + public: + typedef SetMapProjectionsRequest Request; + typedef SetMapProjectionsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMap.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMap.h new file mode 100755 index 0000000..5fa87e8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_GetMap_h +#define _ROS_SERVICE_GetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char GETMAP[] = "nav_msgs/GetMap"; + + class GetMapRequest : public ros::Msg + { + public: + + GetMapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapAction.h new file mode 100755 index 0000000..774101b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapAction_h +#define _ROS_nav_msgs_GetMapAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/GetMapActionGoal.h" +#include "nav_msgs/GetMapActionResult.h" +#include "nav_msgs/GetMapActionFeedback.h" + +namespace nav_msgs +{ + + class GetMapAction : public ros::Msg + { + public: + nav_msgs::GetMapActionGoal action_goal; + nav_msgs::GetMapActionResult action_result; + nav_msgs::GetMapActionFeedback action_feedback; + + GetMapAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapAction"; }; + const char * getMD5(){ return "e611ad23fbf237c031b7536416dc7cd7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h new file mode 100755 index 0000000..e5445b3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionFeedback_h +#define _ROS_nav_msgs_GetMapActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapFeedback.h" + +namespace nav_msgs +{ + + class GetMapActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapFeedback feedback; + + GetMapActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h new file mode 100755 index 0000000..644be5c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionGoal_h +#define _ROS_nav_msgs_GetMapActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "nav_msgs/GetMapGoal.h" + +namespace nav_msgs +{ + + class GetMapActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + nav_msgs::GetMapGoal goal; + + GetMapActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionGoal"; }; + const char * getMD5(){ return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionResult.h new file mode 100755 index 0000000..b635cfd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionResult_h +#define _ROS_nav_msgs_GetMapActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapResult.h" + +namespace nav_msgs +{ + + class GetMapActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapResult result; + + GetMapActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionResult"; }; + const char * getMD5(){ return "ac66e5b9a79bb4bbd33dab245236c892"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapFeedback.h new file mode 100755 index 0000000..e3b4560 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapFeedback_h +#define _ROS_nav_msgs_GetMapFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapFeedback : public ros::Msg + { + public: + + GetMapFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapGoal.h new file mode 100755 index 0000000..88a17c5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapGoal_h +#define _ROS_nav_msgs_GetMapGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapGoal : public ros::Msg + { + public: + + GetMapGoal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapGoal"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapResult.h new file mode 100755 index 0000000..005b639 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetMapResult.h @@ -0,0 +1,43 @@ +#ifndef _ROS_nav_msgs_GetMapResult_h +#define _ROS_nav_msgs_GetMapResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + + class GetMapResult : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResult(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapResult"; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetPlan.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetPlan.h new file mode 100755 index 0000000..1ea3f32 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GetPlan.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_GetPlan_h +#define _ROS_SERVICE_GetPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "nav_msgs/Path.h" + +namespace nav_msgs +{ + +static const char GETPLAN[] = "nav_msgs/GetPlan"; + + class GetPlanRequest : public ros::Msg + { + public: + geometry_msgs::PoseStamped start; + geometry_msgs::PoseStamped goal; + float tolerance; + + GetPlanRequest(): + start(), + goal(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.real = this->tolerance; + *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tolerance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.base = 0; + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tolerance = u_tolerance.real; + offset += sizeof(this->tolerance); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + nav_msgs::Path plan; + + GetPlanResponse(): + plan() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GridCells.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GridCells.h new file mode 100755 index 0000000..c65160c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/GridCells.h @@ -0,0 +1,110 @@ +#ifndef _ROS_nav_msgs_GridCells_h +#define _ROS_nav_msgs_GridCells_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace nav_msgs +{ + + class GridCells : public ros::Msg + { + public: + std_msgs::Header header; + float cell_width; + float cell_height; + uint8_t cells_length; + geometry_msgs::Point st_cells; + geometry_msgs::Point * cells; + + GridCells(): + header(), + cell_width(0), + cell_height(0), + cells_length(0), cells(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.real = this->cell_width; + *(outbuffer + offset + 0) = (u_cell_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.real = this->cell_height; + *(outbuffer + offset + 0) = (u_cell_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_height); + *(outbuffer + offset++) = cells_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.base = 0; + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_width = u_cell_width.real; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.base = 0; + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_height = u_cell_height.real; + offset += sizeof(this->cell_height); + uint8_t cells_lengthT = *(inbuffer + offset++); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + cells_length = cells_lengthT; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/GridCells"; }; + const char * getMD5(){ return "b9e4f5df6d28e272ebde00a3994830f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/MapMetaData.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/MapMetaData.h new file mode 100755 index 0000000..e9e73d8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/MapMetaData.h @@ -0,0 +1,113 @@ +#ifndef _ROS_nav_msgs_MapMetaData_h +#define _ROS_nav_msgs_MapMetaData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "geometry_msgs/Pose.h" + +namespace nav_msgs +{ + + class MapMetaData : public ros::Msg + { + public: + ros::Time map_load_time; + float resolution; + uint32_t width; + uint32_t height; + geometry_msgs::Pose origin; + + MapMetaData(): + map_load_time(), + resolution(0), + width(0), + height(0), + origin() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->map_load_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.sec); + *(outbuffer + offset + 0) = (this->map_load_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.real = this->resolution; + *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->resolution); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + offset += this->origin.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->map_load_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.sec); + this->map_load_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.base = 0; + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->resolution = u_resolution.real; + offset += sizeof(this->resolution); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + offset += this->origin.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/MapMetaData"; }; + const char * getMD5(){ return "10cfc8a2818024d3248802c00c95f11b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/OccupancyGrid.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/OccupancyGrid.h new file mode 100755 index 0000000..6cc22b7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/OccupancyGrid.h @@ -0,0 +1,81 @@ +#ifndef _ROS_nav_msgs_OccupancyGrid_h +#define _ROS_nav_msgs_OccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "nav_msgs/MapMetaData.h" + +namespace nav_msgs +{ + + class OccupancyGrid : public ros::Msg + { + public: + std_msgs::Header header; + nav_msgs::MapMetaData info; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGrid(): + header(), + info(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/OccupancyGrid"; }; + const char * getMD5(){ return "3381f2d731d4076ec5c71b0759edbe4e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/Odometry.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/Odometry.h new file mode 100755 index 0000000..7966ea5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/Odometry.h @@ -0,0 +1,69 @@ +#ifndef _ROS_nav_msgs_Odometry_h +#define _ROS_nav_msgs_Odometry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace nav_msgs +{ + + class Odometry : public ros::Msg + { + public: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::PoseWithCovariance pose; + geometry_msgs::TwistWithCovariance twist; + + Odometry(): + header(), + child_frame_id(""), + pose(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/Odometry"; }; + const char * getMD5(){ return "cd5e73d190d741a2f92e81eda573aca7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/Path.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/Path.h new file mode 100755 index 0000000..88d2301 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/Path.h @@ -0,0 +1,64 @@ +#ifndef _ROS_nav_msgs_Path_h +#define _ROS_nav_msgs_Path_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseStamped.h" + +namespace nav_msgs +{ + + class Path : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::PoseStamped st_poses; + geometry_msgs::PoseStamped * poses; + + Path(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::PoseStamped)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/Path"; }; + const char * getMD5(){ return "6227e2b7e9cce15051f669a5e197bbf7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/SetMap.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/SetMap.h new file mode 100755 index 0000000..436f95d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nav_msgs/SetMap.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetMap_h +#define _ROS_SERVICE_SetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace nav_msgs +{ + +static const char SETMAP[] = "nav_msgs/SetMap"; + + class SetMapRequest : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + geometry_msgs::PoseWithCovarianceStamped initial_pose; + + SetMapRequest(): + map(), + initial_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += this->initial_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += this->initial_pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "91149a20d7be299b87c340df8cc94fd4"; }; + + }; + + class SetMapResponse : public ros::Msg + { + public: + bool success; + + SetMapResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetMap { + public: + typedef SetMapRequest Request; + typedef SetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletList.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletList.h new file mode 100755 index 0000000..6cb0cd1 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_NodeletList_h +#define _ROS_SERVICE_NodeletList_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLIST[] = "nodelet/NodeletList"; + + class NodeletListRequest : public ros::Msg + { + public: + + NodeletListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodeletListResponse : public ros::Msg + { + public: + uint8_t nodelets_length; + char* st_nodelets; + char* * nodelets; + + NodeletListResponse(): + nodelets_length(0), nodelets(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = nodelets_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_nodeletsi = strlen(this->nodelets[i]); + memcpy(outbuffer + offset, &length_nodeletsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->nodelets[i], length_nodeletsi); + offset += length_nodeletsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t nodelets_lengthT = *(inbuffer + offset++); + if(nodelets_lengthT > nodelets_length) + this->nodelets = (char**)realloc(this->nodelets, nodelets_lengthT * sizeof(char*)); + offset += 3; + nodelets_length = nodelets_lengthT; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_st_nodelets; + memcpy(&length_st_nodelets, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_nodelets; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_nodelets-1]=0; + this->st_nodelets = (char *)(inbuffer + offset-1); + offset += length_st_nodelets; + memcpy( &(this->nodelets[i]), &(this->st_nodelets), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "99c7b10e794f5600b8030e697e946ca7"; }; + + }; + + class NodeletList { + public: + typedef NodeletListRequest Request; + typedef NodeletListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletLoad.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletLoad.h new file mode 100755 index 0000000..17d85de --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletLoad.h @@ -0,0 +1,231 @@ +#ifndef _ROS_SERVICE_NodeletLoad_h +#define _ROS_SERVICE_NodeletLoad_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLOAD[] = "nodelet/NodeletLoad"; + + class NodeletLoadRequest : public ros::Msg + { + public: + const char* name; + const char* type; + uint8_t remap_source_args_length; + char* st_remap_source_args; + char* * remap_source_args; + uint8_t remap_target_args_length; + char* st_remap_target_args; + char* * remap_target_args; + uint8_t my_argv_length; + char* st_my_argv; + char* * my_argv; + const char* bond_id; + + NodeletLoadRequest(): + name(""), + type(""), + remap_source_args_length(0), remap_source_args(NULL), + remap_target_args_length(0), remap_target_args(NULL), + my_argv_length(0), my_argv(NULL), + bond_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = remap_source_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_remap_source_argsi = strlen(this->remap_source_args[i]); + memcpy(outbuffer + offset, &length_remap_source_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_source_args[i], length_remap_source_argsi); + offset += length_remap_source_argsi; + } + *(outbuffer + offset++) = remap_target_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_remap_target_argsi = strlen(this->remap_target_args[i]); + memcpy(outbuffer + offset, &length_remap_target_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_target_args[i], length_remap_target_argsi); + offset += length_remap_target_argsi; + } + *(outbuffer + offset++) = my_argv_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_my_argvi = strlen(this->my_argv[i]); + memcpy(outbuffer + offset, &length_my_argvi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->my_argv[i], length_my_argvi); + offset += length_my_argvi; + } + uint32_t length_bond_id = strlen(this->bond_id); + memcpy(outbuffer + offset, &length_bond_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->bond_id, length_bond_id); + offset += length_bond_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t remap_source_args_lengthT = *(inbuffer + offset++); + if(remap_source_args_lengthT > remap_source_args_length) + this->remap_source_args = (char**)realloc(this->remap_source_args, remap_source_args_lengthT * sizeof(char*)); + offset += 3; + remap_source_args_length = remap_source_args_lengthT; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_st_remap_source_args; + memcpy(&length_st_remap_source_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_source_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_source_args-1]=0; + this->st_remap_source_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_source_args; + memcpy( &(this->remap_source_args[i]), &(this->st_remap_source_args), sizeof(char*)); + } + uint8_t remap_target_args_lengthT = *(inbuffer + offset++); + if(remap_target_args_lengthT > remap_target_args_length) + this->remap_target_args = (char**)realloc(this->remap_target_args, remap_target_args_lengthT * sizeof(char*)); + offset += 3; + remap_target_args_length = remap_target_args_lengthT; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_st_remap_target_args; + memcpy(&length_st_remap_target_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_target_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_target_args-1]=0; + this->st_remap_target_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_target_args; + memcpy( &(this->remap_target_args[i]), &(this->st_remap_target_args), sizeof(char*)); + } + uint8_t my_argv_lengthT = *(inbuffer + offset++); + if(my_argv_lengthT > my_argv_length) + this->my_argv = (char**)realloc(this->my_argv, my_argv_lengthT * sizeof(char*)); + offset += 3; + my_argv_length = my_argv_lengthT; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_st_my_argv; + memcpy(&length_st_my_argv, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_my_argv; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_my_argv-1]=0; + this->st_my_argv = (char *)(inbuffer + offset-1); + offset += length_st_my_argv; + memcpy( &(this->my_argv[i]), &(this->st_my_argv), sizeof(char*)); + } + uint32_t length_bond_id; + memcpy(&length_bond_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_bond_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_bond_id-1]=0; + this->bond_id = (char *)(inbuffer + offset-1); + offset += length_bond_id; + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "c6e28cc4d2e259249d96cfb50658fbec"; }; + + }; + + class NodeletLoadResponse : public ros::Msg + { + public: + bool success; + + NodeletLoadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletLoad { + public: + typedef NodeletLoadRequest Request; + typedef NodeletLoadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletUnload.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletUnload.h new file mode 100755 index 0000000..0f1c1df --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/nodelet/NodeletUnload.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_NodeletUnload_h +#define _ROS_SERVICE_NodeletUnload_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETUNLOAD[] = "nodelet/NodeletUnload"; + + class NodeletUnloadRequest : public ros::Msg + { + public: + const char* name; + + NodeletUnloadRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class NodeletUnloadResponse : public ros::Msg + { + public: + bool success; + + NodeletUnloadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletUnload { + public: + typedef NodeletUnloadRequest Request; + typedef NodeletUnloadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h new file mode 100755 index 0000000..87ede8b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h @@ -0,0 +1,82 @@ +#ifndef _ROS_pcl_msgs_ModelCoefficients_h +#define _ROS_pcl_msgs_ModelCoefficients_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class ModelCoefficients : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t values_length; + float st_values; + float * values; + + ModelCoefficients(): + header(), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/ModelCoefficients"; }; + const char * getMD5(){ return "ca27dea75e72cb894cd36f9e5005e93e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/PointIndices.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/PointIndices.h new file mode 100755 index 0000000..5e55370 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/PointIndices.h @@ -0,0 +1,82 @@ +#ifndef _ROS_pcl_msgs_PointIndices_h +#define _ROS_pcl_msgs_PointIndices_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class PointIndices : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t indices_length; + int32_t st_indices; + int32_t * indices; + + PointIndices(): + header(), + indices_length(0), indices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = indices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_indicesi; + u_indicesi.real = this->indices[i]; + *(outbuffer + offset + 0) = (u_indicesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_indicesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_indicesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_indicesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t indices_lengthT = *(inbuffer + offset++); + if(indices_lengthT > indices_length) + this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t)); + offset += 3; + indices_length = indices_lengthT; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_indices; + u_st_indices.base = 0; + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_indices = u_st_indices.real; + offset += sizeof(this->st_indices); + memcpy( &(this->indices[i]), &(this->st_indices), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PointIndices"; }; + const char * getMD5(){ return "458c7998b7eaf99908256472e273b3d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/PolygonMesh.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/PolygonMesh.h new file mode 100755 index 0000000..eac8917 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/PolygonMesh.h @@ -0,0 +1,69 @@ +#ifndef _ROS_pcl_msgs_PolygonMesh_h +#define _ROS_pcl_msgs_PolygonMesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" +#include "pcl_msgs/Vertices.h" + +namespace pcl_msgs +{ + + class PolygonMesh : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::PointCloud2 cloud; + uint8_t polygons_length; + pcl_msgs::Vertices st_polygons; + pcl_msgs::Vertices * polygons; + + PolygonMesh(): + header(), + cloud(), + polygons_length(0), polygons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + *(outbuffer + offset++) = polygons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + uint8_t polygons_lengthT = *(inbuffer + offset++); + if(polygons_lengthT > polygons_length) + this->polygons = (pcl_msgs::Vertices*)realloc(this->polygons, polygons_lengthT * sizeof(pcl_msgs::Vertices)); + offset += 3; + polygons_length = polygons_lengthT; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->st_polygons.deserialize(inbuffer + offset); + memcpy( &(this->polygons[i]), &(this->st_polygons), sizeof(pcl_msgs::Vertices)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PolygonMesh"; }; + const char * getMD5(){ return "45a5fc6ad2cde8489600a790acc9a38a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/Vertices.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/Vertices.h new file mode 100755 index 0000000..47479b4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/pcl_msgs/Vertices.h @@ -0,0 +1,66 @@ +#ifndef _ROS_pcl_msgs_Vertices_h +#define _ROS_pcl_msgs_Vertices_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pcl_msgs +{ + + class Vertices : public ros::Msg + { + public: + uint8_t vertices_length; + uint32_t st_vertices; + uint32_t * vertices; + + Vertices(): + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + this->st_vertices = ((uint32_t) (*(inbuffer + offset))); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_vertices); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/Vertices"; }; + const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/polled_camera/GetPolledImage.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/polled_camera/GetPolledImage.h new file mode 100755 index 0000000..31da9e7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/polled_camera/GetPolledImage.h @@ -0,0 +1,194 @@ +#ifndef _ROS_SERVICE_GetPolledImage_h +#define _ROS_SERVICE_GetPolledImage_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/RegionOfInterest.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace polled_camera +{ + +static const char GETPOLLEDIMAGE[] = "polled_camera/GetPolledImage"; + + class GetPolledImageRequest : public ros::Msg + { + public: + const char* response_namespace; + ros::Duration timeout; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + GetPolledImageRequest(): + response_namespace(""), + timeout(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_response_namespace = strlen(this->response_namespace); + memcpy(outbuffer + offset, &length_response_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_namespace, length_response_namespace); + offset += length_response_namespace; + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_response_namespace; + memcpy(&length_response_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_namespace-1]=0; + this->response_namespace = (char *)(inbuffer + offset-1); + offset += length_response_namespace; + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "c77ed43e530fd48e9e7a2a93845e154c"; }; + + }; + + class GetPolledImageResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + ros::Time stamp; + + GetPolledImageResponse(): + success(0), + status_message(""), + stamp() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "dbf1f851bc511800e6129ccd5a3542ab"; }; + + }; + + class GetPolledImage { + public: + typedef GetPolledImageRequest Request; + typedef GetPolledImageResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros.h new file mode 100755 index 0000000..447cf32 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros.h @@ -0,0 +1,58 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_H_ +#define _ROS_H_ + +#include "ros/node_handle.h" +#include "ArduinoHardware.h" + +namespace ros +{ +#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega168__) + /* downsize our buffers */ + typedef NodeHandle_ NodeHandle; + +#elif defined(__AVR_ATmega328P__) + + typedef NodeHandle_ NodeHandle; + +#else + + typedef NodeHandle_ NodeHandle; + +#endif +} + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/duration.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/duration.h new file mode 100755 index 0000000..ab889cd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/duration.h @@ -0,0 +1,67 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_DURATION_H_ +#define _ROS_DURATION_H_ + +#include +#include + +namespace ros { + + void normalizeSecNSecSigned(int32_t& sec, int32_t& nsec); + + class Duration + { + public: + int32_t sec, nsec; + + Duration() : sec(0), nsec(0) {} + Duration(int32_t _sec, int32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSecSigned(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); }; + + Duration& operator+=(const Duration &rhs); + Duration& operator-=(const Duration &rhs); + Duration& operator*=(double scale); + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/msg.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/msg.h new file mode 100755 index 0000000..87f2e5c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/msg.h @@ -0,0 +1,129 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_MSG_H_ +#define _ROS_MSG_H_ + +#include + +namespace ros { + +/* Base Message Type */ +class Msg +{ +public: + virtual int serialize(unsigned char *outbuffer) const = 0; + virtual int deserialize(unsigned char *data) = 0; + virtual const char * getType() = 0; + virtual const char * getMD5() = 0; + + /** + * @brief This tricky function handles promoting a 32bit float to a 64bit + * double, so that AVR can publish messages containing float64 + * fields, despite AVV having no native support for double. + * + * @param[out] outbuffer pointer for buffer to serialize to. + * @param[in] f value to serialize. + * + * @return number of bytes to advance the buffer pointer. + * + */ + static int serializeAvrFloat64(unsigned char* outbuffer, const float f) + { + const int32_t* val = (int32_t*) &f; + int32_t exp = ((*val >> 23) & 255); + if (exp != 0) + { + exp += 1023 - 127; + } + + int32_t sig = *val; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = (sig << 5) & 0xff; + *(outbuffer++) = (sig >> 3) & 0xff; + *(outbuffer++) = (sig >> 11) & 0xff; + *(outbuffer++) = ((exp << 4) & 0xF0) | ((sig >> 19) & 0x0F); + *(outbuffer++) = (exp >> 4) & 0x7F; + + // Mark negative bit as necessary. + if (f < 0) + { + *(outbuffer - 1) |= 0x80; + } + + return 8; + } + + /** + * @brief This tricky function handles demoting a 64bit double to a + * 32bit float, so that AVR can understand messages containing + * float64 fields, despite AVR having no native support for double. + * + * @param[in] inbuffer pointer for buffer to deserialize from. + * @param[out] f pointer to place the deserialized value in. + * + * @return number of bytes to advance the buffer pointer. + */ + static int deserializeAvrFloat64(const unsigned char* inbuffer, float* f) + { + uint32_t* val = (uint32_t*)f; + inbuffer += 3; + + // Copy truncated mantissa. + *val = ((uint32_t)(*(inbuffer++)) >> 5 & 0x07); + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 3; + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 11; + *val |= ((uint32_t)(*inbuffer) & 0x0f) << 19; + + // Copy truncated exponent. + uint32_t exp = ((uint32_t)(*(inbuffer++)) & 0xf0)>>4; + exp |= ((uint32_t)(*inbuffer) & 0x7f) << 4; + if (exp != 0) + { + *val |= ((exp) - 1023 + 127) << 23; + } + + // Copy negative sign. + *val |= ((uint32_t)(*(inbuffer++)) & 0x80) << 24; + + return 8; + } + +}; + +} // namespace ros + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/node_handle.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/node_handle.h new file mode 100755 index 0000000..9babaff --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/node_handle.h @@ -0,0 +1,543 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_NODE_HANDLE_H_ +#define ROS_NODE_HANDLE_H_ + +#include + +#include "std_msgs/Time.h" +#include "rosserial_msgs/TopicInfo.h" +#include "rosserial_msgs/Log.h" +#include "rosserial_msgs/RequestParam.h" + +#define SYNC_SECONDS 5 + +#define MODE_FIRST_FF 0 +/* + * The second sync byte is a protocol version. It's value is 0xff for the first + * version of the rosserial protocol (used up to hydro), 0xfe for the second version + * (introduced in hydro), 0xfd for the next, and so on. Its purpose is to enable + * detection of mismatched protocol versions (e.g. hydro rosserial_python with groovy + * rosserial_arduino. It must be changed in both this file and in + * rosserial_python/src/rosserial_python/SerialClient.py + */ +#define MODE_PROTOCOL_VER 1 +#define PROTOCOL_VER1 0xff // through groovy +#define PROTOCOL_VER2 0xfe // in hydro +#define PROTOCOL_VER PROTOCOL_VER2 +#define MODE_SIZE_L 2 +#define MODE_SIZE_H 3 +#define MODE_SIZE_CHECKSUM 4 // checksum for msg size received from size L and H +#define MODE_TOPIC_L 5 // waiting for topic id +#define MODE_TOPIC_H 6 +#define MODE_MESSAGE 7 +#define MODE_MSG_CHECKSUM 8 // checksum for msg and topic id + + +#define MSG_TIMEOUT 20 //20 milliseconds to recieve all of message data + +#include "msg.h" + +namespace ros { + + class NodeHandleBase_{ + public: + virtual int publish(int id, const Msg* msg)=0; + virtual int spinOnce()=0; + virtual bool connected()=0; + }; +} + +#include "publisher.h" +#include "subscriber.h" +#include "service_server.h" +#include "service_client.h" + +namespace ros { + + using rosserial_msgs::TopicInfo; + + /* Node Handle */ + template + class NodeHandle_ : public NodeHandleBase_ + { + protected: + Hardware hardware_; + + /* time used for syncing */ + uint32_t rt_time; + + /* used for computing current time */ + uint32_t sec_offset, nsec_offset; + + uint8_t message_in[INPUT_SIZE]; + uint8_t message_out[OUTPUT_SIZE]; + + Publisher * publishers[MAX_PUBLISHERS]; + Subscriber_ * subscribers[MAX_SUBSCRIBERS]; + + /* + * Setup Functions + */ + public: + NodeHandle_() : configured_(false) { + + for(unsigned int i=0; i< MAX_PUBLISHERS; i++) + publishers[i] = 0; + + for(unsigned int i=0; i< MAX_SUBSCRIBERS; i++) + subscribers[i] = 0; + + for(unsigned int i=0; i< INPUT_SIZE; i++) + message_in[i] = 0; + + for(unsigned int i=0; i< OUTPUT_SIZE; i++) + message_out[i] = 0; + + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + req_param_resp.floats_length = 0; + req_param_resp.floats = NULL; + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + } + + Hardware* getHardware(){ + return &hardware_; + } + + /* Start serial, initialize buffers */ + void initNode(){ + hardware_.init(); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + /* Start a named port, which may be network server IP, initialize buffers */ + void initNode(char *portName){ + hardware_.init(portName); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + protected: + //State machine variables for spinOnce + int mode_; + int bytes_; + int topic_; + int index_; + int checksum_; + + bool configured_; + + /* used for syncing the time */ + uint32_t last_sync_time; + uint32_t last_sync_receive_time; + uint32_t last_msg_timeout_time; + + public: + /* This function goes in your loop() function, it handles + * serial input and callbacks for subscribers. + */ + + + virtual int spinOnce(){ + + /* restart if timed out */ + uint32_t c_time = hardware_.time(); + if( (c_time - last_sync_receive_time) > (SYNC_SECONDS*2200) ){ + configured_ = false; + } + + /* reset if message has timed out */ + if ( mode_ != MODE_FIRST_FF){ + if (c_time > last_msg_timeout_time){ + mode_ = MODE_FIRST_FF; + } + } + + /* while available buffer, read data */ + while( true ) + { + int data = hardware_.read(); + if( data < 0 ) + break; + checksum_ += data; + if( mode_ == MODE_MESSAGE ){ /* message data being recieved */ + message_in[index_++] = data; + bytes_--; + if(bytes_ == 0) /* is message complete? if so, checksum */ + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_FIRST_FF ){ + if(data == 0xff){ + mode_++; + last_msg_timeout_time = c_time + MSG_TIMEOUT; + } + else if( hardware_.time() - c_time > (SYNC_SECONDS)){ + /* We have been stuck in spinOnce too long, return error */ + configured_=false; + return -2; + } + }else if( mode_ == MODE_PROTOCOL_VER ){ + if(data == PROTOCOL_VER){ + mode_++; + }else{ + mode_ = MODE_FIRST_FF; + if (configured_ == false) + requestSyncTime(); /* send a msg back showing our protocol version */ + } + }else if( mode_ == MODE_SIZE_L ){ /* bottom half of message size */ + bytes_ = data; + index_ = 0; + mode_++; + checksum_ = data; /* first byte for calculating size checksum */ + }else if( mode_ == MODE_SIZE_H ){ /* top half of message size */ + bytes_ += data<<8; + mode_++; + }else if( mode_ == MODE_SIZE_CHECKSUM ){ + if( (checksum_%256) == 255) + mode_++; + else + mode_ = MODE_FIRST_FF; /* Abandon the frame if the msg len is wrong */ + }else if( mode_ == MODE_TOPIC_L ){ /* bottom half of topic id */ + topic_ = data; + mode_++; + checksum_ = data; /* first byte included in checksum */ + }else if( mode_ == MODE_TOPIC_H ){ /* top half of topic id */ + topic_ += data<<8; + mode_ = MODE_MESSAGE; + if(bytes_ == 0) + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_MSG_CHECKSUM ){ /* do checksum */ + mode_ = MODE_FIRST_FF; + if( (checksum_%256) == 255){ + if(topic_ == TopicInfo::ID_PUBLISHER){ + requestSyncTime(); + negotiateTopics(); + last_sync_time = c_time; + last_sync_receive_time = c_time; + return -1; + }else if(topic_ == TopicInfo::ID_TIME){ + syncTime(message_in); + }else if (topic_ == TopicInfo::ID_PARAMETER_REQUEST){ + req_param_resp.deserialize(message_in); + param_recieved= true; + }else if(topic_ == TopicInfo::ID_TX_STOP){ + configured_ = false; + }else{ + if(subscribers[topic_-100]) + subscribers[topic_-100]->callback( message_in ); + } + } + } + } + + /* occasionally sync time */ + if( configured_ && ((c_time-last_sync_time) > (SYNC_SECONDS*500) )){ + requestSyncTime(); + last_sync_time = c_time; + } + + return 0; + } + + + /* Are we connected to the PC? */ + virtual bool connected() { + return configured_; + }; + + /******************************************************************** + * Time functions + */ + + void requestSyncTime() + { + std_msgs::Time t; + publish(TopicInfo::ID_TIME, &t); + rt_time = hardware_.time(); + } + + void syncTime(uint8_t * data) + { + std_msgs::Time t; + uint32_t offset = hardware_.time() - rt_time; + + t.deserialize(data); + t.data.sec += offset/1000; + t.data.nsec += (offset%1000)*1000000UL; + + this->setNow(t.data); + last_sync_receive_time = hardware_.time(); + } + + Time now() + { + uint32_t ms = hardware_.time(); + Time current_time; + current_time.sec = ms/1000 + sec_offset; + current_time.nsec = (ms%1000)*1000000UL + nsec_offset; + normalizeSecNSec(current_time.sec, current_time.nsec); + return current_time; + } + + void setNow( Time & new_now ) + { + uint32_t ms = hardware_.time(); + sec_offset = new_now.sec - ms/1000 - 1; + nsec_offset = new_now.nsec - (ms%1000)*1000000UL + 1000000000UL; + normalizeSecNSec(sec_offset, nsec_offset); + } + + /******************************************************************** + * Topic Management + */ + + /* Register a new publisher */ + bool advertise(Publisher & p) + { + for(int i = 0; i < MAX_PUBLISHERS; i++){ + if(publishers[i] == 0){ // empty slot + publishers[i] = &p; + p.id_ = i+100+MAX_SUBSCRIBERS; + p.nh_ = this; + return true; + } + } + return false; + } + + /* Register a new subscriber */ + template + bool subscribe(Subscriber< MsgT> & s){ + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &s; + s.id_ = i+100; + return true; + } + } + return false; + } + + /* Register a new Service Server */ + template + bool advertiseService(ServiceServer& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + /* Register a new Service Client */ + template + bool serviceClient(ServiceClient& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + void negotiateTopics() + { + rosserial_msgs::TopicInfo ti; + int i; + for(i = 0; i < MAX_PUBLISHERS; i++) + { + if(publishers[i] != 0) // non-empty slot + { + ti.topic_id = publishers[i]->id_; + ti.topic_name = (char *) publishers[i]->topic_; + ti.message_type = (char *) publishers[i]->msg_->getType(); + ti.md5sum = (char *) publishers[i]->msg_->getMD5(); + ti.buffer_size = OUTPUT_SIZE; + publish( publishers[i]->getEndpointType(), &ti ); + } + } + for(i = 0; i < MAX_SUBSCRIBERS; i++) + { + if(subscribers[i] != 0) // non-empty slot + { + ti.topic_id = subscribers[i]->id_; + ti.topic_name = (char *) subscribers[i]->topic_; + ti.message_type = (char *) subscribers[i]->getMsgType(); + ti.md5sum = (char *) subscribers[i]->getMsgMD5(); + ti.buffer_size = INPUT_SIZE; + publish( subscribers[i]->getEndpointType(), &ti ); + } + } + configured_ = true; + } + + virtual int publish(int id, const Msg * msg) + { + if(id >= 100 && !configured_) + return 0; + + /* serialize message */ + uint16_t l = msg->serialize(message_out+7); + + /* setup the header */ + message_out[0] = 0xff; + message_out[1] = PROTOCOL_VER; + message_out[2] = (uint8_t) ((uint16_t)l&255); + message_out[3] = (uint8_t) ((uint16_t)l>>8); + message_out[4] = 255 - ((message_out[2] + message_out[3])%256); + message_out[5] = (uint8_t) ((int16_t)id&255); + message_out[6] = (uint8_t) ((int16_t)id>>8); + + /* calculate checksum */ + int chk = 0; + for(int i =5; i end_time) return false; + } + return true; + } + + public: + bool getParam(const char* name, int* param, int length =1){ + if (requestParam(name) ){ + if (length == req_param_resp.ints_length){ + //copy it over + for(int i=0; ipublish(id_, msg); }; + int getEndpointType(){ return endpoint_; } + + const char * topic_; + Msg *msg_; + // id_ and no_ are set by NodeHandle when we advertise + int id_; + NodeHandleBase_* nh_; + + private: + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/service_client.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/service_client.h new file mode 100755 index 0000000..06522f2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/service_client.h @@ -0,0 +1,83 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_CLIENT_H_ +#define _ROS_SERVICE_CLIENT_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceClient : public Subscriber_ { + public: + ServiceClient(const char* topic_name) : + pub(topic_name, &req, rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->waiting = true; + } + + virtual void call(const MReq & request, MRes & response) + { + if(!pub.nh_->connected()) return; + ret = &response; + waiting = true; + pub.publish(&request); + while(waiting && pub.nh_->connected()) + if(pub.nh_->spinOnce() < 0) break; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + ret->deserialize(data); + waiting = false; + } + virtual const char * getMsgType(){ return this->resp.getType(); } + virtual const char * getMsgMD5(){ return this->resp.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + MRes * ret; + bool waiting; + Publisher pub; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/service_server.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/service_server.h new file mode 100755 index 0000000..67a3e0a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/service_server.h @@ -0,0 +1,76 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_SERVER_H_ +#define _ROS_SERVICE_SERVER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceServer : public Subscriber_ { + public: + typedef void(*CallbackT)(const MReq&, MRes&); + + ServiceServer(const char* topic_name, CallbackT cb) : + pub(topic_name, &resp, rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->cb_ = cb; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + req.deserialize(data); + cb_(req,resp); + pub.publish(&resp); + } + virtual const char * getMsgType(){ return this->req.getType(); } + virtual const char * getMsgMD5(){ return this->req.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + Publisher pub; + private: + CallbackT cb_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/subscriber.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/subscriber.h new file mode 100755 index 0000000..5464646 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/subscriber.h @@ -0,0 +1,88 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_SUBSCRIBER_H_ +#define ROS_SUBSCRIBER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +namespace ros { + + /* Base class for objects subscribers. */ + class Subscriber_ + { + public: + virtual void callback(unsigned char *data)=0; + virtual int getEndpointType()=0; + + // id_ is set by NodeHandle when we advertise + int id_; + + virtual const char * getMsgType()=0; + virtual const char * getMsgMD5()=0; + const char * topic_; + }; + + + /* Actual subscriber, templated on message type. */ + template + class Subscriber: public Subscriber_{ + public: + typedef void(*CallbackT)(const MsgT&); + MsgT msg; + + Subscriber(const char * topic_name, CallbackT cb, int endpoint=rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : + cb_(cb), + endpoint_(endpoint) + { + topic_ = topic_name; + }; + + virtual void callback(unsigned char* data){ + msg.deserialize(data); + this->cb_(msg); + } + + virtual const char * getMsgType(){ return this->msg.getType(); } + virtual const char * getMsgMD5(){ return this->msg.getMD5(); } + virtual int getEndpointType(){ return endpoint_; } + + private: + CallbackT cb_; + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/time.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/time.h new file mode 100755 index 0000000..6141261 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/ros/time.h @@ -0,0 +1,73 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TIME_H_ +#define ROS_TIME_H_ + +#include +#include + +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSec(uint32_t &sec, uint32_t &nsec); + + class Time + { + public: + uint32_t sec, nsec; + + Time() : sec(0), nsec(0) {} + Time(uint32_t _sec, uint32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSec(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); }; + + uint32_t toNsec() { return (uint32_t)sec*1000000000ull + (uint32_t)nsec; }; + Time& fromNSec(int32_t t); + + Time& operator +=(const Duration &rhs); + Time& operator -=(const Duration &rhs); + + static Time now(); + static void setNow( Time & new_now); + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/Empty.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/Empty.h new file mode 100755 index 0000000..df021b7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char EMPTY[] = "roscpp/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/GetLoggers.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/GetLoggers.h new file mode 100755 index 0000000..0574cd7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/GetLoggers.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_GetLoggers_h +#define _ROS_SERVICE_GetLoggers_h +#include +#include +#include +#include "ros/msg.h" +#include "roscpp/Logger.h" + +namespace roscpp +{ + +static const char GETLOGGERS[] = "roscpp/GetLoggers"; + + class GetLoggersRequest : public ros::Msg + { + public: + + GetLoggersRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetLoggersResponse : public ros::Msg + { + public: + uint8_t loggers_length; + roscpp::Logger st_loggers; + roscpp::Logger * loggers; + + GetLoggersResponse(): + loggers_length(0), loggers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = loggers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->loggers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t loggers_lengthT = *(inbuffer + offset++); + if(loggers_lengthT > loggers_length) + this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger)); + offset += 3; + loggers_length = loggers_lengthT; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->st_loggers.deserialize(inbuffer + offset); + memcpy( &(this->loggers[i]), &(this->st_loggers), sizeof(roscpp::Logger)); + } + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "32e97e85527d4678a8f9279894bb64b0"; }; + + }; + + class GetLoggers { + public: + typedef GetLoggersRequest Request; + typedef GetLoggersResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/Logger.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/Logger.h new file mode 100755 index 0000000..a67fb51 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/Logger.h @@ -0,0 +1,70 @@ +#ifndef _ROS_roscpp_Logger_h +#define _ROS_roscpp_Logger_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + + class Logger : public ros::Msg + { + public: + const char* name; + const char* level; + + Logger(): + name(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return "roscpp/Logger"; }; + const char * getMD5(){ return "a6069a2ff40db7bd32143dd66e1f408e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/SetLoggerLevel.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/SetLoggerLevel.h new file mode 100755 index 0000000..dddee2e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp/SetLoggerLevel.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_SetLoggerLevel_h +#define _ROS_SERVICE_SetLoggerLevel_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; + + class SetLoggerLevelRequest : public ros::Msg + { + public: + const char* logger; + const char* level; + + SetLoggerLevelRequest(): + logger(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_logger = strlen(this->logger); + memcpy(outbuffer + offset, &length_logger, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->logger, length_logger); + offset += length_logger; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_logger; + memcpy(&length_logger, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_logger; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_logger-1]=0; + this->logger = (char *)(inbuffer + offset-1); + offset += length_logger; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + SetLoggerLevelResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp_tutorials/TwoInts.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp_tutorials/TwoInts.h new file mode 100755 index 0000000..f35797c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/roscpp_tutorials/TwoInts.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_TwoInts_h +#define _ROS_SERVICE_TwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp_tutorials +{ + +static const char TWOINTS[] = "roscpp_tutorials/TwoInts"; + + class TwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + TwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class TwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class TwoInts { + public: + typedef TwoIntsRequest Request; + typedef TwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/Clock.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/Clock.h new file mode 100755 index 0000000..10a3c0c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/Clock.h @@ -0,0 +1,61 @@ +#ifndef _ROS_rosgraph_msgs_Clock_h +#define _ROS_rosgraph_msgs_Clock_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosgraph_msgs +{ + + class Clock : public ros::Msg + { + public: + ros::Time clock; + + Clock(): + clock() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.sec); + *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->clock.sec = ((uint32_t) (*(inbuffer + offset))); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.sec); + this->clock.nsec = ((uint32_t) (*(inbuffer + offset))); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Clock"; }; + const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/Log.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/Log.h new file mode 100755 index 0000000..439dd36 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/Log.h @@ -0,0 +1,173 @@ +#ifndef _ROS_rosgraph_msgs_Log_h +#define _ROS_rosgraph_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rosgraph_msgs +{ + + class Log : public ros::Msg + { + public: + std_msgs::Header header; + int8_t level; + const char* name; + const char* msg; + const char* file; + const char* function; + uint32_t line; + uint8_t topics_length; + char* st_topics; + char* * topics; + enum { DEBUG = 1 }; + enum { INFO = 2 }; + enum { WARN = 4 }; + enum { ERROR = 8 }; + enum { FATAL = 16 }; + + Log(): + header(), + level(0), + name(""), + msg(""), + file(""), + function(""), + line(0), + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + uint32_t length_file = strlen(this->file); + memcpy(outbuffer + offset, &length_file, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->file, length_file); + offset += length_file; + uint32_t length_function = strlen(this->function); + memcpy(outbuffer + offset, &length_function, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->function, length_function); + offset += length_function; + *(outbuffer + offset + 0) = (this->line >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->line >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->line >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->line >> (8 * 3)) & 0xFF; + offset += sizeof(this->line); + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + uint32_t length_file; + memcpy(&length_file, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file-1]=0; + this->file = (char *)(inbuffer + offset-1); + offset += length_file; + uint32_t length_function; + memcpy(&length_function, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_function; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_function-1]=0; + this->function = (char *)(inbuffer + offset-1); + offset += length_function; + this->line = ((uint32_t) (*(inbuffer + offset))); + this->line |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->line |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->line |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->line); + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Log"; }; + const char * getMD5(){ return "acffd30cd6b6de30f120938c17c593fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h new file mode 100755 index 0000000..2c6fd65 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h @@ -0,0 +1,333 @@ +#ifndef _ROS_rosgraph_msgs_TopicStatistics_h +#define _ROS_rosgraph_msgs_TopicStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace rosgraph_msgs +{ + + class TopicStatistics : public ros::Msg + { + public: + const char* topic; + const char* node_pub; + const char* node_sub; + ros::Time window_start; + ros::Time window_stop; + int32_t delivered_msgs; + int32_t dropped_msgs; + int32_t traffic; + ros::Duration period_mean; + ros::Duration period_stddev; + ros::Duration period_max; + ros::Duration stamp_age_mean; + ros::Duration stamp_age_stddev; + ros::Duration stamp_age_max; + + TopicStatistics(): + topic(""), + node_pub(""), + node_sub(""), + window_start(), + window_stop(), + delivered_msgs(0), + dropped_msgs(0), + traffic(0), + period_mean(), + period_stddev(), + period_max(), + stamp_age_mean(), + stamp_age_stddev(), + stamp_age_max() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + uint32_t length_node_pub = strlen(this->node_pub); + memcpy(outbuffer + offset, &length_node_pub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_pub, length_node_pub); + offset += length_node_pub; + uint32_t length_node_sub = strlen(this->node_sub); + memcpy(outbuffer + offset, &length_node_sub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_sub, length_node_sub); + offset += length_node_sub; + *(outbuffer + offset + 0) = (this->window_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.sec); + *(outbuffer + offset + 0) = (this->window_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.nsec); + *(outbuffer + offset + 0) = (this->window_stop.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.sec); + *(outbuffer + offset + 0) = (this->window_stop.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.real = this->delivered_msgs; + *(outbuffer + offset + 0) = (u_delivered_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delivered_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delivered_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delivered_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.real = this->dropped_msgs; + *(outbuffer + offset + 0) = (u_dropped_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dropped_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dropped_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dropped_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.real = this->traffic; + *(outbuffer + offset + 0) = (u_traffic.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_traffic.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_traffic.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_traffic.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->traffic); + *(outbuffer + offset + 0) = (this->period_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.sec); + *(outbuffer + offset + 0) = (this->period_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.nsec); + *(outbuffer + offset + 0) = (this->period_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.sec); + *(outbuffer + offset + 0) = (this->period_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.nsec); + *(outbuffer + offset + 0) = (this->period_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.sec); + *(outbuffer + offset + 0) = (this->period_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.sec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.sec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.sec); + *(outbuffer + offset + 0) = (this->stamp_age_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + uint32_t length_node_pub; + memcpy(&length_node_pub, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_pub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_pub-1]=0; + this->node_pub = (char *)(inbuffer + offset-1); + offset += length_node_pub; + uint32_t length_node_sub; + memcpy(&length_node_sub, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_sub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_sub-1]=0; + this->node_sub = (char *)(inbuffer + offset-1); + offset += length_node_sub; + this->window_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.sec); + this->window_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.nsec); + this->window_stop.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.sec); + this->window_stop.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.base = 0; + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delivered_msgs = u_delivered_msgs.real; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.base = 0; + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dropped_msgs = u_dropped_msgs.real; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.base = 0; + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->traffic = u_traffic.real; + offset += sizeof(this->traffic); + this->period_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.sec); + this->period_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.nsec); + this->period_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.sec); + this->period_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.nsec); + this->period_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.sec); + this->period_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.nsec); + this->stamp_age_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.sec); + this->stamp_age_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.nsec); + this->stamp_age_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.sec); + this->stamp_age_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.nsec); + this->stamp_age_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.sec); + this->stamp_age_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/TopicStatistics"; }; + const char * getMD5(){ return "10152ed868c5097a5e2e4a89d7daa710"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h new file mode 100755 index 0000000..37332a0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_AddTwoInts_h +#define _ROS_SERVICE_AddTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char ADDTWOINTS[] = "rospy_tutorials/AddTwoInts"; + + class AddTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + AddTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class AddTwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + AddTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class AddTwoInts { + public: + typedef AddTwoIntsRequest Request; + typedef AddTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h new file mode 100755 index 0000000..f76f277 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h @@ -0,0 +1,147 @@ +#ifndef _ROS_SERVICE_BadTwoInts_h +#define _ROS_SERVICE_BadTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char BADTWOINTS[] = "rospy_tutorials/BadTwoInts"; + + class BadTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int32_t b; + + BadTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "29bb5c7dea8bf822f53e94b0ee5a3a56"; }; + + }; + + class BadTwoIntsResponse : public ros::Msg + { + public: + int32_t sum; + + BadTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "0ba699c25c9418c0366f3595c0c8e8ec"; }; + + }; + + class BadTwoInts { + public: + typedef BadTwoIntsRequest Request; + typedef BadTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/Floats.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/Floats.h new file mode 100755 index 0000000..113468d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/Floats.h @@ -0,0 +1,77 @@ +#ifndef _ROS_rospy_tutorials_Floats_h +#define _ROS_rospy_tutorials_Floats_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + + class Floats : public ros::Msg + { + public: + uint8_t data_length; + float st_data; + float * data; + + Floats(): + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "rospy_tutorials/Floats"; }; + const char * getMD5(){ return "420cd38b6b071cd49f2970c3e2cee511"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/HeaderString.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/HeaderString.h new file mode 100755 index 0000000..f53759c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rospy_tutorials/HeaderString.h @@ -0,0 +1,59 @@ +#ifndef _ROS_rospy_tutorials_HeaderString_h +#define _ROS_rospy_tutorials_HeaderString_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rospy_tutorials +{ + + class HeaderString : public ros::Msg + { + public: + std_msgs::Header header; + const char* data; + + HeaderString(): + header(), + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "rospy_tutorials/HeaderString"; }; + const char * getMD5(){ return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_arduino/Adc.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_arduino/Adc.h new file mode 100755 index 0000000..21114c7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_arduino/Adc.h @@ -0,0 +1,86 @@ +#ifndef _ROS_rosserial_arduino_Adc_h +#define _ROS_rosserial_arduino_Adc_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + + class Adc : public ros::Msg + { + public: + uint16_t adc0; + uint16_t adc1; + uint16_t adc2; + uint16_t adc3; + uint16_t adc4; + uint16_t adc5; + + Adc(): + adc0(0), + adc1(0), + adc2(0), + adc3(0), + adc4(0), + adc5(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->adc0 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc0 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc0); + *(outbuffer + offset + 0) = (this->adc1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc1 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc1); + *(outbuffer + offset + 0) = (this->adc2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc2 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc2); + *(outbuffer + offset + 0) = (this->adc3 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc3 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc3); + *(outbuffer + offset + 0) = (this->adc4 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc4 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc4); + *(outbuffer + offset + 0) = (this->adc5 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc5 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc5); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->adc0 = ((uint16_t) (*(inbuffer + offset))); + this->adc0 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc0); + this->adc1 = ((uint16_t) (*(inbuffer + offset))); + this->adc1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc1); + this->adc2 = ((uint16_t) (*(inbuffer + offset))); + this->adc2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc2); + this->adc3 = ((uint16_t) (*(inbuffer + offset))); + this->adc3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc3); + this->adc4 = ((uint16_t) (*(inbuffer + offset))); + this->adc4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc4); + this->adc5 = ((uint16_t) (*(inbuffer + offset))); + this->adc5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc5); + return offset; + } + + const char * getType(){ return "rosserial_arduino/Adc"; }; + const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_arduino/Test.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_arduino/Test.h new file mode 100755 index 0000000..e132728 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_arduino/Test.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_Test_h +#define _ROS_SERVICE_Test_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + +static const char TEST[] = "rosserial_arduino/Test"; + + class TestRequest : public ros::Msg + { + public: + const char* input; + + TestRequest(): + input("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_input = strlen(this->input); + memcpy(outbuffer + offset, &length_input, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->input, length_input); + offset += length_input; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_input; + memcpy(&length_input, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_input; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_input-1]=0; + this->input = (char *)(inbuffer + offset-1); + offset += length_input; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "39e92f1778057359c64c7b8a7d7b19de"; }; + + }; + + class TestResponse : public ros::Msg + { + public: + const char* output; + + TestResponse(): + output("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_output = strlen(this->output); + memcpy(outbuffer + offset, &length_output, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_output; + memcpy(&length_output, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_output; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_output-1]=0; + this->output = (char *)(inbuffer + offset-1); + offset += length_output; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class Test { + public: + typedef TestRequest Request; + typedef TestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/Log.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/Log.h new file mode 100755 index 0000000..bcd6fd6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/Log.h @@ -0,0 +1,65 @@ +#ifndef _ROS_rosserial_msgs_Log_h +#define _ROS_rosserial_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class Log : public ros::Msg + { + public: + uint8_t level; + const char* msg; + enum { ROSDEBUG = 0 }; + enum { INFO = 1 }; + enum { WARN = 2 }; + enum { ERROR = 3 }; + enum { FATAL = 4 }; + + Log(): + level(0), + msg("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->level = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->level); + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + return offset; + } + + const char * getType(){ return "rosserial_msgs/Log"; }; + const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h new file mode 100755 index 0000000..98af72e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h @@ -0,0 +1,118 @@ +#ifndef _ROS_SERVICE_RequestMessageInfo_h +#define _ROS_SERVICE_RequestMessageInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo"; + + class RequestMessageInfoRequest : public ros::Msg + { + public: + const char* type; + + RequestMessageInfoRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class RequestMessageInfoResponse : public ros::Msg + { + public: + const char* md5; + const char* definition; + + RequestMessageInfoResponse(): + md5(""), + definition("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_md5 = strlen(this->md5); + memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5, length_md5); + offset += length_md5; + uint32_t length_definition = strlen(this->definition); + memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->definition, length_definition); + offset += length_definition; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_md5; + memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5-1]=0; + this->md5 = (char *)(inbuffer + offset-1); + offset += length_md5; + uint32_t length_definition; + memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_definition; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_definition-1]=0; + this->definition = (char *)(inbuffer + offset-1); + offset += length_definition; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; }; + + }; + + class RequestMessageInfo { + public: + typedef RequestMessageInfoRequest Request; + typedef RequestMessageInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestParam.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestParam.h new file mode 100755 index 0000000..f4c76bd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestParam.h @@ -0,0 +1,196 @@ +#ifndef _ROS_SERVICE_RequestParam_h +#define _ROS_SERVICE_RequestParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTPARAM[] = "rosserial_msgs/RequestParam"; + + class RequestParamRequest : public ros::Msg + { + public: + const char* name; + + RequestParamRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class RequestParamResponse : public ros::Msg + { + public: + uint8_t ints_length; + int32_t st_ints; + int32_t * ints; + uint8_t floats_length; + float st_floats; + float * floats; + uint8_t strings_length; + char* st_strings; + char* * strings; + + RequestParamResponse(): + ints_length(0), ints(NULL), + floats_length(0), floats(NULL), + strings_length(0), strings(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_intsi; + u_intsi.real = this->ints[i]; + *(outbuffer + offset + 0) = (u_intsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints[i]); + } + *(outbuffer + offset++) = floats_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_floatsi; + u_floatsi.real = this->floats[i]; + *(outbuffer + offset + 0) = (u_floatsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_floatsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_floatsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_floatsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats[i]); + } + *(outbuffer + offset++) = strings_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_stringsi = strlen(this->strings[i]); + memcpy(outbuffer + offset, &length_stringsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->strings[i], length_stringsi); + offset += length_stringsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (int32_t*)realloc(this->ints, ints_lengthT * sizeof(int32_t)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ints; + u_st_ints.base = 0; + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ints = u_st_ints.real; + offset += sizeof(this->st_ints); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(int32_t)); + } + uint8_t floats_lengthT = *(inbuffer + offset++); + if(floats_lengthT > floats_length) + this->floats = (float*)realloc(this->floats, floats_lengthT * sizeof(float)); + offset += 3; + floats_length = floats_lengthT; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_st_floats; + u_st_floats.base = 0; + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_floats = u_st_floats.real; + offset += sizeof(this->st_floats); + memcpy( &(this->floats[i]), &(this->st_floats), sizeof(float)); + } + uint8_t strings_lengthT = *(inbuffer + offset++); + if(strings_lengthT > strings_length) + this->strings = (char**)realloc(this->strings, strings_lengthT * sizeof(char*)); + offset += 3; + strings_length = strings_lengthT; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_st_strings; + memcpy(&length_st_strings, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_strings; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_strings-1]=0; + this->st_strings = (char *)(inbuffer + offset-1); + offset += length_st_strings; + memcpy( &(this->strings[i]), &(this->st_strings), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "9f0e98bda65981986ddf53afa7a40e49"; }; + + }; + + class RequestParam { + public: + typedef RequestParamRequest Request; + typedef RequestParamResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h new file mode 100755 index 0000000..90b47c5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h @@ -0,0 +1,134 @@ +#ifndef _ROS_SERVICE_RequestServiceInfo_h +#define _ROS_SERVICE_RequestServiceInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo"; + + class RequestServiceInfoRequest : public ros::Msg + { + public: + const char* service; + + RequestServiceInfoRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service = strlen(this->service); + memcpy(outbuffer + offset, &length_service, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service; + memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class RequestServiceInfoResponse : public ros::Msg + { + public: + const char* service_md5; + const char* request_md5; + const char* response_md5; + + RequestServiceInfoResponse(): + service_md5(""), + request_md5(""), + response_md5("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service_md5 = strlen(this->service_md5); + memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service_md5, length_service_md5); + offset += length_service_md5; + uint32_t length_request_md5 = strlen(this->request_md5); + memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->request_md5, length_request_md5); + offset += length_request_md5; + uint32_t length_response_md5 = strlen(this->response_md5); + memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_md5, length_response_md5); + offset += length_response_md5; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service_md5; + memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service_md5-1]=0; + this->service_md5 = (char *)(inbuffer + offset-1); + offset += length_service_md5; + uint32_t length_request_md5; + memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_request_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_request_md5-1]=0; + this->request_md5 = (char *)(inbuffer + offset-1); + offset += length_request_md5; + uint32_t length_response_md5; + memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_md5-1]=0; + this->response_md5 = (char *)(inbuffer + offset-1); + offset += length_response_md5; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; }; + + }; + + class RequestServiceInfo { + public: + typedef RequestServiceInfoRequest Request; + typedef RequestServiceInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/TopicInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/TopicInfo.h new file mode 100755 index 0000000..c4daf2d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/rosserial_msgs/TopicInfo.h @@ -0,0 +1,125 @@ +#ifndef _ROS_rosserial_msgs_TopicInfo_h +#define _ROS_rosserial_msgs_TopicInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class TopicInfo : public ros::Msg + { + public: + uint16_t topic_id; + const char* topic_name; + const char* message_type; + const char* md5sum; + int32_t buffer_size; + enum { ID_PUBLISHER = 0 }; + enum { ID_SUBSCRIBER = 1 }; + enum { ID_SERVICE_SERVER = 2 }; + enum { ID_SERVICE_CLIENT = 4 }; + enum { ID_PARAMETER_REQUEST = 6 }; + enum { ID_LOG = 7 }; + enum { ID_TIME = 10 }; + enum { ID_TX_STOP = 11 }; + + TopicInfo(): + topic_id(0), + topic_name(""), + message_type(""), + md5sum(""), + buffer_size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topic_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topic_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->topic_id); + uint32_t length_topic_name = strlen(this->topic_name); + memcpy(outbuffer + offset, &length_topic_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic_name, length_topic_name); + offset += length_topic_name; + uint32_t length_message_type = strlen(this->message_type); + memcpy(outbuffer + offset, &length_message_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message_type, length_message_type); + offset += length_message_type; + uint32_t length_md5sum = strlen(this->md5sum); + memcpy(outbuffer + offset, &length_md5sum, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5sum, length_md5sum); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.real = this->buffer_size; + *(outbuffer + offset + 0) = (u_buffer_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buffer_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buffer_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buffer_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buffer_size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->topic_id = ((uint16_t) (*(inbuffer + offset))); + this->topic_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->topic_id); + uint32_t length_topic_name; + memcpy(&length_topic_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic_name-1]=0; + this->topic_name = (char *)(inbuffer + offset-1); + offset += length_topic_name; + uint32_t length_message_type; + memcpy(&length_message_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_type-1]=0; + this->message_type = (char *)(inbuffer + offset-1); + offset += length_message_type; + uint32_t length_md5sum; + memcpy(&length_md5sum, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5sum; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5sum-1]=0; + this->md5sum = (char *)(inbuffer + offset-1); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.base = 0; + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->buffer_size = u_buffer_size.real; + offset += sizeof(this->buffer_size); + return offset; + } + + const char * getType(){ return "rosserial_msgs/TopicInfo"; }; + const char * getMD5(){ return "0ad51f88fc44892f8c10684077646005"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/BatteryState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/BatteryState.h new file mode 100755 index 0000000..0328963 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/BatteryState.h @@ -0,0 +1,308 @@ +#ifndef _ROS_sensor_msgs_BatteryState_h +#define _ROS_sensor_msgs_BatteryState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class BatteryState : public ros::Msg + { + public: + std_msgs::Header header; + float voltage; + float current; + float charge; + float capacity; + float design_capacity; + float percentage; + uint8_t power_supply_status; + uint8_t power_supply_health; + uint8_t power_supply_technology; + bool present; + uint8_t cell_voltage_length; + float st_cell_voltage; + float * cell_voltage; + const char* location; + const char* serial_number; + enum { POWER_SUPPLY_STATUS_UNKNOWN = 0 }; + enum { POWER_SUPPLY_STATUS_CHARGING = 1 }; + enum { POWER_SUPPLY_STATUS_DISCHARGING = 2 }; + enum { POWER_SUPPLY_STATUS_NOT_CHARGING = 3 }; + enum { POWER_SUPPLY_STATUS_FULL = 4 }; + enum { POWER_SUPPLY_HEALTH_UNKNOWN = 0 }; + enum { POWER_SUPPLY_HEALTH_GOOD = 1 }; + enum { POWER_SUPPLY_HEALTH_OVERHEAT = 2 }; + enum { POWER_SUPPLY_HEALTH_DEAD = 3 }; + enum { POWER_SUPPLY_HEALTH_OVERVOLTAGE = 4 }; + enum { POWER_SUPPLY_HEALTH_UNSPEC_FAILURE = 5 }; + enum { POWER_SUPPLY_HEALTH_COLD = 6 }; + enum { POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE = 7 }; + enum { POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE = 8 }; + enum { POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0 }; + enum { POWER_SUPPLY_TECHNOLOGY_NIMH = 1 }; + enum { POWER_SUPPLY_TECHNOLOGY_LION = 2 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIPO = 3 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIFE = 4 }; + enum { POWER_SUPPLY_TECHNOLOGY_NICD = 5 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIMN = 6 }; + + BatteryState(): + header(), + voltage(0), + current(0), + charge(0), + capacity(0), + design_capacity(0), + percentage(0), + power_supply_status(0), + power_supply_health(0), + power_supply_technology(0), + present(0), + cell_voltage_length(0), cell_voltage(NULL), + location(""), + serial_number("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.real = this->voltage; + *(outbuffer + offset + 0) = (u_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.real = this->current; + *(outbuffer + offset + 0) = (u_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_charge; + u_charge.real = this->charge; + *(outbuffer + offset + 0) = (u_charge.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charge.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charge.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charge.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.real = this->capacity; + *(outbuffer + offset + 0) = (u_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.real = this->design_capacity; + *(outbuffer + offset + 0) = (u_design_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_design_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_design_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_design_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.real = this->percentage; + *(outbuffer + offset + 0) = (u_percentage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_percentage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_percentage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_percentage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->percentage); + *(outbuffer + offset + 0) = (this->power_supply_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_status); + *(outbuffer + offset + 0) = (this->power_supply_health >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_health); + *(outbuffer + offset + 0) = (this->power_supply_technology >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.real = this->present; + *(outbuffer + offset + 0) = (u_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->present); + *(outbuffer + offset++) = cell_voltage_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_cell_voltagei; + u_cell_voltagei.real = this->cell_voltage[i]; + *(outbuffer + offset + 0) = (u_cell_voltagei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_voltagei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_voltagei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_voltagei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_voltage[i]); + } + uint32_t length_location = strlen(this->location); + memcpy(outbuffer + offset, &length_location, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->location, length_location); + offset += length_location; + uint32_t length_serial_number = strlen(this->serial_number); + memcpy(outbuffer + offset, &length_serial_number, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->serial_number, length_serial_number); + offset += length_serial_number; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.base = 0; + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->voltage = u_voltage.real; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.base = 0; + u_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current = u_current.real; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_charge; + u_charge.base = 0; + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charge = u_charge.real; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.base = 0; + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->capacity = u_capacity.real; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.base = 0; + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->design_capacity = u_design_capacity.real; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.base = 0; + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->percentage = u_percentage.real; + offset += sizeof(this->percentage); + this->power_supply_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_status); + this->power_supply_health = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_health); + this->power_supply_technology = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.base = 0; + u_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->present = u_present.real; + offset += sizeof(this->present); + uint8_t cell_voltage_lengthT = *(inbuffer + offset++); + if(cell_voltage_lengthT > cell_voltage_length) + this->cell_voltage = (float*)realloc(this->cell_voltage, cell_voltage_lengthT * sizeof(float)); + offset += 3; + cell_voltage_length = cell_voltage_lengthT; + for( uint8_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_st_cell_voltage; + u_st_cell_voltage.base = 0; + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cell_voltage = u_st_cell_voltage.real; + offset += sizeof(this->st_cell_voltage); + memcpy( &(this->cell_voltage[i]), &(this->st_cell_voltage), sizeof(float)); + } + uint32_t length_location; + memcpy(&length_location, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_location; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_location-1]=0; + this->location = (char *)(inbuffer + offset-1); + offset += length_location; + uint32_t length_serial_number; + memcpy(&length_serial_number, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_serial_number; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_serial_number-1]=0; + this->serial_number = (char *)(inbuffer + offset-1); + offset += length_serial_number; + return offset; + } + + const char * getType(){ return "sensor_msgs/BatteryState"; }; + const char * getMD5(){ return "476f837fa6771f6e16e3bf4ef96f8770"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/CameraInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/CameraInfo.h new file mode 100755 index 0000000..55280ed --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/CameraInfo.h @@ -0,0 +1,156 @@ +#ifndef _ROS_sensor_msgs_CameraInfo_h +#define _ROS_sensor_msgs_CameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace sensor_msgs +{ + + class CameraInfo : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* distortion_model; + uint8_t D_length; + float st_D; + float * D; + float K[9]; + float R[9]; + float P[12]; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + CameraInfo(): + header(), + height(0), + width(0), + distortion_model(""), + D_length(0), D(NULL), + K(), + R(), + P(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_distortion_model = strlen(this->distortion_model); + memcpy(outbuffer + offset, &length_distortion_model, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->distortion_model, length_distortion_model); + offset += length_distortion_model; + *(outbuffer + offset++) = D_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < D_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->D[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->K[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->R[i]); + } + for( uint8_t i = 0; i < 12; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->P[i]); + } + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_distortion_model; + memcpy(&length_distortion_model, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_distortion_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_distortion_model-1]=0; + this->distortion_model = (char *)(inbuffer + offset-1); + offset += length_distortion_model; + uint8_t D_lengthT = *(inbuffer + offset++); + if(D_lengthT > D_length) + this->D = (float*)realloc(this->D, D_lengthT * sizeof(float)); + offset += 3; + D_length = D_lengthT; + for( uint8_t i = 0; i < D_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_D)); + memcpy( &(this->D[i]), &(this->st_D), sizeof(float)); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->K[i])); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->R[i])); + } + for( uint8_t i = 0; i < 12; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->P[i])); + } + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "sensor_msgs/CameraInfo"; }; + const char * getMD5(){ return "c9a58c1b0b154e0e6da7578cb991d214"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h new file mode 100755 index 0000000..ed58158 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h @@ -0,0 +1,93 @@ +#ifndef _ROS_sensor_msgs_ChannelFloat32_h +#define _ROS_sensor_msgs_ChannelFloat32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class ChannelFloat32 : public ros::Msg + { + public: + const char* name; + uint8_t values_length; + float st_values; + float * values; + + ChannelFloat32(): + name(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/ChannelFloat32"; }; + const char * getMD5(){ return "3d40139cdd33dfedcb71ffeeeb42ae7f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/CompressedImage.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/CompressedImage.h new file mode 100755 index 0000000..fdda842 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/CompressedImage.h @@ -0,0 +1,81 @@ +#ifndef _ROS_sensor_msgs_CompressedImage_h +#define _ROS_sensor_msgs_CompressedImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class CompressedImage : public ros::Msg + { + public: + std_msgs::Header header; + const char* format; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + CompressedImage(): + header(), + format(""), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_format = strlen(this->format); + memcpy(outbuffer + offset, &length_format, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_format; + memcpy(&length_format, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_format-1]=0; + this->format = (char *)(inbuffer + offset-1); + offset += length_format; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/CompressedImage"; }; + const char * getMD5(){ return "8f7a12909da2c9d3332d540a0977563f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/FluidPressure.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/FluidPressure.h new file mode 100755 index 0000000..b24e211 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/FluidPressure.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_FluidPressure_h +#define _ROS_sensor_msgs_FluidPressure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class FluidPressure : public ros::Msg + { + public: + std_msgs::Header header; + float fluid_pressure; + float variance; + + FluidPressure(): + header(), + fluid_pressure(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->fluid_pressure); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fluid_pressure)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/FluidPressure"; }; + const char * getMD5(){ return "804dc5cea1c5306d6a2eb80b9833befe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Illuminance.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Illuminance.h new file mode 100755 index 0000000..7e21795 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Illuminance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_Illuminance_h +#define _ROS_sensor_msgs_Illuminance_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Illuminance : public ros::Msg + { + public: + std_msgs::Header header; + float illuminance; + float variance; + + Illuminance(): + header(), + illuminance(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->illuminance); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->illuminance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Illuminance"; }; + const char * getMD5(){ return "8cf5febb0952fca9d650c3d11a81a188"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Image.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Image.h new file mode 100755 index 0000000..2b7ba85 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Image.h @@ -0,0 +1,123 @@ +#ifndef _ROS_sensor_msgs_Image_h +#define _ROS_sensor_msgs_Image_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Image : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* encoding; + uint8_t is_bigendian; + uint32_t step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + Image(): + header(), + height(0), + width(0), + encoding(""), + is_bigendian(0), + step(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_encoding = strlen(this->encoding); + memcpy(outbuffer + offset, &length_encoding, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->encoding, length_encoding); + offset += length_encoding; + *(outbuffer + offset + 0) = (this->is_bigendian >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->step >> (8 * 3)) & 0xFF; + offset += sizeof(this->step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_encoding; + memcpy(&length_encoding, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_encoding; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_encoding-1]=0; + this->encoding = (char *)(inbuffer + offset-1); + offset += length_encoding; + this->is_bigendian = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->is_bigendian); + this->step = ((uint32_t) (*(inbuffer + offset))); + this->step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Image"; }; + const char * getMD5(){ return "060021388200f6f0f447d0fcd9c64743"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Imu.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Imu.h new file mode 100755 index 0000000..7f7116e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Imu.h @@ -0,0 +1,81 @@ +#ifndef _ROS_sensor_msgs_Imu_h +#define _ROS_sensor_msgs_Imu_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class Imu : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion orientation; + float orientation_covariance[9]; + geometry_msgs::Vector3 angular_velocity; + float angular_velocity_covariance[9]; + geometry_msgs::Vector3 linear_acceleration; + float linear_acceleration_covariance[9]; + + Imu(): + header(), + orientation(), + orientation_covariance(), + angular_velocity(), + angular_velocity_covariance(), + linear_acceleration(), + linear_acceleration_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_covariance[i]); + } + offset += this->angular_velocity.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->angular_velocity_covariance[i]); + } + offset += this->linear_acceleration.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->linear_acceleration_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_covariance[i])); + } + offset += this->angular_velocity.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angular_velocity_covariance[i])); + } + offset += this->linear_acceleration.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->linear_acceleration_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Imu"; }; + const char * getMD5(){ return "6a62c6daae103f4ff57a132d6f95cec2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JointState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JointState.h new file mode 100755 index 0000000..387b7f4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JointState.h @@ -0,0 +1,135 @@ +#ifndef _ROS_sensor_msgs_JointState_h +#define _ROS_sensor_msgs_JointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class JointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t effort_length; + float st_effort; + float * effort; + + JointState(): + header(), + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + effort_length(0), effort(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JointState"; }; + const char * getMD5(){ return "3066dcd76a6cfaef579bd0f34173e9fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Joy.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Joy.h new file mode 100755 index 0000000..f8b5721 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Joy.h @@ -0,0 +1,121 @@ +#ifndef _ROS_sensor_msgs_Joy_h +#define _ROS_sensor_msgs_Joy_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Joy : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t axes_length; + float st_axes; + float * axes; + uint8_t buttons_length; + int32_t st_buttons; + int32_t * buttons; + + Joy(): + header(), + axes_length(0), axes(NULL), + buttons_length(0), buttons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = axes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_axesi; + u_axesi.real = this->axes[i]; + *(outbuffer + offset + 0) = (u_axesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_axesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_axesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_axesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->axes[i]); + } + *(outbuffer + offset++) = buttons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_buttonsi; + u_buttonsi.real = this->buttons[i]; + *(outbuffer + offset + 0) = (u_buttonsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buttonsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buttonsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buttonsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t axes_lengthT = *(inbuffer + offset++); + if(axes_lengthT > axes_length) + this->axes = (float*)realloc(this->axes, axes_lengthT * sizeof(float)); + offset += 3; + axes_length = axes_lengthT; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_st_axes; + u_st_axes.base = 0; + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_axes = u_st_axes.real; + offset += sizeof(this->st_axes); + memcpy( &(this->axes[i]), &(this->st_axes), sizeof(float)); + } + uint8_t buttons_lengthT = *(inbuffer + offset++); + if(buttons_lengthT > buttons_length) + this->buttons = (int32_t*)realloc(this->buttons, buttons_lengthT * sizeof(int32_t)); + offset += 3; + buttons_length = buttons_lengthT; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_buttons; + u_st_buttons.base = 0; + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_buttons = u_st_buttons.real; + offset += sizeof(this->st_buttons); + memcpy( &(this->buttons[i]), &(this->st_buttons), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Joy"; }; + const char * getMD5(){ return "5a9ea5f83505693b71e785041e67a8bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JoyFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JoyFeedback.h new file mode 100755 index 0000000..dfea009 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JoyFeedback.h @@ -0,0 +1,76 @@ +#ifndef _ROS_sensor_msgs_JoyFeedback_h +#define _ROS_sensor_msgs_JoyFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class JoyFeedback : public ros::Msg + { + public: + uint8_t type; + uint8_t id; + float intensity; + enum { TYPE_LED = 0 }; + enum { TYPE_RUMBLE = 1 }; + enum { TYPE_BUZZER = 2 }; + + JoyFeedback(): + type(0), + id(0), + intensity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.real = this->intensity; + *(outbuffer + offset + 0) = (u_intensity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.base = 0; + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->intensity = u_intensity.real; + offset += sizeof(this->intensity); + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedback"; }; + const char * getMD5(){ return "f4dcd73460360d98f36e55ee7f2e46f1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h new file mode 100755 index 0000000..9f0de2b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_sensor_msgs_JoyFeedbackArray_h +#define _ROS_sensor_msgs_JoyFeedbackArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JoyFeedback.h" + +namespace sensor_msgs +{ + + class JoyFeedbackArray : public ros::Msg + { + public: + uint8_t array_length; + sensor_msgs::JoyFeedback st_array; + sensor_msgs::JoyFeedback * array; + + JoyFeedbackArray(): + array_length(0), array(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = array_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->array[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t array_lengthT = *(inbuffer + offset++); + if(array_lengthT > array_length) + this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback)); + offset += 3; + array_length = array_lengthT; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->st_array.deserialize(inbuffer + offset); + memcpy( &(this->array[i]), &(this->st_array), sizeof(sensor_msgs::JoyFeedback)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedbackArray"; }; + const char * getMD5(){ return "cde5730a895b1fc4dee6f91b754b213d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/LaserEcho.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/LaserEcho.h new file mode 100755 index 0000000..8d48ba5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/LaserEcho.h @@ -0,0 +1,77 @@ +#ifndef _ROS_sensor_msgs_LaserEcho_h +#define _ROS_sensor_msgs_LaserEcho_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class LaserEcho : public ros::Msg + { + public: + uint8_t echoes_length; + float st_echoes; + float * echoes; + + LaserEcho(): + echoes_length(0), echoes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = echoes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_echoesi; + u_echoesi.real = this->echoes[i]; + *(outbuffer + offset + 0) = (u_echoesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_echoesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_echoesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_echoesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->echoes[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t echoes_lengthT = *(inbuffer + offset++); + if(echoes_lengthT > echoes_length) + this->echoes = (float*)realloc(this->echoes, echoes_lengthT * sizeof(float)); + offset += 3; + echoes_length = echoes_lengthT; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_st_echoes; + u_st_echoes.base = 0; + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_echoes = u_st_echoes.real; + offset += sizeof(this->st_echoes); + memcpy( &(this->echoes[i]), &(this->st_echoes), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserEcho"; }; + const char * getMD5(){ return "8bc5ae449b200fba4d552b4225586696"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/LaserScan.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/LaserScan.h new file mode 100755 index 0000000..8276622 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/LaserScan.h @@ -0,0 +1,282 @@ +#ifndef _ROS_sensor_msgs_LaserScan_h +#define _ROS_sensor_msgs_LaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class LaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + float st_ranges; + float * ranges; + uint8_t intensities_length; + float st_intensities; + float * intensities; + + LaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_rangesi; + u_rangesi.real = this->ranges[i]; + *(outbuffer + offset + 0) = (u_rangesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rangesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rangesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rangesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges[i]); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_intensitiesi; + u_intensitiesi.real = this->intensities[i]; + *(outbuffer + offset + 0) = (u_intensitiesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensitiesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensitiesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensitiesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (float*)realloc(this->ranges, ranges_lengthT * sizeof(float)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_st_ranges; + u_st_ranges.base = 0; + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ranges = u_st_ranges.real; + offset += sizeof(this->st_ranges); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(float)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (float*)realloc(this->intensities, intensities_lengthT * sizeof(float)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_st_intensities; + u_st_intensities.base = 0; + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_intensities = u_st_intensities.real; + offset += sizeof(this->st_intensities); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserScan"; }; + const char * getMD5(){ return "90c7ef2dc6895d81024acba2ac42f369"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MagneticField.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MagneticField.h new file mode 100755 index 0000000..b4a37c2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MagneticField.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sensor_msgs_MagneticField_h +#define _ROS_sensor_msgs_MagneticField_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class MagneticField : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 magnetic_field; + float magnetic_field_covariance[9]; + + MagneticField(): + header(), + magnetic_field(), + magnetic_field_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->magnetic_field.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->magnetic_field_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->magnetic_field.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->magnetic_field_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MagneticField"; }; + const char * getMD5(){ return "2f3b0b43eed0c9501de0fa3ff89a45aa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h new file mode 100755 index 0000000..af5ab91 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h @@ -0,0 +1,138 @@ +#ifndef _ROS_sensor_msgs_MultiDOFJointState_h +#define _ROS_sensor_msgs_MultiDOFJointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace sensor_msgs +{ + + class MultiDOFJointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + MultiDOFJointState(): + header(), + joint_names_length(0), joint_names(NULL), + transforms_length(0), transforms(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiDOFJointState"; }; + const char * getMD5(){ return "690f272f0640d2631c305eeb8301e59d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h new file mode 100755 index 0000000..142be5f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h @@ -0,0 +1,245 @@ +#ifndef _ROS_sensor_msgs_MultiEchoLaserScan_h +#define _ROS_sensor_msgs_MultiEchoLaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/LaserEcho.h" + +namespace sensor_msgs +{ + + class MultiEchoLaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + sensor_msgs::LaserEcho st_ranges; + sensor_msgs::LaserEcho * ranges; + uint8_t intensities_length; + sensor_msgs::LaserEcho st_intensities; + sensor_msgs::LaserEcho * intensities; + + MultiEchoLaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->ranges[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->intensities[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->st_ranges.deserialize(inbuffer + offset); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(sensor_msgs::LaserEcho)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->st_intensities.deserialize(inbuffer + offset); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(sensor_msgs::LaserEcho)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiEchoLaserScan"; }; + const char * getMD5(){ return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/NavSatFix.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/NavSatFix.h new file mode 100755 index 0000000..ba06e0c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/NavSatFix.h @@ -0,0 +1,78 @@ +#ifndef _ROS_sensor_msgs_NavSatFix_h +#define _ROS_sensor_msgs_NavSatFix_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/NavSatStatus.h" + +namespace sensor_msgs +{ + + class NavSatFix : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::NavSatStatus status; + float latitude; + float longitude; + float altitude; + float position_covariance[9]; + uint8_t position_covariance_type; + enum { COVARIANCE_TYPE_UNKNOWN = 0 }; + enum { COVARIANCE_TYPE_APPROXIMATED = 1 }; + enum { COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 }; + enum { COVARIANCE_TYPE_KNOWN = 3 }; + + NavSatFix(): + header(), + status(), + latitude(0), + longitude(0), + altitude(0), + position_covariance(), + position_covariance_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + offset += serializeAvrFloat64(outbuffer + offset, this->altitude); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position_covariance[i]); + } + *(outbuffer + offset + 0) = (this->position_covariance_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->position_covariance_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->altitude)); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position_covariance[i])); + } + this->position_covariance_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->position_covariance_type); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatFix"; }; + const char * getMD5(){ return "2d3a8cd499b9b4a0249fb98fd05cfa48"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/NavSatStatus.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/NavSatStatus.h new file mode 100755 index 0000000..f696571 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/NavSatStatus.h @@ -0,0 +1,71 @@ +#ifndef _ROS_sensor_msgs_NavSatStatus_h +#define _ROS_sensor_msgs_NavSatStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class NavSatStatus : public ros::Msg + { + public: + int8_t status; + uint16_t service; + enum { STATUS_NO_FIX = -1 }; + enum { STATUS_FIX = 0 }; + enum { STATUS_SBAS_FIX = 1 }; + enum { STATUS_GBAS_FIX = 2 }; + enum { SERVICE_GPS = 1 }; + enum { SERVICE_GLONASS = 2 }; + enum { SERVICE_COMPASS = 4 }; + enum { SERVICE_GALILEO = 8 }; + + NavSatStatus(): + status(0), + service(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.real = this->status; + *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; + offset += sizeof(this->service); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.base = 0; + u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->status = u_status.real; + offset += sizeof(this->status); + this->service = ((uint16_t) (*(inbuffer + offset))); + this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->service); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointCloud.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointCloud.h new file mode 100755 index 0000000..ce7f775 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointCloud.h @@ -0,0 +1,85 @@ +#ifndef _ROS_sensor_msgs_PointCloud_h +#define _ROS_sensor_msgs_PointCloud_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "sensor_msgs/ChannelFloat32.h" + +namespace sensor_msgs +{ + + class PointCloud : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + uint8_t channels_length; + sensor_msgs::ChannelFloat32 st_channels; + sensor_msgs::ChannelFloat32 * channels; + + PointCloud(): + header(), + points_length(0), points(NULL), + channels_length(0), channels(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = channels_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->channels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + uint8_t channels_lengthT = *(inbuffer + offset++); + if(channels_lengthT > channels_length) + this->channels = (sensor_msgs::ChannelFloat32*)realloc(this->channels, channels_lengthT * sizeof(sensor_msgs::ChannelFloat32)); + offset += 3; + channels_length = channels_lengthT; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->st_channels.deserialize(inbuffer + offset); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(sensor_msgs::ChannelFloat32)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud"; }; + const char * getMD5(){ return "d8e9c3f5afbdd8a130fd1d2763945fca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointCloud2.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointCloud2.h new file mode 100755 index 0000000..8b50802 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointCloud2.h @@ -0,0 +1,168 @@ +#ifndef _ROS_sensor_msgs_PointCloud2_h +#define _ROS_sensor_msgs_PointCloud2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointField.h" + +namespace sensor_msgs +{ + + class PointCloud2 : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + uint8_t fields_length; + sensor_msgs::PointField st_fields; + sensor_msgs::PointField * fields; + bool is_bigendian; + uint32_t point_step; + uint32_t row_step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + bool is_dense; + + PointCloud2(): + header(), + height(0), + width(0), + fields_length(0), fields(NULL), + is_bigendian(0), + point_step(0), + row_step(0), + data_length(0), data(NULL), + is_dense(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset++) = fields_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->fields[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.real = this->is_bigendian; + *(outbuffer + offset + 0) = (u_is_bigendian.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->point_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->point_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->point_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->point_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->point_step); + *(outbuffer + offset + 0) = (this->row_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->row_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->row_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->row_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->row_step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.real = this->is_dense; + *(outbuffer + offset + 0) = (u_is_dense.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_dense); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint8_t fields_lengthT = *(inbuffer + offset++); + if(fields_lengthT > fields_length) + this->fields = (sensor_msgs::PointField*)realloc(this->fields, fields_lengthT * sizeof(sensor_msgs::PointField)); + offset += 3; + fields_length = fields_lengthT; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->st_fields.deserialize(inbuffer + offset); + memcpy( &(this->fields[i]), &(this->st_fields), sizeof(sensor_msgs::PointField)); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.base = 0; + u_is_bigendian.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_bigendian = u_is_bigendian.real; + offset += sizeof(this->is_bigendian); + this->point_step = ((uint32_t) (*(inbuffer + offset))); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->point_step); + this->row_step = ((uint32_t) (*(inbuffer + offset))); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->row_step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.base = 0; + u_is_dense.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_dense = u_is_dense.real; + offset += sizeof(this->is_dense); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud2"; }; + const char * getMD5(){ return "1158d486dd51d683ce2f1be655c3c181"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointField.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointField.h new file mode 100755 index 0000000..5ef0d0e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/PointField.h @@ -0,0 +1,92 @@ +#ifndef _ROS_sensor_msgs_PointField_h +#define _ROS_sensor_msgs_PointField_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class PointField : public ros::Msg + { + public: + const char* name; + uint32_t offset; + uint8_t datatype; + uint32_t count; + enum { INT8 = 1 }; + enum { UINT8 = 2 }; + enum { INT16 = 3 }; + enum { UINT16 = 4 }; + enum { INT32 = 5 }; + enum { UINT32 = 6 }; + enum { FLOAT32 = 7 }; + enum { FLOAT64 = 8 }; + + PointField(): + name(""), + offset(0), + datatype(0), + count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->datatype >> (8 * 0)) & 0xFF; + offset += sizeof(this->datatype); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->count >> (8 * 3)) & 0xFF; + offset += sizeof(this->count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + this->offset = ((uint32_t) (*(inbuffer + offset))); + this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->offset); + this->datatype = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->datatype); + this->count = ((uint32_t) (*(inbuffer + offset))); + this->count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->count); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointField"; }; + const char * getMD5(){ return "268eacb2962780ceac86cbd17e328150"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Range.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Range.h new file mode 100755 index 0000000..a8ddcaa --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Range.h @@ -0,0 +1,143 @@ +#ifndef _ROS_sensor_msgs_Range_h +#define _ROS_sensor_msgs_Range_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Range : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t radiation_type; + float field_of_view; + float min_range; + float max_range; + float range; + enum { ULTRASOUND = 0 }; + enum { INFRARED = 1 }; + + Range(): + header(), + radiation_type(0), + field_of_view(0), + min_range(0), + max_range(0), + range(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->radiation_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.real = this->field_of_view; + *(outbuffer + offset + 0) = (u_field_of_view.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_field_of_view.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_field_of_view.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_field_of_view.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.real = this->min_range; + *(outbuffer + offset + 0) = (u_min_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.real = this->max_range; + *(outbuffer + offset + 0) = (u_max_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.real = this->range; + *(outbuffer + offset + 0) = (u_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->radiation_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.base = 0; + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->field_of_view = u_field_of_view.real; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.base = 0; + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_range = u_min_range.real; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.base = 0; + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_range = u_max_range.real; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.base = 0; + u_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range = u_range.real; + offset += sizeof(this->range); + return offset; + } + + const char * getType(){ return "sensor_msgs/Range"; }; + const char * getMD5(){ return "c005c34273dc426c67a020a87bc24148"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h new file mode 100755 index 0000000..ebdb9b3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h @@ -0,0 +1,103 @@ +#ifndef _ROS_sensor_msgs_RegionOfInterest_h +#define _ROS_sensor_msgs_RegionOfInterest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class RegionOfInterest : public ros::Msg + { + public: + uint32_t x_offset; + uint32_t y_offset; + uint32_t height; + uint32_t width; + bool do_rectify; + + RegionOfInterest(): + x_offset(0), + y_offset(0), + height(0), + width(0), + do_rectify(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->x_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->x_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->x_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->x_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->x_offset); + *(outbuffer + offset + 0) = (this->y_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->y_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->y_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->y_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->y_offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.real = this->do_rectify; + *(outbuffer + offset + 0) = (u_do_rectify.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->do_rectify); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->x_offset = ((uint32_t) (*(inbuffer + offset))); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->x_offset); + this->y_offset = ((uint32_t) (*(inbuffer + offset))); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->y_offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.base = 0; + u_do_rectify.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->do_rectify = u_do_rectify.real; + offset += sizeof(this->do_rectify); + return offset; + } + + const char * getType(){ return "sensor_msgs/RegionOfInterest"; }; + const char * getMD5(){ return "bdb633039d588fcccb441a4d43ccfe09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h new file mode 100755 index 0000000..2ec392a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_RelativeHumidity_h +#define _ROS_sensor_msgs_RelativeHumidity_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class RelativeHumidity : public ros::Msg + { + public: + std_msgs::Header header; + float relative_humidity; + float variance; + + RelativeHumidity(): + header(), + relative_humidity(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->relative_humidity); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->relative_humidity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/RelativeHumidity"; }; + const char * getMD5(){ return "8730015b05955b7e992ce29a2678d90f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h new file mode 100755 index 0000000..9f49b67 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetCameraInfo_h +#define _ROS_SERVICE_SetCameraInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" + +namespace sensor_msgs +{ + +static const char SETCAMERAINFO[] = "sensor_msgs/SetCameraInfo"; + + class SetCameraInfoRequest : public ros::Msg + { + public: + sensor_msgs::CameraInfo camera_info; + + SetCameraInfoRequest(): + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "ee34be01fdeee563d0d99cd594d5581d"; }; + + }; + + class SetCameraInfoResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetCameraInfoResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetCameraInfo { + public: + typedef SetCameraInfoRequest Request; + typedef SetCameraInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Temperature.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Temperature.h new file mode 100755 index 0000000..f630a39 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/Temperature.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_Temperature_h +#define _ROS_sensor_msgs_Temperature_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Temperature : public ros::Msg + { + public: + std_msgs::Header header; + float temperature; + float variance; + + Temperature(): + header(), + temperature(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Temperature"; }; + const char * getMD5(){ return "ff71b307acdbe7c871a5a6d7ed359100"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/TimeReference.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/TimeReference.h new file mode 100755 index 0000000..eab85e6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/sensor_msgs/TimeReference.h @@ -0,0 +1,82 @@ +#ifndef _ROS_sensor_msgs_TimeReference_h +#define _ROS_sensor_msgs_TimeReference_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace sensor_msgs +{ + + class TimeReference : public ros::Msg + { + public: + std_msgs::Header header; + ros::Time time_ref; + const char* source; + + TimeReference(): + header(), + time_ref(), + source("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_ref.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.sec); + *(outbuffer + offset + 0) = (this->time_ref.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.nsec); + uint32_t length_source = strlen(this->source); + memcpy(outbuffer + offset, &length_source, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source, length_source); + offset += length_source; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->time_ref.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.sec); + this->time_ref.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.nsec); + uint32_t length_source; + memcpy(&length_source, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source-1]=0; + this->source = (char *)(inbuffer + offset-1); + offset += length_source; + return offset; + } + + const char * getType(){ return "sensor_msgs/TimeReference"; }; + const char * getMD5(){ return "fded64a0265108ba86c3d38fb11c0c16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/Mesh.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/Mesh.h new file mode 100755 index 0000000..8a12baa --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/Mesh.h @@ -0,0 +1,80 @@ +#ifndef _ROS_shape_msgs_Mesh_h +#define _ROS_shape_msgs_Mesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/MeshTriangle.h" +#include "geometry_msgs/Point.h" + +namespace shape_msgs +{ + + class Mesh : public ros::Msg + { + public: + uint8_t triangles_length; + shape_msgs::MeshTriangle st_triangles; + shape_msgs::MeshTriangle * triangles; + uint8_t vertices_length; + geometry_msgs::Point st_vertices; + geometry_msgs::Point * vertices; + + Mesh(): + triangles_length(0), triangles(NULL), + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = triangles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->triangles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->vertices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t triangles_lengthT = *(inbuffer + offset++); + if(triangles_lengthT > triangles_length) + this->triangles = (shape_msgs::MeshTriangle*)realloc(this->triangles, triangles_lengthT * sizeof(shape_msgs::MeshTriangle)); + offset += 3; + triangles_length = triangles_lengthT; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->st_triangles.deserialize(inbuffer + offset); + memcpy( &(this->triangles[i]), &(this->st_triangles), sizeof(shape_msgs::MeshTriangle)); + } + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (geometry_msgs::Point*)realloc(this->vertices, vertices_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->st_vertices.deserialize(inbuffer + offset); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Mesh"; }; + const char * getMD5(){ return "1ffdae9486cd3316a121c578b47a85cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/MeshTriangle.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/MeshTriangle.h new file mode 100755 index 0000000..1cb7e99 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/MeshTriangle.h @@ -0,0 +1,54 @@ +#ifndef _ROS_shape_msgs_MeshTriangle_h +#define _ROS_shape_msgs_MeshTriangle_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class MeshTriangle : public ros::Msg + { + public: + uint32_t vertex_indices[3]; + + MeshTriangle(): + vertex_indices() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + for( uint8_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->vertex_indices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertex_indices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertex_indices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertex_indices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 3; i++){ + this->vertex_indices[i] = ((uint32_t) (*(inbuffer + offset))); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + const char * getType(){ return "shape_msgs/MeshTriangle"; }; + const char * getMD5(){ return "23688b2e6d2de3d32fe8af104a903253"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/Plane.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/Plane.h new file mode 100755 index 0000000..b6c4d77 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/Plane.h @@ -0,0 +1,46 @@ +#ifndef _ROS_shape_msgs_Plane_h +#define _ROS_shape_msgs_Plane_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class Plane : public ros::Msg + { + public: + float coef[4]; + + Plane(): + coef() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coef[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->coef[i])); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Plane"; }; + const char * getMD5(){ return "2c1b92ed8f31492f8e73f6a4a44ca796"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/SolidPrimitive.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/SolidPrimitive.h new file mode 100755 index 0000000..ba1974d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/shape_msgs/SolidPrimitive.h @@ -0,0 +1,76 @@ +#ifndef _ROS_shape_msgs_SolidPrimitive_h +#define _ROS_shape_msgs_SolidPrimitive_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class SolidPrimitive : public ros::Msg + { + public: + uint8_t type; + uint8_t dimensions_length; + float st_dimensions; + float * dimensions; + enum { BOX = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { CONE = 4 }; + enum { BOX_X = 0 }; + enum { BOX_Y = 1 }; + enum { BOX_Z = 2 }; + enum { SPHERE_RADIUS = 0 }; + enum { CYLINDER_HEIGHT = 0 }; + enum { CYLINDER_RADIUS = 1 }; + enum { CONE_HEIGHT = 0 }; + enum { CONE_RADIUS = 1 }; + + SolidPrimitive(): + type(0), + dimensions_length(0), dimensions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = dimensions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dimensions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t dimensions_lengthT = *(inbuffer + offset++); + if(dimensions_lengthT > dimensions_length) + this->dimensions = (float*)realloc(this->dimensions, dimensions_lengthT * sizeof(float)); + offset += 3; + dimensions_length = dimensions_lengthT; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_dimensions)); + memcpy( &(this->dimensions[i]), &(this->st_dimensions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/SolidPrimitive"; }; + const char * getMD5(){ return "d8f8cbc74c5ff283fca29569ccefb45d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h new file mode 100755 index 0000000..aa0b000 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h @@ -0,0 +1,102 @@ +#ifndef _ROS_smach_msgs_SmachContainerInitialStatusCmd_h +#define _ROS_smach_msgs_SmachContainerInitialStatusCmd_h + +#include +#include +#include +#include "ros/msg.h" + +namespace smach_msgs +{ + + class SmachContainerInitialStatusCmd : public ros::Msg + { + public: + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + const char* local_data; + + SmachContainerInitialStatusCmd(): + path(""), + initial_states_length(0), initial_states(NULL), + local_data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerInitialStatusCmd"; }; + const char * getMD5(){ return "45f8cf31fc29b829db77f23001f788d6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h new file mode 100755 index 0000000..73300de --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h @@ -0,0 +1,155 @@ +#ifndef _ROS_smach_msgs_SmachContainerStatus_h +#define _ROS_smach_msgs_SmachContainerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStatus : public ros::Msg + { + public: + std_msgs::Header header; + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + uint8_t active_states_length; + char* st_active_states; + char* * active_states; + const char* local_data; + const char* info; + + SmachContainerStatus(): + header(), + path(""), + initial_states_length(0), initial_states(NULL), + active_states_length(0), active_states(NULL), + local_data(""), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + *(outbuffer + offset++) = active_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_active_statesi = strlen(this->active_states[i]); + memcpy(outbuffer + offset, &length_active_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->active_states[i], length_active_statesi); + offset += length_active_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint8_t active_states_lengthT = *(inbuffer + offset++); + if(active_states_lengthT > active_states_length) + this->active_states = (char**)realloc(this->active_states, active_states_lengthT * sizeof(char*)); + offset += 3; + active_states_length = active_states_lengthT; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_st_active_states; + memcpy(&length_st_active_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_active_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_active_states-1]=0; + this->st_active_states = (char *)(inbuffer + offset-1); + offset += length_st_active_states; + memcpy( &(this->active_states[i]), &(this->st_active_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStatus"; }; + const char * getMD5(){ return "5ba2bb79ac19e3842d562a191f2a675b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h new file mode 100755 index 0000000..c03ed2e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h @@ -0,0 +1,219 @@ +#ifndef _ROS_smach_msgs_SmachContainerStructure_h +#define _ROS_smach_msgs_SmachContainerStructure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStructure : public ros::Msg + { + public: + std_msgs::Header header; + const char* path; + uint8_t children_length; + char* st_children; + char* * children; + uint8_t internal_outcomes_length; + char* st_internal_outcomes; + char* * internal_outcomes; + uint8_t outcomes_from_length; + char* st_outcomes_from; + char* * outcomes_from; + uint8_t outcomes_to_length; + char* st_outcomes_to; + char* * outcomes_to; + uint8_t container_outcomes_length; + char* st_container_outcomes; + char* * container_outcomes; + + SmachContainerStructure(): + header(), + path(""), + children_length(0), children(NULL), + internal_outcomes_length(0), internal_outcomes(NULL), + outcomes_from_length(0), outcomes_from(NULL), + outcomes_to_length(0), outcomes_to(NULL), + container_outcomes_length(0), container_outcomes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = children_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_childreni = strlen(this->children[i]); + memcpy(outbuffer + offset, &length_childreni, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->children[i], length_childreni); + offset += length_childreni; + } + *(outbuffer + offset++) = internal_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); + memcpy(outbuffer + offset, &length_internal_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); + offset += length_internal_outcomesi; + } + *(outbuffer + offset++) = outcomes_from_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); + memcpy(outbuffer + offset, &length_outcomes_fromi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); + offset += length_outcomes_fromi; + } + *(outbuffer + offset++) = outcomes_to_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); + memcpy(outbuffer + offset, &length_outcomes_toi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); + offset += length_outcomes_toi; + } + *(outbuffer + offset++) = container_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); + memcpy(outbuffer + offset, &length_container_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); + offset += length_container_outcomesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t children_lengthT = *(inbuffer + offset++); + if(children_lengthT > children_length) + this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); + offset += 3; + children_length = children_lengthT; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_st_children; + memcpy(&length_st_children, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_children; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_children-1]=0; + this->st_children = (char *)(inbuffer + offset-1); + offset += length_st_children; + memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); + } + uint8_t internal_outcomes_lengthT = *(inbuffer + offset++); + if(internal_outcomes_lengthT > internal_outcomes_length) + this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); + offset += 3; + internal_outcomes_length = internal_outcomes_lengthT; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_st_internal_outcomes; + memcpy(&length_st_internal_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_internal_outcomes-1]=0; + this->st_internal_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_internal_outcomes; + memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); + } + uint8_t outcomes_from_lengthT = *(inbuffer + offset++); + if(outcomes_from_lengthT > outcomes_from_length) + this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); + offset += 3; + outcomes_from_length = outcomes_from_lengthT; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_st_outcomes_from; + memcpy(&length_st_outcomes_from, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_from-1]=0; + this->st_outcomes_from = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_from; + memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); + } + uint8_t outcomes_to_lengthT = *(inbuffer + offset++); + if(outcomes_to_lengthT > outcomes_to_length) + this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); + offset += 3; + outcomes_to_length = outcomes_to_lengthT; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_st_outcomes_to; + memcpy(&length_st_outcomes_to, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_to-1]=0; + this->st_outcomes_to = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_to; + memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); + } + uint8_t container_outcomes_lengthT = *(inbuffer + offset++); + if(container_outcomes_lengthT > container_outcomes_length) + this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); + offset += 3; + container_outcomes_length = container_outcomes_lengthT; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_st_container_outcomes; + memcpy(&length_st_container_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_container_outcomes-1]=0; + this->st_container_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_container_outcomes; + memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; + const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Bool.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Bool.h new file mode 100755 index 0000000..1ec6d07 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Bool.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Bool_h +#define _ROS_std_msgs_Bool_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Bool : public ros::Msg + { + public: + bool data; + + Bool(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Bool"; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Byte.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Byte.h new file mode 100755 index 0000000..cbb1bc2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Byte.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Byte_h +#define _ROS_std_msgs_Byte_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Byte : public ros::Msg + { + public: + int8_t data; + + Byte(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Byte"; }; + const char * getMD5(){ return "ad736a2e8818154c487bb80fe42ce43b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/ByteMultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/ByteMultiArray.h new file mode 100755 index 0000000..a41a450 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/ByteMultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_ByteMultiArray_h +#define _ROS_std_msgs_ByteMultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class ByteMultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + ByteMultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/ByteMultiArray"; }; + const char * getMD5(){ return "70ea476cbcfd65ac2f68f3cda1e891fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Char.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Char.h new file mode 100755 index 0000000..977cc8b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Char.h @@ -0,0 +1,44 @@ +#ifndef _ROS_std_msgs_Char_h +#define _ROS_std_msgs_Char_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Char : public ros::Msg + { + public: + uint8_t data; + + Char(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Char"; }; + const char * getMD5(){ return "1bf77f25acecdedba0e224b162199717"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/ColorRGBA.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/ColorRGBA.h new file mode 100755 index 0000000..d458c91 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/ColorRGBA.h @@ -0,0 +1,130 @@ +#ifndef _ROS_std_msgs_ColorRGBA_h +#define _ROS_std_msgs_ColorRGBA_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class ColorRGBA : public ros::Msg + { + public: + float r; + float g; + float b; + float a; + + ColorRGBA(): + r(0), + g(0), + b(0), + a(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.real = this->r; + *(outbuffer + offset + 0) = (u_r.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.real = this->g; + *(outbuffer + offset + 0) = (u_g.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_g.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_g.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_g.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->a); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.base = 0; + u_r.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r = u_r.real; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.base = 0; + u_g.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->g = u_g.real; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->a = u_a.real; + offset += sizeof(this->a); + return offset; + } + + const char * getType(){ return "std_msgs/ColorRGBA"; }; + const char * getMD5(){ return "a29a96539573343b1310c73607334b00"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Duration.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Duration.h new file mode 100755 index 0000000..883a752 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Duration.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Duration_h +#define _ROS_std_msgs_Duration_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace std_msgs +{ + + class Duration : public ros::Msg + { + public: + ros::Duration data; + + Duration(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Duration"; }; + const char * getMD5(){ return "3e286caf4241d664e55f3ad380e2ae46"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Empty.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Empty.h new file mode 100755 index 0000000..440e5ed --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Empty.h @@ -0,0 +1,38 @@ +#ifndef _ROS_std_msgs_Empty_h +#define _ROS_std_msgs_Empty_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Empty : public ros::Msg + { + public: + + Empty() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "std_msgs/Empty"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float32.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float32.h new file mode 100755 index 0000000..b324c1b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float32.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Float32_h +#define _ROS_std_msgs_Float32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float32 : public ros::Msg + { + public: + float data; + + Float32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Float32"; }; + const char * getMD5(){ return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float32MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float32MultiArray.h new file mode 100755 index 0000000..51f9406 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float32MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Float32MultiArray_h +#define _ROS_std_msgs_Float32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float32MultiArray"; }; + const char * getMD5(){ return "6a40e0ffa6a17a503ac3f8616991b1f6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float64.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float64.h new file mode 100755 index 0000000..3cc9fd0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float64.h @@ -0,0 +1,42 @@ +#ifndef _ROS_std_msgs_Float64_h +#define _ROS_std_msgs_Float64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float64 : public ros::Msg + { + public: + float data; + + Float64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->data)); + return offset; + } + + const char * getType(){ return "std_msgs/Float64"; }; + const char * getMD5(){ return "fdb28210bfa9d7c91146260178d9a584"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float64MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float64MultiArray.h new file mode 100755 index 0000000..ab740b6 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Float64MultiArray.h @@ -0,0 +1,63 @@ +#ifndef _ROS_std_msgs_Float64MultiArray_h +#define _ROS_std_msgs_Float64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_data)); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float64MultiArray"; }; + const char * getMD5(){ return "4b7d974086d4060e7db4613a7e6c3ba4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Header.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Header.h new file mode 100755 index 0000000..2aa0f7f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Header.h @@ -0,0 +1,89 @@ +#ifndef _ROS_std_msgs_Header_h +#define _ROS_std_msgs_Header_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Header : public ros::Msg + { + public: + uint32_t seq; + ros::Time stamp; + const char* frame_id; + + Header(): + seq(0), + stamp(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq); + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->seq = ((uint32_t) (*(inbuffer + offset))); + this->seq |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->seq); + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + const char * getType(){ return "std_msgs/Header"; }; + const char * getMD5(){ return "2176decaecbce78abc3b96ef049fabed"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int16.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int16.h new file mode 100755 index 0000000..a83f7b2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int16.h @@ -0,0 +1,57 @@ +#ifndef _ROS_std_msgs_Int16_h +#define _ROS_std_msgs_Int16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int16 : public ros::Msg + { + public: + int16_t data; + + Int16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int16"; }; + const char * getMD5(){ return "8524586e34fbd7cb1c08c5f5f1ca0e57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int16MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int16MultiArray.h new file mode 100755 index 0000000..e70f4e2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int16MultiArray.h @@ -0,0 +1,78 @@ +#ifndef _ROS_std_msgs_Int16MultiArray_h +#define _ROS_std_msgs_Int16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int16_t st_data; + int16_t * data; + + Int16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int16MultiArray"; }; + const char * getMD5(){ return "d9338d7f523fcb692fae9d0a0e9f067c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int32.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int32.h new file mode 100755 index 0000000..a2a364f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int32.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Int32_h +#define _ROS_std_msgs_Int32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int32 : public ros::Msg + { + public: + int32_t data; + + Int32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int32"; }; + const char * getMD5(){ return "da5909fbe378aeaf85e547e830cc1bb7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int32MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int32MultiArray.h new file mode 100755 index 0000000..4df5ff5 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int32MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Int32MultiArray_h +#define _ROS_std_msgs_Int32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int32_t st_data; + int32_t * data; + + Int32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int32MultiArray"; }; + const char * getMD5(){ return "1d99f79f8b325b44fee908053e9c945b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int64.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int64.h new file mode 100755 index 0000000..4016081 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int64.h @@ -0,0 +1,69 @@ +#ifndef _ROS_std_msgs_Int64_h +#define _ROS_std_msgs_Int64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int64 : public ros::Msg + { + public: + int64_t data; + + Int64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_data.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_data.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_data.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_data.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int64"; }; + const char * getMD5(){ return "34add168574510e6e17f5d23ecc077ef"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int64MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int64MultiArray.h new file mode 100755 index 0000000..5733608 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int64MultiArray.h @@ -0,0 +1,90 @@ +#ifndef _ROS_std_msgs_Int64MultiArray_h +#define _ROS_std_msgs_Int64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int64_t st_data; + int64_t * data; + + Int64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int64MultiArray"; }; + const char * getMD5(){ return "54865aa6c65be0448113a2afc6a49270"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int8.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int8.h new file mode 100755 index 0000000..b02ef77 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int8.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Int8_h +#define _ROS_std_msgs_Int8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int8 : public ros::Msg + { + public: + int8_t data; + + Int8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int8"; }; + const char * getMD5(){ return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int8MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int8MultiArray.h new file mode 100755 index 0000000..7bf8c9b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Int8MultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_Int8MultiArray_h +#define _ROS_std_msgs_Int8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + Int8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int8MultiArray"; }; + const char * getMD5(){ return "d7c1af35a1b4781bbe79e03dd94b7c13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/MultiArrayDimension.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/MultiArrayDimension.h new file mode 100755 index 0000000..7cae4ba --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/MultiArrayDimension.h @@ -0,0 +1,78 @@ +#ifndef _ROS_std_msgs_MultiArrayDimension_h +#define _ROS_std_msgs_MultiArrayDimension_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class MultiArrayDimension : public ros::Msg + { + public: + const char* label; + uint32_t size; + uint32_t stride; + + MultiArrayDimension(): + label(""), + size(0), + stride(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_label = strlen(this->label); + memcpy(outbuffer + offset, &length_label, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + *(outbuffer + offset + 0) = (this->stride >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stride >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stride >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stride >> (8 * 3)) & 0xFF; + offset += sizeof(this->stride); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_label; + memcpy(&length_label, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + this->size = ((uint32_t) (*(inbuffer + offset))); + this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size); + this->stride = ((uint32_t) (*(inbuffer + offset))); + this->stride |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stride |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stride |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stride); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayDimension"; }; + const char * getMD5(){ return "4cd0c83a8683deae40ecdac60e53bfa8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/MultiArrayLayout.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/MultiArrayLayout.h new file mode 100755 index 0000000..a30ff41 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/MultiArrayLayout.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_MultiArrayLayout_h +#define _ROS_std_msgs_MultiArrayLayout_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayDimension.h" + +namespace std_msgs +{ + + class MultiArrayLayout : public ros::Msg + { + public: + uint8_t dim_length; + std_msgs::MultiArrayDimension st_dim; + std_msgs::MultiArrayDimension * dim; + uint32_t data_offset; + + MultiArrayLayout(): + dim_length(0), dim(NULL), + data_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = dim_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->dim[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->data_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t dim_lengthT = *(inbuffer + offset++); + if(dim_lengthT > dim_length) + this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); + offset += 3; + dim_length = dim_lengthT; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->st_dim.deserialize(inbuffer + offset); + memcpy( &(this->dim[i]), &(this->st_dim), sizeof(std_msgs::MultiArrayDimension)); + } + this->data_offset = ((uint32_t) (*(inbuffer + offset))); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_offset); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayLayout"; }; + const char * getMD5(){ return "0fed2a11c13e11c5571b4e2a995a91a3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/String.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/String.h new file mode 100755 index 0000000..f590500 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/String.h @@ -0,0 +1,54 @@ +#ifndef _ROS_std_msgs_String_h +#define _ROS_std_msgs_String_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class String : public ros::Msg + { + public: + const char* data; + + String(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "std_msgs/String"; }; + const char * getMD5(){ return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Time.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Time.h new file mode 100755 index 0000000..d87047b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/Time.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Time_h +#define _ROS_std_msgs_Time_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Time : public ros::Msg + { + public: + ros::Time data; + + Time(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Time"; }; + const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt16.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt16.h new file mode 100755 index 0000000..dd3c0cb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt16.h @@ -0,0 +1,46 @@ +#ifndef _ROS_std_msgs_UInt16_h +#define _ROS_std_msgs_UInt16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt16 : public ros::Msg + { + public: + uint16_t data; + + UInt16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint16_t) (*(inbuffer + offset))); + this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt16"; }; + const char * getMD5(){ return "1df79edf208b629fe6b81923a544552d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt16MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt16MultiArray.h new file mode 100755 index 0000000..28bc27d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt16MultiArray.h @@ -0,0 +1,67 @@ +#ifndef _ROS_std_msgs_UInt16MultiArray_h +#define _ROS_std_msgs_UInt16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint16_t st_data; + uint16_t * data; + + UInt16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint16_t*)realloc(this->data, data_lengthT * sizeof(uint16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint16_t) (*(inbuffer + offset))); + this->st_data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt16MultiArray"; }; + const char * getMD5(){ return "52f264f1c973c4b73790d384c6cb4484"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt32.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt32.h new file mode 100755 index 0000000..170208f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt32.h @@ -0,0 +1,50 @@ +#ifndef _ROS_std_msgs_UInt32_h +#define _ROS_std_msgs_UInt32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt32 : public ros::Msg + { + public: + uint32_t data; + + UInt32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint32_t) (*(inbuffer + offset))); + this->data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt32"; }; + const char * getMD5(){ return "304a39449588c7f8ce2df6e8001c5fce"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt32MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt32MultiArray.h new file mode 100755 index 0000000..8dd7e1b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt32MultiArray.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_UInt32MultiArray_h +#define _ROS_std_msgs_UInt32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint32_t st_data; + uint32_t * data; + + UInt32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint32_t) (*(inbuffer + offset))); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt32MultiArray"; }; + const char * getMD5(){ return "4d6a180abc9be191b96a7eda6c8a233d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt64.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt64.h new file mode 100755 index 0000000..d69b9fe --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt64.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_UInt64_h +#define _ROS_std_msgs_UInt64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt64 : public ros::Msg + { + public: + uint64_t data; + + UInt64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt64"; }; + const char * getMD5(){ return "1b2a79973e8bf53d7b53acb71299cb57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt64MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt64MultiArray.h new file mode 100755 index 0000000..5510abe --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt64MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_UInt64MultiArray_h +#define _ROS_std_msgs_UInt64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint64_t st_data; + uint64_t * data; + + UInt64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint64_t*)realloc(this->data, data_lengthT * sizeof(uint64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt64MultiArray"; }; + const char * getMD5(){ return "6088f127afb1d6c72927aa1247e945af"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt8.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt8.h new file mode 100755 index 0000000..15dbb6f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt8.h @@ -0,0 +1,44 @@ +#ifndef _ROS_std_msgs_UInt8_h +#define _ROS_std_msgs_UInt8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt8 : public ros::Msg + { + public: + uint8_t data; + + UInt8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt8"; }; + const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt8MultiArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt8MultiArray.h new file mode 100755 index 0000000..8a2a616 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_msgs/UInt8MultiArray.h @@ -0,0 +1,65 @@ +#ifndef _ROS_std_msgs_UInt8MultiArray_h +#define _ROS_std_msgs_UInt8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + UInt8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt8MultiArray"; }; + const char * getMD5(){ return "82373f1612381bb6ee473b5cd6f5d89c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/Empty.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/Empty.h new file mode 100755 index 0000000..b040dd2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char EMPTY[] = "std_srvs/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/SetBool.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/SetBool.h new file mode 100755 index 0000000..796485b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/SetBool.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_SetBool_h +#define _ROS_SERVICE_SetBool_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char SETBOOL[] = "std_srvs/SetBool"; + + class SetBoolRequest : public ros::Msg + { + public: + bool data; + + SetBoolRequest(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return SETBOOL; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + + class SetBoolResponse : public ros::Msg + { + public: + bool success; + const char* message; + + SetBoolResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return SETBOOL; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class SetBool { + public: + typedef SetBoolRequest Request; + typedef SetBoolResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/Trigger.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/Trigger.h new file mode 100755 index 0000000..958d2b8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/std_srvs/Trigger.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_Trigger_h +#define _ROS_SERVICE_Trigger_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char TRIGGER[] = "std_srvs/Trigger"; + + class TriggerRequest : public ros::Msg + { + public: + + TriggerRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TriggerResponse : public ros::Msg + { + public: + bool success; + const char* message; + + TriggerResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class Trigger { + public: + typedef TriggerRequest Request; + typedef TriggerResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/stereo_msgs/DisparityImage.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/stereo_msgs/DisparityImage.h new file mode 100755 index 0000000..53d557b --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/stereo_msgs/DisparityImage.h @@ -0,0 +1,168 @@ +#ifndef _ROS_stereo_msgs_DisparityImage_h +#define _ROS_stereo_msgs_DisparityImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace stereo_msgs +{ + + class DisparityImage : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::Image image; + float f; + float T; + sensor_msgs::RegionOfInterest valid_window; + float min_disparity; + float max_disparity; + float delta_d; + + DisparityImage(): + header(), + image(), + f(0), + T(0), + valid_window(), + min_disparity(0), + max_disparity(0), + delta_d(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.real = this->f; + *(outbuffer + offset + 0) = (u_f.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_f.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_f.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_f.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.real = this->T; + *(outbuffer + offset + 0) = (u_T.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_T.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_T.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_T.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->T); + offset += this->valid_window.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.real = this->min_disparity; + *(outbuffer + offset + 0) = (u_min_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.real = this->max_disparity; + *(outbuffer + offset + 0) = (u_max_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.real = this->delta_d; + *(outbuffer + offset + 0) = (u_delta_d.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delta_d.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delta_d.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delta_d.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delta_d); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.base = 0; + u_f.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->f = u_f.real; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.base = 0; + u_T.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->T = u_T.real; + offset += sizeof(this->T); + offset += this->valid_window.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.base = 0; + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_disparity = u_min_disparity.real; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.base = 0; + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_disparity = u_max_disparity.real; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.base = 0; + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delta_d = u_delta_d.real; + offset += sizeof(this->delta_d); + return offset; + } + + const char * getType(){ return "stereo_msgs/DisparityImage"; }; + const char * getMD5(){ return "04a177815f75271039fa21f16acad8c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/array_test/array_test.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/array_test/array_test.pde new file mode 100755 index 0000000..8aa72de --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/array_test/array_test.pde @@ -0,0 +1,49 @@ +/* + * rosserial::geometry_msgs::PoseArray Test + * Sums an array, publishes sum + */ + +#include +#include +#include + + +ros::NodeHandle nh; + + +bool set_; + + +geometry_msgs::Pose sum_msg; +ros::Publisher p("sum", &sum_msg); + +void messageCb(const geometry_msgs::PoseArray& msg){ + sum_msg.position.x = 0; + sum_msg.position.y = 0; + sum_msg.position.z = 0; + for(int i = 0; i < msg.poses_length; i++) + { + sum_msg.position.x += msg.poses[i].position.x; + sum_msg.position.y += msg.poses[i].position.y; + sum_msg.position.z += msg.poses[i].position.z; + } + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber s("poses",messageCb); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(s); + nh.advertise(p); +} + +void loop() +{ + p.publish(&sum_msg); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/float64_test/float64_test.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/float64_test/float64_test.pde new file mode 100755 index 0000000..41a6f4a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/float64_test/float64_test.pde @@ -0,0 +1,38 @@ +/* + * rosserial::std_msgs::Float64 Test + * Receives a Float64 input, subtracts 1.0, and publishes it + */ + +#include +#include + + +ros::NodeHandle nh; + +float x; + +void messageCb( const std_msgs::Float64& msg){ + x = msg.data - 1.0; + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +std_msgs::Float64 test; +ros::Subscriber s("your_topic", &messageCb); +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); + nh.subscribe(s); +} + +void loop() +{ + test.data = x; + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/time_test/time_test.pde b/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/time_test/time_test.pde new file mode 100755 index 0000000..c5fa739 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tests/time_test/time_test.pde @@ -0,0 +1,30 @@ +/* + * rosserial::std_msgs::Time Test + * Publishes current time + */ + +#include +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Time test; +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); +} + +void loop() +{ + test.data = nh.now(); + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/FrameGraph.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/FrameGraph.h new file mode 100755 index 0000000..b7d2f31 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/FrameGraph.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf +{ + +static const char FRAMEGRAPH[] = "tf/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* dot_graph; + + FrameGraphResponse(): + dot_graph("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_dot_graph = strlen(this->dot_graph); + memcpy(outbuffer + offset, &length_dot_graph, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->dot_graph, length_dot_graph); + offset += length_dot_graph; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_dot_graph; + memcpy(&length_dot_graph, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dot_graph; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dot_graph-1]=0; + this->dot_graph = (char *)(inbuffer + offset-1); + offset += length_dot_graph; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/tf.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/tf.h new file mode 100755 index 0000000..a2888e3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/tf.h @@ -0,0 +1,56 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TF_H_ +#define ROS_TF_H_ + +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + static inline geometry_msgs::Quaternion createQuaternionFromYaw(double yaw) + { + geometry_msgs::Quaternion q; + q.x = 0; + q.y = 0; + q.z = sin(yaw * 0.5); + q.w = cos(yaw * 0.5); + return q; + } + +} + +#endif + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/tfMessage.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/tfMessage.h new file mode 100755 index 0000000..e8b3eb7 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/tfMessage.h @@ -0,0 +1,59 @@ +#ifndef _ROS_tf_tfMessage_h +#define _ROS_tf_tfMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + class tfMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + tfMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf/tfMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/transform_broadcaster.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/transform_broadcaster.h new file mode 100755 index 0000000..817eaba --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf/transform_broadcaster.h @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TRANSFORM_BROADCASTER_H_ +#define ROS_TRANSFORM_BROADCASTER_H_ + +#include "tfMessage.h" + +namespace tf +{ + + class TransformBroadcaster + { + public: + TransformBroadcaster() : publisher_("/tf", &internal_msg) {} + + void init(ros::NodeHandle &nh) + { + nh.advertise(publisher_); + } + + void sendTransform(geometry_msgs::TransformStamped &transform) + { + internal_msg.transforms_length = 1; + internal_msg.transforms = &transform; + publisher_.publish(&internal_msg); + } + + private: + tf::tfMessage internal_msg; + ros::Publisher publisher_; + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/FrameGraph.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/FrameGraph.h new file mode 100755 index 0000000..a703dd2 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/FrameGraph.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + +static const char FRAMEGRAPH[] = "tf2_msgs/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* frame_yaml; + + FrameGraphResponse(): + frame_yaml("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_yaml = strlen(this->frame_yaml); + memcpy(outbuffer + offset, &length_frame_yaml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_yaml, length_frame_yaml); + offset += length_frame_yaml; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_yaml; + memcpy(&length_frame_yaml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_yaml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_yaml-1]=0; + this->frame_yaml = (char *)(inbuffer + offset-1); + offset += length_frame_yaml; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "437ea58e9463815a0d511c7326b686b0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h new file mode 100755 index 0000000..2a0178f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformAction_h +#define _ROS_tf2_msgs_LookupTransformAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "tf2_msgs/LookupTransformActionGoal.h" +#include "tf2_msgs/LookupTransformActionResult.h" +#include "tf2_msgs/LookupTransformActionFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformAction : public ros::Msg + { + public: + tf2_msgs::LookupTransformActionGoal action_goal; + tf2_msgs::LookupTransformActionResult action_result; + tf2_msgs::LookupTransformActionFeedback action_feedback; + + LookupTransformAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformAction"; }; + const char * getMD5(){ return "7ee01ba91a56c2245c610992dbaa3c37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h new file mode 100755 index 0000000..f0de7af --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionFeedback_h +#define _ROS_tf2_msgs_LookupTransformActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformFeedback feedback; + + LookupTransformActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h new file mode 100755 index 0000000..d668cd9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionGoal_h +#define _ROS_tf2_msgs_LookupTransformActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "tf2_msgs/LookupTransformGoal.h" + +namespace tf2_msgs +{ + + class LookupTransformActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + tf2_msgs::LookupTransformGoal goal; + + LookupTransformActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionGoal"; }; + const char * getMD5(){ return "f2e7bcdb75c847978d0351a13e699da5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h new file mode 100755 index 0000000..99298ff --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionResult_h +#define _ROS_tf2_msgs_LookupTransformActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformResult.h" + +namespace tf2_msgs +{ + + class LookupTransformActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformResult result; + + LookupTransformActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionResult"; }; + const char * getMD5(){ return "ac26ce75a41384fa8bb4dc10f491ab90"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h new file mode 100755 index 0000000..6be0748 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_tf2_msgs_LookupTransformFeedback_h +#define _ROS_tf2_msgs_LookupTransformFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class LookupTransformFeedback : public ros::Msg + { + public: + + LookupTransformFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h new file mode 100755 index 0000000..f498e45 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h @@ -0,0 +1,171 @@ +#ifndef _ROS_tf2_msgs_LookupTransformGoal_h +#define _ROS_tf2_msgs_LookupTransformGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace tf2_msgs +{ + + class LookupTransformGoal : public ros::Msg + { + public: + const char* target_frame; + const char* source_frame; + ros::Time source_time; + ros::Duration timeout; + ros::Time target_time; + const char* fixed_frame; + bool advanced; + + LookupTransformGoal(): + target_frame(""), + source_frame(""), + source_time(), + timeout(), + target_time(), + fixed_frame(""), + advanced(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_target_frame = strlen(this->target_frame); + memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + uint32_t length_source_frame = strlen(this->source_frame); + memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source_frame, length_source_frame); + offset += length_source_frame; + *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.sec); + *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.nsec); + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->target_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.sec); + *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame = strlen(this->fixed_frame); + memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.real = this->advanced; + *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->advanced); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_target_frame; + memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + uint32_t length_source_frame; + memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source_frame-1]=0; + this->source_frame = (char *)(inbuffer + offset-1); + offset += length_source_frame; + this->source_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.sec); + this->source_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.nsec); + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->target_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.sec); + this->target_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame; + memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_fixed_frame-1]=0; + this->fixed_frame = (char *)(inbuffer + offset-1); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.base = 0; + u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->advanced = u_advanced.real; + offset += sizeof(this->advanced); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformGoal"; }; + const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h new file mode 100755 index 0000000..6dbf6f4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h @@ -0,0 +1,48 @@ +#ifndef _ROS_tf2_msgs_LookupTransformResult_h +#define _ROS_tf2_msgs_LookupTransformResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" +#include "tf2_msgs/TF2Error.h" + +namespace tf2_msgs +{ + + class LookupTransformResult : public ros::Msg + { + public: + geometry_msgs::TransformStamped transform; + tf2_msgs::TF2Error error; + + LookupTransformResult(): + transform(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->transform.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->transform.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformResult"; }; + const char * getMD5(){ return "3fe5db6a19ca9cfb675418c5ad875c36"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/TF2Error.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/TF2Error.h new file mode 100755 index 0000000..0fc1a7f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/TF2Error.h @@ -0,0 +1,67 @@ +#ifndef _ROS_tf2_msgs_TF2Error_h +#define _ROS_tf2_msgs_TF2Error_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class TF2Error : public ros::Msg + { + public: + uint8_t error; + const char* error_string; + enum { NO_ERROR = 0 }; + enum { LOOKUP_ERROR = 1 }; + enum { CONNECTIVITY_ERROR = 2 }; + enum { EXTRAPOLATION_ERROR = 3 }; + enum { INVALID_ARGUMENT_ERROR = 4 }; + enum { TIMEOUT_ERROR = 5 }; + enum { TRANSFORM_ERROR = 6 }; + + TF2Error(): + error(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "tf2_msgs/TF2Error"; }; + const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/TFMessage.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/TFMessage.h new file mode 100755 index 0000000..d358efa --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/tf2_msgs/TFMessage.h @@ -0,0 +1,59 @@ +#ifndef _ROS_tf2_msgs_TFMessage_h +#define _ROS_tf2_msgs_TFMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_msgs +{ + + class TFMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + TFMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf2_msgs/TFMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/theora_image_transport/Packet.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/theora_image_transport/Packet.h new file mode 100755 index 0000000..85127b9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/theora_image_transport/Packet.h @@ -0,0 +1,173 @@ +#ifndef _ROS_theora_image_transport_Packet_h +#define _ROS_theora_image_transport_Packet_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace theora_image_transport +{ + + class Packet : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + int32_t b_o_s; + int32_t e_o_s; + int64_t granulepos; + int64_t packetno; + + Packet(): + header(), + data_length(0), data(NULL), + b_o_s(0), + e_o_s(0), + granulepos(0), + packetno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.real = this->b_o_s; + *(outbuffer + offset + 0) = (u_b_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.real = this->e_o_s; + *(outbuffer + offset + 0) = (u_e_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_e_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_e_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_e_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.real = this->granulepos; + *(outbuffer + offset + 0) = (u_granulepos.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_granulepos.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_granulepos.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_granulepos.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_granulepos.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_granulepos.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_granulepos.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_granulepos.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.real = this->packetno; + *(outbuffer + offset + 0) = (u_packetno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_packetno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_packetno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_packetno.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_packetno.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_packetno.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_packetno.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_packetno.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->packetno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.base = 0; + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b_o_s = u_b_o_s.real; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.base = 0; + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->e_o_s = u_e_o_s.real; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.base = 0; + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->granulepos = u_granulepos.real; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.base = 0; + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->packetno = u_packetno.real; + offset += sizeof(this->packetno); + return offset; + } + + const char * getType(){ return "theora_image_transport/Packet"; }; + const char * getMD5(){ return "33ac4e14a7cff32e7e0d65f18bb410f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/time.cpp b/case_study/arduino_lab/group_07/original/lib/ros_lib/time.cpp new file mode 100755 index 0000000..9341196 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/time.cpp @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ros/time.h" + +namespace ros +{ + void normalizeSecNSec(uint32_t& sec, uint32_t& nsec){ + uint32_t nsec_part= nsec % 1000000000UL; + uint32_t sec_part = nsec / 1000000000UL; + sec += sec_part; + nsec = nsec_part; + } + + Time& Time::fromNSec(int32_t t) + { + sec = t / 1000000000; + nsec = t % 1000000000; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator +=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator -=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } +} diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxAdd.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxAdd.h new file mode 100755 index 0000000..269912e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxAdd.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_DemuxAdd_h +#define _ROS_SERVICE_DemuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXADD[] = "topic_tools/DemuxAdd"; + + class DemuxAddRequest : public ros::Msg + { + public: + const char* topic; + + DemuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxAddResponse : public ros::Msg + { + public: + + DemuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxAdd { + public: + typedef DemuxAddRequest Request; + typedef DemuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxDelete.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxDelete.h new file mode 100755 index 0000000..af15d3a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxDelete.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_DemuxDelete_h +#define _ROS_SERVICE_DemuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXDELETE[] = "topic_tools/DemuxDelete"; + + class DemuxDeleteRequest : public ros::Msg + { + public: + const char* topic; + + DemuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxDeleteResponse : public ros::Msg + { + public: + + DemuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxDelete { + public: + typedef DemuxDeleteRequest Request; + typedef DemuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxList.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxList.h new file mode 100755 index 0000000..5d0beb9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_DemuxList_h +#define _ROS_SERVICE_DemuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXLIST[] = "topic_tools/DemuxList"; + + class DemuxListRequest : public ros::Msg + { + public: + + DemuxListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + DemuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class DemuxList { + public: + typedef DemuxListRequest Request; + typedef DemuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxSelect.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxSelect.h new file mode 100755 index 0000000..449a387 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/DemuxSelect.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_DemuxSelect_h +#define _ROS_SERVICE_DemuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXSELECT[] = "topic_tools/DemuxSelect"; + + class DemuxSelectRequest : public ros::Msg + { + public: + const char* topic; + + DemuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + DemuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class DemuxSelect { + public: + typedef DemuxSelectRequest Request; + typedef DemuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxAdd.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxAdd.h new file mode 100755 index 0000000..92ffe35 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxAdd.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_MuxAdd_h +#define _ROS_SERVICE_MuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXADD[] = "topic_tools/MuxAdd"; + + class MuxAddRequest : public ros::Msg + { + public: + const char* topic; + + MuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxAddResponse : public ros::Msg + { + public: + + MuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxAdd { + public: + typedef MuxAddRequest Request; + typedef MuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxDelete.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxDelete.h new file mode 100755 index 0000000..b624e7a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxDelete.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_MuxDelete_h +#define _ROS_SERVICE_MuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXDELETE[] = "topic_tools/MuxDelete"; + + class MuxDeleteRequest : public ros::Msg + { + public: + const char* topic; + + MuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxDeleteResponse : public ros::Msg + { + public: + + MuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxDelete { + public: + typedef MuxDeleteRequest Request; + typedef MuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxList.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxList.h new file mode 100755 index 0000000..011c179 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_MuxList_h +#define _ROS_SERVICE_MuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXLIST[] = "topic_tools/MuxList"; + + class MuxListRequest : public ros::Msg + { + public: + + MuxListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + MuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class MuxList { + public: + typedef MuxListRequest Request; + typedef MuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxSelect.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxSelect.h new file mode 100755 index 0000000..b883b8e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/topic_tools/MuxSelect.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_MuxSelect_h +#define _ROS_SERVICE_MuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXSELECT[] = "topic_tools/MuxSelect"; + + class MuxSelectRequest : public ros::Msg + { + public: + const char* topic; + + MuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + MuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class MuxSelect { + public: + typedef MuxSelectRequest Request; + typedef MuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h new file mode 100755 index 0000000..13a4f3c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectory_h +#define _ROS_trajectory_msgs_JointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class JointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::JointTrajectoryPoint st_points; + trajectory_msgs::JointTrajectoryPoint * points; + + JointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::JointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectory"; }; + const char * getMD5(){ return "65b4f94a94d1ed67169da35a02f33d3f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h new file mode 100755 index 0000000..20b40e4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h @@ -0,0 +1,141 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectoryPoint_h +#define _ROS_trajectory_msgs_JointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class JointTrajectoryPoint : public ros::Msg + { + public: + uint8_t positions_length; + float st_positions; + float * positions; + uint8_t velocities_length; + float st_velocities; + float * velocities; + uint8_t accelerations_length; + float st_accelerations; + float * accelerations; + uint8_t effort_length; + float st_effort; + float * effort; + ros::Duration time_from_start; + + JointTrajectoryPoint(): + positions_length(0), positions(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + effort_length(0), effort(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->positions[i]); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accelerations[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t positions_lengthT = *(inbuffer + offset++); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + offset += 3; + positions_length = positions_lengthT; + for( uint8_t i = 0; i < positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_positions)); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_accelerations)); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectoryPoint"; }; + const char * getMD5(){ return "f3cd1e1c4d320c79d6985c904ae5dcd3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h new file mode 100755 index 0000000..dcecf64 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectory_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/MultiDOFJointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::MultiDOFJointTrajectoryPoint st_points; + trajectory_msgs::MultiDOFJointTrajectoryPoint * points; + + MultiDOFJointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::MultiDOFJointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectory"; }; + const char * getMD5(){ return "ef145a45a5f47b77b7f5cdde4b16c942"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h new file mode 100755 index 0000000..d665acd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h @@ -0,0 +1,123 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectoryPoint : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t velocities_length; + geometry_msgs::Twist st_velocities; + geometry_msgs::Twist * velocities; + uint8_t accelerations_length; + geometry_msgs::Twist st_accelerations; + geometry_msgs::Twist * accelerations; + ros::Duration time_from_start; + + MultiDOFJointTrajectoryPoint(): + transforms_length(0), transforms(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->velocities[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->accelerations[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (geometry_msgs::Twist*)realloc(this->velocities, velocities_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->st_velocities.deserialize(inbuffer + offset); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(geometry_msgs::Twist)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (geometry_msgs::Twist*)realloc(this->accelerations, accelerations_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->st_accelerations.deserialize(inbuffer + offset); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(geometry_msgs::Twist)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectoryPoint"; }; + const char * getMD5(){ return "3ebe08d1abd5b65862d50e09430db776"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeAction.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeAction.h new file mode 100755 index 0000000..76a28dd --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeAction_h +#define _ROS_turtle_actionlib_ShapeAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "turtle_actionlib/ShapeActionGoal.h" +#include "turtle_actionlib/ShapeActionResult.h" +#include "turtle_actionlib/ShapeActionFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeAction : public ros::Msg + { + public: + turtle_actionlib::ShapeActionGoal action_goal; + turtle_actionlib::ShapeActionResult action_result; + turtle_actionlib::ShapeActionFeedback action_feedback; + + ShapeAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeAction"; }; + const char * getMD5(){ return "d73b17d6237a925511f5d7727a1dc903"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h new file mode 100755 index 0000000..f6186e3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionFeedback_h +#define _ROS_turtle_actionlib_ShapeActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeFeedback feedback; + + ShapeActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h new file mode 100755 index 0000000..1d205cc --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionGoal_h +#define _ROS_turtle_actionlib_ShapeActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "turtle_actionlib/ShapeGoal.h" + +namespace turtle_actionlib +{ + + class ShapeActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + turtle_actionlib::ShapeGoal goal; + + ShapeActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionGoal"; }; + const char * getMD5(){ return "dbfccd187f2ec9c593916447ffd6cc77"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h new file mode 100755 index 0000000..e60375a --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionResult_h +#define _ROS_turtle_actionlib_ShapeActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeResult.h" + +namespace turtle_actionlib +{ + + class ShapeActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeResult result; + + ShapeActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionResult"; }; + const char * getMD5(){ return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h new file mode 100755 index 0000000..6c00c07 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_turtle_actionlib_ShapeFeedback_h +#define _ROS_turtle_actionlib_ShapeFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeFeedback : public ros::Msg + { + public: + + ShapeFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h new file mode 100755 index 0000000..0e1f10d --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_ShapeGoal_h +#define _ROS_turtle_actionlib_ShapeGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeGoal : public ros::Msg + { + public: + int32_t edges; + float radius; + + ShapeGoal(): + edges(0), + radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.real = this->edges; + *(outbuffer + offset + 0) = (u_edges.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_edges.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_edges.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_edges.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.real = this->radius; + *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.base = 0; + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->edges = u_edges.real; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.base = 0; + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->radius = u_radius.real; + offset += sizeof(this->radius); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeGoal"; }; + const char * getMD5(){ return "3b9202ab7292cebe5a95ab2bf6b9c091"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeResult.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeResult.h new file mode 100755 index 0000000..164f65c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/ShapeResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_ShapeResult_h +#define _ROS_turtle_actionlib_ShapeResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeResult : public ros::Msg + { + public: + float interior_angle; + float apothem; + + ShapeResult(): + interior_angle(0), + apothem(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.real = this->interior_angle; + *(outbuffer + offset + 0) = (u_interior_angle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_interior_angle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_interior_angle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_interior_angle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.real = this->apothem; + *(outbuffer + offset + 0) = (u_apothem.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_apothem.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_apothem.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_apothem.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->apothem); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.base = 0; + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->interior_angle = u_interior_angle.real; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.base = 0; + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->apothem = u_apothem.real; + offset += sizeof(this->apothem); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeResult"; }; + const char * getMD5(){ return "b06c6e2225f820dbc644270387cd1a7c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/Velocity.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/Velocity.h new file mode 100755 index 0000000..5105eb3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtle_actionlib/Velocity.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_Velocity_h +#define _ROS_turtle_actionlib_Velocity_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class Velocity : public ros::Msg + { + public: + float linear; + float angular; + + Velocity(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return "turtle_actionlib/Velocity"; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Color.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Color.h new file mode 100755 index 0000000..90ed1fb --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Color.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtlesim_Color_h +#define _ROS_turtlesim_Color_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Color : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + + Color(): + r(0), + g(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "turtlesim/Color"; }; + const char * getMD5(){ return "353891e354491c51aabe32df673fb446"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Kill.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Kill.h new file mode 100755 index 0000000..c7011bf --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Kill.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_Kill_h +#define _ROS_SERVICE_Kill_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char KILL[] = "turtlesim/Kill"; + + class KillRequest : public ros::Msg + { + public: + const char* name; + + KillRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class KillResponse : public ros::Msg + { + public: + + KillResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Kill { + public: + typedef KillRequest Request; + typedef KillResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Pose.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Pose.h new file mode 100755 index 0000000..a0ab8d8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Pose.h @@ -0,0 +1,153 @@ +#ifndef _ROS_turtlesim_Pose_h +#define _ROS_turtlesim_Pose_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Pose : public ros::Msg + { + public: + float x; + float y; + float theta; + float linear_velocity; + float angular_velocity; + + Pose(): + x(0), + y(0), + theta(0), + linear_velocity(0), + angular_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.real = this->linear_velocity; + *(outbuffer + offset + 0) = (u_linear_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.real = this->angular_velocity; + *(outbuffer + offset + 0) = (u_angular_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.base = 0; + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear_velocity = u_linear_velocity.real; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.base = 0; + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular_velocity = u_angular_velocity.real; + offset += sizeof(this->angular_velocity); + return offset; + } + + const char * getType(){ return "turtlesim/Pose"; }; + const char * getMD5(){ return "863b248d5016ca62ea2e895ae5265cf9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/SetPen.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/SetPen.h new file mode 100755 index 0000000..0759f05 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/SetPen.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetPen_h +#define _ROS_SERVICE_SetPen_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SETPEN[] = "turtlesim/SetPen"; + + class SetPenRequest : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t width; + uint8_t off; + + SetPenRequest(): + r(0), + g(0), + b(0), + width(0), + off(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->off >> (8 * 0)) & 0xFF; + offset += sizeof(this->off); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + this->width = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->width); + this->off = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->off); + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "9f452acce566bf0c0954594f69a8e41b"; }; + + }; + + class SetPenResponse : public ros::Msg + { + public: + + SetPenResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPen { + public: + typedef SetPenRequest Request; + typedef SetPenResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Spawn.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Spawn.h new file mode 100755 index 0000000..416fa95 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/Spawn.h @@ -0,0 +1,171 @@ +#ifndef _ROS_SERVICE_Spawn_h +#define _ROS_SERVICE_Spawn_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SPAWN[] = "turtlesim/Spawn"; + + class SpawnRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + const char* name; + + SpawnRequest(): + x(0), + y(0), + theta(0), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "57f001c49ab7b11d699f8606c1f4f7ff"; }; + + }; + + class SpawnResponse : public ros::Msg + { + public: + const char* name; + + SpawnResponse(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class Spawn { + public: + typedef SpawnRequest Request; + typedef SpawnResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/TeleportAbsolute.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/TeleportAbsolute.h new file mode 100755 index 0000000..a75f19e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/TeleportAbsolute.h @@ -0,0 +1,139 @@ +#ifndef _ROS_SERVICE_TeleportAbsolute_h +#define _ROS_SERVICE_TeleportAbsolute_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; + + class TeleportAbsoluteRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + + TeleportAbsoluteRequest(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "a130bc60ee6513855dc62ea83fcc5b20"; }; + + }; + + class TeleportAbsoluteResponse : public ros::Msg + { + public: + + TeleportAbsoluteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportAbsolute { + public: + typedef TeleportAbsoluteRequest Request; + typedef TeleportAbsoluteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/TeleportRelative.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/TeleportRelative.h new file mode 100755 index 0000000..7df40d9 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/turtlesim/TeleportRelative.h @@ -0,0 +1,116 @@ +#ifndef _ROS_SERVICE_TeleportRelative_h +#define _ROS_SERVICE_TeleportRelative_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTRELATIVE[] = "turtlesim/TeleportRelative"; + + class TeleportRelativeRequest : public ros::Msg + { + public: + float linear; + float angular; + + TeleportRelativeRequest(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + + class TeleportRelativeResponse : public ros::Msg + { + public: + + TeleportRelativeResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportRelative { + public: + typedef TeleportRelativeRequest Request; + typedef TeleportRelativeResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/ImageMarker.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/ImageMarker.h new file mode 100755 index 0000000..008ee8e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/ImageMarker.h @@ -0,0 +1,241 @@ +#ifndef _ROS_visualization_msgs_ImageMarker_h +#define _ROS_visualization_msgs_ImageMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace visualization_msgs +{ + + class ImageMarker : public ros::Msg + { + public: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Point position; + float scale; + std_msgs::ColorRGBA outline_color; + uint8_t filled; + std_msgs::ColorRGBA fill_color; + ros::Duration lifetime; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t outline_colors_length; + std_msgs::ColorRGBA st_outline_colors; + std_msgs::ColorRGBA * outline_colors; + enum { CIRCLE = 0 }; + enum { LINE_STRIP = 1 }; + enum { LINE_LIST = 2 }; + enum { POLYGON = 3 }; + enum { POINTS = 4 }; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + + ImageMarker(): + header(), + ns(""), + id(0), + type(0), + action(0), + position(), + scale(0), + outline_color(), + filled(0), + fill_color(), + lifetime(), + points_length(0), points(NULL), + outline_colors_length(0), outline_colors(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->position.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + offset += this->outline_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->filled >> (8 * 0)) & 0xFF; + offset += sizeof(this->filled); + offset += this->fill_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = outline_colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->position.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + offset += this->outline_color.deserialize(inbuffer + offset); + this->filled = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->filled); + offset += this->fill_color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t outline_colors_lengthT = *(inbuffer + offset++); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + outline_colors_length = outline_colors_lengthT; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->st_outline_colors.deserialize(inbuffer + offset); + memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/ImageMarker"; }; + const char * getMD5(){ return "1de93c67ec8858b831025a08fbf1b35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h new file mode 100755 index 0000000..97f9510 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h @@ -0,0 +1,145 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarker_h +#define _ROS_visualization_msgs_InteractiveMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "visualization_msgs/MenuEntry.h" +#include "visualization_msgs/InteractiveMarkerControl.h" + +namespace visualization_msgs +{ + + class InteractiveMarker : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + const char* description; + float scale; + uint8_t menu_entries_length; + visualization_msgs::MenuEntry st_menu_entries; + visualization_msgs::MenuEntry * menu_entries; + uint8_t controls_length; + visualization_msgs::InteractiveMarkerControl st_controls; + visualization_msgs::InteractiveMarkerControl * controls; + + InteractiveMarker(): + header(), + pose(), + name(""), + description(""), + scale(0), + menu_entries_length(0), menu_entries(NULL), + controls_length(0), controls(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + *(outbuffer + offset++) = menu_entries_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->menu_entries[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = controls_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->controls[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + uint8_t menu_entries_lengthT = *(inbuffer + offset++); + if(menu_entries_lengthT > menu_entries_length) + this->menu_entries = (visualization_msgs::MenuEntry*)realloc(this->menu_entries, menu_entries_lengthT * sizeof(visualization_msgs::MenuEntry)); + offset += 3; + menu_entries_length = menu_entries_lengthT; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->st_menu_entries.deserialize(inbuffer + offset); + memcpy( &(this->menu_entries[i]), &(this->st_menu_entries), sizeof(visualization_msgs::MenuEntry)); + } + uint8_t controls_lengthT = *(inbuffer + offset++); + if(controls_lengthT > controls_length) + this->controls = (visualization_msgs::InteractiveMarkerControl*)realloc(this->controls, controls_lengthT * sizeof(visualization_msgs::InteractiveMarkerControl)); + offset += 3; + controls_length = controls_lengthT; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->st_controls.deserialize(inbuffer + offset); + memcpy( &(this->controls[i]), &(this->st_controls), sizeof(visualization_msgs::InteractiveMarkerControl)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarker"; }; + const char * getMD5(){ return "311bd5f6cd6a20820ac0ba84315f4e22"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h new file mode 100755 index 0000000..1c2cef0 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h @@ -0,0 +1,155 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerControl_h +#define _ROS_visualization_msgs_InteractiveMarkerControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Quaternion.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerControl : public ros::Msg + { + public: + const char* name; + geometry_msgs::Quaternion orientation; + uint8_t orientation_mode; + uint8_t interaction_mode; + bool always_visible; + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + bool independent_marker_orientation; + const char* description; + enum { INHERIT = 0 }; + enum { FIXED = 1 }; + enum { VIEW_FACING = 2 }; + enum { NONE = 0 }; + enum { MENU = 1 }; + enum { BUTTON = 2 }; + enum { MOVE_AXIS = 3 }; + enum { MOVE_PLANE = 4 }; + enum { ROTATE_AXIS = 5 }; + enum { MOVE_ROTATE = 6 }; + enum { MOVE_3D = 7 }; + enum { ROTATE_3D = 8 }; + enum { MOVE_ROTATE_3D = 9 }; + + InteractiveMarkerControl(): + name(""), + orientation(), + orientation_mode(0), + interaction_mode(0), + always_visible(0), + markers_length(0), markers(NULL), + independent_marker_orientation(0), + description("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += this->orientation.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->orientation_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->orientation_mode); + *(outbuffer + offset + 0) = (this->interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.real = this->always_visible; + *(outbuffer + offset + 0) = (u_always_visible.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->always_visible); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.real = this->independent_marker_orientation; + *(outbuffer + offset + 0) = (u_independent_marker_orientation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += this->orientation.deserialize(inbuffer + offset); + this->orientation_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->orientation_mode); + this->interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.base = 0; + u_always_visible.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->always_visible = u_always_visible.real; + offset += sizeof(this->always_visible); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.base = 0; + u_independent_marker_orientation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->independent_marker_orientation = u_independent_marker_orientation.real; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerControl"; }; + const char * getMD5(){ return "e3a939c98cdd4f709d8e1dec2a9c3f37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h new file mode 100755 index 0000000..7cdd2c3 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h @@ -0,0 +1,142 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerFeedback_h +#define _ROS_visualization_msgs_InteractiveMarkerFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerFeedback : public ros::Msg + { + public: + std_msgs::Header header; + const char* client_id; + const char* marker_name; + const char* control_name; + uint8_t event_type; + geometry_msgs::Pose pose; + uint32_t menu_entry_id; + geometry_msgs::Point mouse_point; + bool mouse_point_valid; + enum { KEEP_ALIVE = 0 }; + enum { POSE_UPDATE = 1 }; + enum { MENU_SELECT = 2 }; + enum { BUTTON_CLICK = 3 }; + enum { MOUSE_DOWN = 4 }; + enum { MOUSE_UP = 5 }; + + InteractiveMarkerFeedback(): + header(), + client_id(""), + marker_name(""), + control_name(""), + event_type(0), + pose(), + menu_entry_id(0), + mouse_point(), + mouse_point_valid(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_client_id = strlen(this->client_id); + memcpy(outbuffer + offset, &length_client_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->client_id, length_client_id); + offset += length_client_id; + uint32_t length_marker_name = strlen(this->marker_name); + memcpy(outbuffer + offset, &length_marker_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + uint32_t length_control_name = strlen(this->control_name); + memcpy(outbuffer + offset, &length_control_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->control_name, length_control_name); + offset += length_control_name; + *(outbuffer + offset + 0) = (this->event_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->event_type); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->menu_entry_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menu_entry_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menu_entry_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menu_entry_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.real = this->mouse_point_valid; + *(outbuffer + offset + 0) = (u_mouse_point_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_client_id; + memcpy(&length_client_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client_id-1]=0; + this->client_id = (char *)(inbuffer + offset-1); + offset += length_client_id; + uint32_t length_marker_name; + memcpy(&length_marker_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + uint32_t length_control_name; + memcpy(&length_control_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_control_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_control_name-1]=0; + this->control_name = (char *)(inbuffer + offset-1); + offset += length_control_name; + this->event_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->event_type); + offset += this->pose.deserialize(inbuffer + offset); + this->menu_entry_id = ((uint32_t) (*(inbuffer + offset))); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.base = 0; + u_mouse_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mouse_point_valid = u_mouse_point_valid.real; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerFeedback"; }; + const char * getMD5(){ return "ab0f1eee058667e28c19ff3ffc3f4b78"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h new file mode 100755 index 0000000..656df9e --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h @@ -0,0 +1,98 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerInit_h +#define _ROS_visualization_msgs_InteractiveMarkerInit_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerInit : public ros::Msg + { + public: + const char* server_id; + uint64_t seq_num; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + + InteractiveMarkerInit(): + server_id(""), + seq_num(0), + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerInit"; }; + const char * getMD5(){ return "aa2f1dcea79533d1710675195653028d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h new file mode 100755 index 0000000..b94dc8f --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h @@ -0,0 +1,64 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerPose_h +#define _ROS_visualization_msgs_InteractiveMarkerPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerPose : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + + InteractiveMarkerPose(): + header(), + pose(), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerPose"; }; + const char * getMD5(){ return "a6e6833209a196a38d798dadb02c81f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h new file mode 100755 index 0000000..d24ea0c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h @@ -0,0 +1,159 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerUpdate_h +#define _ROS_visualization_msgs_InteractiveMarkerUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" +#include "visualization_msgs/InteractiveMarkerPose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerUpdate : public ros::Msg + { + public: + const char* server_id; + uint64_t seq_num; + uint8_t type; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + uint8_t poses_length; + visualization_msgs::InteractiveMarkerPose st_poses; + visualization_msgs::InteractiveMarkerPose * poses; + uint8_t erases_length; + char* st_erases; + char* * erases; + enum { KEEP_ALIVE = 0 }; + enum { UPDATE = 1 }; + + InteractiveMarkerUpdate(): + server_id(""), + seq_num(0), + type(0), + markers_length(0), markers(NULL), + poses_length(0), poses(NULL), + erases_length(0), erases(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = erases_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_erasesi = strlen(this->erases[i]); + memcpy(outbuffer + offset, &length_erasesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->erases[i], length_erasesi); + offset += length_erasesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (visualization_msgs::InteractiveMarkerPose*)realloc(this->poses, poses_lengthT * sizeof(visualization_msgs::InteractiveMarkerPose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(visualization_msgs::InteractiveMarkerPose)); + } + uint8_t erases_lengthT = *(inbuffer + offset++); + if(erases_lengthT > erases_length) + this->erases = (char**)realloc(this->erases, erases_lengthT * sizeof(char*)); + offset += 3; + erases_length = erases_lengthT; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_st_erases; + memcpy(&length_st_erases, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_erases; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_erases-1]=0; + this->st_erases = (char *)(inbuffer + offset-1); + offset += length_st_erases; + memcpy( &(this->erases[i]), &(this->st_erases), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerUpdate"; }; + const char * getMD5(){ return "83e22f99d3b31fde725e0a338200e036"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/Marker.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/Marker.h new file mode 100755 index 0000000..2219629 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/Marker.h @@ -0,0 +1,288 @@ +#ifndef _ROS_visualization_msgs_Marker_h +#define _ROS_visualization_msgs_Marker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class Marker : public ros::Msg + { + public: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Pose pose; + geometry_msgs::Vector3 scale; + std_msgs::ColorRGBA color; + ros::Duration lifetime; + bool frame_locked; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t colors_length; + std_msgs::ColorRGBA st_colors; + std_msgs::ColorRGBA * colors; + const char* text; + const char* mesh_resource; + bool mesh_use_embedded_materials; + enum { ARROW = 0 }; + enum { CUBE = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { LINE_STRIP = 4 }; + enum { LINE_LIST = 5 }; + enum { CUBE_LIST = 6 }; + enum { SPHERE_LIST = 7 }; + enum { POINTS = 8 }; + enum { TEXT_VIEW_FACING = 9 }; + enum { MESH_RESOURCE = 10 }; + enum { TRIANGLE_LIST = 11 }; + enum { ADD = 0 }; + enum { MODIFY = 0 }; + enum { DELETE = 2 }; + + Marker(): + header(), + ns(""), + id(0), + type(0), + action(0), + pose(), + scale(), + color(), + lifetime(), + frame_locked(0), + points_length(0), points(NULL), + colors_length(0), colors(NULL), + text(""), + mesh_resource(""), + mesh_use_embedded_materials(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->pose.serialize(outbuffer + offset); + offset += this->scale.serialize(outbuffer + offset); + offset += this->color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.real = this->frame_locked; + *(outbuffer + offset + 0) = (u_frame_locked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame_locked); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_mesh_resource = strlen(this->mesh_resource); + memcpy(outbuffer + offset, &length_mesh_resource, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.real = this->mesh_use_embedded_materials; + *(outbuffer + offset + 0) = (u_mesh_use_embedded_materials.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->scale.deserialize(inbuffer + offset); + offset += this->color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.base = 0; + u_frame_locked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->frame_locked = u_frame_locked.real; + offset += sizeof(this->frame_locked); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t colors_lengthT = *(inbuffer + offset++); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + colors_length = colors_lengthT; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->st_colors.deserialize(inbuffer + offset); + memcpy( &(this->colors[i]), &(this->st_colors), sizeof(std_msgs::ColorRGBA)); + } + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + uint32_t length_mesh_resource; + memcpy(&length_mesh_resource, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.base = 0; + u_mesh_use_embedded_materials.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mesh_use_embedded_materials = u_mesh_use_embedded_materials.real; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + const char * getType(){ return "visualization_msgs/Marker"; }; + const char * getMD5(){ return "18326976df9d29249efc939e00342cde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/MarkerArray.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/MarkerArray.h new file mode 100755 index 0000000..97e32df --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/MarkerArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_visualization_msgs_MarkerArray_h +#define _ROS_visualization_msgs_MarkerArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class MarkerArray : public ros::Msg + { + public: + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + + MarkerArray(): + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/MarkerArray"; }; + const char * getMD5(){ return "90da67007c26525f655c1c269094e39f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/MenuEntry.h b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/MenuEntry.h new file mode 100755 index 0000000..8ba43e8 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/lib/ros_lib/visualization_msgs/MenuEntry.h @@ -0,0 +1,103 @@ +#ifndef _ROS_visualization_msgs_MenuEntry_h +#define _ROS_visualization_msgs_MenuEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace visualization_msgs +{ + + class MenuEntry : public ros::Msg + { + public: + uint32_t id; + uint32_t parent_id; + const char* title; + const char* command; + uint8_t command_type; + enum { FEEDBACK = 0 }; + enum { ROSRUN = 1 }; + enum { ROSLAUNCH = 2 }; + + MenuEntry(): + id(0), + parent_id(0), + title(""), + command(""), + command_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->parent_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parent_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parent_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parent_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent_id); + uint32_t length_title = strlen(this->title); + memcpy(outbuffer + offset, &length_title, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_command = strlen(this->command); + memcpy(outbuffer + offset, &length_command, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + *(outbuffer + offset + 0) = (this->command_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->command_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->id = ((uint32_t) (*(inbuffer + offset))); + this->id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->id); + this->parent_id = ((uint32_t) (*(inbuffer + offset))); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parent_id); + uint32_t length_title; + memcpy(&length_title, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + uint32_t length_command; + memcpy(&length_command, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + this->command_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->command_type); + return offset; + } + + const char * getType(){ return "visualization_msgs/MenuEntry"; }; + const char * getMD5(){ return "b90ec63024573de83b57aa93eb39be2d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_07/original/output.txt b/case_study/arduino_lab/group_07/original/output.txt new file mode 100755 index 0000000..b60a1a4 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/output.txt @@ -0,0 +1,8 @@ +============================= test session starts ============================== +platform linux -- Python 3.4.3, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 +rootdir: /home/qianqianzhu/test_robot/mutation_python/group_07, inifile: +collected 5 items + +../run_test.py ..... [100%] + +========================== 5 passed in 58.65 seconds =========================== diff --git a/case_study/arduino_lab/group_07/original/platformio.ini b/case_study/arduino_lab/group_07/original/platformio.ini new file mode 100755 index 0000000..c724062 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/platformio.ini @@ -0,0 +1,18 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +env_default = megaADK + +[env:megaADK] +platform = atmelavr +framework = arduino +board = megaADK +upload_port = /dev/ttyACM0 + diff --git a/case_study/arduino_lab/group_07/original/speed_log.txt b/case_study/arduino_lab/group_07/original/speed_log.txt new file mode 100755 index 0000000..bb1c27c --- /dev/null +++ b/case_study/arduino_lab/group_07/original/speed_log.txt @@ -0,0 +1,6558 @@ +0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 diff --git a/case_study/arduino_lab/group_07/original/src/.robotbase_1.ino.swp b/case_study/arduino_lab/group_07/original/src/.robotbase_1.ino.swp new file mode 100755 index 0000000..8fc9929 Binary files /dev/null and b/case_study/arduino_lab/group_07/original/src/.robotbase_1.ino.swp differ diff --git a/case_study/arduino_lab/group_07/original/src/robotbase_07.ino b/case_study/arduino_lab/group_07/original/src/robotbase_07.ino new file mode 100755 index 0000000..d206d12 --- /dev/null +++ b/case_study/arduino_lab/group_07/original/src/robotbase_07.ino @@ -0,0 +1,195 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include +#include + +bool toggled = false; +float TURN_RATE = 255.0/90; + +// Map pins to a constant +const int LEFT_FOR = 6; +const int LEFT_BACK = 7; +const int RIGHT_FOR = 2; +const int RIGHT_BACK = 3; +const int trigger = 23; +const int echo = 22; +const int led = 13; + +// Global speed of the car +float distanceSpeed = 0; +float leftForSpeed = 0; +float leftBackSpeed = 0; +float rightForSpeed = 0; +float rightBackSpeed = 0; + +// Last time recorded and timeout delay. +unsigned long lastSpeed = 0; +const unsigned long TIMEOUT = 1000; // in ms. + + +void updateSpeeds() { + distanceSpeed = distanceCheck(); + + // Check if there is a need for timeout. + if(millis() - TIMEOUT > lastSpeed) { + distanceSpeed = 0; // Just set the distance speed to 0, so the car stops. + } + + // Update all speeds based on the new distanceSpeed value + analogWrite(RIGHT_BACK, rightBackSpeed * distanceSpeed); + analogWrite(RIGHT_FOR, rightForSpeed * distanceSpeed); + analogWrite(LEFT_BACK, leftBackSpeed * distanceSpeed); + analogWrite(LEFT_FOR, leftForSpeed * distanceSpeed); + return; +} + +float distanceCheck() { + digitalWrite(trigger, LOW); + digitalWrite(trigger, HIGH); + digitalWrite(trigger, LOW); + // Check the distance of the closest object + float duration = pulseIn(echo, HIGH); + // Convert into cm + float distance = (duration / 2.0) / 29.0; // From the data sheet of the SR04 + + // Create mapping from cm to speed. + if(distance < 10) { + return 0.0; + } else if (distance < 20) { + return 0.65; + } else if (distance < 30) { + return 0.75; + } else if (distance < 40) { + return 0.85; + } else { + return 1.0; + } +} + +/* + * This function handles the logic for making a turn to the left. + * It will gradually turn based on the twist_msg.angular.z value. + */ +void leftTurn(const geometry_msgs::Twist& twist_msg) { + + float turn = (twist_msg.linear.x + twist_msg.angular.z * 2); + float turnSpeed = turn < 0 ? 0 : turn; + + // Calculate the speed of the tracks + // Right track + rightBackSpeed = LOW; + float speed = (turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5) * distanceSpeed; + rightForSpeed = (turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5); + analogWrite(RIGHT_BACK, LOW); // Reverse + analogWrite(RIGHT_FOR, speed); // Forward + + // Left track + leftForSpeed = turnSpeed; + leftBackSpeed = LOW; + analogWrite(LEFT_BACK, LOW); // Forward + analogWrite(LEFT_FOR, turnSpeed); // Reverse +} +/* + * This function handles the logic for making a turn to the right. + * It will gradually turn based on the twist_msg.angular.z value. + */ +void rightTurn(const geometry_msgs::Twist& twist_msg) { + + float turn = (twist_msg.linear.x - twist_msg.angular.z * 2); + float turnSpeed = turn < 0 ? 0 : turn; + + // Calculate the speed of the tracks + // Left track + leftBackSpeed = LOW; + float speed = (turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5) * distanceSpeed; + leftForSpeed = turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5; + analogWrite(LEFT_BACK, LOW); // Reverse + analogWrite(LEFT_FOR, speed); // Forward} + + // Right track + rightForSpeed = turnSpeed; + rightBackSpeed = LOW; + analogWrite(RIGHT_BACK, LOW); // Forward + analogWrite(RIGHT_FOR, turnSpeed); // Reverse +} + +void messageCb( const geometry_msgs::Twist& twist_msg){ + digitalWrite(24, HIGH); + digitalWrite(25, HIGH); + + distanceSpeed = distanceCheck(); + lastSpeed = millis(); + + // Make a left turn + if(twist_msg.angular.z < -10) { + leftTurn(twist_msg); + + // Make a right turn + } else if(twist_msg.angular.z > 10) { + rightTurn(twist_msg); + + // Don't make any turn. + } else { + // Calculate the speed based on the distance to an object. + float speed = twist_msg.linear.x * distanceSpeed; + + // Go Forward + if(twist_msg.linear.x > 0) { + rightBackSpeed = LOW; + rightForSpeed = twist_msg.linear.x; + analogWrite(RIGHT_BACK, LOW); // Reverse + analogWrite(RIGHT_FOR, speed ); // Forward + + leftBackSpeed = LOW; + leftForSpeed = twist_msg.linear.x; + analogWrite(LEFT_BACK, LOW); // Reverse + analogWrite(LEFT_FOR, speed); // Forward + + // Go Backwards + } else { + rightBackSpeed = -1 * twist_msg.linear.x; + rightForSpeed = LOW; + analogWrite(RIGHT_FOR, LOW); // Forward + analogWrite(RIGHT_BACK, -1 * speed); // Reverse + + leftBackSpeed = -1 * twist_msg.linear.x; + leftForSpeed = LOW; + analogWrite(LEFT_FOR, LOW); // Forward + analogWrite(LEFT_BACK, -1 * speed); // Reverse + } + } +} + +ros::Subscriber sub("cmd_vel", &messageCb ); + +class NewHardware : public ArduinoHardware { + public : NewHardware() : ArduinoHardware(&Serial1, 57600){}; +}; ros::NodeHandle_ nh; + + +void setup() { + // Set-up all pins and ROS. + Serial.begin(9600); + pinMode(13, OUTPUT); + pinMode(23, OUTPUT); + pinMode(22, INPUT); + pinMode(7, OUTPUT); + pinMode(6, OUTPUT); + pinMode(24, OUTPUT); + pinMode(25, OUTPUT); + pinMode(2, OUTPUT); + pinMode(3, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() { + updateSpeeds(); + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_07/robotbase_7/robotbase_7.ino b/case_study/arduino_lab/group_07/robotbase_7/robotbase_7.ino new file mode 100755 index 0000000..d206d12 --- /dev/null +++ b/case_study/arduino_lab/group_07/robotbase_7/robotbase_7.ino @@ -0,0 +1,195 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include +#include + +bool toggled = false; +float TURN_RATE = 255.0/90; + +// Map pins to a constant +const int LEFT_FOR = 6; +const int LEFT_BACK = 7; +const int RIGHT_FOR = 2; +const int RIGHT_BACK = 3; +const int trigger = 23; +const int echo = 22; +const int led = 13; + +// Global speed of the car +float distanceSpeed = 0; +float leftForSpeed = 0; +float leftBackSpeed = 0; +float rightForSpeed = 0; +float rightBackSpeed = 0; + +// Last time recorded and timeout delay. +unsigned long lastSpeed = 0; +const unsigned long TIMEOUT = 1000; // in ms. + + +void updateSpeeds() { + distanceSpeed = distanceCheck(); + + // Check if there is a need for timeout. + if(millis() - TIMEOUT > lastSpeed) { + distanceSpeed = 0; // Just set the distance speed to 0, so the car stops. + } + + // Update all speeds based on the new distanceSpeed value + analogWrite(RIGHT_BACK, rightBackSpeed * distanceSpeed); + analogWrite(RIGHT_FOR, rightForSpeed * distanceSpeed); + analogWrite(LEFT_BACK, leftBackSpeed * distanceSpeed); + analogWrite(LEFT_FOR, leftForSpeed * distanceSpeed); + return; +} + +float distanceCheck() { + digitalWrite(trigger, LOW); + digitalWrite(trigger, HIGH); + digitalWrite(trigger, LOW); + // Check the distance of the closest object + float duration = pulseIn(echo, HIGH); + // Convert into cm + float distance = (duration / 2.0) / 29.0; // From the data sheet of the SR04 + + // Create mapping from cm to speed. + if(distance < 10) { + return 0.0; + } else if (distance < 20) { + return 0.65; + } else if (distance < 30) { + return 0.75; + } else if (distance < 40) { + return 0.85; + } else { + return 1.0; + } +} + +/* + * This function handles the logic for making a turn to the left. + * It will gradually turn based on the twist_msg.angular.z value. + */ +void leftTurn(const geometry_msgs::Twist& twist_msg) { + + float turn = (twist_msg.linear.x + twist_msg.angular.z * 2); + float turnSpeed = turn < 0 ? 0 : turn; + + // Calculate the speed of the tracks + // Right track + rightBackSpeed = LOW; + float speed = (turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5) * distanceSpeed; + rightForSpeed = (turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5); + analogWrite(RIGHT_BACK, LOW); // Reverse + analogWrite(RIGHT_FOR, speed); // Forward + + // Left track + leftForSpeed = turnSpeed; + leftBackSpeed = LOW; + analogWrite(LEFT_BACK, LOW); // Forward + analogWrite(LEFT_FOR, turnSpeed); // Reverse +} +/* + * This function handles the logic for making a turn to the right. + * It will gradually turn based on the twist_msg.angular.z value. + */ +void rightTurn(const geometry_msgs::Twist& twist_msg) { + + float turn = (twist_msg.linear.x - twist_msg.angular.z * 2); + float turnSpeed = turn < 0 ? 0 : turn; + + // Calculate the speed of the tracks + // Left track + leftBackSpeed = LOW; + float speed = (turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5) * distanceSpeed; + leftForSpeed = turnSpeed + (twist_msg.linear.x - turnSpeed) * 0.5; + analogWrite(LEFT_BACK, LOW); // Reverse + analogWrite(LEFT_FOR, speed); // Forward} + + // Right track + rightForSpeed = turnSpeed; + rightBackSpeed = LOW; + analogWrite(RIGHT_BACK, LOW); // Forward + analogWrite(RIGHT_FOR, turnSpeed); // Reverse +} + +void messageCb( const geometry_msgs::Twist& twist_msg){ + digitalWrite(24, HIGH); + digitalWrite(25, HIGH); + + distanceSpeed = distanceCheck(); + lastSpeed = millis(); + + // Make a left turn + if(twist_msg.angular.z < -10) { + leftTurn(twist_msg); + + // Make a right turn + } else if(twist_msg.angular.z > 10) { + rightTurn(twist_msg); + + // Don't make any turn. + } else { + // Calculate the speed based on the distance to an object. + float speed = twist_msg.linear.x * distanceSpeed; + + // Go Forward + if(twist_msg.linear.x > 0) { + rightBackSpeed = LOW; + rightForSpeed = twist_msg.linear.x; + analogWrite(RIGHT_BACK, LOW); // Reverse + analogWrite(RIGHT_FOR, speed ); // Forward + + leftBackSpeed = LOW; + leftForSpeed = twist_msg.linear.x; + analogWrite(LEFT_BACK, LOW); // Reverse + analogWrite(LEFT_FOR, speed); // Forward + + // Go Backwards + } else { + rightBackSpeed = -1 * twist_msg.linear.x; + rightForSpeed = LOW; + analogWrite(RIGHT_FOR, LOW); // Forward + analogWrite(RIGHT_BACK, -1 * speed); // Reverse + + leftBackSpeed = -1 * twist_msg.linear.x; + leftForSpeed = LOW; + analogWrite(LEFT_FOR, LOW); // Forward + analogWrite(LEFT_BACK, -1 * speed); // Reverse + } + } +} + +ros::Subscriber sub("cmd_vel", &messageCb ); + +class NewHardware : public ArduinoHardware { + public : NewHardware() : ArduinoHardware(&Serial1, 57600){}; +}; ros::NodeHandle_ nh; + + +void setup() { + // Set-up all pins and ROS. + Serial.begin(9600); + pinMode(13, OUTPUT); + pinMode(23, OUTPUT); + pinMode(22, INPUT); + pinMode(7, OUTPUT); + pinMode(6, OUTPUT); + pinMode(24, OUTPUT); + pinMode(25, OUTPUT); + pinMode(2, OUTPUT); + pinMode(3, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() { + updateSpeeds(); + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_07/run.sh b/case_study/arduino_lab/group_07/run.sh new file mode 100755 index 0000000..b1f3c58 --- /dev/null +++ b/case_study/arduino_lab/group_07/run.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +rm -f mut*/output.txt +cd original +platformio run -t clean +platformio run -t upload +python3 -m pytest ../run_test.py | tee "output.txt" +cd .. + +for mut_dir in $(ls -d mut*/); do + echo $mut_dir + cd $mut_dir + platformio run -t clean + platformio run -t upload + python3 -m pytest ../run_test.py -x| tee "output.txt" + cd .. + mv $mut_dir executed +done + +egrep -lir --include=*.txt "FAILED" . > "failed.txt" diff --git a/case_study/arduino_lab/group_07/run_test.py b/case_study/arduino_lab/group_07/run_test.py new file mode 100755 index 0000000..9c4b647 --- /dev/null +++ b/case_study/arduino_lab/group_07/run_test.py @@ -0,0 +1,130 @@ +import subprocess,os,signal +import serial,io,time +import pytest +import string +from operator import add + +#----------------------------- +# test helper functions +#----------------------------- +def send_image(image_path): + # source ros file + output = subprocess.check_output('source /home/qianqianzhu/image_transport_ws/devel/setup.bash;env -0' + ,shell=True, executable="/bin/bash") + # replace env + #os.environ.clear() + lines = output.decode().split('\0') + for line in lines: + (key, _, value) = line.partition("=") + os.environ[key] = value + + #image = '/home/qianqianzhu/Pictures/straight.jpg' + #image = '/home/qianqianzhu/Pictures/left.jpg' + #image = '/home/qianqianzhu/Pictures/right.jpeg' + ros_command = 'rosrun image_transport_tutorial my_publisher '+ image_path + pro = subprocess.Popen(ros_command,shell=True,preexec_fn=os.setsid) + + # record pwm + #time.sleep(2) + subprocess.call('rm -f speed_log.txt',shell=True) + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + filename = 'speed_log.txt' # log file to save data in + + with serial.Serial(device,baud) as serialPort, open(filename,'wb') as outFile: + print("start recording serial...") + timer = time.time() + while(time.time()-timer<=10): + line = serialPort.readline() # must send \n! get a line of log + #print (line) # show line on screen + outFile.write(line) # write line of text to file + outFile.flush() # make sure it actually gets written out + print("stop recording serial...") + + # stop sending an image + os.killpg(os.getpgid(pro.pid), signal.SIGTERM) + + # read speed from pwm log + f = open(filename,"rb") + + total = [0,0,0,0] + #print("hello") + + for line in f: + if len(line) == 9: + line = line.decode('utf-8') + columns = line.strip().split(',') + if len(columns) == 4: + delta = list(map(int,columns)) + total = list(map(add,total,delta)) + #print(total) + f.close() + return total + +def send_ultrasensor(signal): + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + with serial.Serial(device,baud,timeout=5) as ard: + time.sleep(0.5) # wait for Arduino + # Serial write section + ard.flush() + print ("send "+signal+" signal!") + ard.write(str.encode(signal)) + time.sleep(0.5) + +#----------------------------- +# test cases +#----------------------------- +def test_straight(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/straight.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == pytest.approx(right_speed,rel=5e-2) + +def test_turn_left(): + #time.sleep(1) + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/straight_offset_right_2.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed < right_speed + +def test_turn_right(): + #time.sleep(1) + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/straight_offset_left_2.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed > right_speed + +def test_stop_obstacle(): + #time.sleep(1) + send_ultrasensor("stop") + time.sleep(1) + image_path = '/home/qianqianzhu/Pictures/straight.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == 0 + assert right_speed == 0 + +def test_stop_no_image(): + time.sleep(2) + send_ultrasensor("go") + image_path = '' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == 0 + assert right_speed == 0 + + diff --git a/case_study/arduino_lab/group_21/.pytest_cache/v/cache/lastfailed b/case_study/arduino_lab/group_21/.pytest_cache/v/cache/lastfailed new file mode 100755 index 0000000..8bf97a6 --- /dev/null +++ b/case_study/arduino_lab/group_21/.pytest_cache/v/cache/lastfailed @@ -0,0 +1,3 @@ +{ + "run_test.py::test_turn_left": true +} \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/failed_21.txt b/case_study/arduino_lab/group_21/failed_21.txt new file mode 100755 index 0000000..84e202c --- /dev/null +++ b/case_study/arduino_lab/group_21/failed_21.txt @@ -0,0 +1,178 @@ +./executed/mut14/output.txt +./executed/mut99/output.txt +./executed/mut73/output.txt +./executed/mut33/output.txt +./executed/mut15/output.txt +./executed/mut30/output.txt +./executed/mut93/output.txt +./executed/mut28/output.txt +./executed/mut81/output.txt +./executed/mut83/output.txt +./executed/mut98/output.txt +./executed/mut17/output.txt +./executed/mut96/output.txt +./executed/mut18/output.txt +./executed/mut82/output.txt +./executed/mut94/output.txt +./executed/mut74/output.txt +./executed/mut120/output.txt +./executed/mut87/output.txt +./executed/mut61/output.txt +./executed/mut86/output.txt +./executed/mut20/output.txt +./executed/mut32/output.txt +./executed/mut31/output.txt +./executed/mut37/output.txt +./executed/mut34/output.txt +./executed/mut111/output.txt +./executed/mut112/output.txt +./executed/mut95/output.txt +./executed/mut100/output.txt +./executed/mut84/output.txt +./executed/mut123/output.txt +./executed/mut21/output.txt +./executed/mut113/output.txt +./executed/mut121/output.txt +./executed/mut19/output.txt +./executed/mut92/output.txt +./executed/mut103/output.txt +./executed/mut122/output.txt +./executed/mut16/output.txt +./executed/mut35/output.txt +./executed/mut97/output.txt +./executed/mut36/output.txt +./executed/mut114/output.txt +./executed/mut110/output.txt +./executed/mut104/output.txt +./executed/mut72/output.txt + +Mutation 0:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 64 +Mutation 1:pin_surround_replacement:digitalWrite(23, ( HIGH)); in Line 64 +Mutation 2:pin_surround_replacement:digitalWrite(25, ( HIGH)); in Line 64 +Mutation 3:pin_surround_replacement:digitalWrite(26, ( HIGH)); in Line 64 +Mutation 4:pin_surround_replacement:digitalWrite(27, ( HIGH)); in Line 64 +Mutation 5:pin_value_replacement:digitalWrite(24, !( HIGH)); in Line 64 +Mutation 6:output_stmt_deletion: in Line 64 +Mutation 7:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 65 +Mutation 8:pin_surround_replacement:digitalWrite(23, ( HIGH)); in Line 65 +Mutation 9:pin_surround_replacement:digitalWrite(24, ( HIGH)); in Line 65 +Mutation 10:pin_surround_replacement:digitalWrite(26, ( HIGH)); in Line 65 +Mutation 11:pin_surround_replacement:digitalWrite(27, ( HIGH)); in Line 65 +Mutation 12:pin_value_replacement:digitalWrite(25, !( HIGH)); in Line 65 +Mutation 13:output_stmt_deletion: in Line 65 +Mutation 14:pin_surround_replacement:digitalWrite(5, ( LOW)); in Line 66 +Mutation 15:pin_surround_replacement:digitalWrite(7, ( LOW)); in Line 66 +Mutation 16:pin_value_replacement:digitalWrite(6, !( LOW)); in Line 66 +Mutation 17:output_stmt_deletion: in Line 66 +Mutation 18:pin_surround_replacement:digitalWrite(1, ( LOW)); in Line 67 +Mutation 19:pin_surround_replacement:digitalWrite(3, ( LOW)); in Line 67 +Mutation 20:pin_value_replacement:digitalWrite(2, !( LOW)); in Line 67 +Mutation 21:output_stmt_deletion: in Line 67 +Mutation 22:pin_surround_replacement:digitalWrite(6, ( LOW)); in Line 68 +Mutation 23:pin_surround_replacement:digitalWrite(8, ( LOW)); in Line 68 +Mutation 24:pin_value_replacement:digitalWrite(7, !( LOW)); in Line 68 +Mutation 25:output_stmt_deletion: in Line 68 +Mutation 26:pin_surround_replacement:digitalWrite(2, ( LOW)); in Line 69 +Mutation 27:pin_surround_replacement:digitalWrite(4, ( LOW)); in Line 69 +Mutation 28:pin_value_replacement:digitalWrite(3, !( LOW)); in Line 69 +Mutation 29:output_stmt_deletion: in Line 69 +Mutation 30:pin_surround_replacement:analogWrite(5, ( robot_speed)); in Line 75 +Mutation 31:pin_surround_replacement:analogWrite(7, ( robot_speed)); in Line 75 +Mutation 32:pin_surround_replacement:analogWrite(1, ( robot_speed)); in Line 76 +Mutation 33:pin_surround_replacement:analogWrite(3, ( robot_speed)); in Line 76 +Mutation 34:pin_surround_replacement:analogWrite(1, ( robot_speed)); in Line 80 +Mutation 35:pin_surround_replacement:analogWrite(3, ( robot_speed)); in Line 80 +Mutation 36:pin_surround_replacement:analogWrite(5, ( robot_speed)); in Line 84 +Mutation 37:pin_surround_replacement:analogWrite(7, ( robot_speed)); in Line 84 +Mutation 38:pin_surround_replacement:digitalWrite(6, ( HIGH)); in Line 95 +Mutation 39:pin_surround_replacement:digitalWrite(8, ( HIGH)); in Line 95 +Mutation 40:pin_value_replacement:digitalWrite(7, !( HIGH)); in Line 95 +Mutation 41:output_stmt_deletion: in Line 95 +Mutation 42:pin_surround_replacement:digitalWrite(1, ( HIGH)); in Line 96 +Mutation 43:pin_surround_replacement:digitalWrite(3, ( HIGH)); in Line 96 +Mutation 44:pin_value_replacement:digitalWrite(2, !( HIGH)); in Line 96 +Mutation 45:output_stmt_deletion: in Line 96 +Mutation 46:pin_surround_replacement:digitalWrite(5, ( HIGH)); in Line 101 +Mutation 47:pin_surround_replacement:digitalWrite(7, ( HIGH)); in Line 101 +Mutation 48:pin_value_replacement:digitalWrite(6, !( HIGH)); in Line 101 +Mutation 49:output_stmt_deletion: in Line 101 +Mutation 50:pin_surround_replacement:digitalWrite(2, ( HIGH)); in Line 102 +Mutation 51:pin_surround_replacement:digitalWrite(4, ( HIGH)); in Line 102 +Mutation 52:pin_value_replacement:digitalWrite(3, !( HIGH)); in Line 102 +Mutation 53:output_stmt_deletion: in Line 102 +Mutation 54:pin_surround_replacement:digitalWrite(6, ( HIGH)); in Line 108 +Mutation 55:pin_surround_replacement:digitalWrite(8, ( HIGH)); in Line 108 +Mutation 56:pin_value_replacement:digitalWrite(7, !( HIGH)); in Line 108 +Mutation 57:output_stmt_deletion: in Line 108 +Mutation 58:pin_surround_replacement:digitalWrite(2, ( HIGH)); in Line 109 +Mutation 59:pin_surround_replacement:digitalWrite(4, ( HIGH)); in Line 109 +Mutation 60:pin_value_replacement:digitalWrite(3, !( HIGH)); in Line 109 +Mutation 61:output_stmt_deletion: in Line 109 +Mutation 62:pin_surround_replacement:digitalWrite(2, ( HIGH)); in Line 113 +Mutation 63:pin_surround_replacement:digitalWrite(4, ( HIGH)); in Line 113 +Mutation 64:pin_value_replacement:digitalWrite(3, !( HIGH)); in Line 113 +Mutation 65:output_stmt_deletion: in Line 113 +Mutation 66:pin_surround_replacement:digitalWrite(6, ( HIGH)); in Line 117 +Mutation 67:pin_surround_replacement:digitalWrite(8, ( HIGH)); in Line 117 +Mutation 68:pin_value_replacement:digitalWrite(7, !( HIGH)); in Line 117 +Mutation 69:output_stmt_deletion: in Line 117 +Mutation 70:pin_surround_replacement:pinMode(12, OUTPUT); in Line 174 +Mutation 71:pin_func_replacement:pinMode(13,INPUT); in Line 174 +Mutation 72:pin_surround_replacement:pinMode(6, OUTPUT); in Line 176 +Mutation 73:pin_surround_replacement:pinMode(8, OUTPUT); in Line 176 +Mutation 74:pin_func_replacement:pinMode(7,INPUT); in Line 176 +Mutation 75:pin_surround_replacement:pinMode(22, OUTPUT); in Line 177 +Mutation 76:pin_surround_replacement:pinMode(23, OUTPUT); in Line 177 +Mutation 77:pin_surround_replacement:pinMode(25, OUTPUT); in Line 177 +Mutation 78:pin_surround_replacement:pinMode(26, OUTPUT); in Line 177 +Mutation 79:pin_surround_replacement:pinMode(27, OUTPUT); in Line 177 +Mutation 80:pin_func_replacement:pinMode(24,INPUT); in Line 177 +Mutation 81:pin_surround_replacement:pinMode(5, OUTPUT); in Line 178 +Mutation 82:pin_surround_replacement:pinMode(7, OUTPUT); in Line 178 +Mutation 83:pin_func_replacement:pinMode(6,INPUT); in Line 178 +Mutation 84:pin_surround_replacement:pinMode(2, OUTPUT); in Line 179 +Mutation 85:pin_surround_replacement:pinMode(4, OUTPUT); in Line 179 +Mutation 86:pin_func_replacement:pinMode(3,INPUT); in Line 179 +Mutation 87:pin_surround_replacement:pinMode(22, OUTPUT); in Line 180 +Mutation 88:pin_surround_replacement:pinMode(23, OUTPUT); in Line 180 +Mutation 89:pin_surround_replacement:pinMode(24, OUTPUT); in Line 180 +Mutation 90:pin_surround_replacement:pinMode(26, OUTPUT); in Line 180 +Mutation 91:pin_surround_replacement:pinMode(27, OUTPUT); in Line 180 +Mutation 92:pin_func_replacement:pinMode(25,INPUT); in Line 180 +Mutation 93:pin_surround_replacement:pinMode(1, OUTPUT); in Line 181 +Mutation 94:pin_surround_replacement:pinMode(3, OUTPUT); in Line 181 +Mutation 95:pin_func_replacement:pinMode(2,INPUT); in Line 181 +Mutation 96:pin_surround_replacement:pinMode(22, OUTPUT); in Line 183 +Mutation 97:pin_surround_replacement:pinMode(24, OUTPUT); in Line 183 +Mutation 98:pin_surround_replacement:pinMode(25, OUTPUT); in Line 183 +Mutation 99:pin_func_replacement:pinMode(23,INPUT); in Line 183 +Mutation 100:pin_surround_replacement:pinMode(23, INPUT); in Line 186 +Mutation 101:pin_surround_replacement:pinMode(24, INPUT); in Line 186 +Mutation 102:pin_surround_replacement:pinMode(25, INPUT); in Line 186 +Mutation 103:pin_func_replacement:pinMode(22,OUTPUT); in Line 186 +Mutation 104:pull_resis_replacement:pinMode(22,INPUT_PULLUP); in Line 186 +Mutation 105:pin_surround_replacement:digitalWrite(22, ( LOW)); in Line 205 +Mutation 106:pin_surround_replacement:digitalWrite(24, ( LOW)); in Line 205 +Mutation 107:pin_surround_replacement:digitalWrite(25, ( LOW)); in Line 205 +Mutation 108:pin_value_replacement:digitalWrite(23, !( LOW)); in Line 205 +Mutation 109:output_stmt_deletion: in Line 205 +Mutation 110:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 207 +Mutation 111:pin_surround_replacement:digitalWrite(24, ( HIGH)); in Line 207 +Mutation 112:pin_surround_replacement:digitalWrite(25, ( HIGH)); in Line 207 +Mutation 113:pin_value_replacement:digitalWrite(23, !( HIGH)); in Line 207 +Mutation 114:output_stmt_deletion: in Line 207 +Mutation 115:pin_surround_replacement:digitalWrite(22, ( LOW)); in Line 209 +Mutation 116:pin_surround_replacement:digitalWrite(24, ( LOW)); in Line 209 +Mutation 117:pin_surround_replacement:digitalWrite(25, ( LOW)); in Line 209 +Mutation 118:pin_value_replacement:digitalWrite(23, !( LOW)); in Line 209 +Mutation 119:output_stmt_deletion: in Line 209 +Mutation 120:pin_surround_replacement:duration = pulseIn(23, ( HIGH)); in Line 210 +Mutation 121:pin_surround_replacement:duration = pulseIn(24, ( HIGH)); in Line 210 +Mutation 122:pin_surround_replacement:duration = pulseIn(25, ( HIGH)); in Line 210 +Mutation 123:pin_value_replacement:duration = pulseIn(22, !( HIGH)); in Line 210 +Mutation 124:pin_surround_replacement:digitalWrite(12, ( HIGH)); in Line 217 +Mutation 125:pin_value_replacement:digitalWrite(13, !( HIGH)); in Line 217 +Mutation 126:output_stmt_deletion: in Line 217 +Mutation 127:pin_surround_replacement:digitalWrite(12, ( LOW)); in Line 221 +Mutation 128:pin_value_replacement:digitalWrite(13, !( LOW)); in Line 221 +Mutation 129:output_stmt_deletion: in Line 221 diff --git a/case_study/arduino_lab/group_21/linefollower_21.cpp b/case_study/arduino_lab/group_21/linefollower_21.cpp new file mode 100755 index 0000000..cc3d4c2 --- /dev/null +++ b/case_study/arduino_lab/group_21/linefollower_21.cpp @@ -0,0 +1,215 @@ +/** + * Group number: 21 + * Student 1: + * Daan van der Valk, 4094751 + * Student 2: + * Stefan de Vringer, 4374851 + */ + +// Includes required for ROS and the image processing +#include "ros/ros.h" +#include "image_transport/image_transport.h" +#include "cv_bridge/cv_bridge.h" +#include "sensor_msgs/image_encodings.h" +#include "std_msgs/String.h" +#include "geometry_msgs/Twist.h" +#include "sensor_msgs/CompressedImage.h" +#include "math.h" +#include "opencv2/imgproc/imgproc.hpp" +#include "opencv2/highgui/highgui.hpp" + +using namespace cv; + +// Name of debugging window +static const std::string OPENCV_WINDOW = "Linefollower debugger by team 21"; +// Declare publisher +ros::Publisher pub; + +// Function to process the incoming images and send Twist message if a path can be found +void imageCallback(const cv_bridge::CvImage::ConstPtr& msg) +{ + // Image processing + // msg->image points to a cv::Mat object + Mat img = msg->image.clone(); + + // Convert to greyscale + Mat greyMat; + cvtColor(msg->image, greyMat, CV_BGR2GRAY); + + // Threshold filter: take binary image + Mat img_bw = greyMat < 64; + + // When there's to much white, (e.g. original image is black), cancel operation + if ( countNonZero(img_bw) > 1280*720/2 ) + return; + + // Construct skeleton image + Mat skel(img_bw.size(), CV_8UC1, cv::Scalar(0)); + Mat temp; + Mat eroded; + + Mat element = cv::getStructuringElement(cv::MORPH_CROSS, cv::Size(3, 3)); + bool done; + do + { + erode(img_bw, eroded, element); + dilate(eroded, temp, element); + subtract(img_bw, temp, temp); + bitwise_or(skel, temp, skel); + eroded.copyTo(img_bw); + + // If (almost) all pixels in binary image are processed, + // skeleton is good enough + done = (countNonZero(img_bw) < 10); + } while (!done); + + // Hough transformation to find lines + vector lines; + vector selected_lines; + HoughLinesP(skel, lines, 1, CV_PI/180, 20, 10, 10); + + // SETTINGS for line selections + // Big area definition (considered lines for all cases) + const int big_minX = 1; + const int big_maxX = 1279; + const int big_minY = 1; + const int big_maxY = 719; + int lines_big_area_count = 0; + + // Small area defintion (considered lines for angle computations) + const int small_minX = 640; + const int small_maxX = 1150; + const int small_minY = 150; + const int small_maxY = 570; + int lines_small_area_count = 0; + + // Variables to keep track of average angle in small area + float A; + vector angles; + + // Variable to compute average y value in big area + float y_values = 0.0; + + // Loop through lines + for(size_t i = 0; i < lines.size(); i++) + { + // Only consider lines in big area + if(lines[i][0] >= big_minX + && lines[i][2] <= big_maxX + && lines[i][1] >= big_minY + && lines[i][3] <= big_maxY ) { + + // Compute line angle + A = ( (float)lines[i][3] - (float)lines[i][1] ) + / ( (float)lines[i][2] - (float)lines[i][0] ); + + // Only consider lines with a reasonable angle + if (A > -10 && A < 10) { + lines_big_area_count++; + // Add y coordinate of line middle point to y_values + y_values += (((float)lines[i][3] + (float)lines[i][1])/2); + // Add line to big selection + selected_lines.push_back(lines[i]); + + // Only add angle of line if it's in the small area + if(lines[i][0] >= small_minX + && lines[i][2] <= small_maxX + && lines[i][1] >= small_minY + && lines[i][3] <= small_maxY ) { + lines_small_area_count++; + // Add to small collection + angles.push_back(A); + // Color lines in small area blue + line(img, Point(lines[i][0], lines[i][1]), + Point(lines[i][2], lines[i][3]), Scalar(255,0,0), 3, 8); + } else { + // Color lines in big area red + line(img, Point(lines[i][0], lines[i][1]), + Point(lines[i][2], lines[i][3]), Scalar(0,0,255), 3, 8); + } + } + } + } + + // If there are no lines in the big area, send no directions + if(lines_big_area_count < 1) { + return; + } + + // Compute average y coordinate of line middle points + float average_y = y_values / (float)lines_big_area_count; + + // Create Twist message + geometry_msgs::Twist directions; + directions.linear.x = 1; + + // Give directions based on corner cases: + // all lines are on the left side + if(average_y < 150) { + directions.angular.z = 1; + } + // all lines are on the right side + else if(average_y > 570) { + directions.angular.z = -1; + } + // Give directions based on available lines: + // no lines in the small area + else if(lines_small_area_count < 1) { + // Average line on left side: send left + if(average_y > 360) { + directions.angular.z = 1; + // Average line on right side: send right + } else { + directions.angular.z = -1; + } + } + // Give directions based on lines in small area + else { + // Compute median of angles of all lines in small area + sort(angles.begin(), angles.end()); + size_t size = angles.size(); + float median; + if (size % 2 == 0) + { + median = (angles[size / 2 - 1] + angles[size / 2]) / 2; + } + else + { + median = angles[size / 2]; + } + + // Based on median, send robot in certain direction + if (median > 0.2) { + directions.angular.z = -1; + } else if ( median < -0.2) { + directions.angular.z = 1; + } else { + directions.angular.z = 0; + } + } + + // Show image with recognized lines + imshow(OPENCV_WINDOW, img); + waitKey(3); + + // Publish directions + pub.publish(directions); +} + +// Main loop to listen to images on topic /camera/image +int main(int argc, char **argv) +{ + ros::init(argc, argv, "linefollower_21"); + ros::NodeHandle n; + + // Set buffer size to 1, to only use the most recent image + ros::Subscriber sub = n.subscribe("camera/image", 1, imageCallback); + pub = n.advertise("cmd_vel", 1000); + + // ros::Rate loop_rate(10); + + ros::spin(); + + return 0; +} + diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/.sconsign.dblite b/case_study/arduino_lab/group_21/original/.pioenvs/.sconsign.dblite new file mode 100755 index 0000000..ce8aa39 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/.sconsign.dblite differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/do-not-modify-files-here.url b/case_study/arduino_lab/group_21/original/.pioenvs/do-not-modify-files-here.url new file mode 100755 index 0000000..4d15482 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.pioenvs/do-not-modify-files-here.url @@ -0,0 +1,3 @@ + +[InternetShortcut] +URL=http://docs.platformio.org/page/projectconf/section_platformio.html#build-dir diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/CDC.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/CDC.o new file mode 100755 index 0000000..c77756c Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/CDC.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o new file mode 100755 index 0000000..ea05c60 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o new file mode 100755 index 0000000..8f08610 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o new file mode 100755 index 0000000..0d98fac Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o new file mode 100755 index 0000000..5698398 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o new file mode 100755 index 0000000..de5560e Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o new file mode 100755 index 0000000..aa9b8df Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o new file mode 100755 index 0000000..4f3de75 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Print.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Print.o new file mode 100755 index 0000000..364384d Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Print.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Stream.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Stream.o new file mode 100755 index 0000000..ffcf57c Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Stream.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Tone.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Tone.o new file mode 100755 index 0000000..fecf30d Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/Tone.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o new file mode 100755 index 0000000..09d2ec2 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o new file mode 100755 index 0000000..7b56fc1 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WMath.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WMath.o new file mode 100755 index 0000000..ad728ab Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WMath.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WString.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WString.o new file mode 100755 index 0000000..bb19f60 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/WString.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o new file mode 100755 index 0000000..2f27e89 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/abi.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/abi.o new file mode 100755 index 0000000..eb60283 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/abi.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/hooks.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/hooks.o new file mode 100755 index 0000000..6a63561 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/hooks.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/main.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/main.o new file mode 100755 index 0000000..90c1989 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/main.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/new.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/new.o new file mode 100755 index 0000000..1dff40e Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/new.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring.o new file mode 100755 index 0000000..51ac2c6 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o new file mode 100755 index 0000000..e189ff8 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o new file mode 100755 index 0000000..f8d9057 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o new file mode 100755 index 0000000..06329ca Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o new file mode 100755 index 0000000..6dcd55d Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/firmware.elf b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/firmware.elf new file mode 100755 index 0000000..2c80caa Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/firmware.elf differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/firmware.hex b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/firmware.hex new file mode 100755 index 0000000..a3247a6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/firmware.hex @@ -0,0 +1,749 @@ +:100000000C94BD010C94EE010C94EE010C94EE01E5 +:100010000C94EE010C94EE010C94EE010C94EE01A4 +:100020000C94EE010C94EE010C94EE010C94EE0194 +:100030000C94EE010C94EE010C94EE010C94EE0184 +:100040000C94EE010C94EE010C94EE010C94EE0174 +:100050000C94490E0C94EE010C94EE010C943310A8 +:100060000C94EE010C94EE010C94EE010C94EE0154 +:100070000C94EE010C94EE010C94EE010C94EE0144 +:100080000C94EE010C94EE010C94EE010C94EE0134 +:100090000C94130E0C94E90D0C94EE010C94EE01EB +:1000A0000C94EE010C94EE010C94EE010C94EE0114 +:1000B0000C94EE010C94EE010C94EE010C94EE0104 +:1000C0000C94EE010C94EE010C94EE010C94EE01F4 +:1000D0000C94EE010C94EE010C94EE010C94EE01E4 +:1000E0000C94EE01A60EA90E980E9C0EA00EE00E2A +:1000F000AD0EB10EB70EBB0EBF0EC50EC90ECD0EA6 +:10010000E00ED30ED70EDB0E480F4E0F540F600FCC +:100110006C0FFB0F780F810F8A0F960FA20FAE0F97 +:10012000BF0FCB0FFB0FD70FE30FEF0F0C94AB07F5 +:100130000C9429030C9477120C94CE020C94F001C9 +:100140000C941F050C94AD0E0C9431030C94BF0F4E +:100150000C94D70E0C9440040C94BF0E0C94F8032E +:100160000C9443040C94E6030C94E3030C94780F72 +:100170000C944E0F0C94600F0C949C0E0C94810FF9 +:100180000C94D70F0C94C50E0C941F020C94EF0F17 +:100190000C94CD0E0C94BB0E0C943D070C94A60E43 +:1001A0000C9434030C940D070C94DB0E0C946B052B +:1001B0000C946C0F0C94B70E0C9479060C944202BC +:1001C0000C94480F0C9440080C94CB0F0C943E0DEB +:1001D0000C9454090C94FB0F0C94660D0C94EC03D6 +:1001E0000C943D040C94980E0C9425050C94F20389 +:1001F0000C9471070C94E00E0C94B10E0C94F50362 +:100200000C94E9030C9438030C945D060C94EF03F2 +:100210000C948A0F0C94C90E0C94A20F0C94960F98 +:100220000C94A90E0C9487020C94A00E0C94E30F6E +:100230000C942E020C94540F0C9450020C94D30E78 +:100240000C9422050C94FB030C94AE0F0C942E031B +:100250000C949F0C0C943306000020002300260011 +:1002600029002C002F0032000001000003010601CC +:10027000090100002100240027002A002D00300081 +:10028000330001010000040107010A0100002200FF +:10029000250028002B002E00310034000201000050 +:1002A000050108010B0105050505070508080808F3 +:1002B000020202020A0A08080404040401010101FE +:1002C00001010101030303030303030304070707F9 +:1002D0000C0C0C0C0C0C0C0C02020202060606069E +:1002E000060606060B0B0B0B0B0B0B0B010210206B +:1002F000200808102040102040800201020108045C +:1003000002010102040810204080804020100804EF +:100310000201800402018040201008040201080448 +:10032000020101020408102040800102040810208C +:10033000408000000A0B02090C0D0E08070304019F +:1003400000000000000000000000000000000000AD +:10035000000000000000000000000000000012117A +:10036000100000000000000000000000000000007D +:100370000000000000000000771211241FBECFEF24 +:10038000D1E2DEBFCDBF00E00CBF14E0A0E0B2E0E0 +:10039000E2EAFCE200E00BBF02C007900D92AA3037 +:1003A000B107D9F729E0AAE0B4E001C01D92A9384D +:1003B000B207E1F711E0CDEBD1E000E006C02197F4 +:1003C0000109802FFE010E94C713CC3BD10780E0BA +:1003D0000807A9F70E94C2100C944F160C94000055 +:1003E000CF92DF92EF92FF920F931F93CF93DF9301 +:1003F0006C017A018B01C0E0D0E0CE15DF0589F0F9 +:10040000D8016D918D01D601ED91FC910190F081A3 +:10041000E02DC6011995892B11F47E0102C02196A9 +:10042000ECCFC701DF91CF911F910F91FF90EF901B +:10043000DF90CF900895089580E090E00895FC014A +:10044000538D448D252F30E0842F90E0821B930B39 +:10045000541710F0CF96089501970895FC01918DDF +:10046000828D981761F0828DDF01A80FB11D5D9616 +:100470008C91928D9F5F9F73928F90E008958FEF84 +:100480009FEF0895FC01918D828D981731F0828D38 +:10049000E80FF11D858D90E008958FEF9FEF08958F +:1004A000FC01918D228D892F90E0805C9F4F821BF3 +:1004B00091098F739927089582E194E00E94500278 +:1004C00021E0892B09F420E0822F0895FC01848D1E +:1004D000DF01A80FB11DA35ABF4F2C91848D90E06E +:1004E00001968F739927848FA689B7892C93A08949 +:1004F000B1898C9180648C93938D848D981306C000 +:100500000288F389E02D80818F7D80830895EF92AA +:10051000FF920F931F93CF93DF93EC0181E0888FBD +:100520009B8D8C8D981305C0E889F989808185FDA4 +:1005300024C0F62E0B8D10E00F5F1F4F0F73112795 +:10054000E02E8C8DE8120CC00FB607FCFACFE889BC +:10055000F989808185FFF5CFCE010E946602F1CF37 +:100560008B8DFE01E80FF11DE35AFF4FF0820B8FD8 +:10057000EA89FB898081806207C0EE89FF896083F8 +:10058000E889F98980818064808381E090E0DF914F +:10059000CF911F910F91FF90EF900895CF93DF932C +:1005A000EC01888D8823C9F0EA89FB89808185FD6B +:1005B00005C0A889B9898C9186FD0FC00FB607FCCC +:1005C000F5CF808185FFF2CFA889B9898C9185FF0D +:1005D000EDCFCE010E946602E7CFDF91CF91089563 +:1005E00080E090E0892B41F080E090E0892B21F0C1 +:1005F0000E940000811121C080E090E0892B21F051 +:100600000E945C0281111CC080E090E0892B41F0C7 +:1006100080E090E0892B21F00E940000811113C03E +:1006200080E090E0892BA1F080E090E0892B81F0C0 +:100630000E94000081110AC008950E940000DCCFD2 +:100640000E940000E1CF0E940000EACF0C9400005D +:100650000895FC01EE57FB4F808108958EE992E0EA +:1006600008958FEB92E00895FC0186A197A108956B +:100670008F929F92AF92BF92CF92DF92EF92FF92B2 +:100680000F931F93CF93DF9300D01F921F92CDB78C +:10069000DEB78C016B0164E6C616D1043CF0FC01A8 +:1006A000EE57FB4F8081882309F478C0DA01ED9181 +:1006B000FC910190F081E02DB801655E7D4FCA018B +:1006C00019959C017801BCEEEB1ABDEFFB0A4FEFC8 +:1006D000F70140834EEF3196408331968083319607 +:1006E00090833196890F809580833196C082D8019E +:1006F000A65EBD4FDC9265E070E040E050E0C901CD +:1007000007966817790730F4A1914A0F511D6F5F62 +:100710007F4FF7CF6901F8E0CF0ED11C800F911FFA +:10072000FC01EC5EFD4F4095408341E0C41642E081 +:10073000D406C1F056014701D80112968D919C91C3 +:100740001397F40161914F01DC01ED91FC9101904F +:10075000F081E02D1995C4018E199F098C159D0516 +:100760005CF31EC08EE392E09A83898383E08B83DF +:1007700083ED92E09D838C83D801ED91FC910190F3 +:10078000F081E02DAE014F5F5F4F67E070E0C80180 +:100790001995AA24AA94BB24BA9402C0A12CB12C06 +:1007A000C5010F900F900F900F900F90DF91CF9198 +:1007B0001F910F91FF90EF90DF90CF90BF90AF907F +:1007C0009F908F9008958EE992E008958FEB92E0CC +:1007D00008958CE093E008958DE293E0089583E41A +:1007E00093E0089586E092E0089584E693E008950A +:1007F00085E893E00895AF92BF92CF92DF92EF9297 +:10080000FF920F931F93CF93DF935C01EB018881DD +:10081000F501828389819A81AB81BC81FB01359688 +:100820006C017D0125E0C20ED11CE11CF11C8F0181 +:10083000061B170B20E030E00C151D052E053F05AB +:1008400038F441919F0122503109E9014883EFCFEB +:10085000FB01E80FF91F14826C5F7F4FF501748371 +:1008600063830596DF91CF911F910F91FF90EF90D9 +:10087000DF90CF90BF90AF90089588E993E00895FE +:1008800089EB93E008956F927F928F929F92AF923F +:10089000BF92CF92DF92EF92FF920F931F93CF936D +:1008A000DF93DC01FB01808190E013969C938E9393 +:1008B00012972181922B13969C938E93129702810B +:1008C0001381248135815B0186E0A80EB11C68018B +:1008D0007901C6E0CC0ED11CE11CF11CA5014E1B18 +:1008E0005F0B60E070E04C155D056E057F0540F420 +:1008F000E50149915E01CE010297EC014883EECFFC +:10090000EF01C00FD11F1D82CF01059615969C9354 +:100910008E931497EF01C00FD11F4E815F816885C0 +:100920007985065F1F4F3F01600E711E6801012E21 +:10093000000CEE08FF08C40ED51EE61EF71E43018C +:100940008E1A9F0AA12CB12C8C149D04AE04BF04F6 +:1009500040F4E30129913E01CE010297EC01288386 +:10096000EECF400F511F9F01240F351FC901019782 +:10097000EC011882C80101978E0F9F1F17969C9358 +:100980008E931697E90188809980AA80BB804C5F7E +:100990005F4F3F01640E751E8A01052E000C220B6D +:1009A000330B080D191D2A1D3B1D6301CE1ADF0AEA +:1009B000E12CF12CC016D106E206F30640F4E30167 +:1009C00069913E01CE010297EC016883EECFCA0126 +:1009D000880D991D8F01080F191F980121503109A9 +:1009E000E9011882BA0161507109E60FF71F1996E3 +:1009F000FC93EE931897F8012181428150E060E06A +:100A000070E0BA0155274427522B2081422B2381C5 +:100A1000722B1A964D935D936D937C931D9704965C +:100A2000DF91CF911F910F91FF90EF90DF90CF90CA +:100A3000BF90AF909F908F907F906F90089582EDC0 +:100A400093E0089583EF93E00895FC01DB014C915E +:100A500050E060E070E042835383648375831196B5 +:100A60008C911197582B428353836483758312961C +:100A70008C911297682B42835383648375831396FA +:100A80008C911397782B42835383648375831496D8 +:100A90004C91149750E060E070E046835783608784 +:100AA000718715968C911597582B468357836087CD +:100AB000718716968C911697682B468357836087AB +:100AC000718717968C91782B46835783608771873F +:100AD00088E090E00895DC01FB0112968C9112975A +:100AE000808313968C911397818314968C9114971D +:100AF000828315968C911597838316968C91169701 +:100B0000848317968C911797858318968C911897E4 +:100B1000868319968C91878388E090E008958F9260 +:100B20009F92AF92BF92CF92DF92EF92FF920F937C +:100B30001F93FC01DB01C380C294C69427E0C2224C +:100B40008C2C912CA12CB12C8D929D92AD92BC92AB +:100B50001397C480D12CE12CF12C33E0CC0CDD1C9C +:100B6000EE1CFF1C3A95D1F7C828D928EA28FB28A3 +:100B7000CD92DD92ED92FC921397058110E020E07A +:100B800030E04BE0000F111F221F331F4A95D1F7B1 +:100B9000C02AD12AE22AF32ACD92DD92ED92FC926C +:100BA000139706810F7010E020E030E053E1000F52 +:100BB000111F221F331F5A95D1F70C291D292E29E9 +:100BC0003F290D931D932D933C9313978681829516 +:100BD0008F7047814F7750E060E070E094E0440F01 +:100BE000551F661F771F9A95D1F7482B4115510560 +:100BF00061057105A1F0405853406109710997E101 +:100C0000440F551F661F771F9A95D1F7402B512B24 +:100C1000622B732B4D935D936D937C931397478158 +:100C2000407850E060E070E0742F66275527442735 +:100C30000D911D912D913C911397402B512B622BBF +:100C4000732B4D935D936D937C93139788E090E0A5 +:100C50001F910F91FF90EF90DF90CF90BF90AF90DA +:100C60009F908F900895EF92FF920F931F93CF93D1 +:100C7000DF938C017B01BC016E5F7F4FC7010E9437 +:100C80008F05EC01B8016A5F7F4FC7018C0F9D1F74 +:100C90000E948F05C80FD91FB801665F7F4FC7013B +:100CA0008C0F9D1F0E948F058C0F9D1FDF91CF9190 +:100CB0001F910F91FF90EF900895EF92FF920F9385 +:100CC0001F93CF93DF937C01EB0102960E943306C2 +:100CD0008C01BE01680F791FC70140960E94330640 +:100CE000800F911FDF91CF911F910F91FF90EF9097 +:100CF00008950F931F93CF93DF938C01EC012696F9 +:100D0000CE010E945D06D8019496ED91FC919597D5 +:100D1000CE01DF91CF911F910F9119948F929F92E5 +:100D2000AF92BF92CF92DF92EF92FF920F931F93F9 +:100D3000CF93DF93EC01CB01BA018B019C0147E11A +:100D400035952795179507954A95D1F711272227AD +:100D50003327011511052105310521F000581C4FDD +:100D60002F4F3F4F188219821A826B017C0145E098 +:100D7000CC0CDD1CEE1CFF1C4A95D1F7CB826B011D +:100D80007C0153E0F594E794D794C7945A95D1F732 +:100D9000CC826B017C01EBE0F594E794D794C79487 +:100DA000EA95D1F7CD8268017901F4E0CC0CDD1C25 +:100DB000EE1CFF1CFA95D1F74B015C01A3E1B59441 +:100DC000A79497948794AA95D1F7482D4F70C42A79 +:100DD000CE8268017901B4E0F594E794D794C79482 +:100DE000BA95D1F720E030E0A9010E94FD1387FDFC +:100DF00002C0CF8203C00C2D00680F8388E090E012 +:100E0000DF91CF911F910F91FF90EF90DF90CF90E6 +:100E1000BF90AF909F908F900895EF92FF920F93A5 +:100E20001F93CF93DF937C018B01FC01428153819F +:100E300064817581C8010E948E06EC01F70146812C +:100E4000578160857185C8018C0F9D1F0E948E0699 +:100E5000C80FD91FF7014285538564857585C80180 +:100E60008C0F9D1F0E948E068C0F9D1FDF91CF91CE +:100E70001F910F91FF90EF900895EF92FF920F93C3 +:100E80001F93CF93DF937C01EB0102960E940D0725 +:100E90008C01BE01680F791FC70140960E940D07A3 +:100EA000800F911FDF91CF911F910F91FF90EF90D5 +:100EB000089561E088E10E94770E61E089E10E9477 +:100EC000770E60E086E00E94770E60E082E00E948C +:100ED000770E60E087E00E94770E60E083E00C947C +:100EE000770E0E9414150F931F93CF93DF93CDB706 +:100EF000DEB72A970FB6F894DEBF0FBECDBF8C01C8 +:100F000082E392E09A8389831B821C821D821E8267 +:100F10001F82188619861A86D801ED91FC910190DE +:100F2000F081E02DAE014F5F5F4F6AE070E0C801D5 +:100F300019950E942710F80160877187828793872F +:100F40002A960FB6F894DEBF0FBECDBFDF91CF91CA +:100F50001F910F9108958F929F92AF92BF92CF925F +:100F6000DF92EF92FF92FC0184809580A680B7808B +:100F7000C28CD38CE48CF58C20E030E0A901C50153 +:100F8000B4010E94261420E030E0A9011816FCF4F8 +:100F9000C701B6010E94261418161CF40E945907B6 +:100FA0000EC020E030E0A901C701B6010E94FD1388 +:100FB000811109C00E94590786E00E94300F82E02B +:100FC0000E94300F4EC00E94590786E0F9CFC5013C +:100FD000B4010E94FD1320E030E0A901811120C07E +:100FE000C701B6010E94261418164CF40E94590736 +:100FF00061E087E00E94770E61E082E030C020E08F +:1010000030E0A901C701B6010E94FD13811103C0A0 +:101010000E94590726C00E94590761E086E016C069 +:10102000C701B6010E94261418161CF40E94590725 +:101030000FC020E030E0A901C701B6010E94FD13F6 +:10104000811109C00E94590761E087E00E94770E74 +:1010500061E083E004C00E94590761E087E00E94DC +:10106000770E80E49CE99093850080938400FF9044 +:10107000EF90DF90CF90BF90AF909F908F900895AA +:101080004F925F926F927F928F929F92AF92BF9298 +:10109000CF92DF92EF92FF920F931F93CF93DF9344 +:1010A000EC017B01DB011C918A81811750F4B4E0D3 +:1010B0001B9FB00111248F8198850E942B14988763 +:1010C0008F831A83F701379680E024E030E06E01C9 +:1010D00093E0C90ED11C9A8189010C5F1F4F8917BB +:1010E00090F5408150E060E070E0742F662755274E +:1010F00044279F0123503109D9019C91492B2F5F2F +:101100003F4FD9019C91592B2F5F3F4FD9019C91A3 +:10111000692B4B835C836D837E8398014F81588557 +:10112000B4E08B9F400D511D1124D6018D909D90F0 +:10113000AD90BC90DA018D929D92AD92BC921397C6 +:101140008F5F3496C8CFF701E20FF31FB080898517 +:101150008B1550F4B4E0BB9EB00111248E859F85A1 +:101160000E942B149F878E87B98640E0BE01665F80 +:101170007F4F8985F701E00FF11F0C5F1F4F481764 +:1011800020F55181828190E0A0E0B0E0DC01992758 +:101190008827952B5081852B2381B22B8A879B87AB +:1011A000AC87BD87AE85BF85E4E04E9FA00DB11D25 +:1011B0001124FB0180809180A280B3808D929D924A +:1011C000AD92BC9213974F5FD4CFB08088898B15B6 +:1011D00050F46B2D70E0660F771F8B899C890E94FD +:1011E0002B149C8B8B8BB88A90E06E01F1E1CF0EB3 +:1011F000D11C8889981708F045C0F701E00FF11F4E +:10120000408151816281738198012C5F3F4FF701CA +:10121000E20FF31F4901032E000CAA08BB08840E3D +:10122000951EA61EB71E8F010E191F092801612CDD +:10123000712C481459046A047B0438F481918F019D +:1012400002501109D8018C93EECF420F531FF701C2 +:10125000E40FF51F31971082215031092E0D3F1DEB +:101260003A8B298B8A012B898C89E22FF82FE90F81 +:10127000F11DE90FF11DD6012D913C9131832083A1 +:101280009F5FB7CFC801DF91CF911F910F91FF9062 +:10129000EF90DF90CF90BF90AF909F908F907F9016 +:1012A0006F905F904F9008952F923F924F925F9270 +:1012B0006F927F928F929F92AF92BF92CF92DF9266 +:1012C000EF92FF920F931F93CF93DF93CDB7DEB7CB +:1012D000A8970FB6F894DEBF0FBECDBF8C010E9459 +:1012E00027102B013C01980129573B4F3C8B2B8B3E +:1012F000F90180819181A281B381A3019201281B10 +:10130000390B4A0B5B0BDA01C901893F9A42A105EF +:10131000B10510F035971082780148E8E41A4BEFD8 +:10132000F40AD7018D919C91892B79F0F801E5574A +:10133000FB4F80819181A281B38184159505A6051B +:10134000B70518F4F70111821082980120583B4F1D +:10135000388B2F87A80144585B4F5A8B498BC801A3 +:1013600044969E8B8D8BD801AE57BB4FBA8FA98FF9 +:10137000F801E057FB4FF8A3EF8F215F3F4F3AA3EF +:1013800029A3180136E8231A3BEF330A4E5F5F4F5B +:10139000588F4F8B89589B4F9CA38BA3A30192011D +:1013A0002C5E3F4F4F4F5F4F2DA33EA34FA358A737 +:1013B000D80112968D919C911397DC01ED91FC91CF +:1013C0000284F385E02D19959C0197FD77C2EF8586 +:1013D000F88980819181820F931F91838083D70147 +:1013E0004D915C9147305105C9F4EF89F88D8081AA +:1013F0009181AC014F5F5F4F51834083F801E80F4B +:10140000F91F248BD1018D919C91119701978D9398 +:101410009C93892B69F688E090E033C04115510513 +:1014200041F52F3F310589F481E090E0D7018D939C +:101430009C932DA13EA14FA158A5ABA1BCA12D937A +:101440003D934D935C931397B3CF0E942710DC011B +:10145000CB0184199509A609B7090697A105B1051D +:1014600008F4A6CFF801EE57FB4F10828EEF9FEFE6 +:101470004DC241305105A9F42E3F310531F482E0CF +:1014800090E0F7019183808393CFD7011D921C9246 +:10149000E98DFA8D808181118BCFC8010E9473077D +:1014A00087CF4230510589F4D1012D933C93EF89C8 +:1014B000F88D1182108283E090E0D7018D939C9388 +:1014C000EF85F8893183208373CF4330510569F468 +:1014D000322F2227D1018D919C911197280F391F0E +:1014E0002D933C9384E090E0CCCF4430510589F4B7 +:1014F00060E071E00E9472138F3F910531F485E046 +:1015000090E0D7018D939C9353CFF7011182108205 +:101510004FCF4530510571F4A989BA892D933C9379 +:1015200086E090E0F70191838083AF85B8892D93A1 +:101530003C933ECF4630510599F4322F2227E9895A +:10154000FA8980819181280F391F3183208387E0B8 +:1015500090E0D7018D939C93F1018081918159CFC7 +:101560004830510509F024CFD7011D921C9260E04C +:1015700071E00E9472138F3F910509F019CFE9893C +:10158000FA8980819181009709F0C7C0C8010E9443 +:10159000730786E292E09A8389831C821B828BE028 +:1015A00093E09E838D8398878F839A8789871B8694 +:1015B0001C861D861E865801FCEEAF1AFBEFBF0A83 +:1015C00068012AEBC21A2BEFD20AD501ED91FC91EA +:1015D0003097D9F1848195819C838B83808191811F +:1015E0009E838D8382819381DC01ED91FC91048047 +:1015F000F581E02D199598878F83D501ED91FC91A8 +:1016000082819381DC01ED91FC910680F781E02DD0 +:1016100019959A87898720E032E040E050E02B87D7 +:101620003C874D875E87D8018D919C91F501A08103 +:10163000B18118966D917C911997DC01ED91FC9127 +:10164000AE014F5F5F4FC8011995B2E0AB0EB11C00 +:10165000AC14BD0409F0B9CF812C92E0992EA12CD5 +:10166000B12CF601A081B1811097E1F112968D9114 +:101670009C9113979C838B8314968D919C911597C5 +:101680009E838D83ED91FC9111970480F581E02D6F +:10169000CD01199598878F83D6018D919C91DC019E +:1016A000ED91FC910680F781E02D19959A87898745 +:1016B0008B869C86AD86BE86D801ED91FC912080FC +:1016C0003180F60180819181DC01ED91FC910280F5 +:1016D000F381E02D1995AE014F5F5F4FBC01C8014A +:1016E000F1011995F2E0CF0ED11CCE14DF0409F000 +:1016F000B8CFF801EE57FB4F81E0808331964082EE +:10170000518262827382AB89BC894D925D926D92E7 +:101710007C9213978FEF9FEFF9C08A30910509F003 +:10172000A2C082E392E09A8389831B821C821D827D +:101730001E821F82188619861A860E942710F801B9 +:1017400080849184A284B3849B01AC012819390957 +:101750004A095B0949015A016D897E89CE010196CA +:101760000E942505C501B40128EE33E040E050E0B9 +:101770000E9486138B809C80AD80BE80820E931E5B +:10178000A41EB51E8B829C82AD82BE829B01AC01E1 +:1017900060E472E48FE090E00E9462138F8098848E +:1017A000A984BA84DC01CB01880D991DAA1DBB1D3B +:1017B0008F839887A987BA870E9427108F80988483 +:1017C000A984BA8436E3931A35E6A30A34ECB30A43 +:1017D00028EE33E040E050E00E9486132B8F3C8FD0 +:1017E0004D8F5E8F9B01AC0160E472E48FE090E06E +:1017F0000E946213A5019401261B370B480B590B5D +:10180000CA01B9018B809C80AD80BE8031E0831A13 +:101810009108A108B1082B8D3C8D4D8D5E8D821AEB +:10182000930AA40AB50A20E03AEC4AE95BE30E9475 +:101830008613820E931EA41EB51ED8011C968D928F +:101840009D92AD92BC921F97F801608B718B828B39 +:10185000938B0E942710AB89BC896D937D938D93E8 +:101860009C931397A5CD8630910559F46D897E8997 +:101870008F8D98A10E94400881E0E9A1FAA18083A0 +:1018800097CD8B30910521F4A98DBA8D1C9290CD06 +:10189000FC01E154FE4FEE0FFF1FE00FF11F8081AE +:1018A0009181009709F484CDDC01ED91FC910190C8 +:1018B000F081E02D6D897E8919957ACDF801EE577A +:1018C000FB4F8081882301F17801BDE7EB1ABBEF64 +:1018D000FB0AF70180819181A281B381A30192016A +:1018E000281B390B4A0B5B0BDA01C901853C994077 +:1018F000A105B10548F0C8010E947307D7014D92B8 +:101900005D926D927C92139780E090E0A8960FB65E +:10191000F894DEBF0FBECDBFDF91CF911F910F9125 +:10192000FF90EF90DF90CF90BF90AF909F908F90FF +:101930007F906F905F904F903F902F900895BF924F +:10194000CF92DF92EF92FF920F931F93CF93DF938B +:10195000EC018B018A81FB01808311821282138248 +:10196000DB01179680E0E4E0F0E09A819F012C5FB4 +:101970003F4F8917B8F4EF81F88594E0899FE00D17 +:10198000F11D11247081518142819381FD013397B2 +:10199000708331965083319640839C93F9018F5F19 +:1019A0001496E3CF8985E00FF11F808311821282A4 +:1019B000138280E09985F801E20FF31F2C5F3F4FFF +:1019C0008917B0F4AE85BF8594E0899FA00DB11D45 +:1019D00011246C9111965C91119712964C9112976B +:1019E00013969C9160835183428393838F5FE2CFF0 +:1019F0008889808311821282C9011382B12C2889BF +:101A0000B21690F5EB2DF0E0EE0FFF1FAB89BC890D +:101A1000AE0FBF1F2D913C91D9010D900020E9F729 +:101A200011976D01C21AD30AD801A80FB91FA601D8 +:101A300060E070E04D935D936D937C9313977C0110 +:101A400024E0E20EF11C8B899C89E80FF91F60816C +:101A50007181A601C8018E0D9F1D0E941915C60136 +:101A60008E0D9F1DB394CBCFDF91CF911F910F911E +:101A7000FF90EF90DF90CF90BF900895CF93DF93CA +:101A8000DC01FB0112968C911297808313968D9145 +:101A90009C911497EC0109900020E9F72197C81B4D +:101AA000D90BAE0160E070E041835283638374839D +:101AB00013966D917C911497AE01CF0105960E940B +:101AC0001915CE010596DF91CF910895CF92DF923F +:101AD000EF92FF920F931F93CF93DF937C01EB0163 +:101AE000FC018281888383818983A481B581FD0182 +:101AF00001900020E9F731976F01CA1ADB0AC6018D +:101B0000A0E0B0E08A839B83AC83BD83F70164814E +:101B10007581A601CE0106960E941915F701A681CE +:101B2000B781FD0101900020E9F731978F010A1B71 +:101B30001B0BFE01EC0DFD1DC801A0E0B0E086838B +:101B40009783A087B187FAE0CF0ED11CF701668199 +:101B50007781A801CE018C0D9D1D0E9419150C0DD9 +:101B60001D1DF701A085B185FD0101900020E9F759 +:101B700031976F01CA1ADB0AFE01E00FF11FC6019F +:101B8000A0E0B0E080839183A283B3830C5F1F4FFA +:101B9000F70160857185A601CE01800F911F0E941B +:101BA00019150C0D1D1DF70142852385948585852A +:101BB000C00FD11F488329839A838B83C801049661 +:101BC000DF91CF911F910F91FF90EF90DF90CF9019 +:101BD00008951F920F920FB60F9211240BB60F9219 +:101BE0002F933F934F935F936F937F938F939F9325 +:101BF000AF93BF93EF93FF9382E194E00E9466025C +:101C0000FF91EF91BF91AF919F918F917F916F91D4 +:101C10005F914F913F912F910F900BBE0F900FBE90 +:101C20000F901F9018951F920F920FB60F921124CC +:101C30000BB60F922F938F939F93EF93FF93E091A7 +:101C40002204F09123048081E0912804F09129047A +:101C500082FD12C0908180912B048F5F8F73209141 +:101C60002C04821751F0E0912B04F0E0EE5EFB4F64 +:101C7000958F80932B0401C08081FF91EF919F91FC +:101C80008F912F910F900BBE0F900FBE0F901F9052 +:101C900018951F920F920FB60F9211240BB60F9248 +:101CA0002F933F934F935F936F937F938F939F9364 +:101CB000AF93BF93EF93FF9380E49CE990938500EB +:101CC000809384000E945907FF91EF91BF91AF91DB +:101CD0009F918F917F916F915F914F913F912F9144 +:101CE0000F900BBE0F900FBE0F901F901895362FC0 +:101CF00090E0FC01EE5CFC4F4491FC01E451FD4F8F +:101D00002491FC01EA55FD4F9491992309F46BC08D +:101D1000442309F455C050E0FA013197E231F1054E +:101D200008F04EC08827EE58FF4F8F4F0C94C71312 +:101D3000809180008F7707C0809180008F7D03C0E5 +:101D400080918000877F809380003AC084B58F7730 +:101D500002C084B58F7D84BD33C08091B0008F7781 +:101D600003C08091B0008F7D8093B00029C0809126 +:101D700090008F7707C0809190008F7D03C0809185 +:101D80009000877F809390001BC08091A0008F7788 +:101D900007C08091A0008F7D03C08091A000877F45 +:101DA0008093A0000DC0809120018F7707C08091A3 +:101DB00020018F7D03C080912001877F80932001C7 +:101DC000E92FF0E0EE0FFF1FE457FD4FA591B4910E +:101DD0008FB7F894EC91311103C020952E2301C0E8 +:101DE0002E2B2C938FBF0895CF93DF9390E0FC01AF +:101DF000E451FD4F2491FC01EA55FD4F8491882365 +:101E000061F190E0880F991FFC01EE58FD4FC591DC +:101E1000D491FC01E457FD4FA591B491611109C023 +:101E20009FB7F8948881209582238883EC912E2394 +:101E30000BC0623061F49FB7F8943881822F80958F +:101E400083238883EC912E2B2C939FBF06C08FB7E2 +:101E5000F894E8812E2B28838FBFDF91CF910895CE +:101E6000CF93C82F61E00E94F40EEC2FF0E0EE5CFF +:101E7000FC4FE4914E2F50E0FA013197E231F10529 +:101E800008F0B9C08827EC57FF4F8F4F0C94C71349 +:101E900084B5806884BD8FE387BDB2C084B580629D +:101EA00084BD8FE388BDACC0809180008068809342 +:101EB00080008FE390E09093890080938800A0C019 +:101EC000809180008062809380008FE390E0909307 +:101ED0008B0080938A0094C08091800088608093FA +:101EE00080008FE390E090938D0080938C0088C0F9 +:101EF0008091B00080688093B0008FE38093B3003E +:101F00007FC08091B00080628093B0008FE38093A7 +:101F1000B40076C0809190008068809390008FE339 +:101F200090E090939900809398006AC0809190000F +:101F30008062809390008FE390E090939B00809369 +:101F40009A005EC0809190008860809390008FE33B +:101F500090E090939D0080939C0052C08091A000DF +:101F600080688093A0008091A0008F7B8093A00068 +:101F70008FE390E09093A9008093A80041C08091E6 +:101F8000A00080628093A0008FE390E09093AB006C +:101F90008093AA0035C08091A00088608093A00043 +:101FA0008FE390E09093AD008093AC0029C08091C6 +:101FB00020018068809320018FE390E090932901B5 +:101FC000809328011DC080912001806280932001B0 +:101FD0008FE390E090932B0180932A0111C08091B0 +:101FE00020018860809320018FE390E090932D0181 +:101FF00080932C0105C060E08C2FCF910C94770E5C +:10200000CF9108953FB7F89480918109909182090A +:10201000A0918309B091840926B5A89B05C02F3FE4 +:1020200019F00196A11DB11D3FBFBA2FA92F982FFE +:102030008827820F911DA11DB11DBC01CD0142E079 +:10204000660F771F881F991F4A95D1F708952FB7FC +:10205000F89460917D0970917E0980917F0990913B +:1020600080092FBF08951F920F920FB60F9211246F +:102070002F933F938F939F93AF93BF9380917D094D +:1020800090917E09A0917F09B091800930917C09DF +:1020900023E0230F2D3720F40196A11DB11D05C0AB +:1020A00026E8230F0296A11DB11D20937C09809381 +:1020B0007D0990937E09A0937F09B0938009809158 +:1020C000810990918209A0918309B09184090196B8 +:1020D000A11DB11D8093810990938209A09383096A +:1020E000B0938409BF91AF919F918F913F912F91B0 +:1020F0000F900FBE0F901F901895CF92DF92EF9226 +:10210000FF920F931F93E82FF92F05C0015011097B +:102110002109310961F1908196239417B9F305C023 +:10212000015011092109310911F19081962394136D +:10213000F7CFC12CD12CE12CF12C0AC08FEFC81A9B +:10214000D80AE80AF80A0C151D052E053F0579F096 +:1021500080818623841791F36C2D7D2D8E2D9F2DEC +:102160001F910F91FF90EF90DF90CF90089560E066 +:1021700070E080E090E01F910F91FF90EF90DF9072 +:10218000CF900895789484B5826084BD84B58160D1 +:1021900084BD85B5826085BD85B5816085BD809132 +:1021A0006E00816080936E001092810080918100AA +:1021B00082608093810080918100816080938100A2 +:1021C000809180008160809380008091B100846064 +:1021D0008093B1008091B00081608093B0008091C5 +:1021E0009100826080939100809191008160809342 +:1021F0009100809190008160809390008091A10077 +:1022000082608093A1008091A10081608093A100F1 +:102210008091A00081608093A00080912101826064 +:10222000809321018091210181608093210180911F +:10223000200181608093200180917A0084608093E6 +:102240007A0080917A00826080937A0080917A008F +:10225000816080937A0080917A00806880937A0010 +:102260001092C100C090DB04D090DC04E090DD044B +:10227000F090DE04C091D904D091DA0460E079E0F6 +:102280008DE390E0A70196010E948613DA01C9014F +:102290000197A109B109B695A795979587959C01D6 +:1022A000E889F98982E08083C11481EED806E104CF +:1022B000F10421F02115E0E13E07A8F0E889F98951 +:1022C000108260E874E88EE190E0A70196010E9418 +:1022D0008613DA01C9010197A109B109B695A7953D +:1022E000979587959C01EC85FD853083EE85FF856C +:1022F0002083188EEC89FD8986E08083EA89FB893A +:10230000808180618083EA89FB8980818860808305 +:10231000EA89FB89808180688083EA89FB898081E2 +:102320008F7D80831092500910924F0910925209AC +:1023300010925109109256091092550910925409A1 +:1023400010925309EDE1F9E080E090E021913191A4 +:10235000232B81F4FC01EE0FFF1FE35EF64F2FEA03 +:1023600034E0318320838C599F4F9093B204809343 +:10237000B10404C001968931910541F761E08DE017 +:102380000E94F40E61E087E00E94F40E61E088E1B3 +:102390000E94F40E61E086E00E94F40E61E083E0AA +:1023A0000E94F40E61E089E10E94F40E61E082E097 +:1023B0000E94F40E61E087E10E94F40E60E086E185 +:1023C0000E94F40EF894109280001092810080E434 +:1023D0009CE99093850080938400809181008460C3 +:1023E0008093810080916F00816080936F0078946A +:1023F000C3E0D0E093E2E92EF12C22E0C22E23E0EC +:10240000D22E3CEB232E32E0332E4AE3442E512CC5 +:10241000612C712C60E087E10E94770ECE0101975C +:10242000F1F761E087E10E94770EC7010197F1F7AC +:1024300060E087E10E94770EF6016491F1018491DA +:10244000E82FF0E0EE0FFF1FE85AFD4F85919491C1 +:1024500000E412E42FE030E0462F0E947D10611569 +:1024600071058105910549F0DC01CB010196A11DA3 +:10247000B11DBC01CD019F7003C060E070E0CB01D5 +:1024800060930E0470930F048093100490931104D2 +:10249000A30192010E94A81320930A0430930B0415 +:1024A00040930C0450930D0425313105410551052D +:1024B00014F461E005C087ED94E00E94540960E0E7 +:1024C0008DE00E94770E0E9402104B015C010E9479 +:1024D0000210DC01CB0188199909AA09BB09883EC1 +:1024E0009340A105B10598F30E94F00293CF10929A +:1024F00015041092140488EE93E0A0E0B0E08093FD +:10250000160490931704A0931804B09319048AE456 +:1025100092E090931304809312048DEC90E09093DA +:102520001F0480931E048CEC90E090932104809310 +:10253000200488EC90E0909323048093220489EC9B +:1025400090E090932504809324048AEC90E090938B +:102550002704809326048EEC90E0909329048093C6 +:10256000280410922B0410922C0410922D04109227 +:102570002E048CE892E09093D8048093D70482E1F3 +:1025800094E09093DA048093D90480E091EEA0E087 +:10259000B0E08093DB049093DC04A093DD04B0935F +:1025A000DE041092590984E792E0909368098093C1 +:1025B00067091092690910926F0910926E091092C2 +:1025C000700910927609109275091092770910928D +:1025D0007B0910927A09EBEEF8E01192119289E0F2 +:1025E000ED31F807D1F7EDE1F9E01192119289E0B0 +:1025F000EF34F807D1F7EBEEF4E0119286E0EB3E12 +:10260000F807D9F7EBEEF6E0119288E0EB3EF80719 +:10261000D9F786E992E09093B0048093AF0488E6FE +:1026200092E09093B6048093B5048CE592E0909389 +:10263000B8048093B7041092B9041092BA041092AF +:10264000BB041092BC041092BD041092BE04109200 +:10265000BF041092C0041092C1041092C2041092E0 +:10266000C3041092C4049093C6048093C5041092CE +:10267000C7041092C8041092C9041092CA041092A0 +:10268000CB041092CC041092CD041092CE04109280 +:10269000CF041092D0041092D1041092D2048BEA8D +:1026A00097E09093D4048093D30481E090E09093DA +:1026B000D6048093D50481E094E09093B404809391 +:1026C000B3040895DB018F939F930E94CF13BF91B2 +:1026D000AF91A29F800D911DA39F900DB29F900D71 +:1026E0001124089597FB072E16F4009407D077FD68 +:1026F00009D00E94DA1307FC05D03EF4909581952D +:102700009F4F0895709561957F4F0895A1E21A2E0D +:10271000AA1BBB1BFD010DC0AA1FBB1FEE1FFF1F85 +:10272000A217B307E407F50720F0A21BB30BE40BD5 +:10273000F50B661F771F881F991F1A9469F760951C +:102740007095809590959B01AC01BD01CF010895D6 +:10275000052E97FB1EF400940E94BF1357FD07D06F +:102760000E94861307FC03D04EF40C94BF135095BF +:102770004095309521953F4F4F4F5F4F089590956D +:102780008095709561957F4F8F4F9F4F0895EE0F05 +:10279000FF1F881F8BBF0790F691E02D19940E94B0 +:1027A000EE13A59F900DB49F900DA49F800D911DD9 +:1027B00011240895AA1BBB1B51E107C0AA1FBB1F10 +:1027C000A617B70710F0A61BB70B881F991F5A95BD +:1027D000A9F780959095BC01CD010895A29FB00105 +:1027E000B39FC001A39F700D811D1124911DB29F45 +:1027F000700D811D1124911D08950E94021408F48A +:1028000081E00895990F0008550FAA0BE0E8FEEF4C +:1028100016161706E807F907C0F012161306E407A4 +:10282000F50798F0621B730B840B950B39F40A269D +:1028300061F0232B242B252B21F408950A2609F47B +:10284000A140A6958FEF811D811D08950E9402145D +:1028500008F48FEF08956F927F928F929F92AF92BC +:10286000BF92CF92DF92EF92FF920F931F93CF937D +:10287000DF93EC01009789F4CB01DF91CF911F9199 +:102880000F91FF90EF90DF90CF90BF90AF909F900F +:102890008F907F906F900C942215FC01E60FF71F2C +:1028A0009C0122503109E217F30708F4ACC0D901AA +:1028B0000D911C91119706171707B0F005301105FF +:1028C00008F49FC0C80104978617970708F499C0B9 +:1028D00002501109061B170B019311936D937C9302 +:1028E000CF010E94B7158DC05B01A01AB10A4C013F +:1028F000800E911EA0918709B091880940E050E0B8 +:10290000E12CF12C109709F44AC0A815B905D1F5AE +:102910006D907C901197630182E0C80ED11CCA149F +:10292000DB0480F1A3014A195B096A0182E0C80E49 +:10293000D11C1296BC9012971396AC91B5E0CB16B1 +:10294000D10440F0B282A38351834083D9016D93B7 +:102950007C930AC00E5F1F4FC301800F911FF901C6 +:1029600091838083EB2DFA2FE114F10431F0D7012C +:102970001396FC93EE93129744C0F0938809E0936A +:1029800087093FC08D919C9111974817590708F40A +:10299000AC017D0112960D90BC91A02DB3CF80911A +:1029A00085099091860988159905E1F4461757071E +:1029B000C8F48091000290910102009741F48DB714 +:1029C0009EB74091040250910502841B950BE817B5 +:1029D000F907C8F4F0938609E0938509F90171833A +:1029E00060830FC0CB010E9422157C01009759F033 +:1029F000A801BE010E941915CE010E94B715C7019A +:102A000004C0CE0102C080E090E0DF91CF911F9121 +:102A10000F91FF90EF90DF90CF90BF90AF909F907D +:102A20008F907F906F90089581E090E0F8940C94DF +:102A30004F16FB01DC0102C001900D924150504045 +:102A4000D8F70895CF93DF938230910510F482E098 +:102A500090E0E0918709F091880920E030E0C0E043 +:102A6000D0E0309711F14081518148175907C0F0EB +:102A70004817590761F482819381209719F09B834D +:102A80008A832BC0909388098093870926C02115DB +:102A9000310519F04217530718F49A01BE01DF01FE +:102AA000EF010280F381E02DDCCF2115310509F122 +:102AB000281B390B2430310590F412968D919C918E +:102AC00013976115710521F0FB019383828304C084 +:102AD0009093880980938709FD01329644C0FD01D7 +:102AE000E20FF31F81939193225031092D933C9370 +:102AF0003AC02091850930918609232B41F4209119 +:102B000002023091030230938609209385092091B7 +:102B10000002309101022115310541F42DB73EB775 +:102B20004091040250910502241B350BE091850968 +:102B3000F0918609E217F307A0F42E1B3F0B28172C +:102B4000390778F0AC014E5F5F4F2417350748F026 +:102B50004E0F5F1F5093860940938509819391938F +:102B600002C0E0E0F0E0CF01DF91CF9108950F9334 +:102B70001F93CF93DF93009709F48CC0FC01329729 +:102B8000138212820091870910918809011511059D +:102B900081F420813181820F931F2091850930912A +:102BA00086092817390779F5F0938609E093850996 +:102BB00071C0D80140E050E0AE17BF0750F4129644 +:102BC0002D913C911397AD012115310509F1D901E2 +:102BD000F3CF9D01DA013383228360817181860FF7 +:102BE000971F8217930769F4EC0128813981260F1A +:102BF000371F2E5F3F4F318320838A819B819383D0 +:102C00008283452B29F4F0938809E093870942C019 +:102C10001396FC93EE931297ED01499159919E0101 +:102C2000240F351FE217F30771F480819181840F1F +:102C3000951F029611969C938E9382819381139691 +:102C40009C938E931297E0E0F0E0D80112968D915C +:102C50009C911397009719F0F8018C01F6CF8D9194 +:102C60009C9198012E5F3F4F820F931F2091850901 +:102C7000309186092817390769F4309729F41092A2 +:102C800088091092870902C0138212821093860964 +:102C900000938509DF91CF911F910F910895F894CA +:022CA000FFCF64 +:102CA200000089098000726F7373657269616C5FDD +:102CB2006D7367732F5265717565737450617261BC +:102CC2006D0000000000660D430440043D04000056 +:102CD20000006B05250522051F05000000003E0DC2 +:102CE200FB03F803F503000000008702F0011F0256 +:102CF200CE0250022E024202000000000D073306EF +:102D0200EC03E903000000003D075D06E603E30370 +:102D1200000000009F0C4008F203EF0300000000D7 +:102D22007107710771077107000000003803540929 +:102D32002903000000007906340331032E033966AB +:102D42003139356638383132343666646661323745 +:102D520039386431643365656263613834610067B0 +:102D6200656F6D657472795F6D7367732F547769E0 +:102D72007374004D6573736167652066726F6D20B1 +:102D82006465766963652064726F707065643A2069 +:102D92006D657373616765206C617267657220741B +:102DA20068616E206275666665722E003461383421 +:102DB20032623635663431333038346463326231EC +:102DC2003066623438346561376631370067656F63 +:102DD2006D657472795F6D7367732F566563746F77 +:102DE2007233003966306539386264613635393894 +:102DF200313938366464663533616661376134303F +:102E020065343900313161626437333163323539C7 +:102E1200333332363163643631383362643132648B +:102E22003632393500726F7373657269616C5F6D2A +:102E32007367732F4C6F67003061643531663838C1 +:102E42006663343438393266386331303638343078 +:102E5200373736343630303500726F7373657269C6 +:102E6200616C5F6D7367732F546F706963496E662F +:102E72006F00636437313636633734633535326316 +:102E8200333131666263633266653561376263325C +:102E92003839007374645F6D7367732F54696D659D +:0A2EA20000636D645F76656C00004C +:00000001FF diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/libros_lib.a b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/libros_lib.a new file mode 100755 index 0000000..2fe75bf Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/libros_lib.a differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/ros_lib/duration.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/ros_lib/duration.o new file mode 100755 index 0000000..2443988 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/ros_lib/duration.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/ros_lib/time.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/ros_lib/time.o new file mode 100755 index 0000000..60db496 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/lib458/ros_lib/time.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/libFrameworkArduino.a b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/libFrameworkArduino.a new file mode 100755 index 0000000..df30ab2 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/libFrameworkArduino.a differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a new file mode 100755 index 0000000..8b277f0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a @@ -0,0 +1 @@ +! diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/src/robotbase_21.ino.o b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/src/robotbase_21.ino.o new file mode 100755 index 0000000..2f949b0 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/.pioenvs/megaADK/src/robotbase_21.ino.o differ diff --git a/case_study/arduino_lab/group_21/original/.pioenvs/structure.hash b/case_study/arduino_lab/group_21/original/.pioenvs/structure.hash new file mode 100755 index 0000000..539e154 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.pioenvs/structure.hash @@ -0,0 +1 @@ +d6c3ffcd57a2299706b78dff960c073b7828021f \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/.library.json b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/.library.json new file mode 100755 index 0000000..fd306ef --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/.library.json @@ -0,0 +1,39 @@ +{ + "name": "Timer", + "repository": { + "url": "https://github.com/JChristensen/Timer.git", + "type": "git" + }, + "platforms": [ + "atmelavr" + ], + "frameworks": [ + "arduino" + ], + "version": "7b408e8131", + "authors": [ + { + "url": null, + "maintainer": true, + "email": null, + "name": "Jack Christensen" + }, + { + "url": null, + "maintainer": false, + "email": null, + "name": "Simon Monk" + }, + { + "url": null, + "maintainer": false, + "email": null, + "name": "Damian Philipp" + } + ], + "keywords": [ + "timer" + ], + "id": 75, + "description": "Timer Library" +} \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Event.cpp b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Event.cpp new file mode 100755 index 0000000..6ef838d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Event.cpp @@ -0,0 +1,65 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// For Arduino 1.0 and earlier +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + +#include "Event.h" + +Event::Event(void) +{ + eventType = EVENT_NONE; +} + +void Event::update(void) +{ + unsigned long now = millis(); + update(now); +} + +void Event::update(unsigned long now) +{ + if (now - lastEventTime >= period) + { + switch (eventType) + { + case EVENT_EVERY: + (*callback)(); + break; + + case EVENT_OSCILLATE: + pinState = ! pinState; + digitalWrite(pin, pinState); + break; + } + lastEventTime = now; + count++; + } + if (repeatCount > -1 && count >= repeatCount) + { + eventType = EVENT_NONE; + } +} diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Event.h b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Event.h new file mode 100755 index 0000000..2f64d3f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Event.h @@ -0,0 +1,49 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef Event_h +#define Event_h + +#include + +#define EVENT_NONE 0 +#define EVENT_EVERY 1 +#define EVENT_OSCILLATE 2 + +class Event +{ + +public: + Event(void); + void update(void); + void update(unsigned long now); + int8_t eventType; + unsigned long period; + int repeatCount; + uint8_t pin; + uint8_t pinState; + void (*callback)(void); + unsigned long lastEventTime; + int count; +}; + +#endif diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/ReadMe.txt b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/ReadMe.txt new file mode 100755 index 0000000..5b08895 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/ReadMe.txt @@ -0,0 +1,29 @@ +1.0 by Simon Monk +Library as downloaded 02Feb2012 22:55 UTC from http://srmonk.blogspot.com/2012/01/arduino-timer-library.html + +1.1 by Jack Christensen +Changed data types of variables and functions: + o event types and indexes changed from int to int8_t. + o periods and durations changed from lon to unsigned long. + o update() and stop() functions typed as void, since they return nothing. + o pin numbers and pin values changed from int to uint8_t, this agrees with digitalWrite(). + o added return values to Timer::pulse() and Timer::oscillate(uint8_t, unsigned long, uint8_t). + o changed test in Event::update() to use subtraction to avoid rollover issues. + o Updated keywords.txt file to include all functions. + +1.2 by Damian Philipp + o Added a range check to Timer::stop() to avoid memory corruption. + o Added constants to : + - NO_TIMER_AVAILABLE: Signals that while an event was to be queued, no free timer could be found. + - TIMER_NOT_AN_EVENT: Can be used to flag a variable that *might* contain a timer ID as + *not* containing a timer ID + o Replaced a bunch of magic numbers in by the above constants + o Added several comments + o Added Timer::pulseImmediate(). pulseImmediate sets the pin to the specified value for the given + duration. After the duration, the pin is set to !value. + +1.3 by Jack Christensen + o Added "blink2" example illustrating flashing two LEDs at different rates. + o 19Oct2013: This is the last v1.x release. It will continue to be available on GitHub + as a branch named v1.3. Future development will continue with Sandy Walsh's v2.0 which + can pass context (timer ID, etc.) to the callback functions. \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Timer.cpp b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Timer.cpp new file mode 100755 index 0000000..9c8b889 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Timer.cpp @@ -0,0 +1,138 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +// For Arduino 1.0 and earlier +#if defined(ARDUINO) && ARDUINO >= 100 +#include "Arduino.h" +#else +#include "WProgram.h" +#endif + +#include "Timer.h" + +Timer::Timer(void) +{ +} + +int8_t Timer::every(unsigned long period, void (*callback)(), int repeatCount) +{ + int8_t i = findFreeEventIndex(); + if (i == -1) return -1; + + _events[i].eventType = EVENT_EVERY; + _events[i].period = period; + _events[i].repeatCount = repeatCount; + _events[i].callback = callback; + _events[i].lastEventTime = millis(); + _events[i].count = 0; + return i; +} + +int8_t Timer::every(unsigned long period, void (*callback)()) +{ + return every(period, callback, -1); // - means forever +} + +int8_t Timer::after(unsigned long period, void (*callback)()) +{ + return every(period, callback, 1); +} + +int8_t Timer::oscillate(uint8_t pin, unsigned long period, uint8_t startingValue, int repeatCount) +{ + int8_t i = findFreeEventIndex(); + if (i == NO_TIMER_AVAILABLE) return NO_TIMER_AVAILABLE; + + _events[i].eventType = EVENT_OSCILLATE; + _events[i].pin = pin; + _events[i].period = period; + _events[i].pinState = startingValue; + digitalWrite(pin, startingValue); + _events[i].repeatCount = repeatCount * 2; // full cycles not transitions + _events[i].lastEventTime = millis(); + _events[i].count = 0; + return i; +} + +int8_t Timer::oscillate(uint8_t pin, unsigned long period, uint8_t startingValue) +{ + return oscillate(pin, period, startingValue, -1); // forever +} + +/** + * This method will generate a pulse of !startingValue, occuring period after the + * call of this method and lasting for period. The Pin will be left in !startingValue. + */ +int8_t Timer::pulse(uint8_t pin, unsigned long period, uint8_t startingValue) +{ + return oscillate(pin, period, startingValue, 1); // once +} + +/** + * This method will generate a pulse of startingValue, starting immediately and of + * length period. The pin will be left in the !startingValue state + */ +int8_t Timer::pulseImmediate(uint8_t pin, unsigned long period, uint8_t pulseValue) +{ + int8_t id(oscillate(pin, period, pulseValue, 1)); + // now fix the repeat count + if (id >= 0 && id < MAX_NUMBER_OF_EVENTS) { + _events[id].repeatCount = 1; + } + return id; +} + + +void Timer::stop(int8_t id) +{ + if (id >= 0 && id < MAX_NUMBER_OF_EVENTS) { + _events[id].eventType = EVENT_NONE; + } +} + +void Timer::update(void) +{ + unsigned long now = millis(); + update(now); +} + +void Timer::update(unsigned long now) +{ + for (int8_t i = 0; i < MAX_NUMBER_OF_EVENTS; i++) + { + if (_events[i].eventType != EVENT_NONE) + { + _events[i].update(now); + } + } +} +int8_t Timer::findFreeEventIndex(void) +{ + for (int8_t i = 0; i < MAX_NUMBER_OF_EVENTS; i++) + { + if (_events[i].eventType == EVENT_NONE) + { + return i; + } + } + return NO_TIMER_AVAILABLE; +} diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Timer.h b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Timer.h new file mode 100755 index 0000000..dd5ce93 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/Timer.h @@ -0,0 +1,67 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * + Code by Simon Monk + http://www.simonmonk.org +* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#ifndef Timer_h +#define Timer_h + +#include +#include "Event.h" + +#define MAX_NUMBER_OF_EVENTS (10) + +#define TIMER_NOT_AN_EVENT (-2) +#define NO_TIMER_AVAILABLE (-1) + +class Timer +{ + +public: + Timer(void); + + int8_t every(unsigned long period, void (*callback)(void)); + int8_t every(unsigned long period, void (*callback)(void), int repeatCount); + int8_t after(unsigned long duration, void (*callback)(void)); + int8_t oscillate(uint8_t pin, unsigned long period, uint8_t startingValue); + int8_t oscillate(uint8_t pin, unsigned long period, uint8_t startingValue, int repeatCount); + + /** + * This method will generate a pulse of !startingValue, occuring period after the + * call of this method and lasting for period. The Pin will be left in !startingValue. + */ + int8_t pulse(uint8_t pin, unsigned long period, uint8_t startingValue); + + /** + * This method will generate a pulse of pulseValue, starting immediately and of + * length period. The pin will be left in the !pulseValue state + */ + int8_t pulseImmediate(uint8_t pin, unsigned long period, uint8_t pulseValue); + void stop(int8_t id); + void update(void); + void update(unsigned long now); + +protected: + Event _events[MAX_NUMBER_OF_EVENTS]; + int8_t findFreeEventIndex(void); + +}; + +#endif diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/blink2/blink2.ino b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/blink2/blink2.ino new file mode 100755 index 0000000..e9080a4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/blink2/blink2.ino @@ -0,0 +1,29 @@ +//Flash two LEDs at different rates using Simon Monk's Timer library +//http://www.doctormonk.com/2012/01/arduino-timer-library.html +// +//Jack Christensen 30Sep2013 +// +//Beerware license: Free for any and all purposes, but if you find it +//useful AND we actually meet someday, you can buy me a beer! + +#include "Timer.h" //http://github.com/JChristensen/Timer + +const int LED1 = 8; //connect one LED to this pin (with appropriate current-limiting resistor of course) +const int LED2 = 9; //connect another LED to this pin (don't forget the resistor) +const unsigned long PERIOD1 = 1000; //one second +const unsigned long PERIOD2 = 10000; //ten seconds +Timer t; //instantiate the timer object + +void setup(void) +{ + pinMode(LED1, OUTPUT); + pinMode(LED2, OUTPUT); + t.oscillate(LED1, PERIOD1, HIGH); + t.oscillate(LED2, PERIOD2, HIGH); +} + +void loop(void) +{ + t.update(); +} + diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/kitchen_sink/kitchen_sink.pde b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/kitchen_sink/kitchen_sink.pde new file mode 100755 index 0000000..991bcb4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/kitchen_sink/kitchen_sink.pde @@ -0,0 +1,42 @@ +#include "Timer.h" + +Timer t; + +int ledEvent; + +void setup() +{ + Serial.begin(9600); + int tickEvent = t.every(2000, doSomething); + Serial.print("2 second tick started id="); + Serial.println(tickEvent); + + pinMode(13, OUTPUT); + ledEvent = t.oscillate(13, 50, HIGH); + Serial.print("LED event started id="); + Serial.println(ledEvent); + + int afterEvent = t.after(10000, doAfter); + Serial.print("After event started id="); + Serial.println(afterEvent); + +} + +void loop() +{ + t.update(); +} + +void doSomething() +{ + Serial.print("2 second tick: millis()="); + Serial.println(millis()); +} + + +void doAfter() +{ + Serial.println("stop the led event"); + t.stop(ledEvent); + t.oscillate(13, 500, HIGH, 5); +} diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/pin_high_10_mins/pin_high_10_mins.pde b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/pin_high_10_mins/pin_high_10_mins.pde new file mode 100755 index 0000000..2a175a8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/pin_high_10_mins/pin_high_10_mins.pde @@ -0,0 +1,17 @@ +#include "Timer.h" + +Timer t; +int pin = 13; + +void setup() +{ + pinMode(pin, OUTPUT); + t.pulse(pin, 10 * 1000UL, HIGH); // 10 seconds + // t.pulse(pin, 10 * 60 * 1000UL, HIGH); // 10 minutes +} + +void loop() +{ + t.update(); +} + diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/read_A0_flashLED/read_A0_flashLED.pde b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/read_A0_flashLED/read_A0_flashLED.pde new file mode 100755 index 0000000..e103e37 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/examples/read_A0_flashLED/read_A0_flashLED.pde @@ -0,0 +1,22 @@ +#include "Timer.h" + +Timer t; +int pin = 13; + +void setup() +{ + Serial.begin(9600); + pinMode(pin, OUTPUT); + t.oscillate(pin, 100, LOW); + t.every(1000, takeReading); +} + +void loop() +{ + t.update(); +} + +void takeReading() +{ + Serial.println(analogRead(0)); +} diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/keywords.txt b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/keywords.txt new file mode 100755 index 0000000..a5107b8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/keywords.txt @@ -0,0 +1,31 @@ +####################################### +# Syntax Coloring Map For Timer Library +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +Timer KEYWORD1 +Event KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### + +every KEYWORD2 +after KEYWORD2 +oscillate KEYWORD2 +pulse KEYWORD2 +pulseImmediate KEYWORD2 +stop KEYWORD2 +update KEYWORD2 +findFreeEventIndex KEYWORD2 + +####################################### +# Instances (KEYWORD2) +####################################### + +####################################### +# Constants (LITERAL1) +####################################### diff --git a/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/library.json b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/library.json new file mode 100755 index 0000000..636f3c1 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/.piolibdeps/Timer_ID75/library.json @@ -0,0 +1,25 @@ +{ + "name": "Timer", + "keywords": "timer", + "description": "Timer Library", + "repository": + { + "type": "git", + "url": "https://github.com/JChristensen/Timer.git" + }, + "authors": + [ + { + "name": "Jack Christensen", + "maintainer": true + }, + { + "name": "Simon Monk" + }, + { + "name": "Damian Philipp" + } + ], + "frameworks": "arduino", + "platforms": "atmelavr" +} diff --git a/case_study/arduino_lab/group_21/original/README.rst b/case_study/arduino_lab/group_21/original/README.rst new file mode 100755 index 0000000..fc64cfa --- /dev/null +++ b/case_study/arduino_lab/group_21/original/README.rst @@ -0,0 +1,29 @@ +.. Copyright (c) 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to test PlatformIO based project +==================================== + +1. `Install PlatformIO Core `_ +2. Download `examples source code `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-examples/unit-testing/wiring-blink + + # Test project + > platformio test + + # Test specific environment + > platformio test -e uno diff --git a/case_study/arduino_lab/group_21/original/lib/readme.txt b/case_study/arduino_lab/group_21/original/lib/readme.txt new file mode 100755 index 0000000..dbadc3d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/readme.txt @@ -0,0 +1,36 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| |--Foo +| | |- Foo.c +| | |- Foo.h +| |- readme.txt --> THIS FILE +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ArduinoHardware.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ArduinoHardware.h new file mode 100755 index 0000000..0f7ff6b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ArduinoHardware.h @@ -0,0 +1,106 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_ARDUINO_HARDWARE_H_ +#define ROS_ARDUINO_HARDWARE_H_ + +#if ARDUINO>=100 + #include // Arduino 1.0 +#else + #include // Arduino 0022 +#endif + +#if defined(__MK20DX128__) || defined(__MK20DX256__) + #include // Teensy 3.0 and 3.1 + #define SERIAL_CLASS usb_serial_class +#elif defined(_SAM3XA_) + #include // Arduino Due + #define SERIAL_CLASS UARTClass +#elif defined(USE_USBCON) + // Arduino Leonardo USB Serial Port + #define SERIAL_CLASS Serial_ +#else + #include // Arduino AVR + #define SERIAL_CLASS HardwareSerial +#endif + +class ArduinoHardware { + public: + ArduinoHardware(SERIAL_CLASS* io , long baud= 57600){ + iostream = io; + baud_ = baud; + } + ArduinoHardware() + { +#if defined(USBCON) and !(defined(USE_USBCON)) + /* Leonardo support */ + iostream = &Serial1; +#else + iostream = &Serial; +#endif + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h){ + this->iostream = iostream; + this->baud_ = h.baud_; + } + + void setBaud(long baud){ + this->baud_= baud; + } + + int getBaud(){return baud_;} + + void init(){ +#if defined(USE_USBCON) + // Startup delay as a fail-safe to upload a new sketch + delay(3000); +#endif + iostream->begin(baud_); + } + + int read(){return iostream->read();}; + void write(uint8_t* data, int length){ + for(int i=0; iwrite(data[i]); + } + + unsigned long time(){return millis();} + + protected: + SERIAL_CLASS* iostream; + long baud_; +}; + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestAction.h new file mode 100755 index 0000000..7777571 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestAction_h +#define _ROS_actionlib_TestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestActionGoal.h" +#include "actionlib/TestActionResult.h" +#include "actionlib/TestActionFeedback.h" + +namespace actionlib +{ + + class TestAction : public ros::Msg + { + public: + actionlib::TestActionGoal action_goal; + actionlib::TestActionResult action_result; + actionlib::TestActionFeedback action_feedback; + + TestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestAction"; }; + const char * getMD5(){ return "991e87a72802262dfbe5d1b3cf6efc9a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionFeedback.h new file mode 100755 index 0000000..347d3f7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionFeedback_h +#define _ROS_actionlib_TestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestFeedback.h" + +namespace actionlib +{ + + class TestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestFeedback feedback; + + TestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionFeedback"; }; + const char * getMD5(){ return "6d3d0bf7fb3dda24779c010a9f3eb7cb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionGoal.h new file mode 100755 index 0000000..2ab1238 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionGoal_h +#define _ROS_actionlib_TestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestGoal.h" + +namespace actionlib +{ + + class TestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestGoal goal; + + TestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionGoal"; }; + const char * getMD5(){ return "348369c5b403676156094e8c159720bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionResult.h new file mode 100755 index 0000000..d7e388c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionResult_h +#define _ROS_actionlib_TestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestResult.h" + +namespace actionlib +{ + + class TestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestResult result; + + TestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionResult"; }; + const char * getMD5(){ return "3d669e3a63aa986c667ea7b0f46ce85e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestFeedback.h new file mode 100755 index 0000000..380f785 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestFeedback.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestFeedback_h +#define _ROS_actionlib_TestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestFeedback : public ros::Msg + { + public: + int32_t feedback; + + TestFeedback(): + feedback(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.real = this->feedback; + *(outbuffer + offset + 0) = (u_feedback.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_feedback.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_feedback.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_feedback.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->feedback); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.base = 0; + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->feedback = u_feedback.real; + offset += sizeof(this->feedback); + return offset; + } + + const char * getType(){ return "actionlib/TestFeedback"; }; + const char * getMD5(){ return "49ceb5b32ea3af22073ede4a0328249e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestGoal.h new file mode 100755 index 0000000..4e2d676 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestGoal_h +#define _ROS_actionlib_TestGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestGoal : public ros::Msg + { + public: + int32_t goal; + + TestGoal(): + goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.real = this->goal; + *(outbuffer + offset + 0) = (u_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.base = 0; + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->goal = u_goal.real; + offset += sizeof(this->goal); + return offset; + } + + const char * getType(){ return "actionlib/TestGoal"; }; + const char * getMD5(){ return "18df0149936b7aa95588e3862476ebde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestAction.h new file mode 100755 index 0000000..2117590 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestAction_h +#define _ROS_actionlib_TestRequestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestRequestActionGoal.h" +#include "actionlib/TestRequestActionResult.h" +#include "actionlib/TestRequestActionFeedback.h" + +namespace actionlib +{ + + class TestRequestAction : public ros::Msg + { + public: + actionlib::TestRequestActionGoal action_goal; + actionlib::TestRequestActionResult action_result; + actionlib::TestRequestActionFeedback action_feedback; + + TestRequestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestAction"; }; + const char * getMD5(){ return "dc44b1f4045dbf0d1db54423b3b86b30"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h new file mode 100755 index 0000000..ce98e9b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionFeedback_h +#define _ROS_actionlib_TestRequestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestFeedback.h" + +namespace actionlib +{ + + class TestRequestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestFeedback feedback; + + TestRequestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionGoal.h new file mode 100755 index 0000000..563b22f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionGoal_h +#define _ROS_actionlib_TestRequestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestRequestGoal.h" + +namespace actionlib +{ + + class TestRequestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestRequestGoal goal; + + TestRequestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionGoal"; }; + const char * getMD5(){ return "1889556d3fef88f821c7cb004e4251f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionResult.h new file mode 100755 index 0000000..67e32a4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionResult_h +#define _ROS_actionlib_TestRequestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestResult.h" + +namespace actionlib +{ + + class TestRequestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestResult result; + + TestRequestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionResult"; }; + const char * getMD5(){ return "0476d1fdf437a3a6e7d6d0e9f5561298"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestFeedback.h new file mode 100755 index 0000000..f1fc247 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TestRequestFeedback_h +#define _ROS_actionlib_TestRequestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestFeedback : public ros::Msg + { + public: + + TestRequestFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TestRequestFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestGoal.h new file mode 100755 index 0000000..8fd822e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestGoal.h @@ -0,0 +1,207 @@ +#ifndef _ROS_actionlib_TestRequestGoal_h +#define _ROS_actionlib_TestRequestGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace actionlib +{ + + class TestRequestGoal : public ros::Msg + { + public: + int32_t terminate_status; + bool ignore_cancel; + const char* result_text; + int32_t the_result; + bool is_simple_client; + ros::Duration delay_accept; + ros::Duration delay_terminate; + ros::Duration pause_status; + enum { TERMINATE_SUCCESS = 0 }; + enum { TERMINATE_ABORTED = 1 }; + enum { TERMINATE_REJECTED = 2 }; + enum { TERMINATE_LOSE = 3 }; + enum { TERMINATE_DROP = 4 }; + enum { TERMINATE_EXCEPTION = 5 }; + + TestRequestGoal(): + terminate_status(0), + ignore_cancel(0), + result_text(""), + the_result(0), + is_simple_client(0), + delay_accept(), + delay_terminate(), + pause_status() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.real = this->terminate_status; + *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.real = this->ignore_cancel; + *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text = strlen(this->result_text); + memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->result_text, length_result_text); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.real = this->is_simple_client; + *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_client); + *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.sec); + *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.nsec); + *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.sec); + *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.nsec); + *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.sec); + *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.base = 0; + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terminate_status = u_terminate_status.real; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.base = 0; + u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ignore_cancel = u_ignore_cancel.real; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text; + memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result_text-1]=0; + this->result_text = (char *)(inbuffer + offset-1); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.base = 0; + u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_client = u_is_simple_client.real; + offset += sizeof(this->is_simple_client); + this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.sec); + this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.nsec); + this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.sec); + this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.nsec); + this->pause_status.sec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.sec); + this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.nsec); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestGoal"; }; + const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestResult.h new file mode 100755 index 0000000..27b1425 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestRequestResult.h @@ -0,0 +1,78 @@ +#ifndef _ROS_actionlib_TestRequestResult_h +#define _ROS_actionlib_TestRequestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestResult : public ros::Msg + { + public: + int32_t the_result; + bool is_simple_server; + + TestRequestResult(): + the_result(0), + is_simple_server(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.real = this->is_simple_server; + *(outbuffer + offset + 0) = (u_is_simple_server.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_server); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.base = 0; + u_is_simple_server.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_server = u_is_simple_server.real; + offset += sizeof(this->is_simple_server); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestResult"; }; + const char * getMD5(){ return "61c2364524499c7c5017e2f3fce7ba06"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestResult.h new file mode 100755 index 0000000..a0bd838 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TestResult.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestResult_h +#define _ROS_actionlib_TestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestResult : public ros::Msg + { + public: + int32_t result; + + TestResult(): + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->result = u_result.real; + offset += sizeof(this->result); + return offset; + } + + const char * getType(){ return "actionlib/TestResult"; }; + const char * getMD5(){ return "034a8e20d6a306665e3a5b340fab3f09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsAction.h new file mode 100755 index 0000000..18ac4d8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsAction_h +#define _ROS_actionlib_TwoIntsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TwoIntsActionGoal.h" +#include "actionlib/TwoIntsActionResult.h" +#include "actionlib/TwoIntsActionFeedback.h" + +namespace actionlib +{ + + class TwoIntsAction : public ros::Msg + { + public: + actionlib::TwoIntsActionGoal action_goal; + actionlib::TwoIntsActionResult action_result; + actionlib::TwoIntsActionFeedback action_feedback; + + TwoIntsAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsAction"; }; + const char * getMD5(){ return "6d1aa538c4bd6183a2dfb7fcac41ee50"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h new file mode 100755 index 0000000..1df0fba --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionFeedback_h +#define _ROS_actionlib_TwoIntsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsFeedback.h" + +namespace actionlib +{ + + class TwoIntsActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsFeedback feedback; + + TwoIntsActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h new file mode 100755 index 0000000..dc3e013 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionGoal_h +#define _ROS_actionlib_TwoIntsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TwoIntsGoal.h" + +namespace actionlib +{ + + class TwoIntsActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TwoIntsGoal goal; + + TwoIntsActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionGoal"; }; + const char * getMD5(){ return "684a2db55d6ffb8046fb9d6764ce0860"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionResult.h new file mode 100755 index 0000000..f6d3397 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionResult_h +#define _ROS_actionlib_TwoIntsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsResult.h" + +namespace actionlib +{ + + class TwoIntsActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsResult result; + + TwoIntsActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionResult"; }; + const char * getMD5(){ return "3ba7dea8b8cddcae4528ade4ef74b6e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsFeedback.h new file mode 100755 index 0000000..3789c4d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TwoIntsFeedback_h +#define _ROS_actionlib_TwoIntsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsFeedback : public ros::Msg + { + public: + + TwoIntsFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsGoal.h new file mode 100755 index 0000000..1fb5639 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsGoal.h @@ -0,0 +1,100 @@ +#ifndef _ROS_actionlib_TwoIntsGoal_h +#define _ROS_actionlib_TwoIntsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsGoal : public ros::Msg + { + public: + int64_t a; + int64_t b; + + TwoIntsGoal(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsGoal"; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsResult.h new file mode 100755 index 0000000..901a523 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib/TwoIntsResult.h @@ -0,0 +1,69 @@ +#ifndef _ROS_actionlib_TwoIntsResult_h +#define _ROS_actionlib_TwoIntsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsResult : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResult(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsResult"; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalID.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalID.h new file mode 100755 index 0000000..989dc6b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalID.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_msgs_GoalID_h +#define _ROS_actionlib_msgs_GoalID_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace actionlib_msgs +{ + + class GoalID : public ros::Msg + { + public: + ros::Time stamp; + const char* id; + + GoalID(): + stamp(), + id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalID"; }; + const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalStatus.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalStatus.h new file mode 100755 index 0000000..b728926 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalStatus.h @@ -0,0 +1,75 @@ +#ifndef _ROS_actionlib_msgs_GoalStatus_h +#define _ROS_actionlib_msgs_GoalStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_msgs/GoalID.h" + +namespace actionlib_msgs +{ + + class GoalStatus : public ros::Msg + { + public: + actionlib_msgs::GoalID goal_id; + uint8_t status; + const char* text; + enum { PENDING = 0 }; + enum { ACTIVE = 1 }; + enum { PREEMPTED = 2 }; + enum { SUCCEEDED = 3 }; + enum { ABORTED = 4 }; + enum { REJECTED = 5 }; + enum { PREEMPTING = 6 }; + enum { RECALLING = 7 }; + enum { RECALLED = 8 }; + enum { LOST = 9 }; + + GoalStatus(): + goal_id(), + status(0), + text("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->goal_id.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->goal_id.deserialize(inbuffer + offset); + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatus"; }; + const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h new file mode 100755 index 0000000..8bff742 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_actionlib_msgs_GoalStatusArray_h +#define _ROS_actionlib_msgs_GoalStatusArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" + +namespace actionlib_msgs +{ + + class GoalStatusArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_list_length; + actionlib_msgs::GoalStatus st_status_list; + actionlib_msgs::GoalStatus * status_list; + + GoalStatusArray(): + header(), + status_list_length(0), status_list(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_list_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->status_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_list_lengthT = *(inbuffer + offset++); + if(status_list_lengthT > status_list_length) + this->status_list = (actionlib_msgs::GoalStatus*)realloc(this->status_list, status_list_lengthT * sizeof(actionlib_msgs::GoalStatus)); + offset += 3; + status_list_length = status_list_lengthT; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->st_status_list.deserialize(inbuffer + offset); + memcpy( &(this->status_list[i]), &(this->st_status_list), sizeof(actionlib_msgs::GoalStatus)); + } + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatusArray"; }; + const char * getMD5(){ return "8b2b82f13216d0a8ea88bd3af735e619"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h new file mode 100755 index 0000000..65a963d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingAction_h +#define _ROS_actionlib_tutorials_AveragingAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/AveragingActionGoal.h" +#include "actionlib_tutorials/AveragingActionResult.h" +#include "actionlib_tutorials/AveragingActionFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingAction : public ros::Msg + { + public: + actionlib_tutorials::AveragingActionGoal action_goal; + actionlib_tutorials::AveragingActionResult action_result; + actionlib_tutorials::AveragingActionFeedback action_feedback; + + AveragingAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingAction"; }; + const char * getMD5(){ return "628678f2b4fa6a5951746a4a2d39e716"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h new file mode 100755 index 0000000..97fda36 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionFeedback_h +#define _ROS_actionlib_tutorials_AveragingActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingFeedback feedback; + + AveragingActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionFeedback"; }; + const char * getMD5(){ return "78a4a09241b1791069223ae7ebd5b16b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h new file mode 100755 index 0000000..4b225e9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionGoal_h +#define _ROS_actionlib_tutorials_AveragingActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/AveragingGoal.h" + +namespace actionlib_tutorials +{ + + class AveragingActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::AveragingGoal goal; + + AveragingActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionGoal"; }; + const char * getMD5(){ return "1561825b734ebd6039851c501e3fb570"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h new file mode 100755 index 0000000..e4d5128 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionResult_h +#define _ROS_actionlib_tutorials_AveragingActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingResult.h" + +namespace actionlib_tutorials +{ + + class AveragingActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingResult result; + + AveragingActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionResult"; }; + const char * getMD5(){ return "8672cb489d347580acdcd05c5d497497"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h new file mode 100755 index 0000000..a987900 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h @@ -0,0 +1,130 @@ +#ifndef _ROS_actionlib_tutorials_AveragingFeedback_h +#define _ROS_actionlib_tutorials_AveragingFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingFeedback : public ros::Msg + { + public: + int32_t sample; + float data; + float mean; + float std_dev; + + AveragingFeedback(): + sample(0), + data(0), + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.real = this->sample; + *(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.base = 0; + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sample = u_sample.real; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; }; + const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h new file mode 100755 index 0000000..5b631c5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_tutorials_AveragingGoal_h +#define _ROS_actionlib_tutorials_AveragingGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingGoal : public ros::Msg + { + public: + int32_t samples; + + AveragingGoal(): + samples(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.real = this->samples; + *(outbuffer + offset + 0) = (u_samples.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_samples.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_samples.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_samples.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.base = 0; + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->samples = u_samples.real; + offset += sizeof(this->samples); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingGoal"; }; + const char * getMD5(){ return "32c9b10ef9b253faa93b93f564762c8f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h new file mode 100755 index 0000000..ce08c43 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_actionlib_tutorials_AveragingResult_h +#define _ROS_actionlib_tutorials_AveragingResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingResult : public ros::Msg + { + public: + float mean; + float std_dev; + + AveragingResult(): + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingResult"; }; + const char * getMD5(){ return "d5c7decf6df75ffb4367a05c1bcc7612"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h new file mode 100755 index 0000000..9432e1c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciAction_h +#define _ROS_actionlib_tutorials_FibonacciAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/FibonacciActionGoal.h" +#include "actionlib_tutorials/FibonacciActionResult.h" +#include "actionlib_tutorials/FibonacciActionFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciAction : public ros::Msg + { + public: + actionlib_tutorials::FibonacciActionGoal action_goal; + actionlib_tutorials::FibonacciActionResult action_result; + actionlib_tutorials::FibonacciActionFeedback action_feedback; + + FibonacciAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciAction"; }; + const char * getMD5(){ return "f59df5767bf7634684781c92598b2406"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h new file mode 100755 index 0000000..3a1e341 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionFeedback_h +#define _ROS_actionlib_tutorials_FibonacciActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciFeedback feedback; + + FibonacciActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionFeedback"; }; + const char * getMD5(){ return "73b8497a9f629a31c0020900e4148f07"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h new file mode 100755 index 0000000..459561c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionGoal_h +#define _ROS_actionlib_tutorials_FibonacciActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/FibonacciGoal.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::FibonacciGoal goal; + + FibonacciActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionGoal"; }; + const char * getMD5(){ return "006871c7fa1d0e3d5fe2226bf17b2a94"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h new file mode 100755 index 0000000..14ed870 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionResult_h +#define _ROS_actionlib_tutorials_FibonacciActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciResult.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciResult result; + + FibonacciActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionResult"; }; + const char * getMD5(){ return "bee73a9fe29ae25e966e105f5553dd03"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h new file mode 100755 index 0000000..5a09ac1 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciFeedback_h +#define _ROS_actionlib_tutorials_FibonacciFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciFeedback : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciFeedback(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciFeedback"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h new file mode 100755 index 0000000..3cec227 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciGoal_h +#define _ROS_actionlib_tutorials_FibonacciGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciGoal : public ros::Msg + { + public: + int32_t order; + + FibonacciGoal(): + order(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.real = this->order; + *(outbuffer + offset + 0) = (u_order.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_order.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_order.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_order.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->order); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.base = 0; + u_order.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->order = u_order.real; + offset += sizeof(this->order); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciGoal"; }; + const char * getMD5(){ return "6889063349a00b249bd1661df429d822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h new file mode 100755 index 0000000..db15770 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciResult_h +#define _ROS_actionlib_tutorials_FibonacciResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciResult : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciResult(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciResult"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/bond/Constants.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/bond/Constants.h new file mode 100755 index 0000000..9594342 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/bond/Constants.h @@ -0,0 +1,44 @@ +#ifndef _ROS_bond_Constants_h +#define _ROS_bond_Constants_h + +#include +#include +#include +#include "ros/msg.h" + +namespace bond +{ + + class Constants : public ros::Msg + { + public: + enum { DEAD_PUBLISH_PERIOD = 0.05 }; + enum { DEFAULT_CONNECT_TIMEOUT = 10.0 }; + enum { DEFAULT_HEARTBEAT_TIMEOUT = 4.0 }; + enum { DEFAULT_DISCONNECT_TIMEOUT = 2.0 }; + enum { DEFAULT_HEARTBEAT_PERIOD = 1.0 }; + enum { DISABLE_HEARTBEAT_TIMEOUT_PARAM = /bond_disable_heartbeat_timeout }; + + Constants() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "bond/Constants"; }; + const char * getMD5(){ return "6fc594dc1d7bd7919077042712f8c8b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/bond/Status.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/bond/Status.h new file mode 100755 index 0000000..1fdb04a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/bond/Status.h @@ -0,0 +1,138 @@ +#ifndef _ROS_bond_Status_h +#define _ROS_bond_Status_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace bond +{ + + class Status : public ros::Msg + { + public: + std_msgs::Header header; + const char* id; + const char* instance_id; + bool active; + float heartbeat_timeout; + float heartbeat_period; + + Status(): + header(), + id(""), + instance_id(""), + active(0), + heartbeat_timeout(0), + heartbeat_period(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + uint32_t length_instance_id = strlen(this->instance_id); + memcpy(outbuffer + offset, &length_instance_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->instance_id, length_instance_id); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.real = this->active; + *(outbuffer + offset + 0) = (u_active.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.real = this->heartbeat_timeout; + *(outbuffer + offset + 0) = (u_heartbeat_timeout.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_timeout.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_timeout.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_timeout.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.real = this->heartbeat_period; + *(outbuffer + offset + 0) = (u_heartbeat_period.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_period.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_period.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_period.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_period); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + uint32_t length_instance_id; + memcpy(&length_instance_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_instance_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_instance_id-1]=0; + this->instance_id = (char *)(inbuffer + offset-1); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.base = 0; + u_active.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->active = u_active.real; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.base = 0; + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_timeout = u_heartbeat_timeout.real; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.base = 0; + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_period = u_heartbeat_period.real; + offset += sizeof(this->heartbeat_period); + return offset; + } + + const char * getType(){ return "bond/Status"; }; + const char * getMD5(){ return "eacc84bf5d65b6777d4c50f463dfb9c8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h new file mode 100755 index 0000000..aa36c45 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryAction_h +#define _ROS_control_msgs_FollowJointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/FollowJointTrajectoryActionGoal.h" +#include "control_msgs/FollowJointTrajectoryActionResult.h" +#include "control_msgs/FollowJointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryAction : public ros::Msg + { + public: + control_msgs::FollowJointTrajectoryActionGoal action_goal; + control_msgs::FollowJointTrajectoryActionResult action_result; + control_msgs::FollowJointTrajectoryActionFeedback action_feedback; + + FollowJointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryAction"; }; + const char * getMD5(){ return "bc4f9b743838566551c0390c65f1a248"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h new file mode 100755 index 0000000..bf9b2c6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryFeedback feedback; + + FollowJointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "d8920dc4eae9fc107e00999cce4be641"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h new file mode 100755 index 0000000..de889cb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/FollowJointTrajectoryGoal.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::FollowJointTrajectoryGoal goal; + + FollowJointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionGoal"; }; + const char * getMD5(){ return "cff5c1d533bf2f82dd0138d57f4304bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h new file mode 100755 index 0000000..252abb3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionResult_h +#define _ROS_control_msgs_FollowJointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryResult.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryResult result; + + FollowJointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionResult"; }; + const char * getMD5(){ return "c4fb3b000dc9da4fd99699380efcc5d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h new file mode 100755 index 0000000..50c5466 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h @@ -0,0 +1,88 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryFeedback : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + FollowJointTrajectoryFeedback(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryFeedback"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h new file mode 100755 index 0000000..2a8f9b1 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h @@ -0,0 +1,107 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "control_msgs/JointTolerance.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + uint8_t path_tolerance_length; + control_msgs::JointTolerance st_path_tolerance; + control_msgs::JointTolerance * path_tolerance; + uint8_t goal_tolerance_length; + control_msgs::JointTolerance st_goal_tolerance; + control_msgs::JointTolerance * goal_tolerance; + ros::Duration goal_time_tolerance; + + FollowJointTrajectoryGoal(): + trajectory(), + path_tolerance_length(0), path_tolerance(NULL), + goal_tolerance_length(0), goal_tolerance(NULL), + goal_time_tolerance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset++) = path_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->path_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = goal_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->goal_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->goal_time_tolerance.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.sec); + *(outbuffer + offset + 0) = (this->goal_time_tolerance.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + uint8_t path_tolerance_lengthT = *(inbuffer + offset++); + if(path_tolerance_lengthT > path_tolerance_length) + this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + path_tolerance_length = path_tolerance_lengthT; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->st_path_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->path_tolerance[i]), &(this->st_path_tolerance), sizeof(control_msgs::JointTolerance)); + } + uint8_t goal_tolerance_lengthT = *(inbuffer + offset++); + if(goal_tolerance_lengthT > goal_tolerance_length) + this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + goal_tolerance_length = goal_tolerance_lengthT; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->st_goal_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->goal_tolerance[i]), &(this->st_goal_tolerance), sizeof(control_msgs::JointTolerance)); + } + this->goal_time_tolerance.sec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.sec); + this->goal_time_tolerance.nsec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryGoal"; }; + const char * getMD5(){ return "69636787b6ecbde4d61d711979bc7ecb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h new file mode 100755 index 0000000..0d55930 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h @@ -0,0 +1,83 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryResult_h +#define _ROS_control_msgs_FollowJointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryResult : public ros::Msg + { + public: + int32_t error_code; + const char* error_string; + enum { SUCCESSFUL = 0 }; + enum { INVALID_GOAL = -1 }; + enum { INVALID_JOINTS = -2 }; + enum { OLD_HEADER_TIMESTAMP = -3 }; + enum { PATH_TOLERANCE_VIOLATED = -4 }; + enum { GOAL_TOLERANCE_VIOLATED = -5 }; + + FollowJointTrajectoryResult(): + error_code(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryResult"; }; + const char * getMD5(){ return "493383b18409bfb604b4e26c676401d2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommand.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommand.h new file mode 100755 index 0000000..a2f65e0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommand.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommand_h +#define _ROS_control_msgs_GripperCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommand : public ros::Msg + { + public: + float position; + float max_effort; + + GripperCommand(): + position(0), + max_effort(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_effort); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_effort)); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommand"; }; + const char * getMD5(){ return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandAction.h new file mode 100755 index 0000000..111229e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandAction_h +#define _ROS_control_msgs_GripperCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommandActionGoal.h" +#include "control_msgs/GripperCommandActionResult.h" +#include "control_msgs/GripperCommandActionFeedback.h" + +namespace control_msgs +{ + + class GripperCommandAction : public ros::Msg + { + public: + control_msgs::GripperCommandActionGoal action_goal; + control_msgs::GripperCommandActionResult action_result; + control_msgs::GripperCommandActionFeedback action_feedback; + + GripperCommandAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandAction"; }; + const char * getMD5(){ return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h new file mode 100755 index 0000000..14f3771 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionFeedback_h +#define _ROS_control_msgs_GripperCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandFeedback.h" + +namespace control_msgs +{ + + class GripperCommandActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandFeedback feedback; + + GripperCommandActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionFeedback"; }; + const char * getMD5(){ return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h new file mode 100755 index 0000000..8a09301 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionGoal_h +#define _ROS_control_msgs_GripperCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/GripperCommandGoal.h" + +namespace control_msgs +{ + + class GripperCommandActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::GripperCommandGoal goal; + + GripperCommandActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionGoal"; }; + const char * getMD5(){ return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h new file mode 100755 index 0000000..1a7ea75 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionResult_h +#define _ROS_control_msgs_GripperCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandResult.h" + +namespace control_msgs +{ + + class GripperCommandActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandResult result; + + GripperCommandActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionResult"; }; + const char * getMD5(){ return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h new file mode 100755 index 0000000..efc889b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h @@ -0,0 +1,80 @@ +#ifndef _ROS_control_msgs_GripperCommandFeedback_h +#define _ROS_control_msgs_GripperCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandFeedback : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandFeedback(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandFeedback"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandGoal.h new file mode 100755 index 0000000..aec6aa2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandGoal.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_GripperCommandGoal_h +#define _ROS_control_msgs_GripperCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommand.h" + +namespace control_msgs +{ + + class GripperCommandGoal : public ros::Msg + { + public: + control_msgs::GripperCommand command; + + GripperCommandGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandGoal"; }; + const char * getMD5(){ return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandResult.h new file mode 100755 index 0000000..7fb51df --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/GripperCommandResult.h @@ -0,0 +1,80 @@ +#ifndef _ROS_control_msgs_GripperCommandResult_h +#define _ROS_control_msgs_GripperCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandResult : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandResult(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandResult"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointControllerState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointControllerState.h new file mode 100755 index 0000000..8de8213 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointControllerState.h @@ -0,0 +1,83 @@ +#ifndef _ROS_control_msgs_JointControllerState_h +#define _ROS_control_msgs_JointControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class JointControllerState : public ros::Msg + { + public: + std_msgs::Header header; + float set_point; + float process_value; + float process_value_dot; + float error; + float time_step; + float command; + float p; + float i; + float d; + float i_clamp; + + JointControllerState(): + header(), + set_point(0), + process_value(0), + process_value_dot(0), + error(0), + time_step(0), + command(0), + p(0), + i(0), + d(0), + i_clamp(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->set_point); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value_dot); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->command); + offset += serializeAvrFloat64(outbuffer + offset, this->p); + offset += serializeAvrFloat64(outbuffer + offset, this->i); + offset += serializeAvrFloat64(outbuffer + offset, this->d); + offset += serializeAvrFloat64(outbuffer + offset, this->i_clamp); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->set_point)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value_dot)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->command)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->p)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->d)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_clamp)); + return offset; + } + + const char * getType(){ return "control_msgs/JointControllerState"; }; + const char * getMD5(){ return "c0d034a7bf20aeb1c37f3eccb7992b69"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTolerance.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTolerance.h new file mode 100755 index 0000000..9593f37 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTolerance.h @@ -0,0 +1,66 @@ +#ifndef _ROS_control_msgs_JointTolerance_h +#define _ROS_control_msgs_JointTolerance_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTolerance : public ros::Msg + { + public: + const char* name; + float position; + float velocity; + float acceleration; + + JointTolerance(): + name(""), + position(0), + velocity(0), + acceleration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acceleration)); + return offset; + } + + const char * getType(){ return "control_msgs/JointTolerance"; }; + const char * getMD5(){ return "f544fe9c16cf04547e135dd6063ff5be"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h new file mode 100755 index 0000000..b619e9f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryAction_h +#define _ROS_control_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/JointTrajectoryActionGoal.h" +#include "control_msgs/JointTrajectoryActionResult.h" +#include "control_msgs/JointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + control_msgs::JointTrajectoryActionGoal action_goal; + control_msgs::JointTrajectoryActionResult action_result; + control_msgs::JointTrajectoryActionFeedback action_feedback; + + JointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryAction"; }; + const char * getMD5(){ return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h new file mode 100755 index 0000000..463a4e9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionFeedback_h +#define _ROS_control_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryFeedback feedback; + + JointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h new file mode 100755 index 0000000..fb2862d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionGoal_h +#define _ROS_control_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/JointTrajectoryGoal.h" + +namespace control_msgs +{ + + class JointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::JointTrajectoryGoal goal; + + JointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionGoal"; }; + const char * getMD5(){ return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h new file mode 100755 index 0000000..accb4d0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionResult_h +#define _ROS_control_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryResult.h" + +namespace control_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryResult result; + + JointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h new file mode 100755 index 0000000..f4bc6b8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,88 @@ +#ifndef _ROS_control_msgs_JointTrajectoryControllerState_h +#define _ROS_control_msgs_JointTrajectoryControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class JointTrajectoryControllerState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + JointTrajectoryControllerState(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryControllerState"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h new file mode 100755 index 0000000..9dfe808 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryFeedback_h +#define _ROS_control_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + JointTrajectoryFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h new file mode 100755 index 0000000..b0cacb7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_JointTrajectoryGoal_h +#define _ROS_control_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace control_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + + JointTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryGoal"; }; + const char * getMD5(){ return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h new file mode 100755 index 0000000..623ed9c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryResult_h +#define _ROS_control_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + + JointTrajectoryResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadAction.h new file mode 100755 index 0000000..a27be21 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadAction_h +#define _ROS_control_msgs_PointHeadAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/PointHeadActionGoal.h" +#include "control_msgs/PointHeadActionResult.h" +#include "control_msgs/PointHeadActionFeedback.h" + +namespace control_msgs +{ + + class PointHeadAction : public ros::Msg + { + public: + control_msgs::PointHeadActionGoal action_goal; + control_msgs::PointHeadActionResult action_result; + control_msgs::PointHeadActionFeedback action_feedback; + + PointHeadAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadAction"; }; + const char * getMD5(){ return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h new file mode 100755 index 0000000..8e04bd0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionFeedback_h +#define _ROS_control_msgs_PointHeadActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadFeedback.h" + +namespace control_msgs +{ + + class PointHeadActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadFeedback feedback; + + PointHeadActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionFeedback"; }; + const char * getMD5(){ return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h new file mode 100755 index 0000000..133d532 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionGoal_h +#define _ROS_control_msgs_PointHeadActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/PointHeadGoal.h" + +namespace control_msgs +{ + + class PointHeadActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::PointHeadGoal goal; + + PointHeadActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionGoal"; }; + const char * getMD5(){ return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionResult.h new file mode 100755 index 0000000..db855d2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionResult_h +#define _ROS_control_msgs_PointHeadActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadResult.h" + +namespace control_msgs +{ + + class PointHeadActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadResult result; + + PointHeadActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadFeedback.h new file mode 100755 index 0000000..4e78f2d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadFeedback.h @@ -0,0 +1,42 @@ +#ifndef _ROS_control_msgs_PointHeadFeedback_h +#define _ROS_control_msgs_PointHeadFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadFeedback : public ros::Msg + { + public: + float pointing_angle_error; + + PointHeadFeedback(): + pointing_angle_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->pointing_angle_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pointing_angle_error)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadFeedback"; }; + const char * getMD5(){ return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadGoal.h new file mode 100755 index 0000000..65ec646 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadGoal.h @@ -0,0 +1,91 @@ +#ifndef _ROS_control_msgs_PointHeadGoal_h +#define _ROS_control_msgs_PointHeadGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class PointHeadGoal : public ros::Msg + { + public: + geometry_msgs::PointStamped target; + geometry_msgs::Vector3 pointing_axis; + const char* pointing_frame; + ros::Duration min_duration; + float max_velocity; + + PointHeadGoal(): + target(), + pointing_axis(), + pointing_frame(""), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->target.serialize(outbuffer + offset); + offset += this->pointing_axis.serialize(outbuffer + offset); + uint32_t length_pointing_frame = strlen(this->pointing_frame); + memcpy(outbuffer + offset, &length_pointing_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame); + offset += length_pointing_frame; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + memcpy(&length_pointing_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pointing_frame-1]=0; + this->pointing_frame = (char *)(inbuffer + offset-1); + offset += length_pointing_frame; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadGoal"; }; + const char * getMD5(){ return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadResult.h new file mode 100755 index 0000000..53f789e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/PointHeadResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_PointHeadResult_h +#define _ROS_control_msgs_PointHeadResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadResult : public ros::Msg + { + public: + + PointHeadResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/QueryCalibrationState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/QueryCalibrationState.h new file mode 100755 index 0000000..b3c1bbf --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/QueryCalibrationState.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_QueryCalibrationState_h +#define _ROS_SERVICE_QueryCalibrationState_h +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + +static const char QUERYCALIBRATIONSTATE[] = "control_msgs/QueryCalibrationState"; + + class QueryCalibrationStateRequest : public ros::Msg + { + public: + + QueryCalibrationStateRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + bool is_calibrated; + + QueryCalibrationStateResponse(): + is_calibrated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h new file mode 100755 index 0000000..1859d7f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h @@ -0,0 +1,185 @@ +#ifndef _ROS_SERVICE_QueryTrajectoryState_h +#define _ROS_SERVICE_QueryTrajectoryState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace control_msgs +{ + +static const char QUERYTRAJECTORYSTATE[] = "control_msgs/QueryTrajectoryState"; + + class QueryTrajectoryStateRequest : public ros::Msg + { + public: + ros::Time time; + + QueryTrajectoryStateRequest(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t acceleration_length; + float st_acceleration; + float * acceleration; + + QueryTrajectoryStateResponse(): + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + acceleration_length(0), acceleration(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = acceleration_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t acceleration_lengthT = *(inbuffer + offset++); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + offset += 3; + acceleration_length = acceleration_lengthT; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_acceleration)); + memcpy( &(this->acceleration[i]), &(this->st_acceleration), sizeof(float)); + } + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h new file mode 100755 index 0000000..25bc0f6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionAction_h +#define _ROS_control_msgs_SingleJointPositionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/SingleJointPositionActionGoal.h" +#include "control_msgs/SingleJointPositionActionResult.h" +#include "control_msgs/SingleJointPositionActionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionAction : public ros::Msg + { + public: + control_msgs::SingleJointPositionActionGoal action_goal; + control_msgs::SingleJointPositionActionResult action_result; + control_msgs::SingleJointPositionActionFeedback action_feedback; + + SingleJointPositionAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionAction"; }; + const char * getMD5(){ return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h new file mode 100755 index 0000000..3cb7efd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionFeedback_h +#define _ROS_control_msgs_SingleJointPositionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionFeedback feedback; + + SingleJointPositionActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionFeedback"; }; + const char * getMD5(){ return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h new file mode 100755 index 0000000..1337710 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionGoal_h +#define _ROS_control_msgs_SingleJointPositionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/SingleJointPositionGoal.h" + +namespace control_msgs +{ + + class SingleJointPositionActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::SingleJointPositionGoal goal; + + SingleJointPositionActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionGoal"; }; + const char * getMD5(){ return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h new file mode 100755 index 0000000..8f11e6e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionResult_h +#define _ROS_control_msgs_SingleJointPositionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionResult.h" + +namespace control_msgs +{ + + class SingleJointPositionActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionResult result; + + SingleJointPositionActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h new file mode 100755 index 0000000..3c8dd15 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_control_msgs_SingleJointPositionFeedback_h +#define _ROS_control_msgs_SingleJointPositionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class SingleJointPositionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + float position; + float velocity; + float error; + + SingleJointPositionFeedback(): + header(), + position(0), + velocity(0), + error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionFeedback"; }; + const char * getMD5(){ return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h new file mode 100755 index 0000000..036c31c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h @@ -0,0 +1,69 @@ +#ifndef _ROS_control_msgs_SingleJointPositionGoal_h +#define _ROS_control_msgs_SingleJointPositionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class SingleJointPositionGoal : public ros::Msg + { + public: + float position; + ros::Duration min_duration; + float max_velocity; + + SingleJointPositionGoal(): + position(0), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionGoal"; }; + const char * getMD5(){ return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h new file mode 100755 index 0000000..7593425 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_SingleJointPositionResult_h +#define _ROS_control_msgs_SingleJointPositionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class SingleJointPositionResult : public ros::Msg + { + public: + + SingleJointPositionResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h new file mode 100755 index 0000000..0dbf042 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_AddDiagnostics_h +#define _ROS_SERVICE_AddDiagnostics_h +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + +static const char ADDDIAGNOSTICS[] = "diagnostic_msgs/AddDiagnostics"; + + class AddDiagnosticsRequest : public ros::Msg + { + public: + const char* load_namespace; + + AddDiagnosticsRequest(): + load_namespace("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_load_namespace = strlen(this->load_namespace); + memcpy(outbuffer + offset, &length_load_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->load_namespace, length_load_namespace); + offset += length_load_namespace; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_load_namespace; + memcpy(&length_load_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_load_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_load_namespace-1]=0; + this->load_namespace = (char *)(inbuffer + offset-1); + offset += length_load_namespace; + return offset; + } + + const char * getType(){ return ADDDIAGNOSTICS; }; + const char * getMD5(){ return "c26cf6e164288fbc6050d74f838bcdf0"; }; + + }; + + class AddDiagnosticsResponse : public ros::Msg + { + public: + bool success; + const char* message; + + AddDiagnosticsResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return ADDDIAGNOSTICS; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class AddDiagnostics { + public: + typedef AddDiagnosticsRequest Request; + typedef AddDiagnosticsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h new file mode 100755 index 0000000..d530b09 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticArray_h +#define _ROS_diagnostic_msgs_DiagnosticArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + + class DiagnosticArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + DiagnosticArray(): + header(), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticArray"; }; + const char * getMD5(){ return "60810da900de1dd6ddd437c3503511da"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h new file mode 100755 index 0000000..4cf2e88 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h @@ -0,0 +1,128 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticStatus_h +#define _ROS_diagnostic_msgs_DiagnosticStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/KeyValue.h" + +namespace diagnostic_msgs +{ + + class DiagnosticStatus : public ros::Msg + { + public: + int8_t level; + const char* name; + const char* message; + const char* hardware_id; + uint8_t values_length; + diagnostic_msgs::KeyValue st_values; + diagnostic_msgs::KeyValue * values; + enum { OK = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + enum { STALE = 3 }; + + DiagnosticStatus(): + level(0), + name(""), + message(""), + hardware_id(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_hardware_id = strlen(this->hardware_id); + memcpy(outbuffer + offset, &length_hardware_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->values[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + uint32_t length_hardware_id; + memcpy(&length_hardware_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_id-1]=0; + this->hardware_id = (char *)(inbuffer + offset-1); + offset += length_hardware_id; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (diagnostic_msgs::KeyValue*)realloc(this->values, values_lengthT * sizeof(diagnostic_msgs::KeyValue)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->st_values.deserialize(inbuffer + offset); + memcpy( &(this->values[i]), &(this->st_values), sizeof(diagnostic_msgs::KeyValue)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticStatus"; }; + const char * getMD5(){ return "d0ce08bc6e5ba34c7754f563a9cabaf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/KeyValue.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/KeyValue.h new file mode 100755 index 0000000..7b48800 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/KeyValue.h @@ -0,0 +1,70 @@ +#ifndef _ROS_diagnostic_msgs_KeyValue_h +#define _ROS_diagnostic_msgs_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + + class KeyValue : public ros::Msg + { + public: + const char* key; + const char* value; + + KeyValue(): + key(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_key = strlen(this->key); + memcpy(outbuffer + offset, &length_key, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->key, length_key); + offset += length_key; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_key; + memcpy(&length_key, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_key; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_key-1]=0; + this->key = (char *)(inbuffer + offset-1); + offset += length_key; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "diagnostic_msgs/KeyValue"; }; + const char * getMD5(){ return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/SelfTest.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/SelfTest.h new file mode 100755 index 0000000..50b599d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/diagnostic_msgs/SelfTest.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_SelfTest_h +#define _ROS_SERVICE_SelfTest_h +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + +static const char SELFTEST[] = "diagnostic_msgs/SelfTest"; + + class SelfTestRequest : public ros::Msg + { + public: + + SelfTestRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SelfTestResponse : public ros::Msg + { + public: + const char* id; + int8_t passed; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + SelfTestResponse(): + id(""), + passed(0), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.real = this->passed; + *(outbuffer + offset + 0) = (u_passed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->passed); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.base = 0; + u_passed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->passed = u_passed.real; + offset += sizeof(this->passed); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "ac21b1bab7ab17546986536c22eb34e9"; }; + + }; + + class SelfTest { + public: + typedef SelfTestRequest Request; + typedef SelfTestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/ConfigString.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/ConfigString.h new file mode 100755 index 0000000..539ebcc --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/ConfigString.h @@ -0,0 +1,70 @@ +#ifndef _ROS_driver_base_ConfigString_h +#define _ROS_driver_base_ConfigString_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigString : public ros::Msg + { + public: + const char* name; + const char* value; + + ConfigString(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "driver_base/ConfigString"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/ConfigValue.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/ConfigValue.h new file mode 100755 index 0000000..33b32a0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/ConfigValue.h @@ -0,0 +1,58 @@ +#ifndef _ROS_driver_base_ConfigValue_h +#define _ROS_driver_base_ConfigValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigValue : public ros::Msg + { + public: + const char* name; + float value; + + ConfigValue(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + const char * getType(){ return "driver_base/ConfigValue"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/SensorLevels.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/SensorLevels.h new file mode 100755 index 0000000..4a4ffd2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/driver_base/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_driver_base_SensorLevels_h +#define _ROS_driver_base_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "driver_base/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/duration.cpp b/case_study/arduino_lab/group_21/original/lib/ros_lib/duration.cpp new file mode 100755 index 0000000..f471c33 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/duration.cpp @@ -0,0 +1,81 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSecSigned(int32_t &sec, int32_t &nsec) + { + int32_t nsec_part = nsec; + int32_t sec_part = sec; + + while (nsec_part > 1000000000L) + { + nsec_part -= 1000000000L; + ++sec_part; + } + while (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + sec = sec_part; + nsec = nsec_part; + } + + Duration& Duration::operator+=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator-=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator*=(double scale){ + sec *= scale; + nsec *= scale; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h new file mode 100755 index 0000000..23df990 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h @@ -0,0 +1,71 @@ +#ifndef _ROS_dynamic_reconfigure_BoolParameter_h +#define _ROS_dynamic_reconfigure_BoolParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class BoolParameter : public ros::Msg + { + public: + const char* name; + bool value; + + BoolParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/BoolParameter"; }; + const char * getMD5(){ return "23f05028c1a699fb83e22401228c3a9e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Config.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Config.h new file mode 100755 index 0000000..0658228 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Config.h @@ -0,0 +1,143 @@ +#ifndef _ROS_dynamic_reconfigure_Config_h +#define _ROS_dynamic_reconfigure_Config_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/BoolParameter.h" +#include "dynamic_reconfigure/IntParameter.h" +#include "dynamic_reconfigure/StrParameter.h" +#include "dynamic_reconfigure/DoubleParameter.h" +#include "dynamic_reconfigure/GroupState.h" + +namespace dynamic_reconfigure +{ + + class Config : public ros::Msg + { + public: + uint8_t bools_length; + dynamic_reconfigure::BoolParameter st_bools; + dynamic_reconfigure::BoolParameter * bools; + uint8_t ints_length; + dynamic_reconfigure::IntParameter st_ints; + dynamic_reconfigure::IntParameter * ints; + uint8_t strs_length; + dynamic_reconfigure::StrParameter st_strs; + dynamic_reconfigure::StrParameter * strs; + uint8_t doubles_length; + dynamic_reconfigure::DoubleParameter st_doubles; + dynamic_reconfigure::DoubleParameter * doubles; + uint8_t groups_length; + dynamic_reconfigure::GroupState st_groups; + dynamic_reconfigure::GroupState * groups; + + Config(): + bools_length(0), bools(NULL), + ints_length(0), ints(NULL), + strs_length(0), strs(NULL), + doubles_length(0), doubles(NULL), + groups_length(0), groups(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = bools_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->bools[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = strs_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->strs[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = doubles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->doubles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t bools_lengthT = *(inbuffer + offset++); + if(bools_lengthT > bools_length) + this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); + offset += 3; + bools_length = bools_lengthT; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->st_bools.deserialize(inbuffer + offset); + memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter)); + } + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->st_ints.deserialize(inbuffer + offset); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter)); + } + uint8_t strs_lengthT = *(inbuffer + offset++); + if(strs_lengthT > strs_length) + this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); + offset += 3; + strs_length = strs_lengthT; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->st_strs.deserialize(inbuffer + offset); + memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter)); + } + uint8_t doubles_lengthT = *(inbuffer + offset++); + if(doubles_lengthT > doubles_length) + this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); + offset += 3; + doubles_length = doubles_lengthT; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->st_doubles.deserialize(inbuffer + offset); + memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter)); + } + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState)); + } + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Config"; }; + const char * getMD5(){ return "958f16a05573709014982821e6822580"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h new file mode 100755 index 0000000..3720189 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h @@ -0,0 +1,72 @@ +#ifndef _ROS_dynamic_reconfigure_ConfigDescription_h +#define _ROS_dynamic_reconfigure_ConfigDescription_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Group.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + + class ConfigDescription : public ros::Msg + { + public: + uint8_t groups_length; + dynamic_reconfigure::Group st_groups; + dynamic_reconfigure::Group * groups; + dynamic_reconfigure::Config max; + dynamic_reconfigure::Config min; + dynamic_reconfigure::Config dflt; + + ConfigDescription(): + groups_length(0), groups(NULL), + max(), + min(), + dflt() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + offset += this->max.serialize(outbuffer + offset); + offset += this->min.serialize(outbuffer + offset); + offset += this->dflt.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::Group*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::Group)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::Group)); + } + offset += this->max.deserialize(inbuffer + offset); + offset += this->min.deserialize(inbuffer + offset); + offset += this->dflt.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ConfigDescription"; }; + const char * getMD5(){ return "757ce9d44ba8ddd801bb30bc456f946f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h new file mode 100755 index 0000000..1407bdb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h @@ -0,0 +1,58 @@ +#ifndef _ROS_dynamic_reconfigure_DoubleParameter_h +#define _ROS_dynamic_reconfigure_DoubleParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class DoubleParameter : public ros::Msg + { + public: + const char* name; + float value; + + DoubleParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/DoubleParameter"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Group.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Group.h new file mode 100755 index 0000000..8e4c957 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Group.h @@ -0,0 +1,137 @@ +#ifndef _ROS_dynamic_reconfigure_Group_h +#define _ROS_dynamic_reconfigure_Group_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/ParamDescription.h" + +namespace dynamic_reconfigure +{ + + class Group : public ros::Msg + { + public: + const char* name; + const char* type; + uint8_t parameters_length; + dynamic_reconfigure::ParamDescription st_parameters; + dynamic_reconfigure::ParamDescription * parameters; + int32_t parent; + int32_t id; + + Group(): + name(""), + type(""), + parameters_length(0), parameters(NULL), + parent(0), + id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = parameters_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t parameters_lengthT = *(inbuffer + offset++); + if(parameters_lengthT > parameters_length) + this->parameters = (dynamic_reconfigure::ParamDescription*)realloc(this->parameters, parameters_lengthT * sizeof(dynamic_reconfigure::ParamDescription)); + offset += 3; + parameters_length = parameters_lengthT; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(dynamic_reconfigure::ParamDescription)); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Group"; }; + const char * getMD5(){ return "9e8cd9e9423c94823db3614dd8b1cf7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/GroupState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/GroupState.h new file mode 100755 index 0000000..f2b137a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/GroupState.h @@ -0,0 +1,117 @@ +#ifndef _ROS_dynamic_reconfigure_GroupState_h +#define _ROS_dynamic_reconfigure_GroupState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class GroupState : public ros::Msg + { + public: + const char* name; + bool state; + int32_t id; + int32_t parent; + + GroupState(): + name(""), + state(0), + id(0), + parent(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.real = this->state; + *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.base = 0; + u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->state = u_state.real; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/GroupState"; }; + const char * getMD5(){ return "a2d87f51dc22930325041a2f8b1571f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h new file mode 100755 index 0000000..c9e90be --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h @@ -0,0 +1,77 @@ +#ifndef _ROS_dynamic_reconfigure_IntParameter_h +#define _ROS_dynamic_reconfigure_IntParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class IntParameter : public ros::Msg + { + public: + const char* name; + int32_t value; + + IntParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/IntParameter"; }; + const char * getMD5(){ return "65fedc7a0cbfb8db035e46194a350bf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h new file mode 100755 index 0000000..ed6a26e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h @@ -0,0 +1,114 @@ +#ifndef _ROS_dynamic_reconfigure_ParamDescription_h +#define _ROS_dynamic_reconfigure_ParamDescription_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class ParamDescription : public ros::Msg + { + public: + const char* name; + const char* type; + uint32_t level; + const char* description; + const char* edit_method; + + ParamDescription(): + name(""), + type(""), + level(0), + description(""), + edit_method("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->level >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->level >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->level >> (8 * 3)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_edit_method = strlen(this->edit_method); + memcpy(outbuffer + offset, &length_edit_method, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->edit_method, length_edit_method); + offset += length_edit_method; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + this->level = ((uint32_t) (*(inbuffer + offset))); + this->level |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->level |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->level |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->level); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + uint32_t length_edit_method; + memcpy(&length_edit_method, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_edit_method; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_edit_method-1]=0; + this->edit_method = (char *)(inbuffer + offset-1); + offset += length_edit_method; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ParamDescription"; }; + const char * getMD5(){ return "7434fcb9348c13054e0c3b267c8cb34d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h new file mode 100755 index 0000000..4f5f4fe --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h @@ -0,0 +1,79 @@ +#ifndef _ROS_SERVICE_Reconfigure_h +#define _ROS_SERVICE_Reconfigure_h +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + +static const char RECONFIGURE[] = "dynamic_reconfigure/Reconfigure"; + + class ReconfigureRequest : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureRequest(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class ReconfigureResponse : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureResponse(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class Reconfigure { + public: + typedef ReconfigureRequest Request; + typedef ReconfigureResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h new file mode 100755 index 0000000..8f85722 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_dynamic_reconfigure_SensorLevels_h +#define _ROS_dynamic_reconfigure_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h new file mode 100755 index 0000000..2cdabdb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h @@ -0,0 +1,70 @@ +#ifndef _ROS_dynamic_reconfigure_StrParameter_h +#define _ROS_dynamic_reconfigure_StrParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class StrParameter : public ros::Msg + { + public: + const char* name; + const char* value; + + StrParameter(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/StrParameter"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ADC/ADC.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ADC/ADC.pde new file mode 100755 index 0000000..a6cabe9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ADC/ADC.pde @@ -0,0 +1,52 @@ +/* + * rosserial ADC Example + * + * This is a poor man's Oscilloscope. It does not have the sampling + * rate or accuracy of a commerical scope, but it is great to get + * an analog value into ROS in a pinch. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +rosserial_arduino::Adc adc_msg; +ros::Publisher p("adc", &adc_msg); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); +} + +//We average the analog reading to elminate some of the noise +int averageAnalog(int pin){ + int v=0; + for(int i=0; i<4; i++) v+= analogRead(pin); + return v/4; +} + +long adc_timer; + +void loop() +{ + adc_msg.adc0 = averageAnalog(0); + adc_msg.adc1 = averageAnalog(1); + adc_msg.adc2 = averageAnalog(2); + adc_msg.adc3 = averageAnalog(3); + adc_msg.adc4 = averageAnalog(4); + adc_msg.adc5 = averageAnalog(5); + + p.publish(&adc_msg); + + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Blink/Blink.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Blink/Blink.pde new file mode 100755 index 0000000..4e9e185 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Blink/Blink.pde @@ -0,0 +1,29 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include + +ros::NodeHandle nh; + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/BlinkM/BlinkM.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/BlinkM/BlinkM.pde new file mode 100755 index 0000000..f54ea28 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/BlinkM/BlinkM.pde @@ -0,0 +1,162 @@ +/* +* RosSerial BlinkM Example +* This program shows how to control a blinkm +* from an arduino using RosSerial +*/ + +#include + + +#include +#include + + +//include Wire/ twi for the BlinkM +#include +extern "C" { +#include "utility/twi.h" +} + +#include "BlinkM_funcs.h" +const byte blinkm_addr = 0x09; //default blinkm address + + +void setLED( bool solid, char color) +{ + + if (solid) + { + switch (color) + { + + case 'w': // white + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0xff); + break; + + case 'r': //RED + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0); + break; + + case 'g':// Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0); + break; + + case 'b':// Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0xff); + break; + + case 'c':// Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0xff); + break; + + case 'm': // Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0xff); + break; + + case 'y': // yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0); + break; + + default: // Black + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0); + break; + } + } + + + else + { + switch (color) + { + case 'r': // Blink Red + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 3,0,0 ); + break; + case 'w': // Blink white + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 2,0,0 ); + break; + case 'g': // Blink Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 4,0,0 ); + break; + + case 'b': // Blink Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 5,0,0 ); + break; + + case 'c': //Blink Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 6,0,0 ); + break; + + case 'm': //Blink Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 7,0,0 ); + break; + + case 'y': //Blink Yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 8,0,0 ); + break; + + default: //OFF + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 9,0,0 ); + break; + } + + } +} + +void light_cb( const std_msgs::String& light_cmd){ + bool solid =false; + char color; + if (strlen( (const char* ) light_cmd.data) ==2 ){ + solid = (light_cmd.data[0] == 'S') || (light_cmd.data[0] == 's'); + color = light_cmd.data[1]; + } + else{ + solid= false; + color = light_cmd.data[0]; + } + + setLED(solid, color); +} + + + +ros::NodeHandle nh; +ros::Subscriber sub("blinkm" , light_cb); + + +void setup() +{ + + pinMode(13, OUTPUT); //set up the LED + + BlinkM_beginWithPower(); + delay(100); + BlinkM_stopScript(blinkm_addr); // turn off startup script + setLED(false, 0); //turn off the led + + nh.initNode(); + nh.subscribe(sub); + +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h new file mode 100755 index 0000000..94cabeb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h @@ -0,0 +1,440 @@ +/* + * BlinkM_funcs.h -- Arduino 'library' to control BlinkM + * -------------- + * + * + * Note: original version of this file lives with the BlinkMTester sketch + * + * Note: all the functions are declared 'static' because + * it saves about 1.5 kbyte in code space in final compiled sketch. + * A C++ library of this costs a 1kB more. + * + * 2007-8, Tod E. Kurt, ThingM, http://thingm.com/ + * + * version: 20081101 + * + * history: + * 20080101 - initial release + * 20080203 - added setStartupParam(), bugfix receiveBytes() from Dan Julio + * 20081101 - fixed to work with Arduino-0012, added MaxM commands, + * added test script read/write functions, cleaned up some functions + * 20090121 - added I2C bus scan functions, has dependencies on private + * functions inside Wire library, so might break in the future + * 20100420 - added BlinkM_startPower and _stopPower + * + */ + +#include + +extern "C" { +#include "utility/twi.h" // from Wire library, so we can do bus scanning +} + + +// format of light script lines: duration, command, arg1,arg2,arg3 +typedef struct _blinkm_script_line { + uint8_t dur; + uint8_t cmd[4]; // cmd,arg1,arg2,arg3 +} blinkm_script_line; + + +// Call this first (when powering BlinkM from a power supply) +static void BlinkM_begin() +{ + Wire.begin(); // join i2c bus (address optional for master) +} + +/* + * actually can't do this either, because twi_init() has THREE callocs in it too + * +static void BlinkM_reset() +{ + twi_init(); // can't just call Wire.begin() again because of calloc()s there +} +*/ + +// +// each call to twi_writeTo() should return 0 if device is there +// or other value (usually 2) if nothing is at that address +// +static void BlinkM_scanI2CBus(byte from, byte to, + void(*callback)(byte add, byte result) ) +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr = from; addr <= to; addr++ ) { + rc = twi_writeTo(addr, &data, 0, 1, 1); + callback( addr, rc ); + } +} + +// +// +static int8_t BlinkM_findFirstI2CDevice() +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr=1; addr < 120; addr++ ) { // only scan addrs 1-120 + rc = twi_writeTo(addr, &data, 0, 1, 1); + if( rc == 0 ) return addr; // found an address + } + return -1; // no device found in range given +} + +// FIXME: make this more Arduino-like +static void BlinkM_startPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC |= _BV(pwrpin) | _BV(gndpin); // make outputs + PORTC &=~ _BV(gndpin); + PORTC |= _BV(pwrpin); +} + +// FIXME: make this more Arduino-like +static void BlinkM_stopPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC &=~ (_BV(pwrpin) | _BV(gndpin)); +} + +// +static void BlinkM_startPower() +{ + BlinkM_startPowerWithPins( PORTC3, PORTC2 ); +} + +// +static void BlinkM_stopPower() +{ + BlinkM_stopPowerWithPins( PORTC3, PORTC2 ); +} + +// General version of BlinkM_beginWithPower(). +// Call this first when BlinkM is plugged directly into Arduino +static void BlinkM_beginWithPowerPins(byte pwrpin, byte gndpin) +{ + BlinkM_startPowerWithPins(pwrpin,gndpin); + delay(100); // wait for things to stabilize + Wire.begin(); +} + +// Call this first when BlinkM is plugged directly into Arduino +// FIXME: make this more Arduino-like +static void BlinkM_beginWithPower() +{ + BlinkM_beginWithPowerPins( PORTC3, PORTC2 ); +} + +// sends a generic command +static void BlinkM_sendCmd(byte addr, byte* cmd, int cmdlen) +{ + Wire.beginTransmission(addr); + for( byte i=0; idur = Wire.read(); + script_line->cmd[0] = Wire.read(); + script_line->cmd[1] = Wire.read(); + script_line->cmd[2] = Wire.read(); + script_line->cmd[3] = Wire.read(); +} + +// +static void BlinkM_writeScriptLine(byte addr, byte script_id, + byte pos, byte dur, + byte cmd, byte arg1, byte arg2, byte arg3) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing line:"); Serial.print(pos,DEC); + Serial.print(" with cmd:"); Serial.print(cmd); + Serial.print(" arg1:"); Serial.println(arg1,HEX); +#endif + Wire.beginTransmission(addr); + Wire.write('W'); + Wire.write(script_id); + Wire.write(pos); + Wire.write(dur); + Wire.write(cmd); + Wire.write(arg1); + Wire.write(arg2); + Wire.write(arg3); + Wire.endTransmission(); + +} + +// +static void BlinkM_writeScript(byte addr, byte script_id, + byte len, byte reps, + blinkm_script_line* lines) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing script to addr:"); Serial.print(addr,DEC); + Serial.print(", script_id:"); Serial.println(script_id,DEC); +#endif + for(byte i=0; i < len; i++) { + blinkm_script_line l = lines[i]; + BlinkM_writeScriptLine( addr, script_id, i, l.dur, + l.cmd[0], l.cmd[1], l.cmd[2], l.cmd[3]); + delay(20); // must wait for EEPROM to be programmed + } + BlinkM_setScriptLengthReps(addr, script_id, len, reps); +} + +// +static void BlinkM_setStartupParams(byte addr, byte mode, byte script_id, + byte reps, byte fadespeed, byte timeadj) +{ + Wire.beginTransmission(addr); + Wire.write('B'); + Wire.write(mode); // default 0x01 == Play script + Wire.write(script_id); // default 0x00 == script #0 + Wire.write(reps); // default 0x00 == repeat infinitely + Wire.write(fadespeed); // default 0x08 == usually overridden by sketch + Wire.write(timeadj); // default 0x00 == sometimes overridden by sketch + Wire.endTransmission(); +} + + +// Gets digital inputs of the BlinkM +// returns -1 on failure +static int BlinkM_getInputsO(byte addr) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)1); + if( Wire.available() ) { + byte b = Wire.read(); + return b; + } + return -1; +} + +// Gets digital inputs of the BlinkM +// stores them in passed in array +// returns -1 on failure +static int BlinkM_getInputs(byte addr, byte inputs[]) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)4); + while( Wire.available() < 4 ) ; // FIXME: wait until we get 4 bytes + + inputs[0] = Wire.read(); + inputs[1] = Wire.read(); + inputs[2] = Wire.read(); + inputs[3] = Wire.read(); + + return 0; +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Clapper/Clapper.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Clapper/Clapper.pde new file mode 100755 index 0000000..712b6f9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Clapper/Clapper.pde @@ -0,0 +1,94 @@ +/* + * rosserial Clapper Example + * + * This code is a very simple example of the kinds of + * custom sensors that you can easily set up with rosserial + * and Arduino. This code uses a microphone attached to + * analog pin 5 detect two claps (2 loud sounds). + * You can use this clapper, for example, to command a robot + * in the area to come do your bidding. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +std_msgs::Empty clap_msg; +ros::Publisher p("clap", &clap_msg); + +enum clapper_state { clap1, clap_one_waiting, pause, clap2}; +clapper_state clap; + +int volume_thresh = 200; //a clap sound needs to be: + //abs(clap_volume) > average noise + volume_thresh +int mic_pin = 5; +int adc_ave=0; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); + + //measure the average volume of the noise in the area + for (int i =0; i<10;i++) adc_ave += analogRead(mic_pin); + adc_ave /= 10; +} + +long event_timer; + +void loop() +{ + int mic_val = 0; + for(int i=0; i<4; i++) mic_val += analogRead(mic_pin); + + mic_val = mic_val/4-adc_ave; + + switch(clap){ + case clap1: + if (abs(mic_val) > volume_thresh){ + clap = clap_one_waiting; + event_timer = millis(); + } + break; + case clap_one_waiting: + if ( (abs(mic_val) < 30) && ( (millis() - event_timer) > 20 ) ) + { + clap= pause; + event_timer = millis(); + + } + break; + case pause: // make sure there is a pause between + // the loud sounds + if ( mic_val > volume_thresh) + { + clap = clap1; + + } + else if ( (millis()-event_timer)> 60) { + clap = clap2; + event_timer = millis(); + + } + break; + case clap2: + if (abs(mic_val) > volume_thresh){ //we have got a double clap! + clap = clap1; + p.publish(&clap_msg); + } + else if ( (millis()-event_timer)> 200) { + clap= clap1; // no clap detected, reset state machine + } + + break; + } + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde new file mode 100755 index 0000000..2474413 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde @@ -0,0 +1,28 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + */ + +#include +#include + +ros::NodeHandle nh; + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(1000); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/IrRanger/IrRanger.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/IrRanger/IrRanger.pde new file mode 100755 index 0000000..240b5a1 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/IrRanger/IrRanger.pde @@ -0,0 +1,64 @@ +/* + * rosserial IR Ranger Example + * + * This example is calibrated for the Sharp GP2D120XJ00F. + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "range_data", &range_msg); + +const int analog_pin = 0; +unsigned long range_timer; + +/* + * getRange() - samples the analog input from the ranger + * and converts it into meters. + */ +float getRange(int pin_num){ + int sample; + // Get data + sample = analogRead(pin_num)/4; + // if the ADC reading is too low, + // then we are really far away from anything + if(sample < 10) + return 254; // max range + // Magic numbers to get cm + sample= 1309/(sample-3); + return (sample - 1)/100; //convert to meters +} + +char frameid[] = "/ir_ranger"; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + range_msg.radiation_type = sensor_msgs::Range::INFRARED; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.01; + range_msg.min_range = 0.03; + range_msg.max_range = 0.4; + +} + +void loop() +{ + // publish the range value every 50 milliseconds + // since it takes that long for the sensor to stabilize + if ( (millis()-range_timer) > 50){ + range_msg.range = getRange(analog_pin); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_timer = millis() + 50; + } + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Logging/Logging.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Logging/Logging.pde new file mode 100755 index 0000000..400a9cd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Logging/Logging.pde @@ -0,0 +1,45 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + + +char debug[]= "debug statements"; +char info[] = "infos"; +char warn[] = "warnings"; +char error[] = "errors"; +char fatal[] = "fatalities"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + + nh.logdebug(debug); + nh.loginfo(info); + nh.logwarn(warn); + nh.logerror(error); + nh.logfatal(fatal); + + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Odom/Odom.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Odom/Odom.pde new file mode 100755 index 0000000..5841020 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Odom/Odom.pde @@ -0,0 +1,53 @@ +/* + * rosserial Planar Odometry Example + */ + +#include +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +double x = 1.0; +double y = 0.0; +double theta = 1.57; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + // drive in a circle + double dx = 0.2; + double dtheta = 0.18; + x += cos(theta)*dx*0.1; + y += sin(theta)*dx*0.1; + theta += dtheta*0.1; + if(theta > 3.14) + theta=-3.14; + + // tf odom->base_link + t.header.frame_id = odom; + t.child_frame_id = base_link; + + t.transform.translation.x = x; + t.transform.translation.y = y; + + t.transform.rotation = tf::createQuaternionFromYaw(theta); + t.header.stamp = nh.now(); + + broadcaster.sendTransform(t); + nh.spinOnce(); + + delay(10); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde new file mode 100755 index 0000000..75093a9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde @@ -0,0 +1,38 @@ +/* + * rosserial Service Client + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +ros::ServiceClient client("test_srv"); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.serviceClient(client); + nh.advertise(chatter); + while(!nh.connected()) nh.spinOnce(); + nh.loginfo("Startup complete"); +} + +void loop() +{ + Test::Request req; + Test::Response res; + req.input = hello; + client.call(req, res); + str_msg.data = res.output; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(100); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceClient/client.py b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceClient/client.py new file mode 100755 index 0000000..3b27bd5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceClient/client.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +""" +Sample code to use with ServiceClient.pde +""" + +import roslib; roslib.load_manifest("rosserial_arduino") +import rospy + +from rosserial_arduino.srv import * + +def callback(req): + print "The arduino is calling! Please send it a message:" + t = TestResponse() + t.output = raw_input() + return t + +rospy.init_node("service_client_test") +rospy.Service("test_srv", Test, callback) +rospy.spin() diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde new file mode 100755 index 0000000..2d3fd70 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde @@ -0,0 +1,40 @@ +/* + * rosserial Service Server + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +int i; +void callback(const Test::Request & req, Test::Response & res){ + if((i++)%2) + res.output = "hello"; + else + res.output = "world"; +} + +ros::ServiceServer server("test_srv",&callback); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertiseService(server); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServoControl/ServoControl.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServoControl/ServoControl.pde new file mode 100755 index 0000000..24db409 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/ServoControl/ServoControl.pde @@ -0,0 +1,49 @@ +/* + * rosserial Servo Control Example + * + * This sketch demonstrates the control of hobby R/C servos + * using ROS and the arduiono + * + * For the full tutorial write up, visit + * www.ros.org/wiki/rosserial_arduino_demos + * + * For more information on the Arduino Servo Library + * Checkout : + * http://www.arduino.cc/en/Reference/Servo + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif + +#include +#include +#include + +ros::NodeHandle nh; + +Servo servo; + +void servo_cb( const std_msgs::UInt16& cmd_msg){ + servo.write(cmd_msg.data); //set servo angle, should be from 0-180 + digitalWrite(13, HIGH-digitalRead(13)); //toggle led +} + + +ros::Subscriber sub("servo", servo_cb); + +void setup(){ + pinMode(13, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + servo.attach(9); //attach it to pin 9 +} + +void loop(){ + nh.spinOnce(); + delay(1); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Temperature/Temperature.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Temperature/Temperature.pde new file mode 100755 index 0000000..2c2f865 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Temperature/Temperature.pde @@ -0,0 +1,72 @@ +/* + * rosserial Temperature Sensor Example + * + * This tutorial demonstrates the usage of the + * Sparkfun TMP102 Digital Temperature Breakout board + * http://www.sparkfun.com/products/9418 + * + * Source Code Based off of: + * http://wiring.org.co/learning/libraries/tmp102sparkfun.html + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::Float32 temp_msg; +ros::Publisher pub_temp("temperature", &temp_msg); + + +// From the datasheet the BMP module address LSB distinguishes +// between read (1) and write (0) operations, corresponding to +// address 0x91 (read) and 0x90 (write). +// shift the address 1 bit right (0x91 or 0x90), the Wire library only needs the 7 +// most significant bits for the address 0x91 >> 1 = 0x48 +// 0x90 >> 1 = 0x48 (72) + +int sensorAddress = 0x91 >> 1; // From datasheet sensor address is 0x91 + // shift the address 1 bit right, the Wire library only needs the 7 + // most significant bits for the address + + +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + + nh.initNode(); + nh.advertise(pub_temp); + +} + +long publisher_timer; + +void loop() +{ + + if (millis() > publisher_timer) { + // step 1: request reading from sensor + Wire.requestFrom(sensorAddress,2); + delay(10); + if (2 <= Wire.available()) // if two bytes were received + { + byte msb; + byte lsb; + int temperature; + + msb = Wire.read(); // receive high byte (full degrees) + lsb = Wire.read(); // receive low byte (fraction degrees) + temperature = ((msb) << 4); // MSB + temperature |= (lsb >> 4); // LSB + + temp_msg.data = temperature*0.0625; + pub_temp.publish(&temp_msg); + } + + publisher_timer = millis() + 1000; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/TimeTF/TimeTF.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/TimeTF/TimeTF.pde new file mode 100755 index 0000000..16fbb70 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/TimeTF/TimeTF.pde @@ -0,0 +1,37 @@ +/* + * rosserial Time and TF Example + * Publishes a transform at current time + */ + +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + t.header.frame_id = odom; + t.child_frame_id = base_link; + t.transform.translation.x = 1.0; + t.transform.rotation.x = 0.0; + t.transform.rotation.y = 0.0; + t.transform.rotation.z = 0.0; + t.transform.rotation.w = 1.0; + t.header.stamp = nh.now(); + broadcaster.sendTransform(t); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde new file mode 100755 index 0000000..d5870cb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde @@ -0,0 +1,61 @@ +/* + * rosserial Ultrasound Example + * + * This example is for the Maxbotix Ultrasound rangers. + */ + +#include +#include +#include + +ros::NodeHandle nh; + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "/ultrasound", &range_msg); + +const int adc_pin = 0; + +char frameid[] = "/ultrasound"; + +float getRange_Ultrasound(int pin_num){ + int val = 0; + for(int i=0; i<4; i++) val += analogRead(pin_num); + float range = val; + return range /322.519685; // (0.0124023437 /4) ; //cvt to meters +} + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + + range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.1; // fake + range_msg.min_range = 0.0; + range_msg.max_range = 6.47; + + pinMode(8,OUTPUT); + digitalWrite(8, LOW); +} + + +long range_time; + +void loop() +{ + + //publish the adc value every 50 milliseconds + //since it takes that long for the sensor to stablize + if ( millis() >= range_time ){ + int r =0; + + range_msg.range = getRange_Ultrasound(5); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_time = millis() + 50; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/button_example/button_example.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/button_example/button_example.pde new file mode 100755 index 0000000..0404542 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/button_example/button_example.pde @@ -0,0 +1,61 @@ +/* + * Button Example for Rosserial + */ + +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Bool pushed_msg; +ros::Publisher pub_button("pushed", &pushed_msg); + +const int button_pin = 7; +const int led_pin = 13; + +bool last_reading; +long last_debounce_time=0; +long debounce_delay=50; +bool published = true; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_button); + + //initialize an LED output pin + //and a input pin for our push button + pinMode(led_pin, OUTPUT); + pinMode(button_pin, INPUT); + + //Enable the pullup resistor on the button + digitalWrite(button_pin, HIGH); + + //The button is a normally button + last_reading = ! digitalRead(button_pin); + +} + +void loop() +{ + + bool reading = ! digitalRead(button_pin); + + if (last_reading!= reading){ + last_debounce_time = millis(); + published = false; + } + + //if the button value has not changed for the debounce delay, we know its stable + if ( !published && (millis() - last_debounce_time) > debounce_delay) { + digitalWrite(led_pin, reading); + pushed_msg.data = reading; + pub_button.publish(&pushed_msg); + published = true; + } + + last_reading = reading; + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/pubsub/pubsub.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/pubsub/pubsub.pde new file mode 100755 index 0000000..753d8ed --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/examples/pubsub/pubsub.pde @@ -0,0 +1,40 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", messageCb ); + + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); + nh.subscribe(sub); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h new file mode 100755 index 0000000..7dd6bc0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_ApplyBodyWrench_h +#define _ROS_SERVICE_ApplyBodyWrench_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "geometry_msgs/Wrench.h" +#include "ros/time.h" +#include "geometry_msgs/Point.h" + +namespace gazebo_msgs +{ + +static const char APPLYBODYWRENCH[] = "gazebo_msgs/ApplyBodyWrench"; + + class ApplyBodyWrenchRequest : public ros::Msg + { + public: + const char* body_name; + const char* reference_frame; + geometry_msgs::Point reference_point; + geometry_msgs::Wrench wrench; + ros::Time start_time; + ros::Duration duration; + + ApplyBodyWrenchRequest(): + body_name(""), + reference_frame(""), + reference_point(), + wrench(), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + offset += this->reference_point.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + offset += this->reference_point.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "e37e6adf97eba5095baa77dffb71e5bd"; }; + + }; + + class ApplyBodyWrenchResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyBodyWrenchResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyBodyWrench { + public: + typedef ApplyBodyWrenchRequest Request; + typedef ApplyBodyWrenchResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h new file mode 100755 index 0000000..99e071c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_ApplyJointEffort_h +#define _ROS_SERVICE_ApplyJointEffort_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace gazebo_msgs +{ + +static const char APPLYJOINTEFFORT[] = "gazebo_msgs/ApplyJointEffort"; + + class ApplyJointEffortRequest : public ros::Msg + { + public: + const char* joint_name; + float effort; + ros::Time start_time; + ros::Duration duration; + + ApplyJointEffortRequest(): + joint_name(""), + effort(0), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2c3396ab9af67a509ecd2167a8fe41a2"; }; + + }; + + class ApplyJointEffortResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyJointEffortResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyJointEffort { + public: + typedef ApplyJointEffortRequest Request; + typedef ApplyJointEffortResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/BodyRequest.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/BodyRequest.h new file mode 100755 index 0000000..99dae8a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/BodyRequest.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_BodyRequest_h +#define _ROS_SERVICE_BodyRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char BODYREQUEST[] = "gazebo_msgs/BodyRequest"; + + class BodyRequestRequest : public ros::Msg + { + public: + const char* body_name; + + BodyRequestRequest(): + body_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "5eade9afe7f232d78005bd0cafeab755"; }; + + }; + + class BodyRequestResponse : public ros::Msg + { + public: + + BodyRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BodyRequest { + public: + typedef BodyRequestRequest Request; + typedef BodyRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ContactState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ContactState.h new file mode 100755 index 0000000..a1966f0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ContactState.h @@ -0,0 +1,172 @@ +#ifndef _ROS_gazebo_msgs_ContactState_h +#define _ROS_gazebo_msgs_ContactState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Wrench.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + + class ContactState : public ros::Msg + { + public: + const char* info; + const char* collision1_name; + const char* collision2_name; + uint8_t wrenches_length; + geometry_msgs::Wrench st_wrenches; + geometry_msgs::Wrench * wrenches; + geometry_msgs::Wrench total_wrench; + uint8_t contact_positions_length; + geometry_msgs::Vector3 st_contact_positions; + geometry_msgs::Vector3 * contact_positions; + uint8_t contact_normals_length; + geometry_msgs::Vector3 st_contact_normals; + geometry_msgs::Vector3 * contact_normals; + uint8_t depths_length; + float st_depths; + float * depths; + + ContactState(): + info(""), + collision1_name(""), + collision2_name(""), + wrenches_length(0), wrenches(NULL), + total_wrench(), + contact_positions_length(0), contact_positions(NULL), + contact_normals_length(0), contact_normals(NULL), + depths_length(0), depths(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + uint32_t length_collision1_name = strlen(this->collision1_name); + memcpy(outbuffer + offset, &length_collision1_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision1_name, length_collision1_name); + offset += length_collision1_name; + uint32_t length_collision2_name = strlen(this->collision2_name); + memcpy(outbuffer + offset, &length_collision2_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision2_name, length_collision2_name); + offset += length_collision2_name; + *(outbuffer + offset++) = wrenches_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->wrenches[i].serialize(outbuffer + offset); + } + offset += this->total_wrench.serialize(outbuffer + offset); + *(outbuffer + offset++) = contact_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->contact_positions[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = contact_normals_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->contact_normals[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = depths_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < depths_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->depths[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + uint32_t length_collision1_name; + memcpy(&length_collision1_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision1_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision1_name-1]=0; + this->collision1_name = (char *)(inbuffer + offset-1); + offset += length_collision1_name; + uint32_t length_collision2_name; + memcpy(&length_collision2_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision2_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision2_name-1]=0; + this->collision2_name = (char *)(inbuffer + offset-1); + offset += length_collision2_name; + uint8_t wrenches_lengthT = *(inbuffer + offset++); + if(wrenches_lengthT > wrenches_length) + this->wrenches = (geometry_msgs::Wrench*)realloc(this->wrenches, wrenches_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrenches_length = wrenches_lengthT; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->st_wrenches.deserialize(inbuffer + offset); + memcpy( &(this->wrenches[i]), &(this->st_wrenches), sizeof(geometry_msgs::Wrench)); + } + offset += this->total_wrench.deserialize(inbuffer + offset); + uint8_t contact_positions_lengthT = *(inbuffer + offset++); + if(contact_positions_lengthT > contact_positions_length) + this->contact_positions = (geometry_msgs::Vector3*)realloc(this->contact_positions, contact_positions_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_positions_length = contact_positions_lengthT; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->st_contact_positions.deserialize(inbuffer + offset); + memcpy( &(this->contact_positions[i]), &(this->st_contact_positions), sizeof(geometry_msgs::Vector3)); + } + uint8_t contact_normals_lengthT = *(inbuffer + offset++); + if(contact_normals_lengthT > contact_normals_length) + this->contact_normals = (geometry_msgs::Vector3*)realloc(this->contact_normals, contact_normals_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_normals_length = contact_normals_lengthT; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->st_contact_normals.deserialize(inbuffer + offset); + memcpy( &(this->contact_normals[i]), &(this->st_contact_normals), sizeof(geometry_msgs::Vector3)); + } + uint8_t depths_lengthT = *(inbuffer + offset++); + if(depths_lengthT > depths_length) + this->depths = (float*)realloc(this->depths, depths_lengthT * sizeof(float)); + offset += 3; + depths_length = depths_lengthT; + for( uint8_t i = 0; i < depths_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_depths)); + memcpy( &(this->depths[i]), &(this->st_depths), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactState"; }; + const char * getMD5(){ return "48c0ffb054b8c444f870cecea1ee50d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ContactsState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ContactsState.h new file mode 100755 index 0000000..38da01f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ContactsState.h @@ -0,0 +1,64 @@ +#ifndef _ROS_gazebo_msgs_ContactsState_h +#define _ROS_gazebo_msgs_ContactsState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/ContactState.h" + +namespace gazebo_msgs +{ + + class ContactsState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t states_length; + gazebo_msgs::ContactState st_states; + gazebo_msgs::ContactState * states; + + ContactsState(): + header(), + states_length(0), states(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t states_lengthT = *(inbuffer + offset++); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + offset += 3; + states_length = states_lengthT; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->st_states.deserialize(inbuffer + offset); + memcpy( &(this->states[i]), &(this->st_states), sizeof(gazebo_msgs::ContactState)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactsState"; }; + const char * getMD5(){ return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/DeleteModel.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/DeleteModel.h new file mode 100755 index 0000000..2c744d8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/DeleteModel.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_DeleteModel_h +#define _ROS_SERVICE_DeleteModel_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char DELETEMODEL[] = "gazebo_msgs/DeleteModel"; + + class DeleteModelRequest : public ros::Msg + { + public: + const char* model_name; + + DeleteModelRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class DeleteModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + DeleteModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteModel { + public: + typedef DeleteModelRequest Request; + typedef DeleteModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h new file mode 100755 index 0000000..361eae6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_GetJointProperties_h +#define _ROS_SERVICE_GetJointProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETJOINTPROPERTIES[] = "gazebo_msgs/GetJointProperties"; + + class GetJointPropertiesRequest : public ros::Msg + { + public: + const char* joint_name; + + GetJointPropertiesRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class GetJointPropertiesResponse : public ros::Msg + { + public: + uint8_t type; + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t position_length; + float st_position; + float * position; + uint8_t rate_length; + float st_rate; + float * rate; + bool success; + const char* status_message; + enum { REVOLUTE = 0 }; + enum { CONTINUOUS = 1 }; + enum { PRISMATIC = 2 }; + enum { FIXED = 3 }; + enum { BALL = 4 }; + enum { UNIVERSAL = 5 }; + + GetJointPropertiesResponse(): + type(0), + damping_length(0), damping(NULL), + position_length(0), position(NULL), + rate_length(0), rate(NULL), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = rate_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rate_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->rate[i]); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t rate_lengthT = *(inbuffer + offset++); + if(rate_lengthT > rate_length) + this->rate = (float*)realloc(this->rate, rate_lengthT * sizeof(float)); + offset += 3; + rate_length = rate_lengthT; + for( uint8_t i = 0; i < rate_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_rate)); + memcpy( &(this->rate[i]), &(this->st_rate), sizeof(float)); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "cd7b30a39faa372283dc94c5f6457f82"; }; + + }; + + class GetJointProperties { + public: + typedef GetJointPropertiesRequest Request; + typedef GetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h new file mode 100755 index 0000000..12ea8dc --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_GetLinkProperties_h +#define _ROS_SERVICE_GetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char GETLINKPROPERTIES[] = "gazebo_msgs/GetLinkProperties"; + + class GetLinkPropertiesRequest : public ros::Msg + { + public: + const char* link_name; + + GetLinkPropertiesRequest(): + link_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "7d82d60381f1b66a30f2157f60884345"; }; + + }; + + class GetLinkPropertiesResponse : public ros::Msg + { + public: + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + bool success; + const char* status_message; + + GetLinkPropertiesResponse(): + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "a8619f92d17cfcc3958c0fd13299443d"; }; + + }; + + class GetLinkProperties { + public: + typedef GetLinkPropertiesRequest Request; + typedef GetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetLinkState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetLinkState.h new file mode 100755 index 0000000..5e9ed3a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetLinkState.h @@ -0,0 +1,140 @@ +#ifndef _ROS_SERVICE_GetLinkState_h +#define _ROS_SERVICE_GetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char GETLINKSTATE[] = "gazebo_msgs/GetLinkState"; + + class GetLinkStateRequest : public ros::Msg + { + public: + const char* link_name; + const char* reference_frame; + + GetLinkStateRequest(): + link_name(""), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "7551675c30aaa71f7c288d4864552001"; }; + + }; + + class GetLinkStateResponse : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + bool success; + const char* status_message; + + GetLinkStateResponse(): + link_state(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "8ba55ad34f9c072e75c0de57b089753b"; }; + + }; + + class GetLinkState { + public: + typedef GetLinkStateRequest Request; + typedef GetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h new file mode 100755 index 0000000..3574fe5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h @@ -0,0 +1,296 @@ +#ifndef _ROS_SERVICE_GetModelProperties_h +#define _ROS_SERVICE_GetModelProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties"; + + class GetModelPropertiesRequest : public ros::Msg + { + public: + const char* model_name; + + GetModelPropertiesRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class GetModelPropertiesResponse : public ros::Msg + { + public: + const char* parent_model_name; + const char* canonical_body_name; + uint8_t body_names_length; + char* st_body_names; + char* * body_names; + uint8_t geom_names_length; + char* st_geom_names; + char* * geom_names; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t child_model_names_length; + char* st_child_model_names; + char* * child_model_names; + bool is_static; + bool success; + const char* status_message; + + GetModelPropertiesResponse(): + parent_model_name(""), + canonical_body_name(""), + body_names_length(0), body_names(NULL), + geom_names_length(0), geom_names(NULL), + joint_names_length(0), joint_names(NULL), + child_model_names_length(0), child_model_names(NULL), + is_static(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_parent_model_name = strlen(this->parent_model_name); + memcpy(outbuffer + offset, &length_parent_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); + offset += length_parent_model_name; + uint32_t length_canonical_body_name = strlen(this->canonical_body_name); + memcpy(outbuffer + offset, &length_canonical_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); + offset += length_canonical_body_name; + *(outbuffer + offset++) = body_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_body_namesi = strlen(this->body_names[i]); + memcpy(outbuffer + offset, &length_body_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); + offset += length_body_namesi; + } + *(outbuffer + offset++) = geom_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_geom_namesi = strlen(this->geom_names[i]); + memcpy(outbuffer + offset, &length_geom_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); + offset += length_geom_namesi; + } + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = child_model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_child_model_namesi = strlen(this->child_model_names[i]); + memcpy(outbuffer + offset, &length_child_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); + offset += length_child_model_namesi; + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.real = this->is_static; + *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_parent_model_name; + memcpy(&length_parent_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_model_name-1]=0; + this->parent_model_name = (char *)(inbuffer + offset-1); + offset += length_parent_model_name; + uint32_t length_canonical_body_name; + memcpy(&length_canonical_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_canonical_body_name-1]=0; + this->canonical_body_name = (char *)(inbuffer + offset-1); + offset += length_canonical_body_name; + uint8_t body_names_lengthT = *(inbuffer + offset++); + if(body_names_lengthT > body_names_length) + this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); + offset += 3; + body_names_length = body_names_lengthT; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_st_body_names; + memcpy(&length_st_body_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_body_names-1]=0; + this->st_body_names = (char *)(inbuffer + offset-1); + offset += length_st_body_names; + memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); + } + uint8_t geom_names_lengthT = *(inbuffer + offset++); + if(geom_names_lengthT > geom_names_length) + this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); + offset += 3; + geom_names_length = geom_names_lengthT; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_st_geom_names; + memcpy(&length_st_geom_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_geom_names-1]=0; + this->st_geom_names = (char *)(inbuffer + offset-1); + offset += length_st_geom_names; + memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); + } + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t child_model_names_lengthT = *(inbuffer + offset++); + if(child_model_names_lengthT > child_model_names_length) + this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); + offset += 3; + child_model_names_length = child_model_names_lengthT; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_st_child_model_names; + memcpy(&length_st_child_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_child_model_names-1]=0; + this->st_child_model_names = (char *)(inbuffer + offset-1); + offset += length_st_child_model_names; + memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.base = 0; + u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_static = u_is_static.real; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; + + }; + + class GetModelProperties { + public: + typedef GetModelPropertiesRequest Request; + typedef GetModelPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetModelState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetModelState.h new file mode 100755 index 0000000..799c432 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetModelState.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_GetModelState_h +#define _ROS_SERVICE_GetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + +static const char GETMODELSTATE[] = "gazebo_msgs/GetModelState"; + + class GetModelStateRequest : public ros::Msg + { + public: + const char* model_name; + const char* relative_entity_name; + + GetModelStateRequest(): + model_name(""), + relative_entity_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_relative_entity_name = strlen(this->relative_entity_name); + memcpy(outbuffer + offset, &length_relative_entity_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->relative_entity_name, length_relative_entity_name); + offset += length_relative_entity_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_relative_entity_name; + memcpy(&length_relative_entity_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_relative_entity_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_relative_entity_name-1]=0; + this->relative_entity_name = (char *)(inbuffer + offset-1); + offset += length_relative_entity_name; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "19d412713cefe4a67437e17a951e759e"; }; + + }; + + class GetModelStateResponse : public ros::Msg + { + public: + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + bool success; + const char* status_message; + + GetModelStateResponse(): + pose(), + twist(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "1f8f991dc94e0cb27fe61383e0f576bb"; }; + + }; + + class GetModelState { + public: + typedef GetModelStateRequest Request; + typedef GetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h new file mode 100755 index 0000000..9713896 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h @@ -0,0 +1,138 @@ +#ifndef _ROS_SERVICE_GetPhysicsProperties_h +#define _ROS_SERVICE_GetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char GETPHYSICSPROPERTIES[] = "gazebo_msgs/GetPhysicsProperties"; + + class GetPhysicsPropertiesRequest : public ros::Msg + { + public: + + GetPhysicsPropertiesRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPhysicsPropertiesResponse : public ros::Msg + { + public: + float time_step; + bool pause; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + bool success; + const char* status_message; + + GetPhysicsPropertiesResponse(): + time_step(0), + pause(0), + max_update_rate(0), + gravity(), + ode_config(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.real = this->pause; + *(outbuffer + offset + 0) = (u_pause.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pause); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.base = 0; + u_pause.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pause = u_pause.real; + offset += sizeof(this->pause); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "575a5e74786981b7df2e3afc567693a6"; }; + + }; + + class GetPhysicsProperties { + public: + typedef GetPhysicsPropertiesRequest Request; + typedef GetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h new file mode 100755 index 0000000..a179500 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h @@ -0,0 +1,156 @@ +#ifndef _ROS_SERVICE_GetWorldProperties_h +#define _ROS_SERVICE_GetWorldProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETWORLDPROPERTIES[] = "gazebo_msgs/GetWorldProperties"; + + class GetWorldPropertiesRequest : public ros::Msg + { + public: + + GetWorldPropertiesRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetWorldPropertiesResponse : public ros::Msg + { + public: + float sim_time; + uint8_t model_names_length; + char* st_model_names; + char* * model_names; + bool rendering_enabled; + bool success; + const char* status_message; + + GetWorldPropertiesResponse(): + sim_time(0), + model_names_length(0), model_names(NULL), + rendering_enabled(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->sim_time); + *(outbuffer + offset++) = model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen(this->model_names[i]); + memcpy(outbuffer + offset, &length_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_names[i], length_model_namesi); + offset += length_model_namesi; + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.real = this->rendering_enabled; + *(outbuffer + offset + 0) = (u_rendering_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sim_time)); + uint8_t model_names_lengthT = *(inbuffer + offset++); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + offset += 3; + model_names_length = model_names_lengthT; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + memcpy(&length_st_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_model_names-1]=0; + this->st_model_names = (char *)(inbuffer + offset-1); + offset += length_st_model_names; + memcpy( &(this->model_names[i]), &(this->st_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.base = 0; + u_rendering_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->rendering_enabled = u_rendering_enabled.real; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "36bb0f2eccf4d8be971410c22818ba3f"; }; + + }; + + class GetWorldProperties { + public: + typedef GetWorldPropertiesRequest Request; + typedef GetWorldPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/JointRequest.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/JointRequest.h new file mode 100755 index 0000000..17029cb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/JointRequest.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_JointRequest_h +#define _ROS_SERVICE_JointRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char JOINTREQUEST[] = "gazebo_msgs/JointRequest"; + + class JointRequestRequest : public ros::Msg + { + public: + const char* joint_name; + + JointRequestRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class JointRequestResponse : public ros::Msg + { + public: + + JointRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class JointRequest { + public: + typedef JointRequestRequest Request; + typedef JointRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/LinkState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/LinkState.h new file mode 100755 index 0000000..6c87024 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/LinkState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_gazebo_msgs_LinkState_h +#define _ROS_gazebo_msgs_LinkState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkState : public ros::Msg + { + public: + const char* link_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + LinkState(): + link_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkState"; }; + const char * getMD5(){ return "0818ebbf28ce3a08d48ab1eaa7309ebe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/LinkStates.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/LinkStates.h new file mode 100755 index 0000000..2dc1c83 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/LinkStates.h @@ -0,0 +1,112 @@ +#ifndef _ROS_gazebo_msgs_LinkStates_h +#define _ROS_gazebo_msgs_LinkStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + LinkStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ModelState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ModelState.h new file mode 100755 index 0000000..15ae191 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ModelState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_gazebo_msgs_ModelState_h +#define _ROS_gazebo_msgs_ModelState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelState : public ros::Msg + { + public: + const char* model_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + ModelState(): + model_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelState"; }; + const char * getMD5(){ return "9330fd35f2fcd82d457e54bd54e10593"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ModelStates.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ModelStates.h new file mode 100755 index 0000000..aeb9f21 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ModelStates.h @@ -0,0 +1,112 @@ +#ifndef _ROS_gazebo_msgs_ModelStates_h +#define _ROS_gazebo_msgs_ModelStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + ModelStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h new file mode 100755 index 0000000..1711110 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h @@ -0,0 +1,238 @@ +#ifndef _ROS_gazebo_msgs_ODEJointProperties_h +#define _ROS_gazebo_msgs_ODEJointProperties_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEJointProperties : public ros::Msg + { + public: + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t hiStop_length; + float st_hiStop; + float * hiStop; + uint8_t loStop_length; + float st_loStop; + float * loStop; + uint8_t erp_length; + float st_erp; + float * erp; + uint8_t cfm_length; + float st_cfm; + float * cfm; + uint8_t stop_erp_length; + float st_stop_erp; + float * stop_erp; + uint8_t stop_cfm_length; + float st_stop_cfm; + float * stop_cfm; + uint8_t fudge_factor_length; + float st_fudge_factor; + float * fudge_factor; + uint8_t fmax_length; + float st_fmax; + float * fmax; + uint8_t vel_length; + float st_vel; + float * vel; + + ODEJointProperties(): + damping_length(0), damping(NULL), + hiStop_length(0), hiStop(NULL), + loStop_length(0), loStop(NULL), + erp_length(0), erp(NULL), + cfm_length(0), cfm(NULL), + stop_erp_length(0), stop_erp(NULL), + stop_cfm_length(0), stop_cfm(NULL), + fudge_factor_length(0), fudge_factor(NULL), + fmax_length(0), fmax(NULL), + vel_length(0), vel(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = hiStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->hiStop[i]); + } + *(outbuffer + offset++) = loStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->loStop[i]); + } + *(outbuffer + offset++) = erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->erp[i]); + } + *(outbuffer + offset++) = cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cfm[i]); + } + *(outbuffer + offset++) = stop_erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_erp[i]); + } + *(outbuffer + offset++) = stop_cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_cfm[i]); + } + *(outbuffer + offset++) = fudge_factor_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fudge_factor[i]); + } + *(outbuffer + offset++) = fmax_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fmax[i]); + } + *(outbuffer + offset++) = vel_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vel_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->vel[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t hiStop_lengthT = *(inbuffer + offset++); + if(hiStop_lengthT > hiStop_length) + this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); + offset += 3; + hiStop_length = hiStop_lengthT; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_hiStop)); + memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); + } + uint8_t loStop_lengthT = *(inbuffer + offset++); + if(loStop_lengthT > loStop_length) + this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); + offset += 3; + loStop_length = loStop_lengthT; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_loStop)); + memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); + } + uint8_t erp_lengthT = *(inbuffer + offset++); + if(erp_lengthT > erp_length) + this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); + offset += 3; + erp_length = erp_lengthT; + for( uint8_t i = 0; i < erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_erp)); + memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); + } + uint8_t cfm_lengthT = *(inbuffer + offset++); + if(cfm_lengthT > cfm_length) + this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); + offset += 3; + cfm_length = cfm_lengthT; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_cfm)); + memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); + } + uint8_t stop_erp_lengthT = *(inbuffer + offset++); + if(stop_erp_lengthT > stop_erp_length) + this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); + offset += 3; + stop_erp_length = stop_erp_lengthT; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_erp)); + memcpy( &(this->stop_erp[i]), &(this->st_stop_erp), sizeof(float)); + } + uint8_t stop_cfm_lengthT = *(inbuffer + offset++); + if(stop_cfm_lengthT > stop_cfm_length) + this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); + offset += 3; + stop_cfm_length = stop_cfm_lengthT; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_cfm)); + memcpy( &(this->stop_cfm[i]), &(this->st_stop_cfm), sizeof(float)); + } + uint8_t fudge_factor_lengthT = *(inbuffer + offset++); + if(fudge_factor_lengthT > fudge_factor_length) + this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); + offset += 3; + fudge_factor_length = fudge_factor_lengthT; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fudge_factor)); + memcpy( &(this->fudge_factor[i]), &(this->st_fudge_factor), sizeof(float)); + } + uint8_t fmax_lengthT = *(inbuffer + offset++); + if(fmax_lengthT > fmax_length) + this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); + offset += 3; + fmax_length = fmax_lengthT; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fmax)); + memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); + } + uint8_t vel_lengthT = *(inbuffer + offset++); + if(vel_lengthT > vel_length) + this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); + offset += 3; + vel_length = vel_lengthT; + for( uint8_t i = 0; i < vel_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_vel)); + memcpy( &(this->vel[i]), &(this->st_vel), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEJointProperties"; }; + const char * getMD5(){ return "1b744c32a920af979f53afe2f9c3511f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h new file mode 100755 index 0000000..079d7bd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h @@ -0,0 +1,115 @@ +#ifndef _ROS_gazebo_msgs_ODEPhysics_h +#define _ROS_gazebo_msgs_ODEPhysics_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEPhysics : public ros::Msg + { + public: + bool auto_disable_bodies; + uint32_t sor_pgs_precon_iters; + uint32_t sor_pgs_iters; + float sor_pgs_w; + float sor_pgs_rms_error_tol; + float contact_surface_layer; + float contact_max_correcting_vel; + float cfm; + float erp; + uint32_t max_contacts; + + ODEPhysics(): + auto_disable_bodies(0), + sor_pgs_precon_iters(0), + sor_pgs_iters(0), + sor_pgs_w(0), + sor_pgs_rms_error_tol(0), + contact_surface_layer(0), + contact_max_correcting_vel(0), + cfm(0), + erp(0), + max_contacts(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.real = this->auto_disable_bodies; + *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->auto_disable_bodies); + *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_precon_iters); + *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_iters); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_w); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_rms_error_tol); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_surface_layer); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_max_correcting_vel); + offset += serializeAvrFloat64(outbuffer + offset, this->cfm); + offset += serializeAvrFloat64(outbuffer + offset, this->erp); + *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_contacts); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.base = 0; + u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->auto_disable_bodies = u_auto_disable_bodies.real; + offset += sizeof(this->auto_disable_bodies); + this->sor_pgs_precon_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_precon_iters); + this->sor_pgs_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_iters); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_w)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_rms_error_tol)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_surface_layer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_max_correcting_vel)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cfm)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->erp)); + this->max_contacts = ((uint32_t) (*(inbuffer + offset))); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->max_contacts); + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEPhysics"; }; + const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h new file mode 100755 index 0000000..1804fd4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_SetJointProperties_h +#define _ROS_SERVICE_SetJointProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEJointProperties.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTPROPERTIES[] = "gazebo_msgs/SetJointProperties"; + + class SetJointPropertiesRequest : public ros::Msg + { + public: + const char* joint_name; + gazebo_msgs::ODEJointProperties ode_joint_config; + + SetJointPropertiesRequest(): + joint_name(""), + ode_joint_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += this->ode_joint_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += this->ode_joint_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "331fd8f35fd27e3c1421175590258e26"; }; + + }; + + class SetJointPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointProperties { + public: + typedef SetJointPropertiesRequest Request; + typedef SetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h new file mode 100755 index 0000000..da5b3e9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_SetJointTrajectory_h +#define _ROS_SERVICE_SetJointTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTTRAJECTORY[] = "gazebo_msgs/SetJointTrajectory"; + + class SetJointTrajectoryRequest : public ros::Msg + { + public: + const char* model_name; + trajectory_msgs::JointTrajectory joint_trajectory; + geometry_msgs::Pose model_pose; + bool set_model_pose; + bool disable_physics_updates; + + SetJointTrajectoryRequest(): + model_name(""), + joint_trajectory(), + model_pose(), + set_model_pose(0), + disable_physics_updates(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->joint_trajectory.serialize(outbuffer + offset); + offset += this->model_pose.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.real = this->set_model_pose; + *(outbuffer + offset + 0) = (u_set_model_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.real = this->disable_physics_updates; + *(outbuffer + offset + 0) = (u_disable_physics_updates.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->joint_trajectory.deserialize(inbuffer + offset); + offset += this->model_pose.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.base = 0; + u_set_model_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->set_model_pose = u_set_model_pose.real; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.base = 0; + u_disable_physics_updates.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->disable_physics_updates = u_disable_physics_updates.real; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "649dd2eba5ffd358069238825f9f85ab"; }; + + }; + + class SetJointTrajectoryResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointTrajectoryResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointTrajectory { + public: + typedef SetJointTrajectoryRequest Request; + typedef SetJointTrajectoryResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h new file mode 100755 index 0000000..644164a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_SetLinkProperties_h +#define _ROS_SERVICE_SetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETLINKPROPERTIES[] = "gazebo_msgs/SetLinkProperties"; + + class SetLinkPropertiesRequest : public ros::Msg + { + public: + const char* link_name; + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + SetLinkPropertiesRequest(): + link_name(""), + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "68ac74a4be01b165bc305b5ccdc45e91"; }; + + }; + + class SetLinkPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkProperties { + public: + typedef SetLinkPropertiesRequest Request; + typedef SetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetLinkState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetLinkState.h new file mode 100755 index 0000000..dad0051 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetLinkState.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetLinkState_h +#define _ROS_SERVICE_SetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char SETLINKSTATE[] = "gazebo_msgs/SetLinkState"; + + class SetLinkStateRequest : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + + SetLinkStateRequest(): + link_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "22a2c757d56911b6f27868159e9a872d"; }; + + }; + + class SetLinkStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkState { + public: + typedef SetLinkStateRequest Request; + typedef SetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h new file mode 100755 index 0000000..5b963b4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h @@ -0,0 +1,187 @@ +#ifndef _ROS_SERVICE_SetModelConfiguration_h +#define _ROS_SERVICE_SetModelConfiguration_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char SETMODELCONFIGURATION[] = "gazebo_msgs/SetModelConfiguration"; + + class SetModelConfigurationRequest : public ros::Msg + { + public: + const char* model_name; + const char* urdf_param_name; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t joint_positions_length; + float st_joint_positions; + float * joint_positions; + + SetModelConfigurationRequest(): + model_name(""), + urdf_param_name(""), + joint_names_length(0), joint_names(NULL), + joint_positions_length(0), joint_positions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_urdf_param_name = strlen(this->urdf_param_name); + memcpy(outbuffer + offset, &length_urdf_param_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->urdf_param_name, length_urdf_param_name); + offset += length_urdf_param_name; + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = joint_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_positions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_urdf_param_name; + memcpy(&length_urdf_param_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_urdf_param_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_urdf_param_name-1]=0; + this->urdf_param_name = (char *)(inbuffer + offset-1); + offset += length_urdf_param_name; + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t joint_positions_lengthT = *(inbuffer + offset++); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + offset += 3; + joint_positions_length = joint_positions_lengthT; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_positions)); + memcpy( &(this->joint_positions[i]), &(this->st_joint_positions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "160eae60f51fabff255480c70afa289f"; }; + + }; + + class SetModelConfigurationResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelConfigurationResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelConfiguration { + public: + typedef SetModelConfigurationRequest Request; + typedef SetModelConfigurationResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetModelState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetModelState.h new file mode 100755 index 0000000..5d8222e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetModelState.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetModelState_h +#define _ROS_SERVICE_SetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ModelState.h" + +namespace gazebo_msgs +{ + +static const char SETMODELSTATE[] = "gazebo_msgs/SetModelState"; + + class SetModelStateRequest : public ros::Msg + { + public: + gazebo_msgs::ModelState model_state; + + SetModelStateRequest(): + model_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->model_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->model_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "cb042b0e91880f4661b29ea5b6234350"; }; + + }; + + class SetModelStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelState { + public: + typedef SetModelStateRequest Request; + typedef SetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h new file mode 100755 index 0000000..9a5534e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_SetPhysicsProperties_h +#define _ROS_SERVICE_SetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char SETPHYSICSPROPERTIES[] = "gazebo_msgs/SetPhysicsProperties"; + + class SetPhysicsPropertiesRequest : public ros::Msg + { + public: + float time_step; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + + SetPhysicsPropertiesRequest(): + time_step(0), + max_update_rate(0), + gravity(), + ode_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "abd9f82732b52b92e9d6bb36e6a82452"; }; + + }; + + class SetPhysicsPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetPhysicsPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetPhysicsProperties { + public: + typedef SetPhysicsPropertiesRequest Request; + typedef SetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SpawnModel.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SpawnModel.h new file mode 100755 index 0000000..8eeb9c9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/SpawnModel.h @@ -0,0 +1,172 @@ +#ifndef _ROS_SERVICE_SpawnModel_h +#define _ROS_SERVICE_SpawnModel_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SPAWNMODEL[] = "gazebo_msgs/SpawnModel"; + + class SpawnModelRequest : public ros::Msg + { + public: + const char* model_name; + const char* model_xml; + const char* robot_namespace; + geometry_msgs::Pose initial_pose; + const char* reference_frame; + + SpawnModelRequest(): + model_name(""), + model_xml(""), + robot_namespace(""), + initial_pose(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_model_xml = strlen(this->model_xml); + memcpy(outbuffer + offset, &length_model_xml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_xml, length_model_xml); + offset += length_model_xml; + uint32_t length_robot_namespace = strlen(this->robot_namespace); + memcpy(outbuffer + offset, &length_robot_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->robot_namespace, length_robot_namespace); + offset += length_robot_namespace; + offset += this->initial_pose.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_model_xml; + memcpy(&length_model_xml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_xml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_xml-1]=0; + this->model_xml = (char *)(inbuffer + offset-1); + offset += length_model_xml; + uint32_t length_robot_namespace; + memcpy(&length_robot_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_namespace-1]=0; + this->robot_namespace = (char *)(inbuffer + offset-1); + offset += length_robot_namespace; + offset += this->initial_pose.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "6d0eba5753761cd57e6263a056b79930"; }; + + }; + + class SpawnModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SpawnModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SpawnModel { + public: + typedef SpawnModelRequest Request; + typedef SpawnModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/WorldState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/WorldState.h new file mode 100755 index 0000000..9ea0ae6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/gazebo_msgs/WorldState.h @@ -0,0 +1,138 @@ +#ifndef _ROS_gazebo_msgs_WorldState_h +#define _ROS_gazebo_msgs_WorldState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace gazebo_msgs +{ + + class WorldState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + WorldState(): + header(), + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/WorldState"; }; + const char * getMD5(){ return "de1a9de3ab7ba97ac0e9ec01a4eb481e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Accel.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Accel.h new file mode 100755 index 0000000..c3bedcf --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Accel.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Accel_h +#define _ROS_geometry_msgs_Accel_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Accel : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Accel(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Accel"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelStamped.h new file mode 100755 index 0000000..121060d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_AccelStamped_h +#define _ROS_geometry_msgs_AccelStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Accel accel; + + AccelStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelStamped"; }; + const char * getMD5(){ return "d8a98a5d81351b6eb0578c78557e7659"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h new file mode 100755 index 0000000..89f39d0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovariance_h +#define _ROS_geometry_msgs_AccelWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelWithCovariance : public ros::Msg + { + public: + geometry_msgs::Accel accel; + float covariance[36]; + + AccelWithCovariance(): + accel(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->accel.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->accel.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovariance"; }; + const char * getMD5(){ return "ad5a718d699c6be72a02b8d6a139f334"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h new file mode 100755 index 0000000..d548139 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovarianceStamped_h +#define _ROS_geometry_msgs_AccelWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/AccelWithCovariance.h" + +namespace geometry_msgs +{ + + class AccelWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::AccelWithCovariance accel; + + AccelWithCovarianceStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovarianceStamped"; }; + const char * getMD5(){ return "96adb295225031ec8d57fb4251b0a886"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Inertia.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Inertia.h new file mode 100755 index 0000000..c7f719a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Inertia.h @@ -0,0 +1,71 @@ +#ifndef _ROS_geometry_msgs_Inertia_h +#define _ROS_geometry_msgs_Inertia_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Inertia : public ros::Msg + { + public: + float m; + geometry_msgs::Vector3 com; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + Inertia(): + m(0), + com(), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->m); + offset += this->com.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m)); + offset += this->com.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Inertia"; }; + const char * getMD5(){ return "1d26e4bb6c83ff141c5cf0d883c2b0fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/InertiaStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/InertiaStamped.h new file mode 100755 index 0000000..33cb756 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/InertiaStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_InertiaStamped_h +#define _ROS_geometry_msgs_InertiaStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Inertia.h" + +namespace geometry_msgs +{ + + class InertiaStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Inertia inertia; + + InertiaStamped(): + header(), + inertia() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->inertia.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->inertia.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/InertiaStamped"; }; + const char * getMD5(){ return "ddee48caeab5a966c5e8d166654a9ac7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Point.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Point.h new file mode 100755 index 0000000..92e1b42 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Point.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Point_h +#define _ROS_geometry_msgs_Point_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point : public ros::Msg + { + public: + float x; + float y; + float z; + + Point(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Point32.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Point32.h new file mode 100755 index 0000000..15be573 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Point32.h @@ -0,0 +1,107 @@ +#ifndef _ROS_geometry_msgs_Point32_h +#define _ROS_geometry_msgs_Point32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point32 : public ros::Msg + { + public: + float x; + float y; + float z; + + Point32(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point32"; }; + const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PointStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PointStamped.h new file mode 100755 index 0000000..76cb588 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PointStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PointStamped_h +#define _ROS_geometry_msgs_PointStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace geometry_msgs +{ + + class PointStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Point point; + + PointStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PointStamped"; }; + const char * getMD5(){ return "c63aecb41bfdfd6b7e1fac37c7cbe7bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Polygon.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Polygon.h new file mode 100755 index 0000000..1d99362 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Polygon.h @@ -0,0 +1,59 @@ +#ifndef _ROS_geometry_msgs_Polygon_h +#define _ROS_geometry_msgs_Polygon_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point32.h" + +namespace geometry_msgs +{ + + class Polygon : public ros::Msg + { + public: + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + + Polygon(): + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/Polygon"; }; + const char * getMD5(){ return "cd60a26494a087f577976f0329fa120e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PolygonStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PolygonStamped.h new file mode 100755 index 0000000..1f90c35 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PolygonStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PolygonStamped_h +#define _ROS_geometry_msgs_PolygonStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Polygon.h" + +namespace geometry_msgs +{ + + class PolygonStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Polygon polygon; + + PolygonStamped(): + header(), + polygon() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PolygonStamped"; }; + const char * getMD5(){ return "c6be8f7dc3bee7fe9e8d296070f53340"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Pose.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Pose.h new file mode 100755 index 0000000..facec0f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Pose.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Pose_h +#define _ROS_geometry_msgs_Pose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Pose : public ros::Msg + { + public: + geometry_msgs::Point position; + geometry_msgs::Quaternion orientation; + + Pose(): + position(), + orientation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose"; }; + const char * getMD5(){ return "e45d45a5a1ce597b249e23fb30fc871f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Pose2D.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Pose2D.h new file mode 100755 index 0000000..a011718 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Pose2D.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Pose2D_h +#define _ROS_geometry_msgs_Pose2D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Pose2D : public ros::Msg + { + public: + float x; + float y; + float theta; + + Pose2D(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->theta)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose2D"; }; + const char * getMD5(){ return "938fa65709584ad8e77d238529be13b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseArray.h new file mode 100755 index 0000000..e7a5050 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_PoseArray_h +#define _ROS_geometry_msgs_PoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::Pose st_poses; + geometry_msgs::Pose * poses; + + PoseArray(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseArray"; }; + const char * getMD5(){ return "916c28c5764443f268b296bb671b9d97"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseStamped.h new file mode 100755 index 0000000..ae466ab --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PoseStamped_h +#define _ROS_geometry_msgs_PoseStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + + PoseStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseStamped"; }; + const char * getMD5(){ return "d3812c3cbc69362b77dc0b19b345f8f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h new file mode 100755 index 0000000..d2091e6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovariance_h +#define _ROS_geometry_msgs_PoseWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseWithCovariance : public ros::Msg + { + public: + geometry_msgs::Pose pose; + float covariance[36]; + + PoseWithCovariance(): + pose(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovariance"; }; + const char * getMD5(){ return "c23e848cf1b7533a8d7c259073a97e6f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h new file mode 100755 index 0000000..586a930 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovarianceStamped_h +#define _ROS_geometry_msgs_PoseWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" + +namespace geometry_msgs +{ + + class PoseWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::PoseWithCovariance pose; + + PoseWithCovarianceStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovarianceStamped"; }; + const char * getMD5(){ return "953b798c0f514ff060a53a3498ce6246"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Quaternion.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Quaternion.h new file mode 100755 index 0000000..69cddbe --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Quaternion.h @@ -0,0 +1,54 @@ +#ifndef _ROS_geometry_msgs_Quaternion_h +#define _ROS_geometry_msgs_Quaternion_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Quaternion : public ros::Msg + { + public: + float x; + float y; + float z; + float w; + + Quaternion(): + x(0), + y(0), + z(0), + w(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->w); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->w)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Quaternion"; }; + const char * getMD5(){ return "a779879fadf0160734f906b8c19c7004"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h new file mode 100755 index 0000000..c2e0fcf --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_QuaternionStamped_h +#define _ROS_geometry_msgs_QuaternionStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class QuaternionStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion quaternion; + + QuaternionStamped(): + header(), + quaternion() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->quaternion.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->quaternion.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/QuaternionStamped"; }; + const char * getMD5(){ return "e57f1e547e0e1fd13504588ffc8334e2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Transform.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Transform.h new file mode 100755 index 0000000..94cf738 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Transform.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Transform_h +#define _ROS_geometry_msgs_Transform_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Transform : public ros::Msg + { + public: + geometry_msgs::Vector3 translation; + geometry_msgs::Quaternion rotation; + + Transform(): + translation(), + rotation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->translation.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->translation.deserialize(inbuffer + offset); + offset += this->rotation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Transform"; }; + const char * getMD5(){ return "ac9eff44abf714214112b05d54a3cf9b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TransformStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TransformStamped.h new file mode 100755 index 0000000..d42125e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TransformStamped.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_TransformStamped_h +#define _ROS_geometry_msgs_TransformStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" + +namespace geometry_msgs +{ + + class TransformStamped : public ros::Msg + { + public: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::Transform transform; + + TransformStamped(): + header(), + child_frame_id(""), + transform() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->transform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->transform.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TransformStamped"; }; + const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Twist.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Twist.h new file mode 100755 index 0000000..6133c64 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Twist.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Twist_h +#define _ROS_geometry_msgs_Twist_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Twist : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Twist(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Twist"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistStamped.h new file mode 100755 index 0000000..bf39940 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_TwistStamped_h +#define _ROS_geometry_msgs_TwistStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Twist twist; + + TwistStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistStamped"; }; + const char * getMD5(){ return "98d34b0043a2093cf9d9345ab6eef12e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h new file mode 100755 index 0000000..c30e300 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovariance_h +#define _ROS_geometry_msgs_TwistWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistWithCovariance : public ros::Msg + { + public: + geometry_msgs::Twist twist; + float covariance[36]; + + TwistWithCovariance(): + twist(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovariance"; }; + const char * getMD5(){ return "1fe8a28e6890a4cc3ae4c3ca5c7d82e6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h new file mode 100755 index 0000000..5ea6c8e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovarianceStamped_h +#define _ROS_geometry_msgs_TwistWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace geometry_msgs +{ + + class TwistWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::TwistWithCovariance twist; + + TwistWithCovarianceStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovarianceStamped"; }; + const char * getMD5(){ return "8927a1a12fb2607ceea095b2dc440a96"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Vector3.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Vector3.h new file mode 100755 index 0000000..af3f253 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Vector3.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Vector3_h +#define _ROS_geometry_msgs_Vector3_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Vector3 : public ros::Msg + { + public: + float x; + float y; + float z; + + Vector3(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h new file mode 100755 index 0000000..589d571 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Vector3Stamped_h +#define _ROS_geometry_msgs_Vector3Stamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Vector3Stamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 vector; + + Vector3Stamped(): + header(), + vector() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3Stamped"; }; + const char * getMD5(){ return "7b324c7325e683bf02a9b14b01090ec7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Wrench.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Wrench.h new file mode 100755 index 0000000..d95bf1b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/Wrench.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Wrench_h +#define _ROS_geometry_msgs_Wrench_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Wrench : public ros::Msg + { + public: + geometry_msgs::Vector3 force; + geometry_msgs::Vector3 torque; + + Wrench(): + force(), + torque() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->force.serialize(outbuffer + offset); + offset += this->torque.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->force.deserialize(inbuffer + offset); + offset += this->torque.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Wrench"; }; + const char * getMD5(){ return "4f539cf138b23283b520fd271b567936"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/WrenchStamped.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/WrenchStamped.h new file mode 100755 index 0000000..86becdc --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/geometry_msgs/WrenchStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_WrenchStamped_h +#define _ROS_geometry_msgs_WrenchStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Wrench.h" + +namespace geometry_msgs +{ + + class WrenchStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Wrench wrench; + + WrenchStamped(): + header(), + wrench() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/WrenchStamped"; }; + const char * getMD5(){ return "d78d3cb249ce23087ade7e7d0c40cfa7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/laser_assembler/AssembleScans.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/laser_assembler/AssembleScans.h new file mode 100755 index 0000000..eda9160 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/laser_assembler/AssembleScans.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_AssembleScans_h +#define _ROS_SERVICE_AssembleScans_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "sensor_msgs/PointCloud.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS[] = "laser_assembler/AssembleScans"; + + class AssembleScansRequest : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + AssembleScansRequest(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScansResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud cloud; + + AssembleScansResponse(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "4217b28a903e4ad7869a83b3653110ff"; }; + + }; + + class AssembleScans { + public: + typedef AssembleScansRequest Request; + typedef AssembleScansResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/laser_assembler/AssembleScans2.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/laser_assembler/AssembleScans2.h new file mode 100755 index 0000000..244f919 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/laser_assembler/AssembleScans2.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_AssembleScans2_h +#define _ROS_SERVICE_AssembleScans2_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" +#include "ros/time.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS2[] = "laser_assembler/AssembleScans2"; + + class AssembleScans2Request : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + AssembleScans2Request(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScans2Response : public ros::Msg + { + public: + sensor_msgs::PointCloud2 cloud; + + AssembleScans2Response(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; + + }; + + class AssembleScans2 { + public: + typedef AssembleScans2Request Request; + typedef AssembleScans2Response Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetMapROI.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetMapROI.h new file mode 100755 index 0000000..68e5053 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetMapROI.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_GetMapROI_h +#define _ROS_SERVICE_GetMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + +static const char GETMAPROI[] = "map_msgs/GetMapROI"; + + class GetMapROIRequest : public ros::Msg + { + public: + float x; + float y; + float l_x; + float l_y; + + GetMapROIRequest(): + x(0), + y(0), + l_x(0), + l_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "43c2ff8f45af555c0eaf070c401e9a47"; }; + + }; + + class GetMapROIResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid sub_map; + + GetMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "4d1986519c00d81967d2891a606b234c"; }; + + }; + + class GetMapROI { + public: + typedef GetMapROIRequest Request; + typedef GetMapROIResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetPointMap.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetPointMap.h new file mode 100755 index 0000000..3f7cfbe --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetPointMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_GetPointMap_h +#define _ROS_SERVICE_GetPointMap_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAP[] = "map_msgs/GetPointMap"; + + class GetPointMapRequest : public ros::Msg + { + public: + + GetPointMapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPointMapResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 map; + + GetPointMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "b84fbb39505086eb6a62d933c75cb7b4"; }; + + }; + + class GetPointMap { + public: + typedef GetPointMapRequest Request; + typedef GetPointMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetPointMapROI.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetPointMapROI.h new file mode 100755 index 0000000..6ecbddf --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/GetPointMapROI.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_GetPointMapROI_h +#define _ROS_SERVICE_GetPointMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAPROI[] = "map_msgs/GetPointMapROI"; + + class GetPointMapROIRequest : public ros::Msg + { + public: + float x; + float y; + float z; + float r; + float l_x; + float l_y; + float l_z; + + GetPointMapROIRequest(): + x(0), + y(0), + z(0), + r(0), + l_x(0), + l_y(0), + l_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->r); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->r)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_z)); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "895f7e437a9a6dd225316872b187a303"; }; + + }; + + class GetPointMapROIResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 sub_map; + + GetPointMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "313769f8b0e724525c6463336cbccd63"; }; + + }; + + class GetPointMapROI { + public: + typedef GetPointMapROIRequest Request; + typedef GetPointMapROIResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h new file mode 100755 index 0000000..b86417d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h @@ -0,0 +1,146 @@ +#ifndef _ROS_map_msgs_OccupancyGridUpdate_h +#define _ROS_map_msgs_OccupancyGridUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace map_msgs +{ + + class OccupancyGridUpdate : public ros::Msg + { + public: + std_msgs::Header header; + int32_t x; + int32_t y; + uint32_t width; + uint32_t height; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGridUpdate(): + header(), + x(0), + y(0), + width(0), + height(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "map_msgs/OccupancyGridUpdate"; }; + const char * getMD5(){ return "b295be292b335c34718bd939deebe1c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/PointCloud2Update.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/PointCloud2Update.h new file mode 100755 index 0000000..116f2eb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/PointCloud2Update.h @@ -0,0 +1,62 @@ +#ifndef _ROS_map_msgs_PointCloud2Update_h +#define _ROS_map_msgs_PointCloud2Update_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + + class PointCloud2Update : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t type; + sensor_msgs::PointCloud2 points; + enum { ADD = 0 }; + enum { DELETE = 1 }; + + PointCloud2Update(): + header(), + type(0), + points() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->type >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->type >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->type >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + offset += this->points.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->type = ((uint32_t) (*(inbuffer + offset))); + this->type |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->type |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->type |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->type); + offset += this->points.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "map_msgs/PointCloud2Update"; }; + const char * getMD5(){ return "6c58e4f249ae9cd2b24fb1ee0f99195e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMap.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMap.h new file mode 100755 index 0000000..7e9e9e0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMap.h @@ -0,0 +1,51 @@ +#ifndef _ROS_map_msgs_ProjectedMap_h +#define _ROS_map_msgs_ProjectedMap_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + + class ProjectedMap : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + float min_z; + float max_z; + + ProjectedMap(): + map(), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + const char * getType(){ return "map_msgs/ProjectedMap"; }; + const char * getMD5(){ return "7bbe8f96e45089681dc1ea7d023cbfca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h new file mode 100755 index 0000000..993c9fa --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h @@ -0,0 +1,78 @@ +#ifndef _ROS_map_msgs_ProjectedMapInfo_h +#define _ROS_map_msgs_ProjectedMapInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace map_msgs +{ + + class ProjectedMapInfo : public ros::Msg + { + public: + const char* frame_id; + float x; + float y; + float width; + float height; + float min_z; + float max_z; + + ProjectedMapInfo(): + frame_id(""), + x(0), + y(0), + width(0), + height(0), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + const char * getType(){ return "map_msgs/ProjectedMapInfo"; }; + const char * getMD5(){ return "2dc10595ae94de23f22f8a6d2a0eef7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h new file mode 100755 index 0000000..0f48d32 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_ProjectedMapsInfo_h +#define _ROS_SERVICE_ProjectedMapsInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char PROJECTEDMAPSINFO[] = "map_msgs/ProjectedMapsInfo"; + + class ProjectedMapsInfoRequest : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + ProjectedMapsInfoRequest(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class ProjectedMapsInfoResponse : public ros::Msg + { + public: + + ProjectedMapsInfoResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ProjectedMapsInfo { + public: + typedef ProjectedMapsInfoRequest Request; + typedef ProjectedMapsInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/SaveMap.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/SaveMap.h new file mode 100755 index 0000000..e5db8c2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/SaveMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_SaveMap_h +#define _ROS_SERVICE_SaveMap_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/String.h" + +namespace map_msgs +{ + +static const char SAVEMAP[] = "map_msgs/SaveMap"; + + class SaveMapRequest : public ros::Msg + { + public: + std_msgs::String filename; + + SaveMapRequest(): + filename() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->filename.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->filename.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "716e25f9d9dc76ceba197f93cbf05dc7"; }; + + }; + + class SaveMapResponse : public ros::Msg + { + public: + + SaveMapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SaveMap { + public: + typedef SaveMapRequest Request; + typedef SaveMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/SetMapProjections.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/SetMapProjections.h new file mode 100755 index 0000000..ff344fb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/map_msgs/SetMapProjections.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_SetMapProjections_h +#define _ROS_SERVICE_SetMapProjections_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char SETMAPPROJECTIONS[] = "map_msgs/SetMapProjections"; + + class SetMapProjectionsRequest : public ros::Msg + { + public: + + SetMapProjectionsRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetMapProjectionsResponse : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + SetMapProjectionsResponse(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class SetMapProjections { + public: + typedef SetMapProjectionsRequest Request; + typedef SetMapProjectionsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMap.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMap.h new file mode 100755 index 0000000..5fa87e8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_GetMap_h +#define _ROS_SERVICE_GetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char GETMAP[] = "nav_msgs/GetMap"; + + class GetMapRequest : public ros::Msg + { + public: + + GetMapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapAction.h new file mode 100755 index 0000000..774101b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapAction_h +#define _ROS_nav_msgs_GetMapAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/GetMapActionGoal.h" +#include "nav_msgs/GetMapActionResult.h" +#include "nav_msgs/GetMapActionFeedback.h" + +namespace nav_msgs +{ + + class GetMapAction : public ros::Msg + { + public: + nav_msgs::GetMapActionGoal action_goal; + nav_msgs::GetMapActionResult action_result; + nav_msgs::GetMapActionFeedback action_feedback; + + GetMapAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapAction"; }; + const char * getMD5(){ return "e611ad23fbf237c031b7536416dc7cd7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h new file mode 100755 index 0000000..e5445b3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionFeedback_h +#define _ROS_nav_msgs_GetMapActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapFeedback.h" + +namespace nav_msgs +{ + + class GetMapActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapFeedback feedback; + + GetMapActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h new file mode 100755 index 0000000..644be5c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionGoal_h +#define _ROS_nav_msgs_GetMapActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "nav_msgs/GetMapGoal.h" + +namespace nav_msgs +{ + + class GetMapActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + nav_msgs::GetMapGoal goal; + + GetMapActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionGoal"; }; + const char * getMD5(){ return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionResult.h new file mode 100755 index 0000000..b635cfd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionResult_h +#define _ROS_nav_msgs_GetMapActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapResult.h" + +namespace nav_msgs +{ + + class GetMapActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapResult result; + + GetMapActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionResult"; }; + const char * getMD5(){ return "ac66e5b9a79bb4bbd33dab245236c892"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapFeedback.h new file mode 100755 index 0000000..e3b4560 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapFeedback_h +#define _ROS_nav_msgs_GetMapFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapFeedback : public ros::Msg + { + public: + + GetMapFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapGoal.h new file mode 100755 index 0000000..88a17c5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapGoal_h +#define _ROS_nav_msgs_GetMapGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapGoal : public ros::Msg + { + public: + + GetMapGoal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapGoal"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapResult.h new file mode 100755 index 0000000..005b639 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetMapResult.h @@ -0,0 +1,43 @@ +#ifndef _ROS_nav_msgs_GetMapResult_h +#define _ROS_nav_msgs_GetMapResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + + class GetMapResult : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResult(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapResult"; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetPlan.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetPlan.h new file mode 100755 index 0000000..1ea3f32 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GetPlan.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_GetPlan_h +#define _ROS_SERVICE_GetPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "nav_msgs/Path.h" + +namespace nav_msgs +{ + +static const char GETPLAN[] = "nav_msgs/GetPlan"; + + class GetPlanRequest : public ros::Msg + { + public: + geometry_msgs::PoseStamped start; + geometry_msgs::PoseStamped goal; + float tolerance; + + GetPlanRequest(): + start(), + goal(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.real = this->tolerance; + *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tolerance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.base = 0; + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tolerance = u_tolerance.real; + offset += sizeof(this->tolerance); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + nav_msgs::Path plan; + + GetPlanResponse(): + plan() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GridCells.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GridCells.h new file mode 100755 index 0000000..c65160c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/GridCells.h @@ -0,0 +1,110 @@ +#ifndef _ROS_nav_msgs_GridCells_h +#define _ROS_nav_msgs_GridCells_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace nav_msgs +{ + + class GridCells : public ros::Msg + { + public: + std_msgs::Header header; + float cell_width; + float cell_height; + uint8_t cells_length; + geometry_msgs::Point st_cells; + geometry_msgs::Point * cells; + + GridCells(): + header(), + cell_width(0), + cell_height(0), + cells_length(0), cells(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.real = this->cell_width; + *(outbuffer + offset + 0) = (u_cell_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.real = this->cell_height; + *(outbuffer + offset + 0) = (u_cell_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_height); + *(outbuffer + offset++) = cells_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.base = 0; + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_width = u_cell_width.real; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.base = 0; + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_height = u_cell_height.real; + offset += sizeof(this->cell_height); + uint8_t cells_lengthT = *(inbuffer + offset++); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + cells_length = cells_lengthT; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/GridCells"; }; + const char * getMD5(){ return "b9e4f5df6d28e272ebde00a3994830f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/MapMetaData.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/MapMetaData.h new file mode 100755 index 0000000..e9e73d8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/MapMetaData.h @@ -0,0 +1,113 @@ +#ifndef _ROS_nav_msgs_MapMetaData_h +#define _ROS_nav_msgs_MapMetaData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "geometry_msgs/Pose.h" + +namespace nav_msgs +{ + + class MapMetaData : public ros::Msg + { + public: + ros::Time map_load_time; + float resolution; + uint32_t width; + uint32_t height; + geometry_msgs::Pose origin; + + MapMetaData(): + map_load_time(), + resolution(0), + width(0), + height(0), + origin() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->map_load_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.sec); + *(outbuffer + offset + 0) = (this->map_load_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.real = this->resolution; + *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->resolution); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + offset += this->origin.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->map_load_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.sec); + this->map_load_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.base = 0; + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->resolution = u_resolution.real; + offset += sizeof(this->resolution); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + offset += this->origin.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/MapMetaData"; }; + const char * getMD5(){ return "10cfc8a2818024d3248802c00c95f11b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/OccupancyGrid.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/OccupancyGrid.h new file mode 100755 index 0000000..6cc22b7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/OccupancyGrid.h @@ -0,0 +1,81 @@ +#ifndef _ROS_nav_msgs_OccupancyGrid_h +#define _ROS_nav_msgs_OccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "nav_msgs/MapMetaData.h" + +namespace nav_msgs +{ + + class OccupancyGrid : public ros::Msg + { + public: + std_msgs::Header header; + nav_msgs::MapMetaData info; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGrid(): + header(), + info(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/OccupancyGrid"; }; + const char * getMD5(){ return "3381f2d731d4076ec5c71b0759edbe4e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/Odometry.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/Odometry.h new file mode 100755 index 0000000..7966ea5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/Odometry.h @@ -0,0 +1,69 @@ +#ifndef _ROS_nav_msgs_Odometry_h +#define _ROS_nav_msgs_Odometry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace nav_msgs +{ + + class Odometry : public ros::Msg + { + public: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::PoseWithCovariance pose; + geometry_msgs::TwistWithCovariance twist; + + Odometry(): + header(), + child_frame_id(""), + pose(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/Odometry"; }; + const char * getMD5(){ return "cd5e73d190d741a2f92e81eda573aca7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/Path.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/Path.h new file mode 100755 index 0000000..88d2301 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/Path.h @@ -0,0 +1,64 @@ +#ifndef _ROS_nav_msgs_Path_h +#define _ROS_nav_msgs_Path_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseStamped.h" + +namespace nav_msgs +{ + + class Path : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::PoseStamped st_poses; + geometry_msgs::PoseStamped * poses; + + Path(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::PoseStamped)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/Path"; }; + const char * getMD5(){ return "6227e2b7e9cce15051f669a5e197bbf7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/SetMap.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/SetMap.h new file mode 100755 index 0000000..436f95d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nav_msgs/SetMap.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetMap_h +#define _ROS_SERVICE_SetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace nav_msgs +{ + +static const char SETMAP[] = "nav_msgs/SetMap"; + + class SetMapRequest : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + geometry_msgs::PoseWithCovarianceStamped initial_pose; + + SetMapRequest(): + map(), + initial_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += this->initial_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += this->initial_pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "91149a20d7be299b87c340df8cc94fd4"; }; + + }; + + class SetMapResponse : public ros::Msg + { + public: + bool success; + + SetMapResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetMap { + public: + typedef SetMapRequest Request; + typedef SetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletList.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletList.h new file mode 100755 index 0000000..6cb0cd1 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_NodeletList_h +#define _ROS_SERVICE_NodeletList_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLIST[] = "nodelet/NodeletList"; + + class NodeletListRequest : public ros::Msg + { + public: + + NodeletListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodeletListResponse : public ros::Msg + { + public: + uint8_t nodelets_length; + char* st_nodelets; + char* * nodelets; + + NodeletListResponse(): + nodelets_length(0), nodelets(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = nodelets_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_nodeletsi = strlen(this->nodelets[i]); + memcpy(outbuffer + offset, &length_nodeletsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->nodelets[i], length_nodeletsi); + offset += length_nodeletsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t nodelets_lengthT = *(inbuffer + offset++); + if(nodelets_lengthT > nodelets_length) + this->nodelets = (char**)realloc(this->nodelets, nodelets_lengthT * sizeof(char*)); + offset += 3; + nodelets_length = nodelets_lengthT; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_st_nodelets; + memcpy(&length_st_nodelets, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_nodelets; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_nodelets-1]=0; + this->st_nodelets = (char *)(inbuffer + offset-1); + offset += length_st_nodelets; + memcpy( &(this->nodelets[i]), &(this->st_nodelets), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "99c7b10e794f5600b8030e697e946ca7"; }; + + }; + + class NodeletList { + public: + typedef NodeletListRequest Request; + typedef NodeletListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletLoad.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletLoad.h new file mode 100755 index 0000000..17d85de --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletLoad.h @@ -0,0 +1,231 @@ +#ifndef _ROS_SERVICE_NodeletLoad_h +#define _ROS_SERVICE_NodeletLoad_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLOAD[] = "nodelet/NodeletLoad"; + + class NodeletLoadRequest : public ros::Msg + { + public: + const char* name; + const char* type; + uint8_t remap_source_args_length; + char* st_remap_source_args; + char* * remap_source_args; + uint8_t remap_target_args_length; + char* st_remap_target_args; + char* * remap_target_args; + uint8_t my_argv_length; + char* st_my_argv; + char* * my_argv; + const char* bond_id; + + NodeletLoadRequest(): + name(""), + type(""), + remap_source_args_length(0), remap_source_args(NULL), + remap_target_args_length(0), remap_target_args(NULL), + my_argv_length(0), my_argv(NULL), + bond_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = remap_source_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_remap_source_argsi = strlen(this->remap_source_args[i]); + memcpy(outbuffer + offset, &length_remap_source_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_source_args[i], length_remap_source_argsi); + offset += length_remap_source_argsi; + } + *(outbuffer + offset++) = remap_target_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_remap_target_argsi = strlen(this->remap_target_args[i]); + memcpy(outbuffer + offset, &length_remap_target_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_target_args[i], length_remap_target_argsi); + offset += length_remap_target_argsi; + } + *(outbuffer + offset++) = my_argv_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_my_argvi = strlen(this->my_argv[i]); + memcpy(outbuffer + offset, &length_my_argvi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->my_argv[i], length_my_argvi); + offset += length_my_argvi; + } + uint32_t length_bond_id = strlen(this->bond_id); + memcpy(outbuffer + offset, &length_bond_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->bond_id, length_bond_id); + offset += length_bond_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t remap_source_args_lengthT = *(inbuffer + offset++); + if(remap_source_args_lengthT > remap_source_args_length) + this->remap_source_args = (char**)realloc(this->remap_source_args, remap_source_args_lengthT * sizeof(char*)); + offset += 3; + remap_source_args_length = remap_source_args_lengthT; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_st_remap_source_args; + memcpy(&length_st_remap_source_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_source_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_source_args-1]=0; + this->st_remap_source_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_source_args; + memcpy( &(this->remap_source_args[i]), &(this->st_remap_source_args), sizeof(char*)); + } + uint8_t remap_target_args_lengthT = *(inbuffer + offset++); + if(remap_target_args_lengthT > remap_target_args_length) + this->remap_target_args = (char**)realloc(this->remap_target_args, remap_target_args_lengthT * sizeof(char*)); + offset += 3; + remap_target_args_length = remap_target_args_lengthT; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_st_remap_target_args; + memcpy(&length_st_remap_target_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_target_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_target_args-1]=0; + this->st_remap_target_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_target_args; + memcpy( &(this->remap_target_args[i]), &(this->st_remap_target_args), sizeof(char*)); + } + uint8_t my_argv_lengthT = *(inbuffer + offset++); + if(my_argv_lengthT > my_argv_length) + this->my_argv = (char**)realloc(this->my_argv, my_argv_lengthT * sizeof(char*)); + offset += 3; + my_argv_length = my_argv_lengthT; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_st_my_argv; + memcpy(&length_st_my_argv, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_my_argv; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_my_argv-1]=0; + this->st_my_argv = (char *)(inbuffer + offset-1); + offset += length_st_my_argv; + memcpy( &(this->my_argv[i]), &(this->st_my_argv), sizeof(char*)); + } + uint32_t length_bond_id; + memcpy(&length_bond_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_bond_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_bond_id-1]=0; + this->bond_id = (char *)(inbuffer + offset-1); + offset += length_bond_id; + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "c6e28cc4d2e259249d96cfb50658fbec"; }; + + }; + + class NodeletLoadResponse : public ros::Msg + { + public: + bool success; + + NodeletLoadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletLoad { + public: + typedef NodeletLoadRequest Request; + typedef NodeletLoadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletUnload.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletUnload.h new file mode 100755 index 0000000..0f1c1df --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/nodelet/NodeletUnload.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_NodeletUnload_h +#define _ROS_SERVICE_NodeletUnload_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETUNLOAD[] = "nodelet/NodeletUnload"; + + class NodeletUnloadRequest : public ros::Msg + { + public: + const char* name; + + NodeletUnloadRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class NodeletUnloadResponse : public ros::Msg + { + public: + bool success; + + NodeletUnloadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletUnload { + public: + typedef NodeletUnloadRequest Request; + typedef NodeletUnloadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h new file mode 100755 index 0000000..87ede8b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h @@ -0,0 +1,82 @@ +#ifndef _ROS_pcl_msgs_ModelCoefficients_h +#define _ROS_pcl_msgs_ModelCoefficients_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class ModelCoefficients : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t values_length; + float st_values; + float * values; + + ModelCoefficients(): + header(), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/ModelCoefficients"; }; + const char * getMD5(){ return "ca27dea75e72cb894cd36f9e5005e93e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/PointIndices.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/PointIndices.h new file mode 100755 index 0000000..5e55370 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/PointIndices.h @@ -0,0 +1,82 @@ +#ifndef _ROS_pcl_msgs_PointIndices_h +#define _ROS_pcl_msgs_PointIndices_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class PointIndices : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t indices_length; + int32_t st_indices; + int32_t * indices; + + PointIndices(): + header(), + indices_length(0), indices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = indices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_indicesi; + u_indicesi.real = this->indices[i]; + *(outbuffer + offset + 0) = (u_indicesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_indicesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_indicesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_indicesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t indices_lengthT = *(inbuffer + offset++); + if(indices_lengthT > indices_length) + this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t)); + offset += 3; + indices_length = indices_lengthT; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_indices; + u_st_indices.base = 0; + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_indices = u_st_indices.real; + offset += sizeof(this->st_indices); + memcpy( &(this->indices[i]), &(this->st_indices), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PointIndices"; }; + const char * getMD5(){ return "458c7998b7eaf99908256472e273b3d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/PolygonMesh.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/PolygonMesh.h new file mode 100755 index 0000000..eac8917 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/PolygonMesh.h @@ -0,0 +1,69 @@ +#ifndef _ROS_pcl_msgs_PolygonMesh_h +#define _ROS_pcl_msgs_PolygonMesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" +#include "pcl_msgs/Vertices.h" + +namespace pcl_msgs +{ + + class PolygonMesh : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::PointCloud2 cloud; + uint8_t polygons_length; + pcl_msgs::Vertices st_polygons; + pcl_msgs::Vertices * polygons; + + PolygonMesh(): + header(), + cloud(), + polygons_length(0), polygons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + *(outbuffer + offset++) = polygons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + uint8_t polygons_lengthT = *(inbuffer + offset++); + if(polygons_lengthT > polygons_length) + this->polygons = (pcl_msgs::Vertices*)realloc(this->polygons, polygons_lengthT * sizeof(pcl_msgs::Vertices)); + offset += 3; + polygons_length = polygons_lengthT; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->st_polygons.deserialize(inbuffer + offset); + memcpy( &(this->polygons[i]), &(this->st_polygons), sizeof(pcl_msgs::Vertices)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PolygonMesh"; }; + const char * getMD5(){ return "45a5fc6ad2cde8489600a790acc9a38a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/Vertices.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/Vertices.h new file mode 100755 index 0000000..47479b4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/pcl_msgs/Vertices.h @@ -0,0 +1,66 @@ +#ifndef _ROS_pcl_msgs_Vertices_h +#define _ROS_pcl_msgs_Vertices_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pcl_msgs +{ + + class Vertices : public ros::Msg + { + public: + uint8_t vertices_length; + uint32_t st_vertices; + uint32_t * vertices; + + Vertices(): + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + this->st_vertices = ((uint32_t) (*(inbuffer + offset))); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_vertices); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/Vertices"; }; + const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/polled_camera/GetPolledImage.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/polled_camera/GetPolledImage.h new file mode 100755 index 0000000..31da9e7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/polled_camera/GetPolledImage.h @@ -0,0 +1,194 @@ +#ifndef _ROS_SERVICE_GetPolledImage_h +#define _ROS_SERVICE_GetPolledImage_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/RegionOfInterest.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace polled_camera +{ + +static const char GETPOLLEDIMAGE[] = "polled_camera/GetPolledImage"; + + class GetPolledImageRequest : public ros::Msg + { + public: + const char* response_namespace; + ros::Duration timeout; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + GetPolledImageRequest(): + response_namespace(""), + timeout(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_response_namespace = strlen(this->response_namespace); + memcpy(outbuffer + offset, &length_response_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_namespace, length_response_namespace); + offset += length_response_namespace; + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_response_namespace; + memcpy(&length_response_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_namespace-1]=0; + this->response_namespace = (char *)(inbuffer + offset-1); + offset += length_response_namespace; + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "c77ed43e530fd48e9e7a2a93845e154c"; }; + + }; + + class GetPolledImageResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + ros::Time stamp; + + GetPolledImageResponse(): + success(0), + status_message(""), + stamp() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "dbf1f851bc511800e6129ccd5a3542ab"; }; + + }; + + class GetPolledImage { + public: + typedef GetPolledImageRequest Request; + typedef GetPolledImageResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros.h new file mode 100755 index 0000000..447cf32 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros.h @@ -0,0 +1,58 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_H_ +#define _ROS_H_ + +#include "ros/node_handle.h" +#include "ArduinoHardware.h" + +namespace ros +{ +#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega168__) + /* downsize our buffers */ + typedef NodeHandle_ NodeHandle; + +#elif defined(__AVR_ATmega328P__) + + typedef NodeHandle_ NodeHandle; + +#else + + typedef NodeHandle_ NodeHandle; + +#endif +} + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/duration.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/duration.h new file mode 100755 index 0000000..ab889cd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/duration.h @@ -0,0 +1,67 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_DURATION_H_ +#define _ROS_DURATION_H_ + +#include +#include + +namespace ros { + + void normalizeSecNSecSigned(int32_t& sec, int32_t& nsec); + + class Duration + { + public: + int32_t sec, nsec; + + Duration() : sec(0), nsec(0) {} + Duration(int32_t _sec, int32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSecSigned(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); }; + + Duration& operator+=(const Duration &rhs); + Duration& operator-=(const Duration &rhs); + Duration& operator*=(double scale); + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/msg.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/msg.h new file mode 100755 index 0000000..87f2e5c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/msg.h @@ -0,0 +1,129 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_MSG_H_ +#define _ROS_MSG_H_ + +#include + +namespace ros { + +/* Base Message Type */ +class Msg +{ +public: + virtual int serialize(unsigned char *outbuffer) const = 0; + virtual int deserialize(unsigned char *data) = 0; + virtual const char * getType() = 0; + virtual const char * getMD5() = 0; + + /** + * @brief This tricky function handles promoting a 32bit float to a 64bit + * double, so that AVR can publish messages containing float64 + * fields, despite AVV having no native support for double. + * + * @param[out] outbuffer pointer for buffer to serialize to. + * @param[in] f value to serialize. + * + * @return number of bytes to advance the buffer pointer. + * + */ + static int serializeAvrFloat64(unsigned char* outbuffer, const float f) + { + const int32_t* val = (int32_t*) &f; + int32_t exp = ((*val >> 23) & 255); + if (exp != 0) + { + exp += 1023 - 127; + } + + int32_t sig = *val; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = (sig << 5) & 0xff; + *(outbuffer++) = (sig >> 3) & 0xff; + *(outbuffer++) = (sig >> 11) & 0xff; + *(outbuffer++) = ((exp << 4) & 0xF0) | ((sig >> 19) & 0x0F); + *(outbuffer++) = (exp >> 4) & 0x7F; + + // Mark negative bit as necessary. + if (f < 0) + { + *(outbuffer - 1) |= 0x80; + } + + return 8; + } + + /** + * @brief This tricky function handles demoting a 64bit double to a + * 32bit float, so that AVR can understand messages containing + * float64 fields, despite AVR having no native support for double. + * + * @param[in] inbuffer pointer for buffer to deserialize from. + * @param[out] f pointer to place the deserialized value in. + * + * @return number of bytes to advance the buffer pointer. + */ + static int deserializeAvrFloat64(const unsigned char* inbuffer, float* f) + { + uint32_t* val = (uint32_t*)f; + inbuffer += 3; + + // Copy truncated mantissa. + *val = ((uint32_t)(*(inbuffer++)) >> 5 & 0x07); + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 3; + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 11; + *val |= ((uint32_t)(*inbuffer) & 0x0f) << 19; + + // Copy truncated exponent. + uint32_t exp = ((uint32_t)(*(inbuffer++)) & 0xf0)>>4; + exp |= ((uint32_t)(*inbuffer) & 0x7f) << 4; + if (exp != 0) + { + *val |= ((exp) - 1023 + 127) << 23; + } + + // Copy negative sign. + *val |= ((uint32_t)(*(inbuffer++)) & 0x80) << 24; + + return 8; + } + +}; + +} // namespace ros + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/node_handle.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/node_handle.h new file mode 100755 index 0000000..9babaff --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/node_handle.h @@ -0,0 +1,543 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_NODE_HANDLE_H_ +#define ROS_NODE_HANDLE_H_ + +#include + +#include "std_msgs/Time.h" +#include "rosserial_msgs/TopicInfo.h" +#include "rosserial_msgs/Log.h" +#include "rosserial_msgs/RequestParam.h" + +#define SYNC_SECONDS 5 + +#define MODE_FIRST_FF 0 +/* + * The second sync byte is a protocol version. It's value is 0xff for the first + * version of the rosserial protocol (used up to hydro), 0xfe for the second version + * (introduced in hydro), 0xfd for the next, and so on. Its purpose is to enable + * detection of mismatched protocol versions (e.g. hydro rosserial_python with groovy + * rosserial_arduino. It must be changed in both this file and in + * rosserial_python/src/rosserial_python/SerialClient.py + */ +#define MODE_PROTOCOL_VER 1 +#define PROTOCOL_VER1 0xff // through groovy +#define PROTOCOL_VER2 0xfe // in hydro +#define PROTOCOL_VER PROTOCOL_VER2 +#define MODE_SIZE_L 2 +#define MODE_SIZE_H 3 +#define MODE_SIZE_CHECKSUM 4 // checksum for msg size received from size L and H +#define MODE_TOPIC_L 5 // waiting for topic id +#define MODE_TOPIC_H 6 +#define MODE_MESSAGE 7 +#define MODE_MSG_CHECKSUM 8 // checksum for msg and topic id + + +#define MSG_TIMEOUT 20 //20 milliseconds to recieve all of message data + +#include "msg.h" + +namespace ros { + + class NodeHandleBase_{ + public: + virtual int publish(int id, const Msg* msg)=0; + virtual int spinOnce()=0; + virtual bool connected()=0; + }; +} + +#include "publisher.h" +#include "subscriber.h" +#include "service_server.h" +#include "service_client.h" + +namespace ros { + + using rosserial_msgs::TopicInfo; + + /* Node Handle */ + template + class NodeHandle_ : public NodeHandleBase_ + { + protected: + Hardware hardware_; + + /* time used for syncing */ + uint32_t rt_time; + + /* used for computing current time */ + uint32_t sec_offset, nsec_offset; + + uint8_t message_in[INPUT_SIZE]; + uint8_t message_out[OUTPUT_SIZE]; + + Publisher * publishers[MAX_PUBLISHERS]; + Subscriber_ * subscribers[MAX_SUBSCRIBERS]; + + /* + * Setup Functions + */ + public: + NodeHandle_() : configured_(false) { + + for(unsigned int i=0; i< MAX_PUBLISHERS; i++) + publishers[i] = 0; + + for(unsigned int i=0; i< MAX_SUBSCRIBERS; i++) + subscribers[i] = 0; + + for(unsigned int i=0; i< INPUT_SIZE; i++) + message_in[i] = 0; + + for(unsigned int i=0; i< OUTPUT_SIZE; i++) + message_out[i] = 0; + + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + req_param_resp.floats_length = 0; + req_param_resp.floats = NULL; + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + } + + Hardware* getHardware(){ + return &hardware_; + } + + /* Start serial, initialize buffers */ + void initNode(){ + hardware_.init(); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + /* Start a named port, which may be network server IP, initialize buffers */ + void initNode(char *portName){ + hardware_.init(portName); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + protected: + //State machine variables for spinOnce + int mode_; + int bytes_; + int topic_; + int index_; + int checksum_; + + bool configured_; + + /* used for syncing the time */ + uint32_t last_sync_time; + uint32_t last_sync_receive_time; + uint32_t last_msg_timeout_time; + + public: + /* This function goes in your loop() function, it handles + * serial input and callbacks for subscribers. + */ + + + virtual int spinOnce(){ + + /* restart if timed out */ + uint32_t c_time = hardware_.time(); + if( (c_time - last_sync_receive_time) > (SYNC_SECONDS*2200) ){ + configured_ = false; + } + + /* reset if message has timed out */ + if ( mode_ != MODE_FIRST_FF){ + if (c_time > last_msg_timeout_time){ + mode_ = MODE_FIRST_FF; + } + } + + /* while available buffer, read data */ + while( true ) + { + int data = hardware_.read(); + if( data < 0 ) + break; + checksum_ += data; + if( mode_ == MODE_MESSAGE ){ /* message data being recieved */ + message_in[index_++] = data; + bytes_--; + if(bytes_ == 0) /* is message complete? if so, checksum */ + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_FIRST_FF ){ + if(data == 0xff){ + mode_++; + last_msg_timeout_time = c_time + MSG_TIMEOUT; + } + else if( hardware_.time() - c_time > (SYNC_SECONDS)){ + /* We have been stuck in spinOnce too long, return error */ + configured_=false; + return -2; + } + }else if( mode_ == MODE_PROTOCOL_VER ){ + if(data == PROTOCOL_VER){ + mode_++; + }else{ + mode_ = MODE_FIRST_FF; + if (configured_ == false) + requestSyncTime(); /* send a msg back showing our protocol version */ + } + }else if( mode_ == MODE_SIZE_L ){ /* bottom half of message size */ + bytes_ = data; + index_ = 0; + mode_++; + checksum_ = data; /* first byte for calculating size checksum */ + }else if( mode_ == MODE_SIZE_H ){ /* top half of message size */ + bytes_ += data<<8; + mode_++; + }else if( mode_ == MODE_SIZE_CHECKSUM ){ + if( (checksum_%256) == 255) + mode_++; + else + mode_ = MODE_FIRST_FF; /* Abandon the frame if the msg len is wrong */ + }else if( mode_ == MODE_TOPIC_L ){ /* bottom half of topic id */ + topic_ = data; + mode_++; + checksum_ = data; /* first byte included in checksum */ + }else if( mode_ == MODE_TOPIC_H ){ /* top half of topic id */ + topic_ += data<<8; + mode_ = MODE_MESSAGE; + if(bytes_ == 0) + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_MSG_CHECKSUM ){ /* do checksum */ + mode_ = MODE_FIRST_FF; + if( (checksum_%256) == 255){ + if(topic_ == TopicInfo::ID_PUBLISHER){ + requestSyncTime(); + negotiateTopics(); + last_sync_time = c_time; + last_sync_receive_time = c_time; + return -1; + }else if(topic_ == TopicInfo::ID_TIME){ + syncTime(message_in); + }else if (topic_ == TopicInfo::ID_PARAMETER_REQUEST){ + req_param_resp.deserialize(message_in); + param_recieved= true; + }else if(topic_ == TopicInfo::ID_TX_STOP){ + configured_ = false; + }else{ + if(subscribers[topic_-100]) + subscribers[topic_-100]->callback( message_in ); + } + } + } + } + + /* occasionally sync time */ + if( configured_ && ((c_time-last_sync_time) > (SYNC_SECONDS*500) )){ + requestSyncTime(); + last_sync_time = c_time; + } + + return 0; + } + + + /* Are we connected to the PC? */ + virtual bool connected() { + return configured_; + }; + + /******************************************************************** + * Time functions + */ + + void requestSyncTime() + { + std_msgs::Time t; + publish(TopicInfo::ID_TIME, &t); + rt_time = hardware_.time(); + } + + void syncTime(uint8_t * data) + { + std_msgs::Time t; + uint32_t offset = hardware_.time() - rt_time; + + t.deserialize(data); + t.data.sec += offset/1000; + t.data.nsec += (offset%1000)*1000000UL; + + this->setNow(t.data); + last_sync_receive_time = hardware_.time(); + } + + Time now() + { + uint32_t ms = hardware_.time(); + Time current_time; + current_time.sec = ms/1000 + sec_offset; + current_time.nsec = (ms%1000)*1000000UL + nsec_offset; + normalizeSecNSec(current_time.sec, current_time.nsec); + return current_time; + } + + void setNow( Time & new_now ) + { + uint32_t ms = hardware_.time(); + sec_offset = new_now.sec - ms/1000 - 1; + nsec_offset = new_now.nsec - (ms%1000)*1000000UL + 1000000000UL; + normalizeSecNSec(sec_offset, nsec_offset); + } + + /******************************************************************** + * Topic Management + */ + + /* Register a new publisher */ + bool advertise(Publisher & p) + { + for(int i = 0; i < MAX_PUBLISHERS; i++){ + if(publishers[i] == 0){ // empty slot + publishers[i] = &p; + p.id_ = i+100+MAX_SUBSCRIBERS; + p.nh_ = this; + return true; + } + } + return false; + } + + /* Register a new subscriber */ + template + bool subscribe(Subscriber< MsgT> & s){ + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &s; + s.id_ = i+100; + return true; + } + } + return false; + } + + /* Register a new Service Server */ + template + bool advertiseService(ServiceServer& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + /* Register a new Service Client */ + template + bool serviceClient(ServiceClient& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + void negotiateTopics() + { + rosserial_msgs::TopicInfo ti; + int i; + for(i = 0; i < MAX_PUBLISHERS; i++) + { + if(publishers[i] != 0) // non-empty slot + { + ti.topic_id = publishers[i]->id_; + ti.topic_name = (char *) publishers[i]->topic_; + ti.message_type = (char *) publishers[i]->msg_->getType(); + ti.md5sum = (char *) publishers[i]->msg_->getMD5(); + ti.buffer_size = OUTPUT_SIZE; + publish( publishers[i]->getEndpointType(), &ti ); + } + } + for(i = 0; i < MAX_SUBSCRIBERS; i++) + { + if(subscribers[i] != 0) // non-empty slot + { + ti.topic_id = subscribers[i]->id_; + ti.topic_name = (char *) subscribers[i]->topic_; + ti.message_type = (char *) subscribers[i]->getMsgType(); + ti.md5sum = (char *) subscribers[i]->getMsgMD5(); + ti.buffer_size = INPUT_SIZE; + publish( subscribers[i]->getEndpointType(), &ti ); + } + } + configured_ = true; + } + + virtual int publish(int id, const Msg * msg) + { + if(id >= 100 && !configured_) + return 0; + + /* serialize message */ + uint16_t l = msg->serialize(message_out+7); + + /* setup the header */ + message_out[0] = 0xff; + message_out[1] = PROTOCOL_VER; + message_out[2] = (uint8_t) ((uint16_t)l&255); + message_out[3] = (uint8_t) ((uint16_t)l>>8); + message_out[4] = 255 - ((message_out[2] + message_out[3])%256); + message_out[5] = (uint8_t) ((int16_t)id&255); + message_out[6] = (uint8_t) ((int16_t)id>>8); + + /* calculate checksum */ + int chk = 0; + for(int i =5; i end_time) return false; + } + return true; + } + + public: + bool getParam(const char* name, int* param, int length =1){ + if (requestParam(name) ){ + if (length == req_param_resp.ints_length){ + //copy it over + for(int i=0; ipublish(id_, msg); }; + int getEndpointType(){ return endpoint_; } + + const char * topic_; + Msg *msg_; + // id_ and no_ are set by NodeHandle when we advertise + int id_; + NodeHandleBase_* nh_; + + private: + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/service_client.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/service_client.h new file mode 100755 index 0000000..06522f2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/service_client.h @@ -0,0 +1,83 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_CLIENT_H_ +#define _ROS_SERVICE_CLIENT_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceClient : public Subscriber_ { + public: + ServiceClient(const char* topic_name) : + pub(topic_name, &req, rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->waiting = true; + } + + virtual void call(const MReq & request, MRes & response) + { + if(!pub.nh_->connected()) return; + ret = &response; + waiting = true; + pub.publish(&request); + while(waiting && pub.nh_->connected()) + if(pub.nh_->spinOnce() < 0) break; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + ret->deserialize(data); + waiting = false; + } + virtual const char * getMsgType(){ return this->resp.getType(); } + virtual const char * getMsgMD5(){ return this->resp.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + MRes * ret; + bool waiting; + Publisher pub; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/service_server.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/service_server.h new file mode 100755 index 0000000..67a3e0a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/service_server.h @@ -0,0 +1,76 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_SERVER_H_ +#define _ROS_SERVICE_SERVER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceServer : public Subscriber_ { + public: + typedef void(*CallbackT)(const MReq&, MRes&); + + ServiceServer(const char* topic_name, CallbackT cb) : + pub(topic_name, &resp, rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->cb_ = cb; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + req.deserialize(data); + cb_(req,resp); + pub.publish(&resp); + } + virtual const char * getMsgType(){ return this->req.getType(); } + virtual const char * getMsgMD5(){ return this->req.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + Publisher pub; + private: + CallbackT cb_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/subscriber.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/subscriber.h new file mode 100755 index 0000000..5464646 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/subscriber.h @@ -0,0 +1,88 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_SUBSCRIBER_H_ +#define ROS_SUBSCRIBER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +namespace ros { + + /* Base class for objects subscribers. */ + class Subscriber_ + { + public: + virtual void callback(unsigned char *data)=0; + virtual int getEndpointType()=0; + + // id_ is set by NodeHandle when we advertise + int id_; + + virtual const char * getMsgType()=0; + virtual const char * getMsgMD5()=0; + const char * topic_; + }; + + + /* Actual subscriber, templated on message type. */ + template + class Subscriber: public Subscriber_{ + public: + typedef void(*CallbackT)(const MsgT&); + MsgT msg; + + Subscriber(const char * topic_name, CallbackT cb, int endpoint=rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : + cb_(cb), + endpoint_(endpoint) + { + topic_ = topic_name; + }; + + virtual void callback(unsigned char* data){ + msg.deserialize(data); + this->cb_(msg); + } + + virtual const char * getMsgType(){ return this->msg.getType(); } + virtual const char * getMsgMD5(){ return this->msg.getMD5(); } + virtual int getEndpointType(){ return endpoint_; } + + private: + CallbackT cb_; + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/time.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/time.h new file mode 100755 index 0000000..6141261 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/ros/time.h @@ -0,0 +1,73 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TIME_H_ +#define ROS_TIME_H_ + +#include +#include + +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSec(uint32_t &sec, uint32_t &nsec); + + class Time + { + public: + uint32_t sec, nsec; + + Time() : sec(0), nsec(0) {} + Time(uint32_t _sec, uint32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSec(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); }; + + uint32_t toNsec() { return (uint32_t)sec*1000000000ull + (uint32_t)nsec; }; + Time& fromNSec(int32_t t); + + Time& operator +=(const Duration &rhs); + Time& operator -=(const Duration &rhs); + + static Time now(); + static void setNow( Time & new_now); + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/Empty.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/Empty.h new file mode 100755 index 0000000..df021b7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char EMPTY[] = "roscpp/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/GetLoggers.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/GetLoggers.h new file mode 100755 index 0000000..0574cd7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/GetLoggers.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_GetLoggers_h +#define _ROS_SERVICE_GetLoggers_h +#include +#include +#include +#include "ros/msg.h" +#include "roscpp/Logger.h" + +namespace roscpp +{ + +static const char GETLOGGERS[] = "roscpp/GetLoggers"; + + class GetLoggersRequest : public ros::Msg + { + public: + + GetLoggersRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetLoggersResponse : public ros::Msg + { + public: + uint8_t loggers_length; + roscpp::Logger st_loggers; + roscpp::Logger * loggers; + + GetLoggersResponse(): + loggers_length(0), loggers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = loggers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->loggers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t loggers_lengthT = *(inbuffer + offset++); + if(loggers_lengthT > loggers_length) + this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger)); + offset += 3; + loggers_length = loggers_lengthT; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->st_loggers.deserialize(inbuffer + offset); + memcpy( &(this->loggers[i]), &(this->st_loggers), sizeof(roscpp::Logger)); + } + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "32e97e85527d4678a8f9279894bb64b0"; }; + + }; + + class GetLoggers { + public: + typedef GetLoggersRequest Request; + typedef GetLoggersResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/Logger.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/Logger.h new file mode 100755 index 0000000..a67fb51 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/Logger.h @@ -0,0 +1,70 @@ +#ifndef _ROS_roscpp_Logger_h +#define _ROS_roscpp_Logger_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + + class Logger : public ros::Msg + { + public: + const char* name; + const char* level; + + Logger(): + name(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return "roscpp/Logger"; }; + const char * getMD5(){ return "a6069a2ff40db7bd32143dd66e1f408e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/SetLoggerLevel.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/SetLoggerLevel.h new file mode 100755 index 0000000..dddee2e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp/SetLoggerLevel.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_SetLoggerLevel_h +#define _ROS_SERVICE_SetLoggerLevel_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; + + class SetLoggerLevelRequest : public ros::Msg + { + public: + const char* logger; + const char* level; + + SetLoggerLevelRequest(): + logger(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_logger = strlen(this->logger); + memcpy(outbuffer + offset, &length_logger, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->logger, length_logger); + offset += length_logger; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_logger; + memcpy(&length_logger, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_logger; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_logger-1]=0; + this->logger = (char *)(inbuffer + offset-1); + offset += length_logger; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + SetLoggerLevelResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp_tutorials/TwoInts.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp_tutorials/TwoInts.h new file mode 100755 index 0000000..f35797c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/roscpp_tutorials/TwoInts.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_TwoInts_h +#define _ROS_SERVICE_TwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp_tutorials +{ + +static const char TWOINTS[] = "roscpp_tutorials/TwoInts"; + + class TwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + TwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class TwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class TwoInts { + public: + typedef TwoIntsRequest Request; + typedef TwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/Clock.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/Clock.h new file mode 100755 index 0000000..10a3c0c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/Clock.h @@ -0,0 +1,61 @@ +#ifndef _ROS_rosgraph_msgs_Clock_h +#define _ROS_rosgraph_msgs_Clock_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosgraph_msgs +{ + + class Clock : public ros::Msg + { + public: + ros::Time clock; + + Clock(): + clock() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.sec); + *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->clock.sec = ((uint32_t) (*(inbuffer + offset))); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.sec); + this->clock.nsec = ((uint32_t) (*(inbuffer + offset))); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Clock"; }; + const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/Log.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/Log.h new file mode 100755 index 0000000..439dd36 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/Log.h @@ -0,0 +1,173 @@ +#ifndef _ROS_rosgraph_msgs_Log_h +#define _ROS_rosgraph_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rosgraph_msgs +{ + + class Log : public ros::Msg + { + public: + std_msgs::Header header; + int8_t level; + const char* name; + const char* msg; + const char* file; + const char* function; + uint32_t line; + uint8_t topics_length; + char* st_topics; + char* * topics; + enum { DEBUG = 1 }; + enum { INFO = 2 }; + enum { WARN = 4 }; + enum { ERROR = 8 }; + enum { FATAL = 16 }; + + Log(): + header(), + level(0), + name(""), + msg(""), + file(""), + function(""), + line(0), + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + uint32_t length_file = strlen(this->file); + memcpy(outbuffer + offset, &length_file, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->file, length_file); + offset += length_file; + uint32_t length_function = strlen(this->function); + memcpy(outbuffer + offset, &length_function, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->function, length_function); + offset += length_function; + *(outbuffer + offset + 0) = (this->line >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->line >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->line >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->line >> (8 * 3)) & 0xFF; + offset += sizeof(this->line); + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + uint32_t length_file; + memcpy(&length_file, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file-1]=0; + this->file = (char *)(inbuffer + offset-1); + offset += length_file; + uint32_t length_function; + memcpy(&length_function, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_function; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_function-1]=0; + this->function = (char *)(inbuffer + offset-1); + offset += length_function; + this->line = ((uint32_t) (*(inbuffer + offset))); + this->line |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->line |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->line |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->line); + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Log"; }; + const char * getMD5(){ return "acffd30cd6b6de30f120938c17c593fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h new file mode 100755 index 0000000..2c6fd65 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h @@ -0,0 +1,333 @@ +#ifndef _ROS_rosgraph_msgs_TopicStatistics_h +#define _ROS_rosgraph_msgs_TopicStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace rosgraph_msgs +{ + + class TopicStatistics : public ros::Msg + { + public: + const char* topic; + const char* node_pub; + const char* node_sub; + ros::Time window_start; + ros::Time window_stop; + int32_t delivered_msgs; + int32_t dropped_msgs; + int32_t traffic; + ros::Duration period_mean; + ros::Duration period_stddev; + ros::Duration period_max; + ros::Duration stamp_age_mean; + ros::Duration stamp_age_stddev; + ros::Duration stamp_age_max; + + TopicStatistics(): + topic(""), + node_pub(""), + node_sub(""), + window_start(), + window_stop(), + delivered_msgs(0), + dropped_msgs(0), + traffic(0), + period_mean(), + period_stddev(), + period_max(), + stamp_age_mean(), + stamp_age_stddev(), + stamp_age_max() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + uint32_t length_node_pub = strlen(this->node_pub); + memcpy(outbuffer + offset, &length_node_pub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_pub, length_node_pub); + offset += length_node_pub; + uint32_t length_node_sub = strlen(this->node_sub); + memcpy(outbuffer + offset, &length_node_sub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_sub, length_node_sub); + offset += length_node_sub; + *(outbuffer + offset + 0) = (this->window_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.sec); + *(outbuffer + offset + 0) = (this->window_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.nsec); + *(outbuffer + offset + 0) = (this->window_stop.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.sec); + *(outbuffer + offset + 0) = (this->window_stop.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.real = this->delivered_msgs; + *(outbuffer + offset + 0) = (u_delivered_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delivered_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delivered_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delivered_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.real = this->dropped_msgs; + *(outbuffer + offset + 0) = (u_dropped_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dropped_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dropped_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dropped_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.real = this->traffic; + *(outbuffer + offset + 0) = (u_traffic.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_traffic.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_traffic.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_traffic.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->traffic); + *(outbuffer + offset + 0) = (this->period_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.sec); + *(outbuffer + offset + 0) = (this->period_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.nsec); + *(outbuffer + offset + 0) = (this->period_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.sec); + *(outbuffer + offset + 0) = (this->period_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.nsec); + *(outbuffer + offset + 0) = (this->period_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.sec); + *(outbuffer + offset + 0) = (this->period_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.sec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.sec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.sec); + *(outbuffer + offset + 0) = (this->stamp_age_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + uint32_t length_node_pub; + memcpy(&length_node_pub, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_pub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_pub-1]=0; + this->node_pub = (char *)(inbuffer + offset-1); + offset += length_node_pub; + uint32_t length_node_sub; + memcpy(&length_node_sub, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_sub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_sub-1]=0; + this->node_sub = (char *)(inbuffer + offset-1); + offset += length_node_sub; + this->window_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.sec); + this->window_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.nsec); + this->window_stop.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.sec); + this->window_stop.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.base = 0; + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delivered_msgs = u_delivered_msgs.real; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.base = 0; + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dropped_msgs = u_dropped_msgs.real; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.base = 0; + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->traffic = u_traffic.real; + offset += sizeof(this->traffic); + this->period_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.sec); + this->period_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.nsec); + this->period_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.sec); + this->period_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.nsec); + this->period_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.sec); + this->period_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.nsec); + this->stamp_age_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.sec); + this->stamp_age_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.nsec); + this->stamp_age_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.sec); + this->stamp_age_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.nsec); + this->stamp_age_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.sec); + this->stamp_age_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/TopicStatistics"; }; + const char * getMD5(){ return "10152ed868c5097a5e2e4a89d7daa710"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h new file mode 100755 index 0000000..37332a0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_AddTwoInts_h +#define _ROS_SERVICE_AddTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char ADDTWOINTS[] = "rospy_tutorials/AddTwoInts"; + + class AddTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + AddTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class AddTwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + AddTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class AddTwoInts { + public: + typedef AddTwoIntsRequest Request; + typedef AddTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h new file mode 100755 index 0000000..f76f277 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h @@ -0,0 +1,147 @@ +#ifndef _ROS_SERVICE_BadTwoInts_h +#define _ROS_SERVICE_BadTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char BADTWOINTS[] = "rospy_tutorials/BadTwoInts"; + + class BadTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int32_t b; + + BadTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "29bb5c7dea8bf822f53e94b0ee5a3a56"; }; + + }; + + class BadTwoIntsResponse : public ros::Msg + { + public: + int32_t sum; + + BadTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "0ba699c25c9418c0366f3595c0c8e8ec"; }; + + }; + + class BadTwoInts { + public: + typedef BadTwoIntsRequest Request; + typedef BadTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/Floats.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/Floats.h new file mode 100755 index 0000000..113468d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/Floats.h @@ -0,0 +1,77 @@ +#ifndef _ROS_rospy_tutorials_Floats_h +#define _ROS_rospy_tutorials_Floats_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + + class Floats : public ros::Msg + { + public: + uint8_t data_length; + float st_data; + float * data; + + Floats(): + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "rospy_tutorials/Floats"; }; + const char * getMD5(){ return "420cd38b6b071cd49f2970c3e2cee511"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/HeaderString.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/HeaderString.h new file mode 100755 index 0000000..f53759c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rospy_tutorials/HeaderString.h @@ -0,0 +1,59 @@ +#ifndef _ROS_rospy_tutorials_HeaderString_h +#define _ROS_rospy_tutorials_HeaderString_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rospy_tutorials +{ + + class HeaderString : public ros::Msg + { + public: + std_msgs::Header header; + const char* data; + + HeaderString(): + header(), + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "rospy_tutorials/HeaderString"; }; + const char * getMD5(){ return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_arduino/Adc.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_arduino/Adc.h new file mode 100755 index 0000000..21114c7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_arduino/Adc.h @@ -0,0 +1,86 @@ +#ifndef _ROS_rosserial_arduino_Adc_h +#define _ROS_rosserial_arduino_Adc_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + + class Adc : public ros::Msg + { + public: + uint16_t adc0; + uint16_t adc1; + uint16_t adc2; + uint16_t adc3; + uint16_t adc4; + uint16_t adc5; + + Adc(): + adc0(0), + adc1(0), + adc2(0), + adc3(0), + adc4(0), + adc5(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->adc0 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc0 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc0); + *(outbuffer + offset + 0) = (this->adc1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc1 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc1); + *(outbuffer + offset + 0) = (this->adc2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc2 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc2); + *(outbuffer + offset + 0) = (this->adc3 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc3 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc3); + *(outbuffer + offset + 0) = (this->adc4 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc4 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc4); + *(outbuffer + offset + 0) = (this->adc5 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc5 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc5); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->adc0 = ((uint16_t) (*(inbuffer + offset))); + this->adc0 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc0); + this->adc1 = ((uint16_t) (*(inbuffer + offset))); + this->adc1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc1); + this->adc2 = ((uint16_t) (*(inbuffer + offset))); + this->adc2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc2); + this->adc3 = ((uint16_t) (*(inbuffer + offset))); + this->adc3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc3); + this->adc4 = ((uint16_t) (*(inbuffer + offset))); + this->adc4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc4); + this->adc5 = ((uint16_t) (*(inbuffer + offset))); + this->adc5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc5); + return offset; + } + + const char * getType(){ return "rosserial_arduino/Adc"; }; + const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_arduino/Test.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_arduino/Test.h new file mode 100755 index 0000000..e132728 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_arduino/Test.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_Test_h +#define _ROS_SERVICE_Test_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + +static const char TEST[] = "rosserial_arduino/Test"; + + class TestRequest : public ros::Msg + { + public: + const char* input; + + TestRequest(): + input("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_input = strlen(this->input); + memcpy(outbuffer + offset, &length_input, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->input, length_input); + offset += length_input; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_input; + memcpy(&length_input, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_input; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_input-1]=0; + this->input = (char *)(inbuffer + offset-1); + offset += length_input; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "39e92f1778057359c64c7b8a7d7b19de"; }; + + }; + + class TestResponse : public ros::Msg + { + public: + const char* output; + + TestResponse(): + output("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_output = strlen(this->output); + memcpy(outbuffer + offset, &length_output, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_output; + memcpy(&length_output, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_output; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_output-1]=0; + this->output = (char *)(inbuffer + offset-1); + offset += length_output; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class Test { + public: + typedef TestRequest Request; + typedef TestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/Log.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/Log.h new file mode 100755 index 0000000..bcd6fd6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/Log.h @@ -0,0 +1,65 @@ +#ifndef _ROS_rosserial_msgs_Log_h +#define _ROS_rosserial_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class Log : public ros::Msg + { + public: + uint8_t level; + const char* msg; + enum { ROSDEBUG = 0 }; + enum { INFO = 1 }; + enum { WARN = 2 }; + enum { ERROR = 3 }; + enum { FATAL = 4 }; + + Log(): + level(0), + msg("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->level = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->level); + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + return offset; + } + + const char * getType(){ return "rosserial_msgs/Log"; }; + const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h new file mode 100755 index 0000000..98af72e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h @@ -0,0 +1,118 @@ +#ifndef _ROS_SERVICE_RequestMessageInfo_h +#define _ROS_SERVICE_RequestMessageInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo"; + + class RequestMessageInfoRequest : public ros::Msg + { + public: + const char* type; + + RequestMessageInfoRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class RequestMessageInfoResponse : public ros::Msg + { + public: + const char* md5; + const char* definition; + + RequestMessageInfoResponse(): + md5(""), + definition("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_md5 = strlen(this->md5); + memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5, length_md5); + offset += length_md5; + uint32_t length_definition = strlen(this->definition); + memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->definition, length_definition); + offset += length_definition; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_md5; + memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5-1]=0; + this->md5 = (char *)(inbuffer + offset-1); + offset += length_md5; + uint32_t length_definition; + memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_definition; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_definition-1]=0; + this->definition = (char *)(inbuffer + offset-1); + offset += length_definition; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; }; + + }; + + class RequestMessageInfo { + public: + typedef RequestMessageInfoRequest Request; + typedef RequestMessageInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestParam.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestParam.h new file mode 100755 index 0000000..f4c76bd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestParam.h @@ -0,0 +1,196 @@ +#ifndef _ROS_SERVICE_RequestParam_h +#define _ROS_SERVICE_RequestParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTPARAM[] = "rosserial_msgs/RequestParam"; + + class RequestParamRequest : public ros::Msg + { + public: + const char* name; + + RequestParamRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class RequestParamResponse : public ros::Msg + { + public: + uint8_t ints_length; + int32_t st_ints; + int32_t * ints; + uint8_t floats_length; + float st_floats; + float * floats; + uint8_t strings_length; + char* st_strings; + char* * strings; + + RequestParamResponse(): + ints_length(0), ints(NULL), + floats_length(0), floats(NULL), + strings_length(0), strings(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_intsi; + u_intsi.real = this->ints[i]; + *(outbuffer + offset + 0) = (u_intsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints[i]); + } + *(outbuffer + offset++) = floats_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_floatsi; + u_floatsi.real = this->floats[i]; + *(outbuffer + offset + 0) = (u_floatsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_floatsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_floatsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_floatsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats[i]); + } + *(outbuffer + offset++) = strings_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_stringsi = strlen(this->strings[i]); + memcpy(outbuffer + offset, &length_stringsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->strings[i], length_stringsi); + offset += length_stringsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (int32_t*)realloc(this->ints, ints_lengthT * sizeof(int32_t)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ints; + u_st_ints.base = 0; + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ints = u_st_ints.real; + offset += sizeof(this->st_ints); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(int32_t)); + } + uint8_t floats_lengthT = *(inbuffer + offset++); + if(floats_lengthT > floats_length) + this->floats = (float*)realloc(this->floats, floats_lengthT * sizeof(float)); + offset += 3; + floats_length = floats_lengthT; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_st_floats; + u_st_floats.base = 0; + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_floats = u_st_floats.real; + offset += sizeof(this->st_floats); + memcpy( &(this->floats[i]), &(this->st_floats), sizeof(float)); + } + uint8_t strings_lengthT = *(inbuffer + offset++); + if(strings_lengthT > strings_length) + this->strings = (char**)realloc(this->strings, strings_lengthT * sizeof(char*)); + offset += 3; + strings_length = strings_lengthT; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_st_strings; + memcpy(&length_st_strings, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_strings; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_strings-1]=0; + this->st_strings = (char *)(inbuffer + offset-1); + offset += length_st_strings; + memcpy( &(this->strings[i]), &(this->st_strings), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "9f0e98bda65981986ddf53afa7a40e49"; }; + + }; + + class RequestParam { + public: + typedef RequestParamRequest Request; + typedef RequestParamResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h new file mode 100755 index 0000000..90b47c5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h @@ -0,0 +1,134 @@ +#ifndef _ROS_SERVICE_RequestServiceInfo_h +#define _ROS_SERVICE_RequestServiceInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo"; + + class RequestServiceInfoRequest : public ros::Msg + { + public: + const char* service; + + RequestServiceInfoRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service = strlen(this->service); + memcpy(outbuffer + offset, &length_service, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service; + memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class RequestServiceInfoResponse : public ros::Msg + { + public: + const char* service_md5; + const char* request_md5; + const char* response_md5; + + RequestServiceInfoResponse(): + service_md5(""), + request_md5(""), + response_md5("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service_md5 = strlen(this->service_md5); + memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service_md5, length_service_md5); + offset += length_service_md5; + uint32_t length_request_md5 = strlen(this->request_md5); + memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->request_md5, length_request_md5); + offset += length_request_md5; + uint32_t length_response_md5 = strlen(this->response_md5); + memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_md5, length_response_md5); + offset += length_response_md5; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service_md5; + memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service_md5-1]=0; + this->service_md5 = (char *)(inbuffer + offset-1); + offset += length_service_md5; + uint32_t length_request_md5; + memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_request_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_request_md5-1]=0; + this->request_md5 = (char *)(inbuffer + offset-1); + offset += length_request_md5; + uint32_t length_response_md5; + memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_md5-1]=0; + this->response_md5 = (char *)(inbuffer + offset-1); + offset += length_response_md5; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; }; + + }; + + class RequestServiceInfo { + public: + typedef RequestServiceInfoRequest Request; + typedef RequestServiceInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/TopicInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/TopicInfo.h new file mode 100755 index 0000000..c4daf2d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/rosserial_msgs/TopicInfo.h @@ -0,0 +1,125 @@ +#ifndef _ROS_rosserial_msgs_TopicInfo_h +#define _ROS_rosserial_msgs_TopicInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class TopicInfo : public ros::Msg + { + public: + uint16_t topic_id; + const char* topic_name; + const char* message_type; + const char* md5sum; + int32_t buffer_size; + enum { ID_PUBLISHER = 0 }; + enum { ID_SUBSCRIBER = 1 }; + enum { ID_SERVICE_SERVER = 2 }; + enum { ID_SERVICE_CLIENT = 4 }; + enum { ID_PARAMETER_REQUEST = 6 }; + enum { ID_LOG = 7 }; + enum { ID_TIME = 10 }; + enum { ID_TX_STOP = 11 }; + + TopicInfo(): + topic_id(0), + topic_name(""), + message_type(""), + md5sum(""), + buffer_size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topic_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topic_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->topic_id); + uint32_t length_topic_name = strlen(this->topic_name); + memcpy(outbuffer + offset, &length_topic_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic_name, length_topic_name); + offset += length_topic_name; + uint32_t length_message_type = strlen(this->message_type); + memcpy(outbuffer + offset, &length_message_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message_type, length_message_type); + offset += length_message_type; + uint32_t length_md5sum = strlen(this->md5sum); + memcpy(outbuffer + offset, &length_md5sum, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5sum, length_md5sum); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.real = this->buffer_size; + *(outbuffer + offset + 0) = (u_buffer_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buffer_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buffer_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buffer_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buffer_size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->topic_id = ((uint16_t) (*(inbuffer + offset))); + this->topic_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->topic_id); + uint32_t length_topic_name; + memcpy(&length_topic_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic_name-1]=0; + this->topic_name = (char *)(inbuffer + offset-1); + offset += length_topic_name; + uint32_t length_message_type; + memcpy(&length_message_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_type-1]=0; + this->message_type = (char *)(inbuffer + offset-1); + offset += length_message_type; + uint32_t length_md5sum; + memcpy(&length_md5sum, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5sum; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5sum-1]=0; + this->md5sum = (char *)(inbuffer + offset-1); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.base = 0; + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->buffer_size = u_buffer_size.real; + offset += sizeof(this->buffer_size); + return offset; + } + + const char * getType(){ return "rosserial_msgs/TopicInfo"; }; + const char * getMD5(){ return "0ad51f88fc44892f8c10684077646005"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/BatteryState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/BatteryState.h new file mode 100755 index 0000000..0328963 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/BatteryState.h @@ -0,0 +1,308 @@ +#ifndef _ROS_sensor_msgs_BatteryState_h +#define _ROS_sensor_msgs_BatteryState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class BatteryState : public ros::Msg + { + public: + std_msgs::Header header; + float voltage; + float current; + float charge; + float capacity; + float design_capacity; + float percentage; + uint8_t power_supply_status; + uint8_t power_supply_health; + uint8_t power_supply_technology; + bool present; + uint8_t cell_voltage_length; + float st_cell_voltage; + float * cell_voltage; + const char* location; + const char* serial_number; + enum { POWER_SUPPLY_STATUS_UNKNOWN = 0 }; + enum { POWER_SUPPLY_STATUS_CHARGING = 1 }; + enum { POWER_SUPPLY_STATUS_DISCHARGING = 2 }; + enum { POWER_SUPPLY_STATUS_NOT_CHARGING = 3 }; + enum { POWER_SUPPLY_STATUS_FULL = 4 }; + enum { POWER_SUPPLY_HEALTH_UNKNOWN = 0 }; + enum { POWER_SUPPLY_HEALTH_GOOD = 1 }; + enum { POWER_SUPPLY_HEALTH_OVERHEAT = 2 }; + enum { POWER_SUPPLY_HEALTH_DEAD = 3 }; + enum { POWER_SUPPLY_HEALTH_OVERVOLTAGE = 4 }; + enum { POWER_SUPPLY_HEALTH_UNSPEC_FAILURE = 5 }; + enum { POWER_SUPPLY_HEALTH_COLD = 6 }; + enum { POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE = 7 }; + enum { POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE = 8 }; + enum { POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0 }; + enum { POWER_SUPPLY_TECHNOLOGY_NIMH = 1 }; + enum { POWER_SUPPLY_TECHNOLOGY_LION = 2 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIPO = 3 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIFE = 4 }; + enum { POWER_SUPPLY_TECHNOLOGY_NICD = 5 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIMN = 6 }; + + BatteryState(): + header(), + voltage(0), + current(0), + charge(0), + capacity(0), + design_capacity(0), + percentage(0), + power_supply_status(0), + power_supply_health(0), + power_supply_technology(0), + present(0), + cell_voltage_length(0), cell_voltage(NULL), + location(""), + serial_number("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.real = this->voltage; + *(outbuffer + offset + 0) = (u_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.real = this->current; + *(outbuffer + offset + 0) = (u_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_charge; + u_charge.real = this->charge; + *(outbuffer + offset + 0) = (u_charge.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charge.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charge.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charge.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.real = this->capacity; + *(outbuffer + offset + 0) = (u_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.real = this->design_capacity; + *(outbuffer + offset + 0) = (u_design_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_design_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_design_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_design_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.real = this->percentage; + *(outbuffer + offset + 0) = (u_percentage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_percentage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_percentage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_percentage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->percentage); + *(outbuffer + offset + 0) = (this->power_supply_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_status); + *(outbuffer + offset + 0) = (this->power_supply_health >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_health); + *(outbuffer + offset + 0) = (this->power_supply_technology >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.real = this->present; + *(outbuffer + offset + 0) = (u_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->present); + *(outbuffer + offset++) = cell_voltage_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_cell_voltagei; + u_cell_voltagei.real = this->cell_voltage[i]; + *(outbuffer + offset + 0) = (u_cell_voltagei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_voltagei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_voltagei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_voltagei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_voltage[i]); + } + uint32_t length_location = strlen(this->location); + memcpy(outbuffer + offset, &length_location, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->location, length_location); + offset += length_location; + uint32_t length_serial_number = strlen(this->serial_number); + memcpy(outbuffer + offset, &length_serial_number, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->serial_number, length_serial_number); + offset += length_serial_number; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.base = 0; + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->voltage = u_voltage.real; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.base = 0; + u_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current = u_current.real; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_charge; + u_charge.base = 0; + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charge = u_charge.real; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.base = 0; + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->capacity = u_capacity.real; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.base = 0; + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->design_capacity = u_design_capacity.real; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.base = 0; + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->percentage = u_percentage.real; + offset += sizeof(this->percentage); + this->power_supply_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_status); + this->power_supply_health = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_health); + this->power_supply_technology = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.base = 0; + u_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->present = u_present.real; + offset += sizeof(this->present); + uint8_t cell_voltage_lengthT = *(inbuffer + offset++); + if(cell_voltage_lengthT > cell_voltage_length) + this->cell_voltage = (float*)realloc(this->cell_voltage, cell_voltage_lengthT * sizeof(float)); + offset += 3; + cell_voltage_length = cell_voltage_lengthT; + for( uint8_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_st_cell_voltage; + u_st_cell_voltage.base = 0; + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cell_voltage = u_st_cell_voltage.real; + offset += sizeof(this->st_cell_voltage); + memcpy( &(this->cell_voltage[i]), &(this->st_cell_voltage), sizeof(float)); + } + uint32_t length_location; + memcpy(&length_location, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_location; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_location-1]=0; + this->location = (char *)(inbuffer + offset-1); + offset += length_location; + uint32_t length_serial_number; + memcpy(&length_serial_number, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_serial_number; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_serial_number-1]=0; + this->serial_number = (char *)(inbuffer + offset-1); + offset += length_serial_number; + return offset; + } + + const char * getType(){ return "sensor_msgs/BatteryState"; }; + const char * getMD5(){ return "476f837fa6771f6e16e3bf4ef96f8770"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/CameraInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/CameraInfo.h new file mode 100755 index 0000000..55280ed --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/CameraInfo.h @@ -0,0 +1,156 @@ +#ifndef _ROS_sensor_msgs_CameraInfo_h +#define _ROS_sensor_msgs_CameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace sensor_msgs +{ + + class CameraInfo : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* distortion_model; + uint8_t D_length; + float st_D; + float * D; + float K[9]; + float R[9]; + float P[12]; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + CameraInfo(): + header(), + height(0), + width(0), + distortion_model(""), + D_length(0), D(NULL), + K(), + R(), + P(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_distortion_model = strlen(this->distortion_model); + memcpy(outbuffer + offset, &length_distortion_model, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->distortion_model, length_distortion_model); + offset += length_distortion_model; + *(outbuffer + offset++) = D_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < D_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->D[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->K[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->R[i]); + } + for( uint8_t i = 0; i < 12; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->P[i]); + } + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_distortion_model; + memcpy(&length_distortion_model, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_distortion_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_distortion_model-1]=0; + this->distortion_model = (char *)(inbuffer + offset-1); + offset += length_distortion_model; + uint8_t D_lengthT = *(inbuffer + offset++); + if(D_lengthT > D_length) + this->D = (float*)realloc(this->D, D_lengthT * sizeof(float)); + offset += 3; + D_length = D_lengthT; + for( uint8_t i = 0; i < D_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_D)); + memcpy( &(this->D[i]), &(this->st_D), sizeof(float)); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->K[i])); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->R[i])); + } + for( uint8_t i = 0; i < 12; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->P[i])); + } + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "sensor_msgs/CameraInfo"; }; + const char * getMD5(){ return "c9a58c1b0b154e0e6da7578cb991d214"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h new file mode 100755 index 0000000..ed58158 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h @@ -0,0 +1,93 @@ +#ifndef _ROS_sensor_msgs_ChannelFloat32_h +#define _ROS_sensor_msgs_ChannelFloat32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class ChannelFloat32 : public ros::Msg + { + public: + const char* name; + uint8_t values_length; + float st_values; + float * values; + + ChannelFloat32(): + name(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/ChannelFloat32"; }; + const char * getMD5(){ return "3d40139cdd33dfedcb71ffeeeb42ae7f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/CompressedImage.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/CompressedImage.h new file mode 100755 index 0000000..fdda842 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/CompressedImage.h @@ -0,0 +1,81 @@ +#ifndef _ROS_sensor_msgs_CompressedImage_h +#define _ROS_sensor_msgs_CompressedImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class CompressedImage : public ros::Msg + { + public: + std_msgs::Header header; + const char* format; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + CompressedImage(): + header(), + format(""), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_format = strlen(this->format); + memcpy(outbuffer + offset, &length_format, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_format; + memcpy(&length_format, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_format-1]=0; + this->format = (char *)(inbuffer + offset-1); + offset += length_format; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/CompressedImage"; }; + const char * getMD5(){ return "8f7a12909da2c9d3332d540a0977563f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/FluidPressure.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/FluidPressure.h new file mode 100755 index 0000000..b24e211 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/FluidPressure.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_FluidPressure_h +#define _ROS_sensor_msgs_FluidPressure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class FluidPressure : public ros::Msg + { + public: + std_msgs::Header header; + float fluid_pressure; + float variance; + + FluidPressure(): + header(), + fluid_pressure(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->fluid_pressure); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fluid_pressure)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/FluidPressure"; }; + const char * getMD5(){ return "804dc5cea1c5306d6a2eb80b9833befe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Illuminance.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Illuminance.h new file mode 100755 index 0000000..7e21795 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Illuminance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_Illuminance_h +#define _ROS_sensor_msgs_Illuminance_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Illuminance : public ros::Msg + { + public: + std_msgs::Header header; + float illuminance; + float variance; + + Illuminance(): + header(), + illuminance(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->illuminance); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->illuminance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Illuminance"; }; + const char * getMD5(){ return "8cf5febb0952fca9d650c3d11a81a188"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Image.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Image.h new file mode 100755 index 0000000..2b7ba85 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Image.h @@ -0,0 +1,123 @@ +#ifndef _ROS_sensor_msgs_Image_h +#define _ROS_sensor_msgs_Image_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Image : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* encoding; + uint8_t is_bigendian; + uint32_t step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + Image(): + header(), + height(0), + width(0), + encoding(""), + is_bigendian(0), + step(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_encoding = strlen(this->encoding); + memcpy(outbuffer + offset, &length_encoding, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->encoding, length_encoding); + offset += length_encoding; + *(outbuffer + offset + 0) = (this->is_bigendian >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->step >> (8 * 3)) & 0xFF; + offset += sizeof(this->step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_encoding; + memcpy(&length_encoding, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_encoding; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_encoding-1]=0; + this->encoding = (char *)(inbuffer + offset-1); + offset += length_encoding; + this->is_bigendian = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->is_bigendian); + this->step = ((uint32_t) (*(inbuffer + offset))); + this->step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Image"; }; + const char * getMD5(){ return "060021388200f6f0f447d0fcd9c64743"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Imu.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Imu.h new file mode 100755 index 0000000..7f7116e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Imu.h @@ -0,0 +1,81 @@ +#ifndef _ROS_sensor_msgs_Imu_h +#define _ROS_sensor_msgs_Imu_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class Imu : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion orientation; + float orientation_covariance[9]; + geometry_msgs::Vector3 angular_velocity; + float angular_velocity_covariance[9]; + geometry_msgs::Vector3 linear_acceleration; + float linear_acceleration_covariance[9]; + + Imu(): + header(), + orientation(), + orientation_covariance(), + angular_velocity(), + angular_velocity_covariance(), + linear_acceleration(), + linear_acceleration_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_covariance[i]); + } + offset += this->angular_velocity.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->angular_velocity_covariance[i]); + } + offset += this->linear_acceleration.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->linear_acceleration_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_covariance[i])); + } + offset += this->angular_velocity.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angular_velocity_covariance[i])); + } + offset += this->linear_acceleration.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->linear_acceleration_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Imu"; }; + const char * getMD5(){ return "6a62c6daae103f4ff57a132d6f95cec2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JointState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JointState.h new file mode 100755 index 0000000..387b7f4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JointState.h @@ -0,0 +1,135 @@ +#ifndef _ROS_sensor_msgs_JointState_h +#define _ROS_sensor_msgs_JointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class JointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t effort_length; + float st_effort; + float * effort; + + JointState(): + header(), + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + effort_length(0), effort(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JointState"; }; + const char * getMD5(){ return "3066dcd76a6cfaef579bd0f34173e9fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Joy.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Joy.h new file mode 100755 index 0000000..f8b5721 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Joy.h @@ -0,0 +1,121 @@ +#ifndef _ROS_sensor_msgs_Joy_h +#define _ROS_sensor_msgs_Joy_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Joy : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t axes_length; + float st_axes; + float * axes; + uint8_t buttons_length; + int32_t st_buttons; + int32_t * buttons; + + Joy(): + header(), + axes_length(0), axes(NULL), + buttons_length(0), buttons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = axes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_axesi; + u_axesi.real = this->axes[i]; + *(outbuffer + offset + 0) = (u_axesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_axesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_axesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_axesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->axes[i]); + } + *(outbuffer + offset++) = buttons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_buttonsi; + u_buttonsi.real = this->buttons[i]; + *(outbuffer + offset + 0) = (u_buttonsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buttonsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buttonsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buttonsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t axes_lengthT = *(inbuffer + offset++); + if(axes_lengthT > axes_length) + this->axes = (float*)realloc(this->axes, axes_lengthT * sizeof(float)); + offset += 3; + axes_length = axes_lengthT; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_st_axes; + u_st_axes.base = 0; + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_axes = u_st_axes.real; + offset += sizeof(this->st_axes); + memcpy( &(this->axes[i]), &(this->st_axes), sizeof(float)); + } + uint8_t buttons_lengthT = *(inbuffer + offset++); + if(buttons_lengthT > buttons_length) + this->buttons = (int32_t*)realloc(this->buttons, buttons_lengthT * sizeof(int32_t)); + offset += 3; + buttons_length = buttons_lengthT; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_buttons; + u_st_buttons.base = 0; + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_buttons = u_st_buttons.real; + offset += sizeof(this->st_buttons); + memcpy( &(this->buttons[i]), &(this->st_buttons), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Joy"; }; + const char * getMD5(){ return "5a9ea5f83505693b71e785041e67a8bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JoyFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JoyFeedback.h new file mode 100755 index 0000000..dfea009 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JoyFeedback.h @@ -0,0 +1,76 @@ +#ifndef _ROS_sensor_msgs_JoyFeedback_h +#define _ROS_sensor_msgs_JoyFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class JoyFeedback : public ros::Msg + { + public: + uint8_t type; + uint8_t id; + float intensity; + enum { TYPE_LED = 0 }; + enum { TYPE_RUMBLE = 1 }; + enum { TYPE_BUZZER = 2 }; + + JoyFeedback(): + type(0), + id(0), + intensity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.real = this->intensity; + *(outbuffer + offset + 0) = (u_intensity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.base = 0; + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->intensity = u_intensity.real; + offset += sizeof(this->intensity); + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedback"; }; + const char * getMD5(){ return "f4dcd73460360d98f36e55ee7f2e46f1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h new file mode 100755 index 0000000..9f0de2b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_sensor_msgs_JoyFeedbackArray_h +#define _ROS_sensor_msgs_JoyFeedbackArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JoyFeedback.h" + +namespace sensor_msgs +{ + + class JoyFeedbackArray : public ros::Msg + { + public: + uint8_t array_length; + sensor_msgs::JoyFeedback st_array; + sensor_msgs::JoyFeedback * array; + + JoyFeedbackArray(): + array_length(0), array(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = array_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->array[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t array_lengthT = *(inbuffer + offset++); + if(array_lengthT > array_length) + this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback)); + offset += 3; + array_length = array_lengthT; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->st_array.deserialize(inbuffer + offset); + memcpy( &(this->array[i]), &(this->st_array), sizeof(sensor_msgs::JoyFeedback)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedbackArray"; }; + const char * getMD5(){ return "cde5730a895b1fc4dee6f91b754b213d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/LaserEcho.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/LaserEcho.h new file mode 100755 index 0000000..8d48ba5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/LaserEcho.h @@ -0,0 +1,77 @@ +#ifndef _ROS_sensor_msgs_LaserEcho_h +#define _ROS_sensor_msgs_LaserEcho_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class LaserEcho : public ros::Msg + { + public: + uint8_t echoes_length; + float st_echoes; + float * echoes; + + LaserEcho(): + echoes_length(0), echoes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = echoes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_echoesi; + u_echoesi.real = this->echoes[i]; + *(outbuffer + offset + 0) = (u_echoesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_echoesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_echoesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_echoesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->echoes[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t echoes_lengthT = *(inbuffer + offset++); + if(echoes_lengthT > echoes_length) + this->echoes = (float*)realloc(this->echoes, echoes_lengthT * sizeof(float)); + offset += 3; + echoes_length = echoes_lengthT; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_st_echoes; + u_st_echoes.base = 0; + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_echoes = u_st_echoes.real; + offset += sizeof(this->st_echoes); + memcpy( &(this->echoes[i]), &(this->st_echoes), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserEcho"; }; + const char * getMD5(){ return "8bc5ae449b200fba4d552b4225586696"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/LaserScan.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/LaserScan.h new file mode 100755 index 0000000..8276622 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/LaserScan.h @@ -0,0 +1,282 @@ +#ifndef _ROS_sensor_msgs_LaserScan_h +#define _ROS_sensor_msgs_LaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class LaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + float st_ranges; + float * ranges; + uint8_t intensities_length; + float st_intensities; + float * intensities; + + LaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_rangesi; + u_rangesi.real = this->ranges[i]; + *(outbuffer + offset + 0) = (u_rangesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rangesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rangesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rangesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges[i]); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_intensitiesi; + u_intensitiesi.real = this->intensities[i]; + *(outbuffer + offset + 0) = (u_intensitiesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensitiesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensitiesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensitiesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (float*)realloc(this->ranges, ranges_lengthT * sizeof(float)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_st_ranges; + u_st_ranges.base = 0; + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ranges = u_st_ranges.real; + offset += sizeof(this->st_ranges); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(float)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (float*)realloc(this->intensities, intensities_lengthT * sizeof(float)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_st_intensities; + u_st_intensities.base = 0; + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_intensities = u_st_intensities.real; + offset += sizeof(this->st_intensities); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserScan"; }; + const char * getMD5(){ return "90c7ef2dc6895d81024acba2ac42f369"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MagneticField.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MagneticField.h new file mode 100755 index 0000000..b4a37c2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MagneticField.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sensor_msgs_MagneticField_h +#define _ROS_sensor_msgs_MagneticField_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class MagneticField : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 magnetic_field; + float magnetic_field_covariance[9]; + + MagneticField(): + header(), + magnetic_field(), + magnetic_field_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->magnetic_field.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->magnetic_field_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->magnetic_field.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->magnetic_field_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MagneticField"; }; + const char * getMD5(){ return "2f3b0b43eed0c9501de0fa3ff89a45aa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h new file mode 100755 index 0000000..af5ab91 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h @@ -0,0 +1,138 @@ +#ifndef _ROS_sensor_msgs_MultiDOFJointState_h +#define _ROS_sensor_msgs_MultiDOFJointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace sensor_msgs +{ + + class MultiDOFJointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + MultiDOFJointState(): + header(), + joint_names_length(0), joint_names(NULL), + transforms_length(0), transforms(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiDOFJointState"; }; + const char * getMD5(){ return "690f272f0640d2631c305eeb8301e59d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h new file mode 100755 index 0000000..142be5f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h @@ -0,0 +1,245 @@ +#ifndef _ROS_sensor_msgs_MultiEchoLaserScan_h +#define _ROS_sensor_msgs_MultiEchoLaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/LaserEcho.h" + +namespace sensor_msgs +{ + + class MultiEchoLaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + sensor_msgs::LaserEcho st_ranges; + sensor_msgs::LaserEcho * ranges; + uint8_t intensities_length; + sensor_msgs::LaserEcho st_intensities; + sensor_msgs::LaserEcho * intensities; + + MultiEchoLaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->ranges[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->intensities[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->st_ranges.deserialize(inbuffer + offset); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(sensor_msgs::LaserEcho)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->st_intensities.deserialize(inbuffer + offset); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(sensor_msgs::LaserEcho)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiEchoLaserScan"; }; + const char * getMD5(){ return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/NavSatFix.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/NavSatFix.h new file mode 100755 index 0000000..ba06e0c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/NavSatFix.h @@ -0,0 +1,78 @@ +#ifndef _ROS_sensor_msgs_NavSatFix_h +#define _ROS_sensor_msgs_NavSatFix_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/NavSatStatus.h" + +namespace sensor_msgs +{ + + class NavSatFix : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::NavSatStatus status; + float latitude; + float longitude; + float altitude; + float position_covariance[9]; + uint8_t position_covariance_type; + enum { COVARIANCE_TYPE_UNKNOWN = 0 }; + enum { COVARIANCE_TYPE_APPROXIMATED = 1 }; + enum { COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 }; + enum { COVARIANCE_TYPE_KNOWN = 3 }; + + NavSatFix(): + header(), + status(), + latitude(0), + longitude(0), + altitude(0), + position_covariance(), + position_covariance_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + offset += serializeAvrFloat64(outbuffer + offset, this->altitude); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position_covariance[i]); + } + *(outbuffer + offset + 0) = (this->position_covariance_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->position_covariance_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->altitude)); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position_covariance[i])); + } + this->position_covariance_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->position_covariance_type); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatFix"; }; + const char * getMD5(){ return "2d3a8cd499b9b4a0249fb98fd05cfa48"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/NavSatStatus.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/NavSatStatus.h new file mode 100755 index 0000000..f696571 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/NavSatStatus.h @@ -0,0 +1,71 @@ +#ifndef _ROS_sensor_msgs_NavSatStatus_h +#define _ROS_sensor_msgs_NavSatStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class NavSatStatus : public ros::Msg + { + public: + int8_t status; + uint16_t service; + enum { STATUS_NO_FIX = -1 }; + enum { STATUS_FIX = 0 }; + enum { STATUS_SBAS_FIX = 1 }; + enum { STATUS_GBAS_FIX = 2 }; + enum { SERVICE_GPS = 1 }; + enum { SERVICE_GLONASS = 2 }; + enum { SERVICE_COMPASS = 4 }; + enum { SERVICE_GALILEO = 8 }; + + NavSatStatus(): + status(0), + service(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.real = this->status; + *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; + offset += sizeof(this->service); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.base = 0; + u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->status = u_status.real; + offset += sizeof(this->status); + this->service = ((uint16_t) (*(inbuffer + offset))); + this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->service); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointCloud.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointCloud.h new file mode 100755 index 0000000..ce7f775 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointCloud.h @@ -0,0 +1,85 @@ +#ifndef _ROS_sensor_msgs_PointCloud_h +#define _ROS_sensor_msgs_PointCloud_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "sensor_msgs/ChannelFloat32.h" + +namespace sensor_msgs +{ + + class PointCloud : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + uint8_t channels_length; + sensor_msgs::ChannelFloat32 st_channels; + sensor_msgs::ChannelFloat32 * channels; + + PointCloud(): + header(), + points_length(0), points(NULL), + channels_length(0), channels(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = channels_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->channels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + uint8_t channels_lengthT = *(inbuffer + offset++); + if(channels_lengthT > channels_length) + this->channels = (sensor_msgs::ChannelFloat32*)realloc(this->channels, channels_lengthT * sizeof(sensor_msgs::ChannelFloat32)); + offset += 3; + channels_length = channels_lengthT; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->st_channels.deserialize(inbuffer + offset); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(sensor_msgs::ChannelFloat32)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud"; }; + const char * getMD5(){ return "d8e9c3f5afbdd8a130fd1d2763945fca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointCloud2.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointCloud2.h new file mode 100755 index 0000000..8b50802 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointCloud2.h @@ -0,0 +1,168 @@ +#ifndef _ROS_sensor_msgs_PointCloud2_h +#define _ROS_sensor_msgs_PointCloud2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointField.h" + +namespace sensor_msgs +{ + + class PointCloud2 : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + uint8_t fields_length; + sensor_msgs::PointField st_fields; + sensor_msgs::PointField * fields; + bool is_bigendian; + uint32_t point_step; + uint32_t row_step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + bool is_dense; + + PointCloud2(): + header(), + height(0), + width(0), + fields_length(0), fields(NULL), + is_bigendian(0), + point_step(0), + row_step(0), + data_length(0), data(NULL), + is_dense(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset++) = fields_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->fields[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.real = this->is_bigendian; + *(outbuffer + offset + 0) = (u_is_bigendian.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->point_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->point_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->point_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->point_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->point_step); + *(outbuffer + offset + 0) = (this->row_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->row_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->row_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->row_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->row_step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.real = this->is_dense; + *(outbuffer + offset + 0) = (u_is_dense.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_dense); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint8_t fields_lengthT = *(inbuffer + offset++); + if(fields_lengthT > fields_length) + this->fields = (sensor_msgs::PointField*)realloc(this->fields, fields_lengthT * sizeof(sensor_msgs::PointField)); + offset += 3; + fields_length = fields_lengthT; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->st_fields.deserialize(inbuffer + offset); + memcpy( &(this->fields[i]), &(this->st_fields), sizeof(sensor_msgs::PointField)); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.base = 0; + u_is_bigendian.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_bigendian = u_is_bigendian.real; + offset += sizeof(this->is_bigendian); + this->point_step = ((uint32_t) (*(inbuffer + offset))); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->point_step); + this->row_step = ((uint32_t) (*(inbuffer + offset))); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->row_step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.base = 0; + u_is_dense.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_dense = u_is_dense.real; + offset += sizeof(this->is_dense); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud2"; }; + const char * getMD5(){ return "1158d486dd51d683ce2f1be655c3c181"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointField.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointField.h new file mode 100755 index 0000000..5ef0d0e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/PointField.h @@ -0,0 +1,92 @@ +#ifndef _ROS_sensor_msgs_PointField_h +#define _ROS_sensor_msgs_PointField_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class PointField : public ros::Msg + { + public: + const char* name; + uint32_t offset; + uint8_t datatype; + uint32_t count; + enum { INT8 = 1 }; + enum { UINT8 = 2 }; + enum { INT16 = 3 }; + enum { UINT16 = 4 }; + enum { INT32 = 5 }; + enum { UINT32 = 6 }; + enum { FLOAT32 = 7 }; + enum { FLOAT64 = 8 }; + + PointField(): + name(""), + offset(0), + datatype(0), + count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->datatype >> (8 * 0)) & 0xFF; + offset += sizeof(this->datatype); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->count >> (8 * 3)) & 0xFF; + offset += sizeof(this->count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + this->offset = ((uint32_t) (*(inbuffer + offset))); + this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->offset); + this->datatype = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->datatype); + this->count = ((uint32_t) (*(inbuffer + offset))); + this->count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->count); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointField"; }; + const char * getMD5(){ return "268eacb2962780ceac86cbd17e328150"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Range.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Range.h new file mode 100755 index 0000000..a8ddcaa --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Range.h @@ -0,0 +1,143 @@ +#ifndef _ROS_sensor_msgs_Range_h +#define _ROS_sensor_msgs_Range_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Range : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t radiation_type; + float field_of_view; + float min_range; + float max_range; + float range; + enum { ULTRASOUND = 0 }; + enum { INFRARED = 1 }; + + Range(): + header(), + radiation_type(0), + field_of_view(0), + min_range(0), + max_range(0), + range(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->radiation_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.real = this->field_of_view; + *(outbuffer + offset + 0) = (u_field_of_view.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_field_of_view.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_field_of_view.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_field_of_view.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.real = this->min_range; + *(outbuffer + offset + 0) = (u_min_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.real = this->max_range; + *(outbuffer + offset + 0) = (u_max_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.real = this->range; + *(outbuffer + offset + 0) = (u_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->radiation_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.base = 0; + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->field_of_view = u_field_of_view.real; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.base = 0; + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_range = u_min_range.real; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.base = 0; + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_range = u_max_range.real; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.base = 0; + u_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range = u_range.real; + offset += sizeof(this->range); + return offset; + } + + const char * getType(){ return "sensor_msgs/Range"; }; + const char * getMD5(){ return "c005c34273dc426c67a020a87bc24148"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h new file mode 100755 index 0000000..ebdb9b3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h @@ -0,0 +1,103 @@ +#ifndef _ROS_sensor_msgs_RegionOfInterest_h +#define _ROS_sensor_msgs_RegionOfInterest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class RegionOfInterest : public ros::Msg + { + public: + uint32_t x_offset; + uint32_t y_offset; + uint32_t height; + uint32_t width; + bool do_rectify; + + RegionOfInterest(): + x_offset(0), + y_offset(0), + height(0), + width(0), + do_rectify(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->x_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->x_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->x_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->x_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->x_offset); + *(outbuffer + offset + 0) = (this->y_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->y_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->y_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->y_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->y_offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.real = this->do_rectify; + *(outbuffer + offset + 0) = (u_do_rectify.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->do_rectify); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->x_offset = ((uint32_t) (*(inbuffer + offset))); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->x_offset); + this->y_offset = ((uint32_t) (*(inbuffer + offset))); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->y_offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.base = 0; + u_do_rectify.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->do_rectify = u_do_rectify.real; + offset += sizeof(this->do_rectify); + return offset; + } + + const char * getType(){ return "sensor_msgs/RegionOfInterest"; }; + const char * getMD5(){ return "bdb633039d588fcccb441a4d43ccfe09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h new file mode 100755 index 0000000..2ec392a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_RelativeHumidity_h +#define _ROS_sensor_msgs_RelativeHumidity_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class RelativeHumidity : public ros::Msg + { + public: + std_msgs::Header header; + float relative_humidity; + float variance; + + RelativeHumidity(): + header(), + relative_humidity(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->relative_humidity); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->relative_humidity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/RelativeHumidity"; }; + const char * getMD5(){ return "8730015b05955b7e992ce29a2678d90f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h new file mode 100755 index 0000000..9f49b67 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetCameraInfo_h +#define _ROS_SERVICE_SetCameraInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" + +namespace sensor_msgs +{ + +static const char SETCAMERAINFO[] = "sensor_msgs/SetCameraInfo"; + + class SetCameraInfoRequest : public ros::Msg + { + public: + sensor_msgs::CameraInfo camera_info; + + SetCameraInfoRequest(): + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "ee34be01fdeee563d0d99cd594d5581d"; }; + + }; + + class SetCameraInfoResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetCameraInfoResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetCameraInfo { + public: + typedef SetCameraInfoRequest Request; + typedef SetCameraInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Temperature.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Temperature.h new file mode 100755 index 0000000..f630a39 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/Temperature.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_Temperature_h +#define _ROS_sensor_msgs_Temperature_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Temperature : public ros::Msg + { + public: + std_msgs::Header header; + float temperature; + float variance; + + Temperature(): + header(), + temperature(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Temperature"; }; + const char * getMD5(){ return "ff71b307acdbe7c871a5a6d7ed359100"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/TimeReference.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/TimeReference.h new file mode 100755 index 0000000..eab85e6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/sensor_msgs/TimeReference.h @@ -0,0 +1,82 @@ +#ifndef _ROS_sensor_msgs_TimeReference_h +#define _ROS_sensor_msgs_TimeReference_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace sensor_msgs +{ + + class TimeReference : public ros::Msg + { + public: + std_msgs::Header header; + ros::Time time_ref; + const char* source; + + TimeReference(): + header(), + time_ref(), + source("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_ref.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.sec); + *(outbuffer + offset + 0) = (this->time_ref.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.nsec); + uint32_t length_source = strlen(this->source); + memcpy(outbuffer + offset, &length_source, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source, length_source); + offset += length_source; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->time_ref.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.sec); + this->time_ref.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.nsec); + uint32_t length_source; + memcpy(&length_source, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source-1]=0; + this->source = (char *)(inbuffer + offset-1); + offset += length_source; + return offset; + } + + const char * getType(){ return "sensor_msgs/TimeReference"; }; + const char * getMD5(){ return "fded64a0265108ba86c3d38fb11c0c16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/Mesh.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/Mesh.h new file mode 100755 index 0000000..8a12baa --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/Mesh.h @@ -0,0 +1,80 @@ +#ifndef _ROS_shape_msgs_Mesh_h +#define _ROS_shape_msgs_Mesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/MeshTriangle.h" +#include "geometry_msgs/Point.h" + +namespace shape_msgs +{ + + class Mesh : public ros::Msg + { + public: + uint8_t triangles_length; + shape_msgs::MeshTriangle st_triangles; + shape_msgs::MeshTriangle * triangles; + uint8_t vertices_length; + geometry_msgs::Point st_vertices; + geometry_msgs::Point * vertices; + + Mesh(): + triangles_length(0), triangles(NULL), + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = triangles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->triangles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->vertices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t triangles_lengthT = *(inbuffer + offset++); + if(triangles_lengthT > triangles_length) + this->triangles = (shape_msgs::MeshTriangle*)realloc(this->triangles, triangles_lengthT * sizeof(shape_msgs::MeshTriangle)); + offset += 3; + triangles_length = triangles_lengthT; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->st_triangles.deserialize(inbuffer + offset); + memcpy( &(this->triangles[i]), &(this->st_triangles), sizeof(shape_msgs::MeshTriangle)); + } + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (geometry_msgs::Point*)realloc(this->vertices, vertices_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->st_vertices.deserialize(inbuffer + offset); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Mesh"; }; + const char * getMD5(){ return "1ffdae9486cd3316a121c578b47a85cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/MeshTriangle.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/MeshTriangle.h new file mode 100755 index 0000000..1cb7e99 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/MeshTriangle.h @@ -0,0 +1,54 @@ +#ifndef _ROS_shape_msgs_MeshTriangle_h +#define _ROS_shape_msgs_MeshTriangle_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class MeshTriangle : public ros::Msg + { + public: + uint32_t vertex_indices[3]; + + MeshTriangle(): + vertex_indices() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + for( uint8_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->vertex_indices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertex_indices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertex_indices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertex_indices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 3; i++){ + this->vertex_indices[i] = ((uint32_t) (*(inbuffer + offset))); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + const char * getType(){ return "shape_msgs/MeshTriangle"; }; + const char * getMD5(){ return "23688b2e6d2de3d32fe8af104a903253"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/Plane.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/Plane.h new file mode 100755 index 0000000..b6c4d77 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/Plane.h @@ -0,0 +1,46 @@ +#ifndef _ROS_shape_msgs_Plane_h +#define _ROS_shape_msgs_Plane_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class Plane : public ros::Msg + { + public: + float coef[4]; + + Plane(): + coef() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coef[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->coef[i])); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Plane"; }; + const char * getMD5(){ return "2c1b92ed8f31492f8e73f6a4a44ca796"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/SolidPrimitive.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/SolidPrimitive.h new file mode 100755 index 0000000..ba1974d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/shape_msgs/SolidPrimitive.h @@ -0,0 +1,76 @@ +#ifndef _ROS_shape_msgs_SolidPrimitive_h +#define _ROS_shape_msgs_SolidPrimitive_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class SolidPrimitive : public ros::Msg + { + public: + uint8_t type; + uint8_t dimensions_length; + float st_dimensions; + float * dimensions; + enum { BOX = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { CONE = 4 }; + enum { BOX_X = 0 }; + enum { BOX_Y = 1 }; + enum { BOX_Z = 2 }; + enum { SPHERE_RADIUS = 0 }; + enum { CYLINDER_HEIGHT = 0 }; + enum { CYLINDER_RADIUS = 1 }; + enum { CONE_HEIGHT = 0 }; + enum { CONE_RADIUS = 1 }; + + SolidPrimitive(): + type(0), + dimensions_length(0), dimensions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = dimensions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dimensions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t dimensions_lengthT = *(inbuffer + offset++); + if(dimensions_lengthT > dimensions_length) + this->dimensions = (float*)realloc(this->dimensions, dimensions_lengthT * sizeof(float)); + offset += 3; + dimensions_length = dimensions_lengthT; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_dimensions)); + memcpy( &(this->dimensions[i]), &(this->st_dimensions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/SolidPrimitive"; }; + const char * getMD5(){ return "d8f8cbc74c5ff283fca29569ccefb45d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h new file mode 100755 index 0000000..aa0b000 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h @@ -0,0 +1,102 @@ +#ifndef _ROS_smach_msgs_SmachContainerInitialStatusCmd_h +#define _ROS_smach_msgs_SmachContainerInitialStatusCmd_h + +#include +#include +#include +#include "ros/msg.h" + +namespace smach_msgs +{ + + class SmachContainerInitialStatusCmd : public ros::Msg + { + public: + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + const char* local_data; + + SmachContainerInitialStatusCmd(): + path(""), + initial_states_length(0), initial_states(NULL), + local_data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerInitialStatusCmd"; }; + const char * getMD5(){ return "45f8cf31fc29b829db77f23001f788d6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h new file mode 100755 index 0000000..73300de --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h @@ -0,0 +1,155 @@ +#ifndef _ROS_smach_msgs_SmachContainerStatus_h +#define _ROS_smach_msgs_SmachContainerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStatus : public ros::Msg + { + public: + std_msgs::Header header; + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + uint8_t active_states_length; + char* st_active_states; + char* * active_states; + const char* local_data; + const char* info; + + SmachContainerStatus(): + header(), + path(""), + initial_states_length(0), initial_states(NULL), + active_states_length(0), active_states(NULL), + local_data(""), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + *(outbuffer + offset++) = active_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_active_statesi = strlen(this->active_states[i]); + memcpy(outbuffer + offset, &length_active_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->active_states[i], length_active_statesi); + offset += length_active_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint8_t active_states_lengthT = *(inbuffer + offset++); + if(active_states_lengthT > active_states_length) + this->active_states = (char**)realloc(this->active_states, active_states_lengthT * sizeof(char*)); + offset += 3; + active_states_length = active_states_lengthT; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_st_active_states; + memcpy(&length_st_active_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_active_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_active_states-1]=0; + this->st_active_states = (char *)(inbuffer + offset-1); + offset += length_st_active_states; + memcpy( &(this->active_states[i]), &(this->st_active_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStatus"; }; + const char * getMD5(){ return "5ba2bb79ac19e3842d562a191f2a675b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h new file mode 100755 index 0000000..c03ed2e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h @@ -0,0 +1,219 @@ +#ifndef _ROS_smach_msgs_SmachContainerStructure_h +#define _ROS_smach_msgs_SmachContainerStructure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStructure : public ros::Msg + { + public: + std_msgs::Header header; + const char* path; + uint8_t children_length; + char* st_children; + char* * children; + uint8_t internal_outcomes_length; + char* st_internal_outcomes; + char* * internal_outcomes; + uint8_t outcomes_from_length; + char* st_outcomes_from; + char* * outcomes_from; + uint8_t outcomes_to_length; + char* st_outcomes_to; + char* * outcomes_to; + uint8_t container_outcomes_length; + char* st_container_outcomes; + char* * container_outcomes; + + SmachContainerStructure(): + header(), + path(""), + children_length(0), children(NULL), + internal_outcomes_length(0), internal_outcomes(NULL), + outcomes_from_length(0), outcomes_from(NULL), + outcomes_to_length(0), outcomes_to(NULL), + container_outcomes_length(0), container_outcomes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = children_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_childreni = strlen(this->children[i]); + memcpy(outbuffer + offset, &length_childreni, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->children[i], length_childreni); + offset += length_childreni; + } + *(outbuffer + offset++) = internal_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); + memcpy(outbuffer + offset, &length_internal_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); + offset += length_internal_outcomesi; + } + *(outbuffer + offset++) = outcomes_from_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); + memcpy(outbuffer + offset, &length_outcomes_fromi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); + offset += length_outcomes_fromi; + } + *(outbuffer + offset++) = outcomes_to_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); + memcpy(outbuffer + offset, &length_outcomes_toi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); + offset += length_outcomes_toi; + } + *(outbuffer + offset++) = container_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); + memcpy(outbuffer + offset, &length_container_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); + offset += length_container_outcomesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t children_lengthT = *(inbuffer + offset++); + if(children_lengthT > children_length) + this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); + offset += 3; + children_length = children_lengthT; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_st_children; + memcpy(&length_st_children, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_children; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_children-1]=0; + this->st_children = (char *)(inbuffer + offset-1); + offset += length_st_children; + memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); + } + uint8_t internal_outcomes_lengthT = *(inbuffer + offset++); + if(internal_outcomes_lengthT > internal_outcomes_length) + this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); + offset += 3; + internal_outcomes_length = internal_outcomes_lengthT; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_st_internal_outcomes; + memcpy(&length_st_internal_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_internal_outcomes-1]=0; + this->st_internal_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_internal_outcomes; + memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); + } + uint8_t outcomes_from_lengthT = *(inbuffer + offset++); + if(outcomes_from_lengthT > outcomes_from_length) + this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); + offset += 3; + outcomes_from_length = outcomes_from_lengthT; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_st_outcomes_from; + memcpy(&length_st_outcomes_from, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_from-1]=0; + this->st_outcomes_from = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_from; + memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); + } + uint8_t outcomes_to_lengthT = *(inbuffer + offset++); + if(outcomes_to_lengthT > outcomes_to_length) + this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); + offset += 3; + outcomes_to_length = outcomes_to_lengthT; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_st_outcomes_to; + memcpy(&length_st_outcomes_to, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_to-1]=0; + this->st_outcomes_to = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_to; + memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); + } + uint8_t container_outcomes_lengthT = *(inbuffer + offset++); + if(container_outcomes_lengthT > container_outcomes_length) + this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); + offset += 3; + container_outcomes_length = container_outcomes_lengthT; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_st_container_outcomes; + memcpy(&length_st_container_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_container_outcomes-1]=0; + this->st_container_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_container_outcomes; + memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; + const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Bool.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Bool.h new file mode 100755 index 0000000..1ec6d07 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Bool.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Bool_h +#define _ROS_std_msgs_Bool_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Bool : public ros::Msg + { + public: + bool data; + + Bool(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Bool"; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Byte.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Byte.h new file mode 100755 index 0000000..cbb1bc2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Byte.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Byte_h +#define _ROS_std_msgs_Byte_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Byte : public ros::Msg + { + public: + int8_t data; + + Byte(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Byte"; }; + const char * getMD5(){ return "ad736a2e8818154c487bb80fe42ce43b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/ByteMultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/ByteMultiArray.h new file mode 100755 index 0000000..a41a450 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/ByteMultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_ByteMultiArray_h +#define _ROS_std_msgs_ByteMultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class ByteMultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + ByteMultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/ByteMultiArray"; }; + const char * getMD5(){ return "70ea476cbcfd65ac2f68f3cda1e891fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Char.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Char.h new file mode 100755 index 0000000..977cc8b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Char.h @@ -0,0 +1,44 @@ +#ifndef _ROS_std_msgs_Char_h +#define _ROS_std_msgs_Char_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Char : public ros::Msg + { + public: + uint8_t data; + + Char(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Char"; }; + const char * getMD5(){ return "1bf77f25acecdedba0e224b162199717"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/ColorRGBA.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/ColorRGBA.h new file mode 100755 index 0000000..d458c91 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/ColorRGBA.h @@ -0,0 +1,130 @@ +#ifndef _ROS_std_msgs_ColorRGBA_h +#define _ROS_std_msgs_ColorRGBA_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class ColorRGBA : public ros::Msg + { + public: + float r; + float g; + float b; + float a; + + ColorRGBA(): + r(0), + g(0), + b(0), + a(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.real = this->r; + *(outbuffer + offset + 0) = (u_r.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.real = this->g; + *(outbuffer + offset + 0) = (u_g.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_g.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_g.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_g.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->a); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.base = 0; + u_r.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r = u_r.real; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.base = 0; + u_g.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->g = u_g.real; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->a = u_a.real; + offset += sizeof(this->a); + return offset; + } + + const char * getType(){ return "std_msgs/ColorRGBA"; }; + const char * getMD5(){ return "a29a96539573343b1310c73607334b00"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Duration.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Duration.h new file mode 100755 index 0000000..883a752 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Duration.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Duration_h +#define _ROS_std_msgs_Duration_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace std_msgs +{ + + class Duration : public ros::Msg + { + public: + ros::Duration data; + + Duration(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Duration"; }; + const char * getMD5(){ return "3e286caf4241d664e55f3ad380e2ae46"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Empty.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Empty.h new file mode 100755 index 0000000..440e5ed --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Empty.h @@ -0,0 +1,38 @@ +#ifndef _ROS_std_msgs_Empty_h +#define _ROS_std_msgs_Empty_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Empty : public ros::Msg + { + public: + + Empty() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "std_msgs/Empty"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float32.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float32.h new file mode 100755 index 0000000..b324c1b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float32.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Float32_h +#define _ROS_std_msgs_Float32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float32 : public ros::Msg + { + public: + float data; + + Float32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Float32"; }; + const char * getMD5(){ return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float32MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float32MultiArray.h new file mode 100755 index 0000000..51f9406 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float32MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Float32MultiArray_h +#define _ROS_std_msgs_Float32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float32MultiArray"; }; + const char * getMD5(){ return "6a40e0ffa6a17a503ac3f8616991b1f6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float64.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float64.h new file mode 100755 index 0000000..3cc9fd0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float64.h @@ -0,0 +1,42 @@ +#ifndef _ROS_std_msgs_Float64_h +#define _ROS_std_msgs_Float64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float64 : public ros::Msg + { + public: + float data; + + Float64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->data)); + return offset; + } + + const char * getType(){ return "std_msgs/Float64"; }; + const char * getMD5(){ return "fdb28210bfa9d7c91146260178d9a584"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float64MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float64MultiArray.h new file mode 100755 index 0000000..ab740b6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Float64MultiArray.h @@ -0,0 +1,63 @@ +#ifndef _ROS_std_msgs_Float64MultiArray_h +#define _ROS_std_msgs_Float64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_data)); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float64MultiArray"; }; + const char * getMD5(){ return "4b7d974086d4060e7db4613a7e6c3ba4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Header.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Header.h new file mode 100755 index 0000000..2aa0f7f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Header.h @@ -0,0 +1,89 @@ +#ifndef _ROS_std_msgs_Header_h +#define _ROS_std_msgs_Header_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Header : public ros::Msg + { + public: + uint32_t seq; + ros::Time stamp; + const char* frame_id; + + Header(): + seq(0), + stamp(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq); + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->seq = ((uint32_t) (*(inbuffer + offset))); + this->seq |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->seq); + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + const char * getType(){ return "std_msgs/Header"; }; + const char * getMD5(){ return "2176decaecbce78abc3b96ef049fabed"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int16.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int16.h new file mode 100755 index 0000000..a83f7b2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int16.h @@ -0,0 +1,57 @@ +#ifndef _ROS_std_msgs_Int16_h +#define _ROS_std_msgs_Int16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int16 : public ros::Msg + { + public: + int16_t data; + + Int16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int16"; }; + const char * getMD5(){ return "8524586e34fbd7cb1c08c5f5f1ca0e57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int16MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int16MultiArray.h new file mode 100755 index 0000000..e70f4e2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int16MultiArray.h @@ -0,0 +1,78 @@ +#ifndef _ROS_std_msgs_Int16MultiArray_h +#define _ROS_std_msgs_Int16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int16_t st_data; + int16_t * data; + + Int16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int16MultiArray"; }; + const char * getMD5(){ return "d9338d7f523fcb692fae9d0a0e9f067c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int32.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int32.h new file mode 100755 index 0000000..a2a364f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int32.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Int32_h +#define _ROS_std_msgs_Int32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int32 : public ros::Msg + { + public: + int32_t data; + + Int32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int32"; }; + const char * getMD5(){ return "da5909fbe378aeaf85e547e830cc1bb7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int32MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int32MultiArray.h new file mode 100755 index 0000000..4df5ff5 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int32MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Int32MultiArray_h +#define _ROS_std_msgs_Int32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int32_t st_data; + int32_t * data; + + Int32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int32MultiArray"; }; + const char * getMD5(){ return "1d99f79f8b325b44fee908053e9c945b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int64.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int64.h new file mode 100755 index 0000000..4016081 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int64.h @@ -0,0 +1,69 @@ +#ifndef _ROS_std_msgs_Int64_h +#define _ROS_std_msgs_Int64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int64 : public ros::Msg + { + public: + int64_t data; + + Int64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_data.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_data.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_data.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_data.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int64"; }; + const char * getMD5(){ return "34add168574510e6e17f5d23ecc077ef"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int64MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int64MultiArray.h new file mode 100755 index 0000000..5733608 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int64MultiArray.h @@ -0,0 +1,90 @@ +#ifndef _ROS_std_msgs_Int64MultiArray_h +#define _ROS_std_msgs_Int64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int64_t st_data; + int64_t * data; + + Int64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int64MultiArray"; }; + const char * getMD5(){ return "54865aa6c65be0448113a2afc6a49270"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int8.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int8.h new file mode 100755 index 0000000..b02ef77 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int8.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Int8_h +#define _ROS_std_msgs_Int8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int8 : public ros::Msg + { + public: + int8_t data; + + Int8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int8"; }; + const char * getMD5(){ return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int8MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int8MultiArray.h new file mode 100755 index 0000000..7bf8c9b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Int8MultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_Int8MultiArray_h +#define _ROS_std_msgs_Int8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + Int8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int8MultiArray"; }; + const char * getMD5(){ return "d7c1af35a1b4781bbe79e03dd94b7c13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/MultiArrayDimension.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/MultiArrayDimension.h new file mode 100755 index 0000000..7cae4ba --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/MultiArrayDimension.h @@ -0,0 +1,78 @@ +#ifndef _ROS_std_msgs_MultiArrayDimension_h +#define _ROS_std_msgs_MultiArrayDimension_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class MultiArrayDimension : public ros::Msg + { + public: + const char* label; + uint32_t size; + uint32_t stride; + + MultiArrayDimension(): + label(""), + size(0), + stride(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_label = strlen(this->label); + memcpy(outbuffer + offset, &length_label, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + *(outbuffer + offset + 0) = (this->stride >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stride >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stride >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stride >> (8 * 3)) & 0xFF; + offset += sizeof(this->stride); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_label; + memcpy(&length_label, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + this->size = ((uint32_t) (*(inbuffer + offset))); + this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size); + this->stride = ((uint32_t) (*(inbuffer + offset))); + this->stride |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stride |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stride |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stride); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayDimension"; }; + const char * getMD5(){ return "4cd0c83a8683deae40ecdac60e53bfa8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/MultiArrayLayout.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/MultiArrayLayout.h new file mode 100755 index 0000000..a30ff41 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/MultiArrayLayout.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_MultiArrayLayout_h +#define _ROS_std_msgs_MultiArrayLayout_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayDimension.h" + +namespace std_msgs +{ + + class MultiArrayLayout : public ros::Msg + { + public: + uint8_t dim_length; + std_msgs::MultiArrayDimension st_dim; + std_msgs::MultiArrayDimension * dim; + uint32_t data_offset; + + MultiArrayLayout(): + dim_length(0), dim(NULL), + data_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = dim_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->dim[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->data_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t dim_lengthT = *(inbuffer + offset++); + if(dim_lengthT > dim_length) + this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); + offset += 3; + dim_length = dim_lengthT; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->st_dim.deserialize(inbuffer + offset); + memcpy( &(this->dim[i]), &(this->st_dim), sizeof(std_msgs::MultiArrayDimension)); + } + this->data_offset = ((uint32_t) (*(inbuffer + offset))); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_offset); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayLayout"; }; + const char * getMD5(){ return "0fed2a11c13e11c5571b4e2a995a91a3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/String.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/String.h new file mode 100755 index 0000000..f590500 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/String.h @@ -0,0 +1,54 @@ +#ifndef _ROS_std_msgs_String_h +#define _ROS_std_msgs_String_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class String : public ros::Msg + { + public: + const char* data; + + String(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "std_msgs/String"; }; + const char * getMD5(){ return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Time.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Time.h new file mode 100755 index 0000000..d87047b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/Time.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Time_h +#define _ROS_std_msgs_Time_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Time : public ros::Msg + { + public: + ros::Time data; + + Time(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Time"; }; + const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt16.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt16.h new file mode 100755 index 0000000..dd3c0cb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt16.h @@ -0,0 +1,46 @@ +#ifndef _ROS_std_msgs_UInt16_h +#define _ROS_std_msgs_UInt16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt16 : public ros::Msg + { + public: + uint16_t data; + + UInt16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint16_t) (*(inbuffer + offset))); + this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt16"; }; + const char * getMD5(){ return "1df79edf208b629fe6b81923a544552d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt16MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt16MultiArray.h new file mode 100755 index 0000000..28bc27d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt16MultiArray.h @@ -0,0 +1,67 @@ +#ifndef _ROS_std_msgs_UInt16MultiArray_h +#define _ROS_std_msgs_UInt16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint16_t st_data; + uint16_t * data; + + UInt16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint16_t*)realloc(this->data, data_lengthT * sizeof(uint16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint16_t) (*(inbuffer + offset))); + this->st_data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt16MultiArray"; }; + const char * getMD5(){ return "52f264f1c973c4b73790d384c6cb4484"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt32.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt32.h new file mode 100755 index 0000000..170208f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt32.h @@ -0,0 +1,50 @@ +#ifndef _ROS_std_msgs_UInt32_h +#define _ROS_std_msgs_UInt32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt32 : public ros::Msg + { + public: + uint32_t data; + + UInt32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint32_t) (*(inbuffer + offset))); + this->data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt32"; }; + const char * getMD5(){ return "304a39449588c7f8ce2df6e8001c5fce"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt32MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt32MultiArray.h new file mode 100755 index 0000000..8dd7e1b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt32MultiArray.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_UInt32MultiArray_h +#define _ROS_std_msgs_UInt32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint32_t st_data; + uint32_t * data; + + UInt32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint32_t) (*(inbuffer + offset))); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt32MultiArray"; }; + const char * getMD5(){ return "4d6a180abc9be191b96a7eda6c8a233d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt64.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt64.h new file mode 100755 index 0000000..d69b9fe --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt64.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_UInt64_h +#define _ROS_std_msgs_UInt64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt64 : public ros::Msg + { + public: + uint64_t data; + + UInt64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt64"; }; + const char * getMD5(){ return "1b2a79973e8bf53d7b53acb71299cb57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt64MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt64MultiArray.h new file mode 100755 index 0000000..5510abe --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt64MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_UInt64MultiArray_h +#define _ROS_std_msgs_UInt64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint64_t st_data; + uint64_t * data; + + UInt64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint64_t*)realloc(this->data, data_lengthT * sizeof(uint64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt64MultiArray"; }; + const char * getMD5(){ return "6088f127afb1d6c72927aa1247e945af"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt8.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt8.h new file mode 100755 index 0000000..15dbb6f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt8.h @@ -0,0 +1,44 @@ +#ifndef _ROS_std_msgs_UInt8_h +#define _ROS_std_msgs_UInt8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt8 : public ros::Msg + { + public: + uint8_t data; + + UInt8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt8"; }; + const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt8MultiArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt8MultiArray.h new file mode 100755 index 0000000..8a2a616 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_msgs/UInt8MultiArray.h @@ -0,0 +1,65 @@ +#ifndef _ROS_std_msgs_UInt8MultiArray_h +#define _ROS_std_msgs_UInt8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + UInt8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt8MultiArray"; }; + const char * getMD5(){ return "82373f1612381bb6ee473b5cd6f5d89c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/Empty.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/Empty.h new file mode 100755 index 0000000..b040dd2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char EMPTY[] = "std_srvs/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/SetBool.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/SetBool.h new file mode 100755 index 0000000..796485b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/SetBool.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_SetBool_h +#define _ROS_SERVICE_SetBool_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char SETBOOL[] = "std_srvs/SetBool"; + + class SetBoolRequest : public ros::Msg + { + public: + bool data; + + SetBoolRequest(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return SETBOOL; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + + class SetBoolResponse : public ros::Msg + { + public: + bool success; + const char* message; + + SetBoolResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return SETBOOL; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class SetBool { + public: + typedef SetBoolRequest Request; + typedef SetBoolResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/Trigger.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/Trigger.h new file mode 100755 index 0000000..958d2b8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/std_srvs/Trigger.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_Trigger_h +#define _ROS_SERVICE_Trigger_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char TRIGGER[] = "std_srvs/Trigger"; + + class TriggerRequest : public ros::Msg + { + public: + + TriggerRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TriggerResponse : public ros::Msg + { + public: + bool success; + const char* message; + + TriggerResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class Trigger { + public: + typedef TriggerRequest Request; + typedef TriggerResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/stereo_msgs/DisparityImage.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/stereo_msgs/DisparityImage.h new file mode 100755 index 0000000..53d557b --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/stereo_msgs/DisparityImage.h @@ -0,0 +1,168 @@ +#ifndef _ROS_stereo_msgs_DisparityImage_h +#define _ROS_stereo_msgs_DisparityImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace stereo_msgs +{ + + class DisparityImage : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::Image image; + float f; + float T; + sensor_msgs::RegionOfInterest valid_window; + float min_disparity; + float max_disparity; + float delta_d; + + DisparityImage(): + header(), + image(), + f(0), + T(0), + valid_window(), + min_disparity(0), + max_disparity(0), + delta_d(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.real = this->f; + *(outbuffer + offset + 0) = (u_f.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_f.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_f.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_f.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.real = this->T; + *(outbuffer + offset + 0) = (u_T.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_T.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_T.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_T.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->T); + offset += this->valid_window.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.real = this->min_disparity; + *(outbuffer + offset + 0) = (u_min_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.real = this->max_disparity; + *(outbuffer + offset + 0) = (u_max_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.real = this->delta_d; + *(outbuffer + offset + 0) = (u_delta_d.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delta_d.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delta_d.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delta_d.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delta_d); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.base = 0; + u_f.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->f = u_f.real; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.base = 0; + u_T.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->T = u_T.real; + offset += sizeof(this->T); + offset += this->valid_window.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.base = 0; + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_disparity = u_min_disparity.real; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.base = 0; + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_disparity = u_max_disparity.real; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.base = 0; + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delta_d = u_delta_d.real; + offset += sizeof(this->delta_d); + return offset; + } + + const char * getType(){ return "stereo_msgs/DisparityImage"; }; + const char * getMD5(){ return "04a177815f75271039fa21f16acad8c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/array_test/array_test.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/array_test/array_test.pde new file mode 100755 index 0000000..8aa72de --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/array_test/array_test.pde @@ -0,0 +1,49 @@ +/* + * rosserial::geometry_msgs::PoseArray Test + * Sums an array, publishes sum + */ + +#include +#include +#include + + +ros::NodeHandle nh; + + +bool set_; + + +geometry_msgs::Pose sum_msg; +ros::Publisher p("sum", &sum_msg); + +void messageCb(const geometry_msgs::PoseArray& msg){ + sum_msg.position.x = 0; + sum_msg.position.y = 0; + sum_msg.position.z = 0; + for(int i = 0; i < msg.poses_length; i++) + { + sum_msg.position.x += msg.poses[i].position.x; + sum_msg.position.y += msg.poses[i].position.y; + sum_msg.position.z += msg.poses[i].position.z; + } + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber s("poses",messageCb); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(s); + nh.advertise(p); +} + +void loop() +{ + p.publish(&sum_msg); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/float64_test/float64_test.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/float64_test/float64_test.pde new file mode 100755 index 0000000..41a6f4a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/float64_test/float64_test.pde @@ -0,0 +1,38 @@ +/* + * rosserial::std_msgs::Float64 Test + * Receives a Float64 input, subtracts 1.0, and publishes it + */ + +#include +#include + + +ros::NodeHandle nh; + +float x; + +void messageCb( const std_msgs::Float64& msg){ + x = msg.data - 1.0; + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +std_msgs::Float64 test; +ros::Subscriber s("your_topic", &messageCb); +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); + nh.subscribe(s); +} + +void loop() +{ + test.data = x; + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/time_test/time_test.pde b/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/time_test/time_test.pde new file mode 100755 index 0000000..c5fa739 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tests/time_test/time_test.pde @@ -0,0 +1,30 @@ +/* + * rosserial::std_msgs::Time Test + * Publishes current time + */ + +#include +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Time test; +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); +} + +void loop() +{ + test.data = nh.now(); + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/FrameGraph.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/FrameGraph.h new file mode 100755 index 0000000..b7d2f31 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/FrameGraph.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf +{ + +static const char FRAMEGRAPH[] = "tf/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* dot_graph; + + FrameGraphResponse(): + dot_graph("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_dot_graph = strlen(this->dot_graph); + memcpy(outbuffer + offset, &length_dot_graph, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->dot_graph, length_dot_graph); + offset += length_dot_graph; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_dot_graph; + memcpy(&length_dot_graph, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dot_graph; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dot_graph-1]=0; + this->dot_graph = (char *)(inbuffer + offset-1); + offset += length_dot_graph; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/tf.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/tf.h new file mode 100755 index 0000000..a2888e3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/tf.h @@ -0,0 +1,56 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TF_H_ +#define ROS_TF_H_ + +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + static inline geometry_msgs::Quaternion createQuaternionFromYaw(double yaw) + { + geometry_msgs::Quaternion q; + q.x = 0; + q.y = 0; + q.z = sin(yaw * 0.5); + q.w = cos(yaw * 0.5); + return q; + } + +} + +#endif + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/tfMessage.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/tfMessage.h new file mode 100755 index 0000000..e8b3eb7 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/tfMessage.h @@ -0,0 +1,59 @@ +#ifndef _ROS_tf_tfMessage_h +#define _ROS_tf_tfMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + class tfMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + tfMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf/tfMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/transform_broadcaster.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/transform_broadcaster.h new file mode 100755 index 0000000..817eaba --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf/transform_broadcaster.h @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TRANSFORM_BROADCASTER_H_ +#define ROS_TRANSFORM_BROADCASTER_H_ + +#include "tfMessage.h" + +namespace tf +{ + + class TransformBroadcaster + { + public: + TransformBroadcaster() : publisher_("/tf", &internal_msg) {} + + void init(ros::NodeHandle &nh) + { + nh.advertise(publisher_); + } + + void sendTransform(geometry_msgs::TransformStamped &transform) + { + internal_msg.transforms_length = 1; + internal_msg.transforms = &transform; + publisher_.publish(&internal_msg); + } + + private: + tf::tfMessage internal_msg; + ros::Publisher publisher_; + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/FrameGraph.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/FrameGraph.h new file mode 100755 index 0000000..a703dd2 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/FrameGraph.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + +static const char FRAMEGRAPH[] = "tf2_msgs/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* frame_yaml; + + FrameGraphResponse(): + frame_yaml("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_yaml = strlen(this->frame_yaml); + memcpy(outbuffer + offset, &length_frame_yaml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_yaml, length_frame_yaml); + offset += length_frame_yaml; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_yaml; + memcpy(&length_frame_yaml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_yaml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_yaml-1]=0; + this->frame_yaml = (char *)(inbuffer + offset-1); + offset += length_frame_yaml; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "437ea58e9463815a0d511c7326b686b0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h new file mode 100755 index 0000000..2a0178f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformAction_h +#define _ROS_tf2_msgs_LookupTransformAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "tf2_msgs/LookupTransformActionGoal.h" +#include "tf2_msgs/LookupTransformActionResult.h" +#include "tf2_msgs/LookupTransformActionFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformAction : public ros::Msg + { + public: + tf2_msgs::LookupTransformActionGoal action_goal; + tf2_msgs::LookupTransformActionResult action_result; + tf2_msgs::LookupTransformActionFeedback action_feedback; + + LookupTransformAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformAction"; }; + const char * getMD5(){ return "7ee01ba91a56c2245c610992dbaa3c37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h new file mode 100755 index 0000000..f0de7af --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionFeedback_h +#define _ROS_tf2_msgs_LookupTransformActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformFeedback feedback; + + LookupTransformActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h new file mode 100755 index 0000000..d668cd9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionGoal_h +#define _ROS_tf2_msgs_LookupTransformActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "tf2_msgs/LookupTransformGoal.h" + +namespace tf2_msgs +{ + + class LookupTransformActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + tf2_msgs::LookupTransformGoal goal; + + LookupTransformActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionGoal"; }; + const char * getMD5(){ return "f2e7bcdb75c847978d0351a13e699da5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h new file mode 100755 index 0000000..99298ff --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionResult_h +#define _ROS_tf2_msgs_LookupTransformActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformResult.h" + +namespace tf2_msgs +{ + + class LookupTransformActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformResult result; + + LookupTransformActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionResult"; }; + const char * getMD5(){ return "ac26ce75a41384fa8bb4dc10f491ab90"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h new file mode 100755 index 0000000..6be0748 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_tf2_msgs_LookupTransformFeedback_h +#define _ROS_tf2_msgs_LookupTransformFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class LookupTransformFeedback : public ros::Msg + { + public: + + LookupTransformFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h new file mode 100755 index 0000000..f498e45 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h @@ -0,0 +1,171 @@ +#ifndef _ROS_tf2_msgs_LookupTransformGoal_h +#define _ROS_tf2_msgs_LookupTransformGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace tf2_msgs +{ + + class LookupTransformGoal : public ros::Msg + { + public: + const char* target_frame; + const char* source_frame; + ros::Time source_time; + ros::Duration timeout; + ros::Time target_time; + const char* fixed_frame; + bool advanced; + + LookupTransformGoal(): + target_frame(""), + source_frame(""), + source_time(), + timeout(), + target_time(), + fixed_frame(""), + advanced(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_target_frame = strlen(this->target_frame); + memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + uint32_t length_source_frame = strlen(this->source_frame); + memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source_frame, length_source_frame); + offset += length_source_frame; + *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.sec); + *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.nsec); + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->target_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.sec); + *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame = strlen(this->fixed_frame); + memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.real = this->advanced; + *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->advanced); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_target_frame; + memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + uint32_t length_source_frame; + memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source_frame-1]=0; + this->source_frame = (char *)(inbuffer + offset-1); + offset += length_source_frame; + this->source_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.sec); + this->source_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.nsec); + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->target_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.sec); + this->target_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame; + memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_fixed_frame-1]=0; + this->fixed_frame = (char *)(inbuffer + offset-1); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.base = 0; + u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->advanced = u_advanced.real; + offset += sizeof(this->advanced); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformGoal"; }; + const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h new file mode 100755 index 0000000..6dbf6f4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h @@ -0,0 +1,48 @@ +#ifndef _ROS_tf2_msgs_LookupTransformResult_h +#define _ROS_tf2_msgs_LookupTransformResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" +#include "tf2_msgs/TF2Error.h" + +namespace tf2_msgs +{ + + class LookupTransformResult : public ros::Msg + { + public: + geometry_msgs::TransformStamped transform; + tf2_msgs::TF2Error error; + + LookupTransformResult(): + transform(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->transform.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->transform.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformResult"; }; + const char * getMD5(){ return "3fe5db6a19ca9cfb675418c5ad875c36"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/TF2Error.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/TF2Error.h new file mode 100755 index 0000000..0fc1a7f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/TF2Error.h @@ -0,0 +1,67 @@ +#ifndef _ROS_tf2_msgs_TF2Error_h +#define _ROS_tf2_msgs_TF2Error_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class TF2Error : public ros::Msg + { + public: + uint8_t error; + const char* error_string; + enum { NO_ERROR = 0 }; + enum { LOOKUP_ERROR = 1 }; + enum { CONNECTIVITY_ERROR = 2 }; + enum { EXTRAPOLATION_ERROR = 3 }; + enum { INVALID_ARGUMENT_ERROR = 4 }; + enum { TIMEOUT_ERROR = 5 }; + enum { TRANSFORM_ERROR = 6 }; + + TF2Error(): + error(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "tf2_msgs/TF2Error"; }; + const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/TFMessage.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/TFMessage.h new file mode 100755 index 0000000..d358efa --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/tf2_msgs/TFMessage.h @@ -0,0 +1,59 @@ +#ifndef _ROS_tf2_msgs_TFMessage_h +#define _ROS_tf2_msgs_TFMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_msgs +{ + + class TFMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + TFMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf2_msgs/TFMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/theora_image_transport/Packet.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/theora_image_transport/Packet.h new file mode 100755 index 0000000..85127b9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/theora_image_transport/Packet.h @@ -0,0 +1,173 @@ +#ifndef _ROS_theora_image_transport_Packet_h +#define _ROS_theora_image_transport_Packet_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace theora_image_transport +{ + + class Packet : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + int32_t b_o_s; + int32_t e_o_s; + int64_t granulepos; + int64_t packetno; + + Packet(): + header(), + data_length(0), data(NULL), + b_o_s(0), + e_o_s(0), + granulepos(0), + packetno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.real = this->b_o_s; + *(outbuffer + offset + 0) = (u_b_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.real = this->e_o_s; + *(outbuffer + offset + 0) = (u_e_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_e_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_e_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_e_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.real = this->granulepos; + *(outbuffer + offset + 0) = (u_granulepos.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_granulepos.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_granulepos.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_granulepos.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_granulepos.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_granulepos.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_granulepos.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_granulepos.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.real = this->packetno; + *(outbuffer + offset + 0) = (u_packetno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_packetno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_packetno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_packetno.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_packetno.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_packetno.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_packetno.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_packetno.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->packetno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.base = 0; + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b_o_s = u_b_o_s.real; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.base = 0; + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->e_o_s = u_e_o_s.real; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.base = 0; + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->granulepos = u_granulepos.real; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.base = 0; + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->packetno = u_packetno.real; + offset += sizeof(this->packetno); + return offset; + } + + const char * getType(){ return "theora_image_transport/Packet"; }; + const char * getMD5(){ return "33ac4e14a7cff32e7e0d65f18bb410f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/time.cpp b/case_study/arduino_lab/group_21/original/lib/ros_lib/time.cpp new file mode 100755 index 0000000..9341196 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/time.cpp @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ros/time.h" + +namespace ros +{ + void normalizeSecNSec(uint32_t& sec, uint32_t& nsec){ + uint32_t nsec_part= nsec % 1000000000UL; + uint32_t sec_part = nsec / 1000000000UL; + sec += sec_part; + nsec = nsec_part; + } + + Time& Time::fromNSec(int32_t t) + { + sec = t / 1000000000; + nsec = t % 1000000000; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator +=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator -=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } +} diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxAdd.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxAdd.h new file mode 100755 index 0000000..269912e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxAdd.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_DemuxAdd_h +#define _ROS_SERVICE_DemuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXADD[] = "topic_tools/DemuxAdd"; + + class DemuxAddRequest : public ros::Msg + { + public: + const char* topic; + + DemuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxAddResponse : public ros::Msg + { + public: + + DemuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxAdd { + public: + typedef DemuxAddRequest Request; + typedef DemuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxDelete.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxDelete.h new file mode 100755 index 0000000..af15d3a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxDelete.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_DemuxDelete_h +#define _ROS_SERVICE_DemuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXDELETE[] = "topic_tools/DemuxDelete"; + + class DemuxDeleteRequest : public ros::Msg + { + public: + const char* topic; + + DemuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxDeleteResponse : public ros::Msg + { + public: + + DemuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxDelete { + public: + typedef DemuxDeleteRequest Request; + typedef DemuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxList.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxList.h new file mode 100755 index 0000000..5d0beb9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_DemuxList_h +#define _ROS_SERVICE_DemuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXLIST[] = "topic_tools/DemuxList"; + + class DemuxListRequest : public ros::Msg + { + public: + + DemuxListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + DemuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class DemuxList { + public: + typedef DemuxListRequest Request; + typedef DemuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxSelect.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxSelect.h new file mode 100755 index 0000000..449a387 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/DemuxSelect.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_DemuxSelect_h +#define _ROS_SERVICE_DemuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXSELECT[] = "topic_tools/DemuxSelect"; + + class DemuxSelectRequest : public ros::Msg + { + public: + const char* topic; + + DemuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + DemuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class DemuxSelect { + public: + typedef DemuxSelectRequest Request; + typedef DemuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxAdd.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxAdd.h new file mode 100755 index 0000000..92ffe35 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxAdd.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_MuxAdd_h +#define _ROS_SERVICE_MuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXADD[] = "topic_tools/MuxAdd"; + + class MuxAddRequest : public ros::Msg + { + public: + const char* topic; + + MuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxAddResponse : public ros::Msg + { + public: + + MuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxAdd { + public: + typedef MuxAddRequest Request; + typedef MuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxDelete.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxDelete.h new file mode 100755 index 0000000..b624e7a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxDelete.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_MuxDelete_h +#define _ROS_SERVICE_MuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXDELETE[] = "topic_tools/MuxDelete"; + + class MuxDeleteRequest : public ros::Msg + { + public: + const char* topic; + + MuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxDeleteResponse : public ros::Msg + { + public: + + MuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxDelete { + public: + typedef MuxDeleteRequest Request; + typedef MuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxList.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxList.h new file mode 100755 index 0000000..011c179 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_MuxList_h +#define _ROS_SERVICE_MuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXLIST[] = "topic_tools/MuxList"; + + class MuxListRequest : public ros::Msg + { + public: + + MuxListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + MuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class MuxList { + public: + typedef MuxListRequest Request; + typedef MuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxSelect.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxSelect.h new file mode 100755 index 0000000..b883b8e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/topic_tools/MuxSelect.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_MuxSelect_h +#define _ROS_SERVICE_MuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXSELECT[] = "topic_tools/MuxSelect"; + + class MuxSelectRequest : public ros::Msg + { + public: + const char* topic; + + MuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + MuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class MuxSelect { + public: + typedef MuxSelectRequest Request; + typedef MuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h new file mode 100755 index 0000000..13a4f3c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectory_h +#define _ROS_trajectory_msgs_JointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class JointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::JointTrajectoryPoint st_points; + trajectory_msgs::JointTrajectoryPoint * points; + + JointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::JointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectory"; }; + const char * getMD5(){ return "65b4f94a94d1ed67169da35a02f33d3f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h new file mode 100755 index 0000000..20b40e4 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h @@ -0,0 +1,141 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectoryPoint_h +#define _ROS_trajectory_msgs_JointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class JointTrajectoryPoint : public ros::Msg + { + public: + uint8_t positions_length; + float st_positions; + float * positions; + uint8_t velocities_length; + float st_velocities; + float * velocities; + uint8_t accelerations_length; + float st_accelerations; + float * accelerations; + uint8_t effort_length; + float st_effort; + float * effort; + ros::Duration time_from_start; + + JointTrajectoryPoint(): + positions_length(0), positions(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + effort_length(0), effort(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->positions[i]); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accelerations[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t positions_lengthT = *(inbuffer + offset++); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + offset += 3; + positions_length = positions_lengthT; + for( uint8_t i = 0; i < positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_positions)); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_accelerations)); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectoryPoint"; }; + const char * getMD5(){ return "f3cd1e1c4d320c79d6985c904ae5dcd3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h new file mode 100755 index 0000000..dcecf64 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectory_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/MultiDOFJointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::MultiDOFJointTrajectoryPoint st_points; + trajectory_msgs::MultiDOFJointTrajectoryPoint * points; + + MultiDOFJointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::MultiDOFJointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectory"; }; + const char * getMD5(){ return "ef145a45a5f47b77b7f5cdde4b16c942"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h new file mode 100755 index 0000000..d665acd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h @@ -0,0 +1,123 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectoryPoint : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t velocities_length; + geometry_msgs::Twist st_velocities; + geometry_msgs::Twist * velocities; + uint8_t accelerations_length; + geometry_msgs::Twist st_accelerations; + geometry_msgs::Twist * accelerations; + ros::Duration time_from_start; + + MultiDOFJointTrajectoryPoint(): + transforms_length(0), transforms(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->velocities[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->accelerations[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (geometry_msgs::Twist*)realloc(this->velocities, velocities_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->st_velocities.deserialize(inbuffer + offset); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(geometry_msgs::Twist)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (geometry_msgs::Twist*)realloc(this->accelerations, accelerations_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->st_accelerations.deserialize(inbuffer + offset); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(geometry_msgs::Twist)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectoryPoint"; }; + const char * getMD5(){ return "3ebe08d1abd5b65862d50e09430db776"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeAction.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeAction.h new file mode 100755 index 0000000..76a28dd --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeAction_h +#define _ROS_turtle_actionlib_ShapeAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "turtle_actionlib/ShapeActionGoal.h" +#include "turtle_actionlib/ShapeActionResult.h" +#include "turtle_actionlib/ShapeActionFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeAction : public ros::Msg + { + public: + turtle_actionlib::ShapeActionGoal action_goal; + turtle_actionlib::ShapeActionResult action_result; + turtle_actionlib::ShapeActionFeedback action_feedback; + + ShapeAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeAction"; }; + const char * getMD5(){ return "d73b17d6237a925511f5d7727a1dc903"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h new file mode 100755 index 0000000..f6186e3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionFeedback_h +#define _ROS_turtle_actionlib_ShapeActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeFeedback feedback; + + ShapeActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h new file mode 100755 index 0000000..1d205cc --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionGoal_h +#define _ROS_turtle_actionlib_ShapeActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "turtle_actionlib/ShapeGoal.h" + +namespace turtle_actionlib +{ + + class ShapeActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + turtle_actionlib::ShapeGoal goal; + + ShapeActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionGoal"; }; + const char * getMD5(){ return "dbfccd187f2ec9c593916447ffd6cc77"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h new file mode 100755 index 0000000..e60375a --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionResult_h +#define _ROS_turtle_actionlib_ShapeActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeResult.h" + +namespace turtle_actionlib +{ + + class ShapeActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeResult result; + + ShapeActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionResult"; }; + const char * getMD5(){ return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h new file mode 100755 index 0000000..6c00c07 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_turtle_actionlib_ShapeFeedback_h +#define _ROS_turtle_actionlib_ShapeFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeFeedback : public ros::Msg + { + public: + + ShapeFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h new file mode 100755 index 0000000..0e1f10d --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_ShapeGoal_h +#define _ROS_turtle_actionlib_ShapeGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeGoal : public ros::Msg + { + public: + int32_t edges; + float radius; + + ShapeGoal(): + edges(0), + radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.real = this->edges; + *(outbuffer + offset + 0) = (u_edges.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_edges.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_edges.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_edges.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.real = this->radius; + *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.base = 0; + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->edges = u_edges.real; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.base = 0; + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->radius = u_radius.real; + offset += sizeof(this->radius); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeGoal"; }; + const char * getMD5(){ return "3b9202ab7292cebe5a95ab2bf6b9c091"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeResult.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeResult.h new file mode 100755 index 0000000..164f65c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/ShapeResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_ShapeResult_h +#define _ROS_turtle_actionlib_ShapeResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeResult : public ros::Msg + { + public: + float interior_angle; + float apothem; + + ShapeResult(): + interior_angle(0), + apothem(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.real = this->interior_angle; + *(outbuffer + offset + 0) = (u_interior_angle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_interior_angle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_interior_angle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_interior_angle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.real = this->apothem; + *(outbuffer + offset + 0) = (u_apothem.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_apothem.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_apothem.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_apothem.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->apothem); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.base = 0; + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->interior_angle = u_interior_angle.real; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.base = 0; + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->apothem = u_apothem.real; + offset += sizeof(this->apothem); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeResult"; }; + const char * getMD5(){ return "b06c6e2225f820dbc644270387cd1a7c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/Velocity.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/Velocity.h new file mode 100755 index 0000000..5105eb3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtle_actionlib/Velocity.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_Velocity_h +#define _ROS_turtle_actionlib_Velocity_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class Velocity : public ros::Msg + { + public: + float linear; + float angular; + + Velocity(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return "turtle_actionlib/Velocity"; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Color.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Color.h new file mode 100755 index 0000000..90ed1fb --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Color.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtlesim_Color_h +#define _ROS_turtlesim_Color_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Color : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + + Color(): + r(0), + g(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "turtlesim/Color"; }; + const char * getMD5(){ return "353891e354491c51aabe32df673fb446"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Kill.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Kill.h new file mode 100755 index 0000000..c7011bf --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Kill.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_Kill_h +#define _ROS_SERVICE_Kill_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char KILL[] = "turtlesim/Kill"; + + class KillRequest : public ros::Msg + { + public: + const char* name; + + KillRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class KillResponse : public ros::Msg + { + public: + + KillResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Kill { + public: + typedef KillRequest Request; + typedef KillResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Pose.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Pose.h new file mode 100755 index 0000000..a0ab8d8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Pose.h @@ -0,0 +1,153 @@ +#ifndef _ROS_turtlesim_Pose_h +#define _ROS_turtlesim_Pose_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Pose : public ros::Msg + { + public: + float x; + float y; + float theta; + float linear_velocity; + float angular_velocity; + + Pose(): + x(0), + y(0), + theta(0), + linear_velocity(0), + angular_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.real = this->linear_velocity; + *(outbuffer + offset + 0) = (u_linear_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.real = this->angular_velocity; + *(outbuffer + offset + 0) = (u_angular_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.base = 0; + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear_velocity = u_linear_velocity.real; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.base = 0; + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular_velocity = u_angular_velocity.real; + offset += sizeof(this->angular_velocity); + return offset; + } + + const char * getType(){ return "turtlesim/Pose"; }; + const char * getMD5(){ return "863b248d5016ca62ea2e895ae5265cf9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/SetPen.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/SetPen.h new file mode 100755 index 0000000..0759f05 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/SetPen.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetPen_h +#define _ROS_SERVICE_SetPen_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SETPEN[] = "turtlesim/SetPen"; + + class SetPenRequest : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t width; + uint8_t off; + + SetPenRequest(): + r(0), + g(0), + b(0), + width(0), + off(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->off >> (8 * 0)) & 0xFF; + offset += sizeof(this->off); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + this->width = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->width); + this->off = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->off); + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "9f452acce566bf0c0954594f69a8e41b"; }; + + }; + + class SetPenResponse : public ros::Msg + { + public: + + SetPenResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPen { + public: + typedef SetPenRequest Request; + typedef SetPenResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Spawn.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Spawn.h new file mode 100755 index 0000000..416fa95 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/Spawn.h @@ -0,0 +1,171 @@ +#ifndef _ROS_SERVICE_Spawn_h +#define _ROS_SERVICE_Spawn_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SPAWN[] = "turtlesim/Spawn"; + + class SpawnRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + const char* name; + + SpawnRequest(): + x(0), + y(0), + theta(0), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "57f001c49ab7b11d699f8606c1f4f7ff"; }; + + }; + + class SpawnResponse : public ros::Msg + { + public: + const char* name; + + SpawnResponse(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class Spawn { + public: + typedef SpawnRequest Request; + typedef SpawnResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/TeleportAbsolute.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/TeleportAbsolute.h new file mode 100755 index 0000000..a75f19e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/TeleportAbsolute.h @@ -0,0 +1,139 @@ +#ifndef _ROS_SERVICE_TeleportAbsolute_h +#define _ROS_SERVICE_TeleportAbsolute_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; + + class TeleportAbsoluteRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + + TeleportAbsoluteRequest(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "a130bc60ee6513855dc62ea83fcc5b20"; }; + + }; + + class TeleportAbsoluteResponse : public ros::Msg + { + public: + + TeleportAbsoluteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportAbsolute { + public: + typedef TeleportAbsoluteRequest Request; + typedef TeleportAbsoluteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/TeleportRelative.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/TeleportRelative.h new file mode 100755 index 0000000..7df40d9 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/turtlesim/TeleportRelative.h @@ -0,0 +1,116 @@ +#ifndef _ROS_SERVICE_TeleportRelative_h +#define _ROS_SERVICE_TeleportRelative_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTRELATIVE[] = "turtlesim/TeleportRelative"; + + class TeleportRelativeRequest : public ros::Msg + { + public: + float linear; + float angular; + + TeleportRelativeRequest(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + + class TeleportRelativeResponse : public ros::Msg + { + public: + + TeleportRelativeResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportRelative { + public: + typedef TeleportRelativeRequest Request; + typedef TeleportRelativeResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/ImageMarker.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/ImageMarker.h new file mode 100755 index 0000000..008ee8e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/ImageMarker.h @@ -0,0 +1,241 @@ +#ifndef _ROS_visualization_msgs_ImageMarker_h +#define _ROS_visualization_msgs_ImageMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace visualization_msgs +{ + + class ImageMarker : public ros::Msg + { + public: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Point position; + float scale; + std_msgs::ColorRGBA outline_color; + uint8_t filled; + std_msgs::ColorRGBA fill_color; + ros::Duration lifetime; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t outline_colors_length; + std_msgs::ColorRGBA st_outline_colors; + std_msgs::ColorRGBA * outline_colors; + enum { CIRCLE = 0 }; + enum { LINE_STRIP = 1 }; + enum { LINE_LIST = 2 }; + enum { POLYGON = 3 }; + enum { POINTS = 4 }; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + + ImageMarker(): + header(), + ns(""), + id(0), + type(0), + action(0), + position(), + scale(0), + outline_color(), + filled(0), + fill_color(), + lifetime(), + points_length(0), points(NULL), + outline_colors_length(0), outline_colors(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->position.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + offset += this->outline_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->filled >> (8 * 0)) & 0xFF; + offset += sizeof(this->filled); + offset += this->fill_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = outline_colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->position.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + offset += this->outline_color.deserialize(inbuffer + offset); + this->filled = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->filled); + offset += this->fill_color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t outline_colors_lengthT = *(inbuffer + offset++); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + outline_colors_length = outline_colors_lengthT; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->st_outline_colors.deserialize(inbuffer + offset); + memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/ImageMarker"; }; + const char * getMD5(){ return "1de93c67ec8858b831025a08fbf1b35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h new file mode 100755 index 0000000..97f9510 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h @@ -0,0 +1,145 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarker_h +#define _ROS_visualization_msgs_InteractiveMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "visualization_msgs/MenuEntry.h" +#include "visualization_msgs/InteractiveMarkerControl.h" + +namespace visualization_msgs +{ + + class InteractiveMarker : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + const char* description; + float scale; + uint8_t menu_entries_length; + visualization_msgs::MenuEntry st_menu_entries; + visualization_msgs::MenuEntry * menu_entries; + uint8_t controls_length; + visualization_msgs::InteractiveMarkerControl st_controls; + visualization_msgs::InteractiveMarkerControl * controls; + + InteractiveMarker(): + header(), + pose(), + name(""), + description(""), + scale(0), + menu_entries_length(0), menu_entries(NULL), + controls_length(0), controls(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + *(outbuffer + offset++) = menu_entries_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->menu_entries[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = controls_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->controls[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + uint8_t menu_entries_lengthT = *(inbuffer + offset++); + if(menu_entries_lengthT > menu_entries_length) + this->menu_entries = (visualization_msgs::MenuEntry*)realloc(this->menu_entries, menu_entries_lengthT * sizeof(visualization_msgs::MenuEntry)); + offset += 3; + menu_entries_length = menu_entries_lengthT; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->st_menu_entries.deserialize(inbuffer + offset); + memcpy( &(this->menu_entries[i]), &(this->st_menu_entries), sizeof(visualization_msgs::MenuEntry)); + } + uint8_t controls_lengthT = *(inbuffer + offset++); + if(controls_lengthT > controls_length) + this->controls = (visualization_msgs::InteractiveMarkerControl*)realloc(this->controls, controls_lengthT * sizeof(visualization_msgs::InteractiveMarkerControl)); + offset += 3; + controls_length = controls_lengthT; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->st_controls.deserialize(inbuffer + offset); + memcpy( &(this->controls[i]), &(this->st_controls), sizeof(visualization_msgs::InteractiveMarkerControl)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarker"; }; + const char * getMD5(){ return "311bd5f6cd6a20820ac0ba84315f4e22"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h new file mode 100755 index 0000000..1c2cef0 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h @@ -0,0 +1,155 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerControl_h +#define _ROS_visualization_msgs_InteractiveMarkerControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Quaternion.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerControl : public ros::Msg + { + public: + const char* name; + geometry_msgs::Quaternion orientation; + uint8_t orientation_mode; + uint8_t interaction_mode; + bool always_visible; + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + bool independent_marker_orientation; + const char* description; + enum { INHERIT = 0 }; + enum { FIXED = 1 }; + enum { VIEW_FACING = 2 }; + enum { NONE = 0 }; + enum { MENU = 1 }; + enum { BUTTON = 2 }; + enum { MOVE_AXIS = 3 }; + enum { MOVE_PLANE = 4 }; + enum { ROTATE_AXIS = 5 }; + enum { MOVE_ROTATE = 6 }; + enum { MOVE_3D = 7 }; + enum { ROTATE_3D = 8 }; + enum { MOVE_ROTATE_3D = 9 }; + + InteractiveMarkerControl(): + name(""), + orientation(), + orientation_mode(0), + interaction_mode(0), + always_visible(0), + markers_length(0), markers(NULL), + independent_marker_orientation(0), + description("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += this->orientation.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->orientation_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->orientation_mode); + *(outbuffer + offset + 0) = (this->interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.real = this->always_visible; + *(outbuffer + offset + 0) = (u_always_visible.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->always_visible); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.real = this->independent_marker_orientation; + *(outbuffer + offset + 0) = (u_independent_marker_orientation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += this->orientation.deserialize(inbuffer + offset); + this->orientation_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->orientation_mode); + this->interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.base = 0; + u_always_visible.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->always_visible = u_always_visible.real; + offset += sizeof(this->always_visible); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.base = 0; + u_independent_marker_orientation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->independent_marker_orientation = u_independent_marker_orientation.real; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerControl"; }; + const char * getMD5(){ return "e3a939c98cdd4f709d8e1dec2a9c3f37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h new file mode 100755 index 0000000..7cdd2c3 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h @@ -0,0 +1,142 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerFeedback_h +#define _ROS_visualization_msgs_InteractiveMarkerFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerFeedback : public ros::Msg + { + public: + std_msgs::Header header; + const char* client_id; + const char* marker_name; + const char* control_name; + uint8_t event_type; + geometry_msgs::Pose pose; + uint32_t menu_entry_id; + geometry_msgs::Point mouse_point; + bool mouse_point_valid; + enum { KEEP_ALIVE = 0 }; + enum { POSE_UPDATE = 1 }; + enum { MENU_SELECT = 2 }; + enum { BUTTON_CLICK = 3 }; + enum { MOUSE_DOWN = 4 }; + enum { MOUSE_UP = 5 }; + + InteractiveMarkerFeedback(): + header(), + client_id(""), + marker_name(""), + control_name(""), + event_type(0), + pose(), + menu_entry_id(0), + mouse_point(), + mouse_point_valid(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_client_id = strlen(this->client_id); + memcpy(outbuffer + offset, &length_client_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->client_id, length_client_id); + offset += length_client_id; + uint32_t length_marker_name = strlen(this->marker_name); + memcpy(outbuffer + offset, &length_marker_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + uint32_t length_control_name = strlen(this->control_name); + memcpy(outbuffer + offset, &length_control_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->control_name, length_control_name); + offset += length_control_name; + *(outbuffer + offset + 0) = (this->event_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->event_type); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->menu_entry_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menu_entry_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menu_entry_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menu_entry_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.real = this->mouse_point_valid; + *(outbuffer + offset + 0) = (u_mouse_point_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_client_id; + memcpy(&length_client_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client_id-1]=0; + this->client_id = (char *)(inbuffer + offset-1); + offset += length_client_id; + uint32_t length_marker_name; + memcpy(&length_marker_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + uint32_t length_control_name; + memcpy(&length_control_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_control_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_control_name-1]=0; + this->control_name = (char *)(inbuffer + offset-1); + offset += length_control_name; + this->event_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->event_type); + offset += this->pose.deserialize(inbuffer + offset); + this->menu_entry_id = ((uint32_t) (*(inbuffer + offset))); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.base = 0; + u_mouse_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mouse_point_valid = u_mouse_point_valid.real; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerFeedback"; }; + const char * getMD5(){ return "ab0f1eee058667e28c19ff3ffc3f4b78"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h new file mode 100755 index 0000000..656df9e --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h @@ -0,0 +1,98 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerInit_h +#define _ROS_visualization_msgs_InteractiveMarkerInit_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerInit : public ros::Msg + { + public: + const char* server_id; + uint64_t seq_num; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + + InteractiveMarkerInit(): + server_id(""), + seq_num(0), + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerInit"; }; + const char * getMD5(){ return "aa2f1dcea79533d1710675195653028d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h new file mode 100755 index 0000000..b94dc8f --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h @@ -0,0 +1,64 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerPose_h +#define _ROS_visualization_msgs_InteractiveMarkerPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerPose : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + + InteractiveMarkerPose(): + header(), + pose(), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerPose"; }; + const char * getMD5(){ return "a6e6833209a196a38d798dadb02c81f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h new file mode 100755 index 0000000..d24ea0c --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h @@ -0,0 +1,159 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerUpdate_h +#define _ROS_visualization_msgs_InteractiveMarkerUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" +#include "visualization_msgs/InteractiveMarkerPose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerUpdate : public ros::Msg + { + public: + const char* server_id; + uint64_t seq_num; + uint8_t type; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + uint8_t poses_length; + visualization_msgs::InteractiveMarkerPose st_poses; + visualization_msgs::InteractiveMarkerPose * poses; + uint8_t erases_length; + char* st_erases; + char* * erases; + enum { KEEP_ALIVE = 0 }; + enum { UPDATE = 1 }; + + InteractiveMarkerUpdate(): + server_id(""), + seq_num(0), + type(0), + markers_length(0), markers(NULL), + poses_length(0), poses(NULL), + erases_length(0), erases(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = erases_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_erasesi = strlen(this->erases[i]); + memcpy(outbuffer + offset, &length_erasesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->erases[i], length_erasesi); + offset += length_erasesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (visualization_msgs::InteractiveMarkerPose*)realloc(this->poses, poses_lengthT * sizeof(visualization_msgs::InteractiveMarkerPose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(visualization_msgs::InteractiveMarkerPose)); + } + uint8_t erases_lengthT = *(inbuffer + offset++); + if(erases_lengthT > erases_length) + this->erases = (char**)realloc(this->erases, erases_lengthT * sizeof(char*)); + offset += 3; + erases_length = erases_lengthT; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_st_erases; + memcpy(&length_st_erases, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_erases; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_erases-1]=0; + this->st_erases = (char *)(inbuffer + offset-1); + offset += length_st_erases; + memcpy( &(this->erases[i]), &(this->st_erases), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerUpdate"; }; + const char * getMD5(){ return "83e22f99d3b31fde725e0a338200e036"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/Marker.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/Marker.h new file mode 100755 index 0000000..2219629 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/Marker.h @@ -0,0 +1,288 @@ +#ifndef _ROS_visualization_msgs_Marker_h +#define _ROS_visualization_msgs_Marker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class Marker : public ros::Msg + { + public: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Pose pose; + geometry_msgs::Vector3 scale; + std_msgs::ColorRGBA color; + ros::Duration lifetime; + bool frame_locked; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t colors_length; + std_msgs::ColorRGBA st_colors; + std_msgs::ColorRGBA * colors; + const char* text; + const char* mesh_resource; + bool mesh_use_embedded_materials; + enum { ARROW = 0 }; + enum { CUBE = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { LINE_STRIP = 4 }; + enum { LINE_LIST = 5 }; + enum { CUBE_LIST = 6 }; + enum { SPHERE_LIST = 7 }; + enum { POINTS = 8 }; + enum { TEXT_VIEW_FACING = 9 }; + enum { MESH_RESOURCE = 10 }; + enum { TRIANGLE_LIST = 11 }; + enum { ADD = 0 }; + enum { MODIFY = 0 }; + enum { DELETE = 2 }; + + Marker(): + header(), + ns(""), + id(0), + type(0), + action(0), + pose(), + scale(), + color(), + lifetime(), + frame_locked(0), + points_length(0), points(NULL), + colors_length(0), colors(NULL), + text(""), + mesh_resource(""), + mesh_use_embedded_materials(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->pose.serialize(outbuffer + offset); + offset += this->scale.serialize(outbuffer + offset); + offset += this->color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.real = this->frame_locked; + *(outbuffer + offset + 0) = (u_frame_locked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame_locked); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_mesh_resource = strlen(this->mesh_resource); + memcpy(outbuffer + offset, &length_mesh_resource, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.real = this->mesh_use_embedded_materials; + *(outbuffer + offset + 0) = (u_mesh_use_embedded_materials.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->scale.deserialize(inbuffer + offset); + offset += this->color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.base = 0; + u_frame_locked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->frame_locked = u_frame_locked.real; + offset += sizeof(this->frame_locked); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t colors_lengthT = *(inbuffer + offset++); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + colors_length = colors_lengthT; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->st_colors.deserialize(inbuffer + offset); + memcpy( &(this->colors[i]), &(this->st_colors), sizeof(std_msgs::ColorRGBA)); + } + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + uint32_t length_mesh_resource; + memcpy(&length_mesh_resource, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.base = 0; + u_mesh_use_embedded_materials.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mesh_use_embedded_materials = u_mesh_use_embedded_materials.real; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + const char * getType(){ return "visualization_msgs/Marker"; }; + const char * getMD5(){ return "18326976df9d29249efc939e00342cde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/MarkerArray.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/MarkerArray.h new file mode 100755 index 0000000..97e32df --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/MarkerArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_visualization_msgs_MarkerArray_h +#define _ROS_visualization_msgs_MarkerArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class MarkerArray : public ros::Msg + { + public: + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + + MarkerArray(): + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/MarkerArray"; }; + const char * getMD5(){ return "90da67007c26525f655c1c269094e39f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/MenuEntry.h b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/MenuEntry.h new file mode 100755 index 0000000..8ba43e8 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/lib/ros_lib/visualization_msgs/MenuEntry.h @@ -0,0 +1,103 @@ +#ifndef _ROS_visualization_msgs_MenuEntry_h +#define _ROS_visualization_msgs_MenuEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace visualization_msgs +{ + + class MenuEntry : public ros::Msg + { + public: + uint32_t id; + uint32_t parent_id; + const char* title; + const char* command; + uint8_t command_type; + enum { FEEDBACK = 0 }; + enum { ROSRUN = 1 }; + enum { ROSLAUNCH = 2 }; + + MenuEntry(): + id(0), + parent_id(0), + title(""), + command(""), + command_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->parent_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parent_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parent_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parent_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent_id); + uint32_t length_title = strlen(this->title); + memcpy(outbuffer + offset, &length_title, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_command = strlen(this->command); + memcpy(outbuffer + offset, &length_command, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + *(outbuffer + offset + 0) = (this->command_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->command_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->id = ((uint32_t) (*(inbuffer + offset))); + this->id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->id); + this->parent_id = ((uint32_t) (*(inbuffer + offset))); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parent_id); + uint32_t length_title; + memcpy(&length_title, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + uint32_t length_command; + memcpy(&length_command, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + this->command_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->command_type); + return offset; + } + + const char * getType(){ return "visualization_msgs/MenuEntry"; }; + const char * getMD5(){ return "b90ec63024573de83b57aa93eb39be2d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_21/original/output.txt b/case_study/arduino_lab/group_21/original/output.txt new file mode 100755 index 0000000..9c206c6 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/output.txt @@ -0,0 +1,8 @@ +============================= test session starts ============================== +platform linux -- Python 3.4.3, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 +rootdir: /home/qianqianzhu/test_robot/mutation_python/group_21, inifile: +collected 5 items + +../run_test.py ..... [100%] + +========================== 5 passed in 55.65 seconds =========================== diff --git a/case_study/arduino_lab/group_21/original/platformio.ini b/case_study/arduino_lab/group_21/original/platformio.ini new file mode 100755 index 0000000..c724062 --- /dev/null +++ b/case_study/arduino_lab/group_21/original/platformio.ini @@ -0,0 +1,18 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +env_default = megaADK + +[env:megaADK] +platform = atmelavr +framework = arduino +board = megaADK +upload_port = /dev/ttyACM0 + diff --git a/case_study/arduino_lab/group_21/original/speed_log.txt b/case_study/arduino_lab/group_21/original/speed_log.txt new file mode 100755 index 0000000..8f61dac --- /dev/null +++ b/case_study/arduino_lab/group_21/original/speed_log.txt @@ -0,0 +1,6562 @@ +00,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 diff --git a/case_study/arduino_lab/group_21/original/src/.robotbase_1.ino.swp b/case_study/arduino_lab/group_21/original/src/.robotbase_1.ino.swp new file mode 100755 index 0000000..8fc9929 Binary files /dev/null and b/case_study/arduino_lab/group_21/original/src/.robotbase_1.ino.swp differ diff --git a/case_study/arduino_lab/group_21/original/src/robotbase_21.ino b/case_study/arduino_lab/group_21/original/src/robotbase_21.ino new file mode 100755 index 0000000..eed62da --- /dev/null +++ b/case_study/arduino_lab/group_21/original/src/robotbase_21.ino @@ -0,0 +1,226 @@ +// ∗∗ +// ∗ Group number: 21 +// ∗ Student 1: +// ∗ Daan van der Valk, 4094751 +// ∗ Student 2: +// ∗ Stefan de Vringer, 4374851 +// ∗/ + + +// Includes required for ROS and the Twist data structure +#include +#include + + +void reset_movement(); + +// SETTINGS +// Settings for obstacle detection (see requirements) +// Robot will be stopped for some obstacle if it’s at 20 cm distance or closer +const int maximumRange = 20; + +// Setting for timer: the register value is set to reset_timer after initiating movement +const int reset_timer = 40000; + +// Setting for speed +// Only used for the directions commanded by our line follower application +const int robot_speed = 63; + + +// CONSTANTS +// Pin numbers: robot motor +const int p1REV = 7; +const int p1EN = 24; +const int p1FWD = 6; +const int p2REV = 3; +const int p2EN = 25; +const int p2FWD = 2; + +// Pin numbers: ultrasonic sensor +const int echoPin = 22; +const int triggerPin = 23; + +// Pin number: yellow LED +const int ledPin = 13; + +// Used for distance calculation of the nearest object +long duration, distance; + + + +// ISR for the timer overflow: +// in this case, the connection with the control (laptop) has timed out +// Stop robot untill new signals are received +ISR(TIMER1_OVF_vect) +{ + TCNT1 = reset_timer; // reset timer + reset_movement(); +} + + + +// MOVEMENT FUNCTIONS +// Keep engines active, but not moving +void reset_movement() { + digitalWrite(p1EN, HIGH); + digitalWrite(p2EN, HIGH); + digitalWrite(p1FWD, LOW); + digitalWrite(p2FWD, LOW); + digitalWrite(p1REV, LOW); + digitalWrite(p2REV, LOW); +} + +// 3 functions for moving forwards +void movement_straight_forward() { + reset_movement(); + analogWrite(p1FWD, robot_speed); + analogWrite(p2FWD, robot_speed); +} +void movement_left_forward() { + reset_movement(); + analogWrite(p2FWD, robot_speed); +} +void movement_right_forward() { + reset_movement(); + analogWrite(p1FWD, robot_speed); +} + +// 1 stop function +void movement_stop() { + reset_movement(); +} + +// 2 rotation functions +void movement_left_rotation() { + reset_movement(); + digitalWrite(p1REV, HIGH); + digitalWrite(p2FWD, HIGH); +} + +void movement_right_rotation() { + reset_movement(); + digitalWrite(p1FWD, HIGH); + digitalWrite(p2REV, HIGH); +} + +// 3 functions for moving backwards +void movement_straight_backward() { + reset_movement(); + digitalWrite(p1REV, HIGH); + digitalWrite(p2REV, HIGH); +} +void movement_left_backward() { + reset_movement(); + digitalWrite(p2REV, HIGH); +} +void movement_right_backward() { + reset_movement(); + digitalWrite(p1REV, HIGH); +} + + +// Control function for handling incoming Twist messages +void inputHandler(const geometry_msgs::Twist& msg) { + // Retrieve linear and angular values + float linear = msg.linear.x; + float angular = msg.angular.z; + + // Linear > 0: movement forwards + if(linear > 0) { + if(angular > 0) + movement_left_forward(); + else if(angular == 0) + movement_straight_forward(); + else + movement_right_forward(); + + // Linear = 0: stop or rotate + } else if(linear == 0) { + if(angular > 0) + movement_left_rotation(); + else if(angular == 0) + movement_stop(); + else + movement_right_rotation(); + + // Linear < 0: movement backwards + } else { + if(angular > 0) + movement_left_backward(); + else if(angular == 0) + movement_straight_backward(); + else + movement_right_backward(); + } + + // Set timing register to reset clock + TCNT1 = reset_timer; +} + + +// Create NodeHandle to connect to ROS as a node +class NewHardware : public ArduinoHardware { + public : NewHardware():ArduinoHardware(&Serial1, 57600){}; +}; ros::NodeHandle_ nh; +// Create subscriber to receive Twist messages +ros::Subscriber sub("cmd_vel", &inputHandler); + + +// Setup Node +void setup() { + nh.initNode(); // Start ROS node + nh.subscribe(sub); // Subscribe to /cmd_vel topic + + // Set control pins as output + pinMode(ledPin, OUTPUT); + + pinMode(p1REV, OUTPUT); + pinMode(p1EN, OUTPUT); + pinMode(p1FWD, OUTPUT); + pinMode(p2REV, OUTPUT); + pinMode(p2EN, OUTPUT); + pinMode(p2FWD, OUTPUT); + + pinMode(triggerPin, OUTPUT); + + // Set echo pin as input + pinMode(echoPin, INPUT); + + // initialize timer1 + noInterrupts(); // Disable all interrupts temporarely + TCCR1A = 0; // Timer1 control register A to 0 + TCCR1B = 0; // Timer1 control register B to 0 + TCNT1 = reset_timer; // Set Timer1 register to reset_timer + + //Set prescalar to 256 (16MHz / 256) + TCCR1B |= (1 << CS12); + TIMSK1 |= (1 << TOIE1); // Enable overflow interrupt + interrupts(); // Enable interrupts again +} + + + +// Repeated code used to actively control the robot +void loop() { + // Use ultrasonic sensor to measure the closest object in front of the robot + digitalWrite(triggerPin, LOW); + delayMicroseconds(2); + digitalWrite(triggerPin, HIGH); + delayMicroseconds(10); + digitalWrite(triggerPin, LOW); + duration = pulseIn(echoPin, HIGH); + + // Calculate the distance (in cm) of the object + distance = duration/58; + + // If the obstacle is too close, put on LED and do not move + if (distance <= maximumRange) { + digitalWrite(ledPin, HIGH); + // Otherwise there is no near obstacle and the robot may move by receiving Twist messages + } else { + nh.spinOnce(); + digitalWrite(ledPin, LOW); + } + + delay(1); +} diff --git a/case_study/arduino_lab/group_21/robotbase_21/robotbase_21.ino b/case_study/arduino_lab/group_21/robotbase_21/robotbase_21.ino new file mode 100755 index 0000000..083473f --- /dev/null +++ b/case_study/arduino_lab/group_21/robotbase_21/robotbase_21.ino @@ -0,0 +1,224 @@ +// ∗∗ +// ∗ Group number: 21 +// ∗ Student 1: +// ∗ Daan van der Valk, 4094751 +// ∗ Student 2: +// ∗ Stefan de Vringer, 4374851 +// ∗/ + + +// Includes required for ROS and the Twist data structure +#include +#include + + +// SETTINGS +// Settings for obstacle detection (see requirements) +// Robot will be stopped for some obstacle if it’s at 20 cm distance or closer +const int maximumRange = 20; + +// Setting for timer: the register value is set to reset_timer after initiating movement +const int reset_timer = 40000; + +// Setting for speed +// Only used for the directions commanded by our line follower application +const int robot_speed = 63; + + +// CONSTANTS +// Pin numbers: robot motor +const int p1REV = 7; +const int p1EN = 24; +const int p1FWD = 6; +const int p2REV = 3; +const int p2EN = 25; +const int p2FWD = 2; + +// Pin numbers: ultrasonic sensor +const int echoPin = 22; +const int triggerPin = 23; + +// Pin number: yellow LED +const int ledPin = 13; + +// Used for distance calculation of the nearest object +long duration, distance; + + + +// ISR for the timer overflow: +// in this case, the connection with the control (laptop) has timed out +// Stop robot untill new signals are received +ISR(TIMER1_OVF_vect) +{ + TCNT1 = reset_timer; // reset timer + reset_movement(); +} + + + +// MOVEMENT FUNCTIONS +// Keep engines active, but not moving +void reset_movement() { + digitalWrite(p1EN, HIGH); + digitalWrite(p2EN, HIGH); + digitalWrite(p1FWD, LOW); + digitalWrite(p2FWD, LOW); + digitalWrite(p1REV, LOW); + digitalWrite(p2REV, LOW); +} + +// 3 functions for moving forwards +void movement_straight_forward() { + reset_movement(); + analogWrite(p1FWD, robot_speed); + analogWrite(p2FWD, robot_speed); +} +void movement_left_forward() { + reset_movement(); + analogWrite(p2FWD, robot_speed); +} +void movement_right_forward() { + reset_movement(); + analogWrite(p1FWD, robot_speed); +} + +// 1 stop function +void movement_stop() { + reset_movement(); +} + +// 2 rotation functions +void movement_left_rotation() { + reset_movement(); + digitalWrite(p1REV, HIGH); + digitalWrite(p2FWD, HIGH); +} + +void movement_right_rotation() { + reset_movement(); + digitalWrite(p1FWD, HIGH); + digitalWrite(p2REV, HIGH); +} + +// 3 functions for moving backwards +void movement_straight_backward() { + reset_movement(); + digitalWrite(p1REV, HIGH); + digitalWrite(p2REV, HIGH); +} +void movement_left_backward() { + reset_movement(); + digitalWrite(p2REV, HIGH); +} +void movement_right_backward() { + reset_movement(); + digitalWrite(p1REV, HIGH); +} + + +// Control function for handling incoming Twist messages +void inputHandler(const geometry_msgs::Twist& msg) { + // Retrieve linear and angular values + float linear = msg.linear.x; + float angular = msg.angular.z; + + // Linear > 0: movement forwards + if(linear > 0) { + if(angular > 0) + movement_left_forward(); + else if(angular == 0) + movement_straight_forward(); + else + movement_right_forward(); + + // Linear = 0: stop or rotate + } else if(linear == 0) { + if(angular > 0) + movement_left_rotation(); + else if(angular == 0) + movement_stop(); + else + movement_right_rotation(); + + // Linear < 0: movement backwards + } else { + if(angular > 0) + movement_left_backward(); + else if(angular == 0) + movement_straight_backward(); + else + movement_right_backward(); + } + + // Set timing register to reset clock + TCNT1 = reset_timer; +} + + +// Create NodeHandle to connect to ROS as a node +class NewHardware : public ArduinoHardware { + public : NewHardware():ArduinoHardware(&Serial1, 57600){}; +}; ros::NodeHandle_ nh; +// Create subscriber to receive Twist messages +ros::Subscriber sub("cmd_vel", &inputHandler); + + +// Setup Node +void setup() { + nh.initNode(); // Start ROS node + nh.subscribe(sub); // Subscribe to /cmd_vel topic + + // Set control pins as output + pinMode(ledPin, OUTPUT); + + pinMode(p1REV, OUTPUT); + pinMode(p1EN, OUTPUT); + pinMode(p1FWD, OUTPUT); + pinMode(p2REV, OUTPUT); + pinMode(p2EN, OUTPUT); + pinMode(p2FWD, OUTPUT); + + pinMode(triggerPin, OUTPUT); + + // Set echo pin as input + pinMode(echoPin, INPUT); + + // initialize timer1 + noInterrupts(); // Disable all interrupts temporarely + TCCR1A = 0; // Timer1 control register A to 0 + TCCR1B = 0; // Timer1 control register B to 0 + TCNT1 = reset_timer; // Set Timer1 register to reset_timer + + //Set prescalar to 256 (16MHz / 256) + TCCR1B |= (1 << CS12); + TIMSK1 |= (1 << TOIE1); // Enable overflow interrupt + interrupts(); // Enable interrupts again +} + + + +// Repeated code used to actively control the robot +void loop() { + // Use ultrasonic sensor to measure the closest object in front of the robot + digitalWrite(triggerPin, LOW); + delayMicroseconds(2); + digitalWrite(triggerPin, HIGH); + delayMicroseconds(10); + digitalWrite(triggerPin, LOW); + duration = pulseIn(echoPin, HIGH); + + // Calculate the distance (in cm) of the object + distance = duration/58; + + // If the obstacle is too close, put on LED and do not move + if (distance <= maximumRange) { + digitalWrite(ledPin, HIGH); + // Otherwise there is no near obstacle and the robot may move by receiving Twist messages + } else { + nh.spinOnce(); + digitalWrite(ledPin, LOW); + } + + delay(1); +} diff --git a/case_study/arduino_lab/group_21/run.sh b/case_study/arduino_lab/group_21/run.sh new file mode 100755 index 0000000..b1f3c58 --- /dev/null +++ b/case_study/arduino_lab/group_21/run.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +rm -f mut*/output.txt +cd original +platformio run -t clean +platformio run -t upload +python3 -m pytest ../run_test.py | tee "output.txt" +cd .. + +for mut_dir in $(ls -d mut*/); do + echo $mut_dir + cd $mut_dir + platformio run -t clean + platformio run -t upload + python3 -m pytest ../run_test.py -x| tee "output.txt" + cd .. + mv $mut_dir executed +done + +egrep -lir --include=*.txt "FAILED" . > "failed.txt" diff --git a/case_study/arduino_lab/group_21/run_test.py b/case_study/arduino_lab/group_21/run_test.py new file mode 100755 index 0000000..a41561a --- /dev/null +++ b/case_study/arduino_lab/group_21/run_test.py @@ -0,0 +1,123 @@ +import subprocess,os,signal +import serial,io,time +import pytest +import string +from operator import add + +#----------------------------- +# test helper functions +#----------------------------- +def send_image(image_path): + # source ros file + output = subprocess.check_output('source /home/qianqianzhu/image_transport_ws/devel/setup.bash;env -0' + ,shell=True, executable="/bin/bash") + # replace env + #os.environ.clear() + lines = output.decode().split('\0') + for line in lines: + (key, _, value) = line.partition("=") + os.environ[key] = value + + #image = '/home/qianqianzhu/Pictures/straight.jpg' + #image = '/home/qianqianzhu/Pictures/left.jpg' + #image = '/home/qianqianzhu/Pictures/right.jpeg' + ros_command = 'rosrun image_transport_tutorial my_publisher '+ image_path + pro = subprocess.Popen(ros_command,shell=True,preexec_fn=os.setsid) + + # record pwm + #time.sleep(2) + subprocess.call('rm -f speed_log.txt',shell=True) + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + filename = 'speed_log.txt' # log file to save data in + + with serial.Serial(device,baud) as serialPort, open(filename,'wb') as outFile: + print("start recording serial...") + timer = time.time() + while(time.time()-timer<=10): + line = serialPort.readline() # must send \n! get a line of log + #print (line) # show line on screen + outFile.write(line) # write line of text to file + outFile.flush() # make sure it actually gets written out + print("stop recording serial...") + + # stop sending an image + os.killpg(os.getpgid(pro.pid), signal.SIGTERM) + + # read speed from pwm log + f = open(filename,"rb") + + total = [0,0,0,0] + #print("hello") + + for line in f: + if len(line) == 9: + line = line.decode('utf-8') + columns = line.strip().split(',') + if len(columns) == 4: + delta = list(map(int,columns)) + total = list(map(add,total,delta)) + #print(total) + f.close() + return total + +def send_ultrasensor(signal): + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + with serial.Serial(device,baud,timeout=5) as ard: + time.sleep(0.5) # wait for Arduino + # Serial write section + ard.flush() + print ("send " + signal+ " signal!") + ard.write(str.encode(signal)) + time.sleep(0.5) + +#----------------------------- +# test cases +#----------------------------- +def test_straight(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/straight_broad_1.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == pytest.approx(right_speed,rel=5e-2) + +def test_turn_left(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/right.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed < right_speed + +def test_turn_right(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/left.jpeg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed > right_speed + +def test_stop_obstacle(): + send_ultrasensor("stop") + image_path = '/home/qianqianzhu/Pictures/straight_broad_1.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed == 0 + assert right_speed == 0 + +def test_stop_no_image(): + send_ultrasensor("go") + image_path = '' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + assert left_speed == 0 + assert right_speed == 0 + + diff --git a/case_study/arduino_lab/group_34/.pytest_cache/v/cache/lastfailed b/case_study/arduino_lab/group_34/.pytest_cache/v/cache/lastfailed new file mode 100755 index 0000000..9e26dfe --- /dev/null +++ b/case_study/arduino_lab/group_34/.pytest_cache/v/cache/lastfailed @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/failed_34.txt b/case_study/arduino_lab/group_34/failed_34.txt new file mode 100755 index 0000000..c9c7d77 --- /dev/null +++ b/case_study/arduino_lab/group_34/failed_34.txt @@ -0,0 +1,138 @@ +./executed/mut73/output.txt +./executed/mut46/output.txt +./executed/mut90/output.txt +./executed/mut75/output.txt +./executed/mut23/output.txt +./executed/mut30/output.txt +./executed/mut83/output.txt +./executed/mut41/output.txt +./executed/mut17/output.txt +./executed/mut39/output.txt +./executed/mut79/output.txt +./executed/mut18/output.txt +./executed/mut27/output.txt +./executed/mut94/output.txt +./executed/mut40/output.txt +./executed/mut91/output.txt +./executed/mut87/output.txt +./executed/mut86/output.txt +./executed/mut20/output.txt +./executed/mut88/output.txt +./executed/mut68/output.txt +./executed/mut49/output.txt +./executed/mut32/output.txt +./executed/mut31/output.txt +./executed/mut89/output.txt +./executed/mut95/output.txt +./executed/mut22/output.txt +./executed/mut84/output.txt +./executed/mut69/output.txt +./executed/mut21/output.txt +./executed/mut47/output.txt +./executed/mut19/output.txt +./executed/mut29/output.txt +./executed/mut48/output.txt +./executed/mut92/output.txt +./executed/mut16/output.txt +./executed/mut55/output.txt +./executed/mut72/output.txt + + +Mutation 0:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 85 +Mutation 1:pin_surround_replacement:digitalWrite(23, ( HIGH)); in Line 85 +Mutation 2:pin_surround_replacement:digitalWrite(25, ( HIGH)); in Line 85 +Mutation 3:pin_surround_replacement:digitalWrite(26, ( HIGH)); in Line 85 +Mutation 4:pin_surround_replacement:digitalWrite(27, ( HIGH)); in Line 85 +Mutation 5:pin_value_replacement:digitalWrite(24, !( HIGH)); in Line 85 +Mutation 6:output_stmt_deletion: in Line 85 +Mutation 7:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 86 +Mutation 8:pin_surround_replacement:digitalWrite(23, ( HIGH)); in Line 86 +Mutation 9:pin_surround_replacement:digitalWrite(24, ( HIGH)); in Line 86 +Mutation 10:pin_surround_replacement:digitalWrite(26, ( HIGH)); in Line 86 +Mutation 11:pin_surround_replacement:digitalWrite(27, ( HIGH)); in Line 86 +Mutation 12:pin_value_replacement:digitalWrite(25, !( HIGH)); in Line 86 +Mutation 13:output_stmt_deletion: in Line 86 +Mutation 14:pin_surround_replacement:digitalWrite(22, ( LOW)); in Line 110 +Mutation 15:pin_surround_replacement:digitalWrite(24, ( LOW)); in Line 110 +Mutation 16:pin_surround_replacement:digitalWrite(25, ( LOW)); in Line 110 +Mutation 17:pin_value_replacement:digitalWrite(23, !( LOW)); in Line 110 +Mutation 18:output_stmt_deletion: in Line 110 +Mutation 19:pin_surround_replacement:digitalWrite(22, ( HIGH)); in Line 112 +Mutation 20:pin_surround_replacement:digitalWrite(24, ( HIGH)); in Line 112 +Mutation 21:pin_surround_replacement:digitalWrite(25, ( HIGH)); in Line 112 +Mutation 22:pin_value_replacement:digitalWrite(23, !( HIGH)); in Line 112 +Mutation 23:output_stmt_deletion: in Line 112 +Mutation 24:pin_surround_replacement:digitalWrite(22, ( LOW)); in Line 114 +Mutation 25:pin_surround_replacement:digitalWrite(24, ( LOW)); in Line 114 +Mutation 26:pin_surround_replacement:digitalWrite(25, ( LOW)); in Line 114 +Mutation 27:pin_value_replacement:digitalWrite(23, !( LOW)); in Line 114 +Mutation 28:output_stmt_deletion: in Line 114 +Mutation 29:pin_surround_replacement:duration = pulseIn(23, ( HIGH)); in Line 115 +Mutation 30:pin_surround_replacement:duration = pulseIn(24, ( HIGH)); in Line 115 +Mutation 31:pin_surround_replacement:duration = pulseIn(25, ( HIGH)); in Line 115 +Mutation 32:pin_value_replacement:duration = pulseIn(22, !( HIGH)); in Line 115 +Mutation 33:pin_surround_replacement:digitalWrite(12, (HIGH)); in Line 128 +Mutation 34:pin_value_replacement:digitalWrite(13, !(HIGH)); in Line 128 +Mutation 35:output_stmt_deletion: in Line 128 +Mutation 36:pin_surround_replacement:digitalWrite(12, (LOW)); in Line 132 +Mutation 37:pin_value_replacement:digitalWrite(13, !(LOW)); in Line 132 +Mutation 38:output_stmt_deletion: in Line 132 +Mutation 39:pin_surround_replacement:analogWrite(5, ( 255*vl/vmax_)); in Line 142 +Mutation 40:pin_surround_replacement:analogWrite(7, ( 255*vl/vmax_)); in Line 142 +Mutation 41:pin_surround_replacement:analogWrite(6, ( 0)); in Line 143 +Mutation 42:pin_surround_replacement:analogWrite(8, ( 0)); in Line 143 +Mutation 43:pin_surround_replacement:analogWrite(5, ( 0)); in Line 145 +Mutation 44:pin_surround_replacement:analogWrite(7, ( 0)); in Line 145 +Mutation 45:pin_surround_replacement:analogWrite(6, ( -255*vl/vmax_)); in Line 146 +Mutation 46:pin_surround_replacement:analogWrite(8, ( -255*vl/vmax_)); in Line 146 +Mutation 47:pin_surround_replacement:analogWrite(1, ( 255*vr/vmax_)); in Line 149 +Mutation 48:pin_surround_replacement:analogWrite(3, ( 255*vr/vmax_)); in Line 149 +Mutation 49:pin_surround_replacement:analogWrite(2, ( 0)); in Line 150 +Mutation 50:pin_surround_replacement:analogWrite(4, ( 0)); in Line 150 +Mutation 51:pin_surround_replacement:analogWrite(1, ( 0)); in Line 152 +Mutation 52:pin_surround_replacement:analogWrite(3, ( 0)); in Line 152 +Mutation 53:pin_surround_replacement:analogWrite(2, ( -255*vr/vmax_)); in Line 153 +Mutation 54:pin_surround_replacement:analogWrite(4, ( -255*vr/vmax_)); in Line 153 +Mutation 55:pin_surround_replacement:analogWrite(5, ( 0)); in Line 156 +Mutation 56:pin_surround_replacement:analogWrite(7, ( 0)); in Line 156 +Mutation 57:pin_surround_replacement:analogWrite(6, ( 0)); in Line 157 +Mutation 58:pin_surround_replacement:analogWrite(8, ( 0)); in Line 157 +Mutation 59:pin_surround_replacement:analogWrite(1, ( 0)); in Line 158 +Mutation 60:pin_surround_replacement:analogWrite(3, ( 0)); in Line 158 +Mutation 61:pin_surround_replacement:analogWrite(2, ( 0)); in Line 159 +Mutation 62:pin_surround_replacement:analogWrite(4, ( 0)); in Line 159 +Mutation 63:pin_surround_replacement:pinMode(6, OUTPUT); in Line 173 +Mutation 64:pin_surround_replacement:pinMode(8, OUTPUT); in Line 173 +Mutation 65:pin_func_replacement:pinMode(7,INPUT); in Line 173 +Mutation 66:pin_surround_replacement:pinMode(22, OUTPUT); in Line 174 +Mutation 67:pin_surround_replacement:pinMode(23, OUTPUT); in Line 174 +Mutation 68:pin_surround_replacement:pinMode(25, OUTPUT); in Line 174 +Mutation 69:pin_surround_replacement:pinMode(26, OUTPUT); in Line 174 +Mutation 70:pin_surround_replacement:pinMode(27, OUTPUT); in Line 174 +Mutation 71:pin_func_replacement:pinMode(24,INPUT); in Line 174 +Mutation 72:pin_surround_replacement:pinMode(5, OUTPUT); in Line 175 +Mutation 73:pin_surround_replacement:pinMode(7, OUTPUT); in Line 175 +Mutation 74:pin_func_replacement:pinMode(6,INPUT); in Line 175 +Mutation 75:pin_surround_replacement:pinMode(2, OUTPUT); in Line 176 +Mutation 76:pin_surround_replacement:pinMode(4, OUTPUT); in Line 176 +Mutation 77:pin_func_replacement:pinMode(3,INPUT); in Line 176 +Mutation 78:pin_surround_replacement:pinMode(22, OUTPUT); in Line 177 +Mutation 79:pin_surround_replacement:pinMode(23, OUTPUT); in Line 177 +Mutation 80:pin_surround_replacement:pinMode(24, OUTPUT); in Line 177 +Mutation 81:pin_surround_replacement:pinMode(26, OUTPUT); in Line 177 +Mutation 82:pin_surround_replacement:pinMode(27, OUTPUT); in Line 177 +Mutation 83:pin_func_replacement:pinMode(25,INPUT); in Line 177 +Mutation 84:pin_surround_replacement:pinMode(1, OUTPUT); in Line 178 +Mutation 85:pin_surround_replacement:pinMode(3, OUTPUT); in Line 178 +Mutation 86:pin_func_replacement:pinMode(2,INPUT); in Line 178 +Mutation 87:pin_surround_replacement:pinMode(22, OUTPUT); in Line 181 +Mutation 88:pin_surround_replacement:pinMode(24, OUTPUT); in Line 181 +Mutation 89:pin_surround_replacement:pinMode(25, OUTPUT); in Line 181 +Mutation 90:pin_func_replacement:pinMode(23,INPUT); in Line 181 +Mutation 91:pin_surround_replacement:pinMode(23, INPUT); in Line 182 +Mutation 92:pin_surround_replacement:pinMode(24, INPUT); in Line 182 +Mutation 93:pin_surround_replacement:pinMode(25, INPUT); in Line 182 +Mutation 94:pin_func_replacement:pinMode(22,OUTPUT); in Line 182 +Mutation 95:pull_resis_replacement:pinMode(22,INPUT_PULLUP); in Line 182 +Mutation 96:pin_surround_replacement:pinMode(12, OUTPUT); in Line 183 +Mutation 97:pin_func_replacement:pinMode(13,INPUT); in Line 183 diff --git a/case_study/arduino_lab/group_34/linefollower_34.cpp b/case_study/arduino_lab/group_34/linefollower_34.cpp new file mode 100755 index 0000000..dcf957e --- /dev/null +++ b/case_study/arduino_lab/group_34/linefollower_34.cpp @@ -0,0 +1,201 @@ +/** + * Group number: 34 + * Student 1: + * Tom van der Meulen, 4189558 + * Student 2: + * Levi Dekker, 4224175 + */ + +// C++ includes +#include +#include + +// ROS includes +#include +#include + +// Image handling and openCV includes +#include +#include +#include +#include +#include + +#define LX_STRAIGHT 0.3 +#define LX_TURN 0.15 +#define WITH_FILTER 1 + +class ImageConverter { + + +public: + ImageConverter(): + img_width(768), img_height(1280), // Assumed dimensions of video stream + roi_up(0.7), roi_down(1), roi_left(0), roi_right(1), + turn_area_width(0.4), + threshold_val(100), + last_r(img_width / 2), last_cx(img_width / 2), last_cy(0), + lx_max(0.16), // [m/s] + ax_max(1), // [rad/s] + it_(nh_) { + // Subscribe to the camera/image topic + image_sub_ = it_.subscribe("camera/image", 1, &ImageConverter::imageCallback, this); + + // Publish generated images on linefollower_34/output_video + image_pub_ = it_.advertise("linefollower_34/output_video", 1); + + // Publish Twist messages on cmd_vel + twist_pub_ = nh_.advertise("cmd_vel",1000); + + // Asserts + assert(roi_up >= 0 && roi_up <=1); + assert(roi_down >= 0 && roi_down <=1); + assert(roi_left >= 0 && roi_left <=1); + assert(roi_right >= 0 && roi_right <=1); + assert(turn_area_width >= 0 && turn_area_width <=0.5); + } + + void imageCallback(const sensor_msgs::ImageConstPtr& msg) { + // Convert ros-img to OpenCV + cv_bridge::CvImagePtr cv_ptr; + + cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::RGB8); + + cv::Mat image_rot, image_roi, image_grey, image_blur, image_threshold, image_canny, image_lines; + + cv::transpose(cv_ptr->image, image_rot); // rotate 90 deg clockwise + cv::flip(image_rot, image_rot, 1); + + // image_lines = image_rot; + + // Get image dimensions in pixels + img_height = image_rot.rows; + img_width = image_rot.cols; + + ROS_DEBUG("img_height = %d, img_width = %d\n", img_height, img_width); + + // Select ROI + cv::Rect roi(roi_left*img_width, roi_up*img_height, (roi_right-roi_left) *img_width, (roi_down-roi_up)*img_height); + image_roi = image_rot(roi); + image_lines = image_roi; + + // Image filters + if(WITH_FILTER) { + cv::cvtColor(image_roi, image_grey, CV_RGB2GRAY); + //cv::GaussianBlur(image_grey, image_blur, cv::Size(3, 3), 0, 0); + cv::blur(image_grey, image_blur, cv::Size(3,3), cv::Point(-1,-1)); + cv::threshold(image_blur, image_threshold, threshold_val, 255, CV_THRESH_BINARY); + } else { + image_grey = image_roi; + cv::bilateralFilter(image_grey, image_blur, 3, 3*2, 3/2); + image_threshold = image_blur; + } + + // Edge detection + cv::Canny(image_threshold, image_canny, 50, 200, 3); + + // Probabilistic Hough Line transform + std::vector lines; + cv::HoughLinesP(image_canny, lines, 1, CV_PI/180, 50, 50, 10 ); + + // Line analysis + int min_r = img_width / 2; + int min_cx = img_width / 2; + int min_cy = 0; + + for(size_t i = 0; i img_width*(1 - turn_area_width) ) { + ROS_INFO("| >|\tTurning right"); + twist_msg.linear.x = LX_TURN * lx_max; + twist_msg.angular.z = -ax_max; + + } else { + ROS_INFO("| ^ |\tGoing Straight"); + twist_msg.linear.x = LX_STRAIGHT * lx_max; + twist_msg.angular.z = 0; + } + + twist_pub_.publish(twist_msg); + + // Create output image + cv::line(image_lines, cv::Point(0, min_cy), cv::Point(img_width, min_cy), cv::Scalar(255,0,0), 3, CV_AA); + cv::line(image_lines, cv::Point(min_cx, 0), cv::Point(min_cx, img_height), cv::Scalar(255,0,0), 3, CV_AA); + + cv::line(image_lines, cv::Point(img_width*turn_area_width, 0), cv::Point(img_width*turn_area_width, img_height), cv::Scalar(255,255,0), 3, CV_AA); + cv::line(image_lines, cv::Point(img_width*(1 - turn_area_width), 0), cv::Point(img_width*(1 - turn_area_width), img_height), cv::Scalar(255,255,0), 3, CV_AA); + + cv_ptr->image = image_roi; //image_lines; + image_pub_.publish(cv_ptr->toImageMsg()); + ROS_DEBUG("Publishing new image\n"); + //TODO: Publish image_lines + } + +private: + ros::NodeHandle nh_; + image_transport::ImageTransport it_; + image_transport::Subscriber image_sub_; + image_transport::Publisher image_pub_; + + ros::Publisher twist_pub_; + + + int img_height; // Nexus 5: img_height = 768px + int img_width; // Nexus 5: img_width = 1280px + + // ROI boundaries + float roi_up, roi_down; // 0 = upper boundary of image; 1 = lower boundary + float roi_left, roi_right; // 0 = left boundary of image; 1 = right boundary + + // Turning parameters + float turn_area_width; // 0 = No turning areas; 0.5 = turning areas go all the way to the horizontal center of the image + int last_r; + int last_cx; + int last_cy; + + // Filter parameters + float threshold_val; + + // Robot parameters + double lx_max; + double ax_max; +}; + +int main(int argc, char **argv) { + ROS_INFO("Starting up image converter\n"); + ros::init(argc, argv, "linefollower_34"); + ImageConverter ic; + + ros::spin(); + return 0; +} diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/.sconsign.dblite b/case_study/arduino_lab/group_34/original/.pioenvs/.sconsign.dblite new file mode 100755 index 0000000..6cde650 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/.sconsign.dblite differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/do-not-modify-files-here.url b/case_study/arduino_lab/group_34/original/.pioenvs/do-not-modify-files-here.url new file mode 100755 index 0000000..4d15482 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/.pioenvs/do-not-modify-files-here.url @@ -0,0 +1,3 @@ + +[InternetShortcut] +URL=http://docs.platformio.org/page/projectconf/section_platformio.html#build-dir diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/CDC.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/CDC.o new file mode 100755 index 0000000..40aace7 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/CDC.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o new file mode 100755 index 0000000..7ba3084 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o new file mode 100755 index 0000000..2ede88b Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial0.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o new file mode 100755 index 0000000..a07296c Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial1.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o new file mode 100755 index 0000000..c8380d0 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial2.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o new file mode 100755 index 0000000..bed99cb Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/HardwareSerial3.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o new file mode 100755 index 0000000..1d65f73 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/IPAddress.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o new file mode 100755 index 0000000..f71f63a Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/PluggableUSB.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Print.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Print.o new file mode 100755 index 0000000..e2e2fb9 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Print.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Stream.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Stream.o new file mode 100755 index 0000000..0a30dbc Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Stream.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Tone.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Tone.o new file mode 100755 index 0000000..0a8f99d Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/Tone.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o new file mode 100755 index 0000000..306dbf4 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/USBCore.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o new file mode 100755 index 0000000..67d5e0d Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WInterrupts.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WMath.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WMath.o new file mode 100755 index 0000000..61ef0e2 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WMath.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WString.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WString.o new file mode 100755 index 0000000..90a8f10 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/WString.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o new file mode 100755 index 0000000..74a6129 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/_wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/abi.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/abi.o new file mode 100755 index 0000000..450aa5e Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/abi.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/hooks.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/hooks.o new file mode 100755 index 0000000..495db0c Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/hooks.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/main.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/main.o new file mode 100755 index 0000000..ce03c9b Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/main.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/new.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/new.o new file mode 100755 index 0000000..2d6ab87 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/new.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring.o new file mode 100755 index 0000000..dfe1026 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o new file mode 100755 index 0000000..6778ecd Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_analog.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o new file mode 100755 index 0000000..0ac6f2c Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_digital.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o new file mode 100755 index 0000000..3a79904 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_pulse.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o new file mode 100755 index 0000000..a670a3a Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/FrameworkArduino/wiring_shift.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/firmware.elf b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/firmware.elf new file mode 100755 index 0000000..bb8b445 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/firmware.elf differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/firmware.hex b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/firmware.hex new file mode 100755 index 0000000..5bc2457 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/firmware.hex @@ -0,0 +1,841 @@ +:100000000C94BD010C94EE010C94EE010C94EE01E5 +:100010000C94EE010C94EE010C94EE010C94EE01A4 +:100020000C94EE010C94EE010C94EE010C94EE0194 +:100030000C94EE010C94EE010C94EE010C94EE0184 +:100040000C94EE010C94EE010C94EE010C94EE0174 +:100050000C94EE010C94EE010C94EE010C945310F0 +:100060000C94EE010C94EE010C94EE010C94EE0154 +:100070000C94EE010C94EE010C94EE010C94EE0144 +:100080000C94EE010C94EE010C94EE010C94EE0134 +:100090000C946A0E0C94400E0C94EE010C94EE013C +:1000A0000C94EE010C94EE010C94EE010C94EE0114 +:1000B0000C94EE010C94EE010C94EE010C94EE0104 +:1000C0000C94EE010C94EE010C94EE010C94EE01F4 +:1000D0000C94EE010C94EE010C94EE010C94EE01E4 +:1000E0000C94EE01CF0ED20EC10EC50EC90E090F33 +:1000F000D60EDA0EE00EE40EE80EEE0EF20EF60E5E +:10010000090FFC0E000F040F820F870F8C0F960F44 +:10011000A00F1910AA0FB20FBA0FC40FCE0FD80F2D +:10012000E70FF10F1910FB0F05100F100C945D066F +:100130000C94C50E0C94D20E0C94F0010C946B052B +:100140000C94E70F0C9450020C94EE0E0C943103B7 +:100150000C94E40E0C94000F0C942E030C94DA0E05 +:100160000C94D60E0C942E020C94C10E0C94BD0D62 +:100170000C94E6030C94FC0E0C9491070C94400430 +:100180000C9429030C94CE020C9422050C940D07B8 +:100190000C9495080C94AA0F0C94F2030C94E00EA6 +:1001A0000C940F100C94CF0E0C94F60C0C948C0F36 +:1001B0000C9433060C9442020C94BA0F0C949708DA +:1001C0000C94CE0F0C9487020C943D040C944304C1 +:1001D0000C94950D0C94FB030C94090F0C943803AC +:1001E0000C94D80F0C94E9030C943D070C94870FE2 +:1001F0000C94A00F0C94E80E0C94F8030C94820F4E +:100200000C94960F0C94F5030C941F020C94F10FB0 +:100210000C9405100C94F20E0C9434030C94FB0F08 +:100220000C94AB090C94040F0C9479060C942505DE +:100230000C941F050C9419100C94EC030C94EF0310 +:100240000C94E3030C9441130C94C40F0C94B20F60 +:100250000C94F60E0C94C90E00002000230026001A +:1002600029002C002F0032000001000003010601CC +:10027000090100002100240027002A002D00300081 +:10028000330001010000040107010A0100002200FF +:10029000250028002B002E00310034000201000050 +:1002A000050108010B0105050505070508080808F3 +:1002B000020202020A0A08080404040401010101FE +:1002C00001010101030303030303030304070707F9 +:1002D0000C0C0C0C0C0C0C0C02020202060606069E +:1002E000060606060B0B0B0B0B0B0B0B010210206B +:1002F000200808102040102040800201020108045C +:1003000002010102040810204080804020100804EF +:100310000201800402018040201008040201080448 +:10032000020101020408102040800102040810208C +:10033000408000000A0B02090C0D0E08070304019F +:1003400000000000000000000000000000000000AD +:10035000000000000000000000000000000012117A +:10036000100000000000000000000000000000007D +:100370000000000000000000411311241FBECFEF59 +:10038000D1E2DEBFCDBF00E00CBF14E0A0E0B2E0E0 +:10039000EAE6F2E300E00BBF02C007900D92AA303C +:1003A000B107D9F729E0AAE0B4E001C01D92AF3847 +:1003B000B207E1F711E0CDEBD1E000E006C02197F4 +:1003C0000109802FFE010E949B14CC3BD10780E0E5 +:1003D0000807A9F70E94E2100C9433190C9400004E +:1003E000CF92DF92EF92FF920F931F93CF93DF9301 +:1003F0006C017A018B01C0E0D0E0CE15DF0589F0F9 +:10040000D8016D918D01D601ED91FC910190F081A3 +:10041000E02DC6011995892B11F47E0102C02196A9 +:10042000ECCFC701DF91CF911F910F91FF90EF901B +:10043000DF90CF900895089580E090E00895FC014A +:10044000538D448D252F30E0842F90E0821B930B39 +:10045000541710F0CF96089501970895FC01918DDF +:10046000828D981761F0828DDF01A80FB11D5D9616 +:100470008C91928D9F5F9F73928F90E008958FEF84 +:100480009FEF0895FC01918D828D981731F0828D38 +:10049000E80FF11D858D90E008958FEF9FEF08958F +:1004A000FC01918D228D892F90E0805C9F4F821BF3 +:1004B00091098F739927089584E194E00E94500276 +:1004C00021E0892B09F420E0822F0895FC01848D1E +:1004D000DF01A80FB11DA35ABF4F2C91848D90E06E +:1004E00001968F739927848FA689B7892C93A08949 +:1004F000B1898C9180648C93938D848D981306C000 +:100500000288F389E02D80818F7D80830895EF92AA +:10051000FF920F931F93CF93DF93EC0181E0888FBD +:100520009B8D8C8D981305C0E889F989808185FDA4 +:1005300024C0F62E0B8D10E00F5F1F4F0F73112795 +:10054000E02E8C8DE8120CC00FB607FCFACFE889BC +:10055000F989808185FFF5CFCE010E946602F1CF37 +:100560008B8DFE01E80FF11DE35AFF4FF0820B8FD8 +:10057000EA89FB898081806207C0EE89FF896083F8 +:10058000E889F98980818064808381E090E0DF914F +:10059000CF911F910F91FF90EF900895CF93DF932C +:1005A000EC01888D8823C9F0EA89FB89808185FD6B +:1005B00005C0A889B9898C9186FD0FC00FB607FCCC +:1005C000F5CF808185FFF2CFA889B9898C9185FF0D +:1005D000EDCFCE010E946602E7CFDF91CF91089563 +:1005E00080E090E0892B41F080E090E0892B21F0C1 +:1005F0000E940000811121C080E090E0892B21F051 +:100600000E945C0281111CC080E090E0892B41F0C7 +:1006100080E090E0892B21F00E940000811113C03E +:1006200080E090E0892BA1F080E090E0892B81F0C0 +:100630000E94000081110AC008950E940000DCCFD2 +:100640000E940000E1CF0E940000EACF0C9400005D +:100650000895FC01EE57FB4F808108958EE992E0EA +:1006600008958FEB92E00895FC0186A197A108956B +:100670008F929F92AF92BF92CF92DF92EF92FF92B2 +:100680000F931F93CF93DF9300D01F921F92CDB78C +:10069000DEB78C016B0164E6C616D1043CF0FC01A8 +:1006A000EE57FB4F8081882309F478C0DA01ED9181 +:1006B000FC910190F081E02DB801655E7D4FCA018B +:1006C00019959C017801BCEEEB1ABDEFFB0A4FEFC8 +:1006D000F70140834EEF3196408331968083319607 +:1006E00090833196890F809580833196C082D8019E +:1006F000A65EBD4FDC9265E070E040E050E0C901CD +:1007000007966817790730F4A1914A0F511D6F5F62 +:100710007F4FF7CF6901F8E0CF0ED11C800F911FFA +:10072000FC01EC5EFD4F4095408341E0C41642E081 +:10073000D406C1F056014701D80112968D919C91C3 +:100740001397F40161914F01DC01ED91FC9101904F +:10075000F081E02D1995C4018E199F098C159D0516 +:100760005CF31EC08EE392E09A83898383E08B83DF +:1007700083ED92E09D838C83D801ED91FC910190F3 +:10078000F081E02DAE014F5F5F4F67E070E0C80180 +:100790001995AA24AA94BB24BA9402C0A12CB12C06 +:1007A000C5010F900F900F900F900F90DF91CF9198 +:1007B0001F910F91FF90EF90DF90CF90BF90AF907F +:1007C0009F908F9008958EE992E008958FEB92E0CC +:1007D00008958CE093E008958DE293E0089583E41A +:1007E00093E0089586E092E0089584E693E008950A +:1007F00085E893E00895AF92BF92CF92DF92EF9297 +:10080000FF920F931F93CF93DF935C01EB018881DD +:10081000F501828389819A81AB81BC81FB01359688 +:100820006C017D0125E0C20ED11CE11CF11C8F0181 +:10083000061B170B20E030E00C151D052E053F05AB +:1008400038F441919F0122503109E9014883EFCFEB +:10085000FB01E80FF91F14826C5F7F4FF501748371 +:1008600063830596DF91CF911F910F91FF90EF90D9 +:10087000DF90CF90BF90AF90089588E993E00895FE +:1008800089EB93E008956F927F928F929F92AF923F +:10089000BF92CF92DF92EF92FF920F931F93CF936D +:1008A000DF93DC01FB01808190E013969C938E9393 +:1008B00012972181922B13969C938E93129702810B +:1008C0001381248135815B0186E0A80EB11C68018B +:1008D0007901C6E0CC0ED11CE11CF11CA5014E1B18 +:1008E0005F0B60E070E04C155D056E057F0540F420 +:1008F000E50149915E01CE010297EC014883EECFFC +:10090000EF01C00FD11F1D82CF01059615969C9354 +:100910008E931497EF01C00FD11F4E815F816885C0 +:100920007985065F1F4F3F01600E711E6801012E21 +:10093000000CEE08FF08C40ED51EE61EF71E43018C +:100940008E1A9F0AA12CB12C8C149D04AE04BF04F6 +:1009500040F4E30129913E01CE010297EC01288386 +:10096000EECF400F511F9F01240F351FC901019782 +:10097000EC011882C80101978E0F9F1F17969C9358 +:100980008E931697E90188809980AA80BB804C5F7E +:100990005F4F3F01640E751E8A01052E000C220B6D +:1009A000330B080D191D2A1D3B1D6301CE1ADF0AEA +:1009B000E12CF12CC016D106E206F30640F4E30167 +:1009C00069913E01CE010297EC016883EECFCA0126 +:1009D000880D991D8F01080F191F980121503109A9 +:1009E000E9011882BA0161507109E60FF71F1996E3 +:1009F000FC93EE931897F8012181428150E060E06A +:100A000070E0BA0155274427522B2081422B2381C5 +:100A1000722B1A964D935D936D937C931D9704965C +:100A2000DF91CF911F910F91FF90EF90DF90CF90CA +:100A3000BF90AF909F908F907F906F90089582EDC0 +:100A400093E0089583EF93E00895FC01DB014C915E +:100A500050E060E070E042835383648375831196B5 +:100A60008C911197582B428353836483758312961C +:100A70008C911297682B42835383648375831396FA +:100A80008C911397782B42835383648375831496D8 +:100A90004C91149750E060E070E046835783608784 +:100AA000718715968C911597582B468357836087CD +:100AB000718716968C911697682B468357836087AB +:100AC000718717968C91782B46835783608771873F +:100AD00088E090E00895DC01FB0112968C9112975A +:100AE000808313968C911397818314968C9114971D +:100AF000828315968C911597838316968C91169701 +:100B0000848317968C911797858318968C911897E4 +:100B1000868319968C91878388E090E008958F9260 +:100B20009F92AF92BF92CF92DF92EF92FF920F937C +:100B30001F93FC01DB01C380C294C69427E0C2224C +:100B40008C2C912CA12CB12C8D929D92AD92BC92AB +:100B50001397C480D12CE12CF12C33E0CC0CDD1C9C +:100B6000EE1CFF1C3A95D1F7C828D928EA28FB28A3 +:100B7000CD92DD92ED92FC921397058110E020E07A +:100B800030E04BE0000F111F221F331F4A95D1F7B1 +:100B9000C02AD12AE22AF32ACD92DD92ED92FC926C +:100BA000139706810F7010E020E030E053E1000F52 +:100BB000111F221F331F5A95D1F70C291D292E29E9 +:100BC0003F290D931D932D933C9313978681829516 +:100BD0008F7047814F7750E060E070E094E0440F01 +:100BE000551F661F771F9A95D1F7482B4115510560 +:100BF00061057105A1F0405853406109710997E101 +:100C0000440F551F661F771F9A95D1F7402B512B24 +:100C1000622B732B4D935D936D937C931397478158 +:100C2000407850E060E070E0742F66275527442735 +:100C30000D911D912D913C911397402B512B622BBF +:100C4000732B4D935D936D937C93139788E090E0A5 +:100C50001F910F91FF90EF90DF90CF90BF90AF90DA +:100C60009F908F900895EF92FF920F931F93CF93D1 +:100C7000DF938C017B01BC016E5F7F4FC7010E9437 +:100C80008F05EC01B8016A5F7F4FC7018C0F9D1F74 +:100C90000E948F05C80FD91FB801665F7F4FC7013B +:100CA0008C0F9D1F0E948F058C0F9D1FDF91CF9190 +:100CB0001F910F91FF90EF900895EF92FF920F9385 +:100CC0001F93CF93DF937C01EB0102960E943306C2 +:100CD0008C01BE01680F791FC70140960E94330640 +:100CE000800F911FDF91CF911F910F91FF90EF9097 +:100CF00008950F931F93CF93DF938C01EC012696F9 +:100D0000CE010E945D06D8019496ED91FC919597D5 +:100D1000CE01DF91CF911F910F9119948F929F92E5 +:100D2000AF92BF92CF92DF92EF92FF920F931F93F9 +:100D3000CF93DF93EC01CB01BA018B019C0147E11A +:100D400035952795179507954A95D1F711272227AD +:100D50003327011511052105310521F000581C4FDD +:100D60002F4F3F4F188219821A826B017C0145E098 +:100D7000CC0CDD1CEE1CFF1C4A95D1F7CB826B011D +:100D80007C0153E0F594E794D794C7945A95D1F732 +:100D9000CC826B017C01EBE0F594E794D794C79487 +:100DA000EA95D1F7CD8268017901F4E0CC0CDD1C25 +:100DB000EE1CFF1CFA95D1F74B015C01A3E1B59441 +:100DC000A79497948794AA95D1F7482D4F70C42A79 +:100DD000CE8268017901B4E0F594E794D794C79482 +:100DE000BA95D1F720E030E0A9010E943E1587FDB9 +:100DF00002C0CF8203C00C2D00680F8388E090E012 +:100E0000DF91CF911F910F91FF90EF90DF90CF90E6 +:100E1000BF90AF909F908F900895EF92FF920F93A5 +:100E20001F93CF93DF937C018B01FC01428153819F +:100E300064817581C8010E948E06EC01F70146812C +:100E4000578160857185C8018C0F9D1F0E948E0699 +:100E5000C80FD91FF7014285538564857585C80180 +:100E60008C0F9D1F0E948E068C0F9D1FDF91CF91CE +:100E70001F910F91FF90EF900895EF92FF920F93C3 +:100E80001F93CF93DF937C01EB0102960E940D0725 +:100E90008C01BE01680F791FC70140960E940D07A3 +:100EA000800F911FDF91CF911F910F91FF90EF90D5 +:100EB00008950F931F93CF93DF93CDB7DEB72A9793 +:100EC0000FB6F894DEBF0FBECDBF8C0182E392E077 +:100ED0009A8389831B821C821D821E821F82188630 +:100EE00019861A86D801ED91FC910190F081E02DD0 +:100EF000AE014F5F5F4F6AE070E0C80119950E9434 +:100F00004710F80160877187828793872A960FB60A +:100F1000F894DEBF0FBECDBFDF91CF911F910F912F +:100F200008954F925F926F927F928F929F92AF92AD +:100F3000BF92CF92DF92EF92FF92CF93DF93EC01BB +:100F40000E9447106093D9047093DA048093DB0405 +:100F50009093DC0481E090E090930F0480930E0462 +:100F60004C805D806E807F802CE53FE842E45DE34D +:100F70006A8D7B8D8C8D9D8D0E94A2166B017C01EC +:100F800061E088E10E94A00E61E089E10E94A00E6C +:100F9000A7019601C301B2010E94D1144B015C016B +:100FA000A3019201C701B6010E94D2146B017C011A +:100FB00020E030E0A901C501B4010E949D16181679 +:100FC00024F0C501B401905802C0C501B4012AE063 +:100FD00037ED43E25EE30E949D161816C4F52AE041 +:100FE00037ED43E25EE3C701B6010E94A2166B0132 +:100FF0007C0120E030E0A901C501B4010E949D16EA +:10100000A501940118160CF05058C701B6010E94B2 +:1010100043156B017C012AE037ED43E25EE3C50135 +:10102000B4010E94A2162B013C0120E030E0A9018E +:10103000C501B4010E949D16A501940118160CF07B +:101040005058C301B2010E9443154B015C0120E0DE +:1010500030E0A901C701B6010E949D16181624F0C0 +:10106000C701B601905802C0C701B6012AE037EDAA +:1010700043E25EE30E949D161816C4F52AE037EDA0 +:1010800043E25EE3C501B4010E94A2164B015C017C +:1010900020E030E0A901C701B6010E949D16A7011A +:1010A000960118160CF05058C501B4010E94431562 +:1010B0004B015C012AE037ED43E25EE3C701B60174 +:1010C0000E94A2162B013C0120E030E0A901C701DB +:1010D000B6010E949D16A701960118160CF05058F3 +:1010E000C301B2010E9443156B017C0180920A0486 +:1010F00090920B04A0920C04B0920D04C0921004C4 +:10110000D0921104E0921204F0921304DF91CF9177 +:10111000FF90EF90DF90CF90BF90AF909F908F9017 +:101120007F906F905F904F9008950E94F8174F92B4 +:101130005F926F927F928F929F92AF92BF92CF9267 +:10114000DF92EF92FF920F931F93CF93DF93EC0107 +:101150007B01DB011C918A81811750F4B4E01B9F55 +:10116000B00111248F8198850E940F1798878F8373 +:101170001A83F701379680E024E030E06E0193E0B7 +:10118000C90ED11C9A8189010C5F1F4F891790F5F8 +:10119000408150E060E070E0742F662755274427B7 +:1011A0009F0123503109D9019C91492B2F5F3F4F5B +:1011B000D9019C91592B2F5F3F4FD9019C91692BED +:1011C0004B835C836D837E8398014F815885B4E0A7 +:1011D0008B9F400D511D1124D6018D909D90AD9097 +:1011E000BC90DA018D929D92AD92BC9213978F5F65 +:1011F0003496C8CFF701E20FF31FB08089858B15B5 +:1012000050F4B4E0BB9EB00111248E859F850E94EE +:101210000F179F878E87B98640E0BE01665F7F4FBC +:101220008985F701E00FF11F0C5F1F4F481720F56C +:101230005181828190E0A0E0B0E0DC01992788270D +:10124000952B5081852B2381B22B8A879B87AC8776 +:10125000BD87AE85BF85E4E04E9FA00DB11D112472 +:10126000FB0180809180A280B3808D929D92AD928F +:10127000BC9213974F5FD4CFB08088898B1550F400 +:101280006B2D70E0660F771F8B899C890E940F176A +:101290009C8B8B8BB88A90E06E01F1E1CF0ED11C54 +:1012A0008889981708F045C0F701E00FF11F4081C9 +:1012B00051816281738198012C5F3F4FF701E20FEA +:1012C000F31F4901032E000CAA08BB08840E951ECB +:1012D000A61EB71E8F010E191F092801612C712C43 +:1012E000481459046A047B0438F481918F01025038 +:1012F0001109D8018C93EECF420F531FF701E40F71 +:10130000F51F31971082215031092E0D3F1D3A8B68 +:10131000298B8A012B898C89E22FF82FE90FF11D87 +:10132000E90FF11DD6012D913C91318320839F5F00 +:10133000B7CFC801DF91CF911F910F91FF90EF9030 +:10134000DF90CF90BF90AF909F908F907F906F90E5 +:101350005F904F9008952F923F924F925F926F92BD +:101360007F928F929F92AF92BF92CF92DF92EF9235 +:10137000FF920F931F93CF93DF93CDB7DEB7A8975C +:101380000FB6F894DEBF0FBECDBF8C010E94471090 +:101390002B013C01980129573B4F3C8B2B8BF901CA +:1013A00080819181A281B381A3019201281B390B15 +:1013B0004A0B5B0BDA01C901893F9A42A105B105CD +:1013C00010F035971082780148E8E41A4BEFF40AE0 +:1013D000D7018D919C91892B79F0F801E557FB4F4E +:1013E00080819181A281B38184159505A605B705F9 +:1013F00018F4F70111821082980120583B4F388B66 +:101400002F87A80144585B4F5A8B498BC8014496DB +:101410009E8B8D8BD801AE57BB4FBA8FA98FF80129 +:10142000E057FB4FF8A3EF8F215F3F4F3AA329A36B +:10143000180136E8231A3BEF330A4E5F5F4F588F8F +:101440004F8B89589B4F9CA38BA3A30192012C5EC9 +:101450003F4F4F4F5F4F2DA33EA34FA358A7D80137 +:1014600012968D919C911397DC01ED91FC91028471 +:10147000F385E02D19959C0197FD77C2EF85F889DA +:1014800080819181820F931F91838083D7014D9139 +:101490005C9147305105C9F4EF89F88D80819181C5 +:1014A000AC014F5F5F4F51834083F801E80FF91F94 +:1014B000248BD1018D919C91119701978D939C93D1 +:1014C000892B69F688E090E033C04115510541F55C +:1014D0002F3F310589F481E090E0D7018D939C93F3 +:1014E0002DA13EA14FA158A5ABA1BCA12D933D9329 +:1014F0004D935C931397B3CF0E944710DC01CB014F +:1015000084199509A609B7090697A105B10508F43C +:10151000A6CFF801EE57FB4F10828EEF9FEF4DC222 +:1015200041305105A9F42E3F310531F482E090E0BD +:10153000F7019183808393CFD7011D921C92E98D8F +:10154000FA8D808181118BCFC8010E94590787CF06 +:101550004230510589F4D1012D933C93EF89F88DE8 +:101560001182108283E090E0D7018D939C93EF85E8 +:10157000F8893183208373CF4330510569F4322FCA +:101580002227D1018D919C911197280F391F2D93FE +:101590003C9384E090E0CCCF4430510589F460E086 +:1015A00071E00E9446148F3F910531F485E090E090 +:1015B000D7018D939C9353CFF701118210824FCFA7 +:1015C0004530510571F4A989BA892D933C9386E081 +:1015D00090E0F70191838083AF85B8892D933C9388 +:1015E0003ECF4630510599F4322F2227E989FA89F6 +:1015F00080819181280F391F3183208387E090E01B +:10160000D7018D939C93F1018081918159CF48300E +:10161000510509F024CFD7011D921C9260E071E0C2 +:101620000E9446148F3F910509F019CFE989FA8984 +:1016300080819181009709F0C7C0C8010E945907B5 +:1016400086E292E09A8389831C821B828BE093E07E +:101650009E838D8398878F839A8789871B861C86B4 +:101660001D861E865801FCEEAF1AFBEFBF0A68010B +:101670002AEBC21A2BEFD20AD501ED91FC913097DB +:10168000D9F1848195819C838B83808191819E8314 +:101690008D8382819381DC01ED91FC910480F58141 +:1016A000E02D199598878F83D501ED91FC9182816A +:1016B0009381DC01ED91FC910680F781E02D199575 +:1016C0009A87898720E032E040E050E02B873C8712 +:1016D0004D875E87D8018D919C91F501A081B181E4 +:1016E00018966D917C911997DC01ED91FC91AE01FA +:1016F0004F5F5F4FC8011995B2E0AB0EB11CAC143F +:10170000BD0409F0B9CF812C92E0992EA12CB12C07 +:10171000F601A081B1811097E1F112968D919C9113 +:1017200013979C838B8314968D919C9115979E8320 +:101730008D83ED91FC9111970480F581E02DCD0111 +:10174000199598878F83D6018D919C91DC01ED913D +:10175000FC910680F781E02D19959A8789878B8601 +:101760009C86AD86BE86D801ED91FC9120803180AB +:10177000F60180819181DC01ED91FC910280F38181 +:10178000E02D1995AE014F5F5F4FBC01C801F1011B +:101790001995F2E0CF0ED11CCE14DF0409F0B8CFBA +:1017A000F801EE57FB4F81E08083319640825182F1 +:1017B00062827382AB89BC894D925D926D927C92FC +:1017C00013978FEF9FEFF9C08A30910509F0A2C0FF +:1017D00082E392E09A8389831B821C821D821E828F +:1017E0001F82188619861A860E944710F801808485 +:1017F0009184A284B3849B01AC01281939094A0958 +:101800005B0949015A016D897E89CE0101960E94CA +:101810002505C501B40128EE33E040E050E00E9408 +:101820005A148B809C80AD80BE80820E931EA41EB5 +:10183000B51E8B829C82AD82BE829B01AC0160E4AE +:1018400072E48FE090E00E9436148F809884A9841F +:10185000BA84DC01CB01880D991DAA1DBB1D8F83A5 +:101860009887A987BA870E9447108F809884A98497 +:10187000BA8436E3931A35E6A30A34ECB30A28EEA9 +:1018800033E040E050E00E945A142B8F3C8F4D8F84 +:101890005E8F9B01AC0160E472E48FE090E00E94F7 +:1018A0003614A5019401261B370B480B590BCA01AE +:1018B000B9018B809C80AD80BE8031E0831A910895 +:1018C000A108B1082B8D3C8D4D8D5E8D821A930A37 +:1018D000A40AB50A20E03AEC4AE95BE30E945A14F4 +:1018E000820E931EA41EB51ED8011C968D929D9249 +:1018F000AD92BC921F97F801608B718B828B938B9A +:101900000E944710AB89BC896D937D938D939C9306 +:101910001397A5CD8630910559F46D897E898F8DF9 +:1019200098A10E94970881E0E9A1FAA1808397CD50 +:101930008B30910521F4A98DBA8D1C9290CDFC01BC +:10194000E154FE4FEE0FFF1FE00FF11F80819181E8 +:10195000009709F484CDDC01ED91FC910190F081B8 +:10196000E02D6D897E8919957ACDF801EE57FB4FF0 +:101970008081882301F17801BDE7EB1ABBEFFB0AF8 +:10198000F70180819181A281B381A3019201281B7B +:10199000390B4A0B5B0BDA01C901853C9940A10563 +:1019A000B10548F0C8010E945907D7014D925D92D8 +:1019B0006D927C92139780E090E0A8960FB6F89411 +:1019C000DEBF0FBECDBFDF91CF911F910F91FF9072 +:1019D000EF90DF90CF90BF90AF909F908F907F90CF +:1019E0006F905F904F903F902F900895BF92CF924D +:1019F000DF92EF92FF920F931F93CF93DF93EC014F +:101A00008B018A81FB018083118212821382DB01A8 +:101A1000179680E0E4E0F0E09A819F012C5F3F4F51 +:101A20008917B8F4EF81F88594E0899FE00DF11DE6 +:101A300011247081518142819381FD01339770831C +:101A400031965083319640839C93F9018F5F1496B1 +:101A5000E3CF8985E00FF11F808311821282138208 +:101A600080E09985F801E20FF31F2C5F3F4F891743 +:101A7000B0F4AE85BF8594E0899FA00DB11D1124FF +:101A80006C9111965C91119712964C911297139646 +:101A90009C9160835183428393838F5FE2CF8889D7 +:101AA000808311821282C9011382B12C2889B21657 +:101AB00090F5EB2DF0E0EE0FFF1FAB89BC89AE0F68 +:101AC000BF1F2D913C91D9010D900020E9F711978E +:101AD0006D01C21AD30AD801A80FB91FA60160E090 +:101AE00070E04D935D936D937C9313977C0124E09C +:101AF000E20EF11C8B899C89E80FF91F60817181CE +:101B0000A601C8018E0D9F1D0E94FD17C6018E0DF6 +:101B10009F1DB394CBCFDF91CF911F910F91FF9079 +:101B2000EF90DF90CF90BF900895CF93DF93DC01CB +:101B3000FB0112968C911297808313968D919C9144 +:101B40001497EC0109900020E9F72197C81BD90BE5 +:101B5000AE0160E070E04183528363837483139627 +:101B60006D917C911497AE01CF0105960E94FD17EF +:101B7000CE010596DF91CF910895CF92DF92EF923B +:101B8000FF920F931F93CF93DF937C01EB01FC0136 +:101B90008281888383818983A481B581FD0101903D +:101BA0000020E9F731976F01CA1ADB0AC601A0E0ED +:101BB000B0E08A839B83AC83BD83F7016481758128 +:101BC000A601CE0106960E94FD17F701A681B781F6 +:101BD000FD0101900020E9F731978F010A1B1B0BD3 +:101BE000FE01EC0DFD1DC801A0E0B0E086839783E7 +:101BF000A087B187FAE0CF0ED11CF701668177810B +:101C0000A801CE018C0D9D1D0E94FD170C0D1D1D00 +:101C1000F701A085B185FD0101900020E9F731971A +:101C20006F01CA1ADB0AFE01E00FF11FC601A0E036 +:101C3000B0E080839183A283B3830C5F1F4FF701D1 +:101C400060857185A601CE01800F911F0E94FD174E +:101C50000C0D1D1DF7014285238594858585C00FD8 +:101C6000D11F488329839A838B83C8010496DF910F +:101C7000CF911F910F91FF90EF90DF90CF9008953B +:101C80001F920F920FB60F9211240BB60F922F9343 +:101C90003F934F935F936F937F938F939F93AF93F4 +:101CA000BF93EF93FF9384E194E00E946602FF915B +:101CB000EF91BF91AF919F918F917F916F915F91C4 +:101CC0004F913F912F910F900BBE0F900FBE0F9031 +:101CD0001F9018951F920F920FB60F9211240BB6FA +:101CE0000F922F938F939F93EF93FF93E091240490 +:101CF000F09125048081E0912A04F0912B0482FD6B +:101D000012C0908180912D048F5F8F7320912E04DB +:101D1000821751F0E0912D04F0E0EC5EFB4F958FBF +:101D200080932D0401C08081FF91EF919F918F914D +:101D30002F910F900BBE0F900FBE0F901F90189514 +:101D4000362F90E0FC01EE5CFC4F4491FC01E45125 +:101D5000FD4F2491FC01EA55FD4F9491992309F41C +:101D60006BC0442309F455C050E0FA013197E231C9 +:101D7000F10508F04EC08827EE58FF4F8F4F0C94A6 +:101D80009B14809180008F7707C0809180008F7DA9 +:101D900003C080918000877F809380003AC084B523 +:101DA0008F7702C084B58F7D84BD33C08091B00031 +:101DB0008F7703C08091B0008F7D8093B00029C0E1 +:101DC000809190008F7707C0809190008F7D03C035 +:101DD00080919000877F809390001BC08091A0002D +:101DE0008F7707C08091A0008F7D03C08091A000F5 +:101DF000877F8093A0000DC0809120018F7707C05E +:101E0000809120018F7D03C080912001877F809386 +:101E10002001E92FF0E0EE0FFF1FE457FD4FA591E1 +:101E2000B4918FB7F894EC91311103C020952E2313 +:101E300001C02E2B2C938FBF0895CF93DF9390E09A +:101E4000FC01E451FD4F2491FC01EA55FD4F8491C2 +:101E5000882361F190E0880F991FFC01EE58FD4F37 +:101E6000C591D491FC01E457FD4FA591B491611146 +:101E700009C09FB7F8948881209582238883EC91CC +:101E80002E230BC0623061F49FB7F8943881822F03 +:101E9000809583238883EC912E2B2C939FBF06C0C3 +:101EA0008FB7F894E8812E2B28838FBFDF91CF91D5 +:101EB00008951F93CF93DF93182FEB0161E00E94E9 +:101EC0001D0F209711F460E004C0CF3FD10539F415 +:101ED00061E0812FDF91CF911F910C94A00EE12F33 +:101EE000F0E0EE5CFC4FE4914E2F50E0FA013197A8 +:101EF000E231F10508F09DC08827EC57FF4F8F4F66 +:101F00000C949B1484B5806884BDC7BD97C084B50C +:101F1000806284BDC8BD92C080918000806880933B +:101F20008000D0938900C093880088C08091800091 +:101F3000806280938000D0938B00C0938A007EC023 +:101F400080918000886080938000D0938D00C09342 +:101F50008C0074C08091B00080688093B000C09302 +:101F6000B3006CC08091B00080628093B000C093D9 +:101F7000B40064C080919000806880939000D093FA +:101F80009900C09398005AC080919000806280931D +:101F90009000D0939B00C0939A0050C08091900015 +:101FA000886080939000D0939D00C0939C0046C0B1 +:101FB0008091A00080688093A0008091A0008F7B1A +:101FC0008093A000D093A900C093A80037C080914F +:101FD000A00080628093A000D093AB00C093AA00C1 +:101FE0002DC08091A00088608093A000D093AD00A8 +:101FF000C093AC0023C080912001806880932001B1 +:10200000D0932901C093280119C0809120018062DA +:1020100080932001D0932B01C0932A010FC080919F +:102020002001886080932001D0932D01C0932C0162 +:1020300005C0C038D1050CF04BCF45CFDF91CF9113 +:102040001F9108953FB7F89480918709909188096E +:10205000A0918909B0918A0926B5A89B05C02F3F98 +:1020600019F00196A11DB11D3FBFBA2FA92F982FBE +:102070008827820F911DA11DB11DBC01CD0142E039 +:10208000660F771F881F991F4A95D1F708952FB7BC +:10209000F8946091830970918409809185099091E9 +:1020A00086092FBF08951F920F920FB60F92112429 +:1020B0002F933F938F939F93AF93BF938091830907 +:1020C00090918409A0918509B09186093091820987 +:1020D00023E0230F2D3720F40196A11DB11D05C06B +:1020E00026E8230F0296A11DB11D2093820980933B +:1020F000830990938409A0938509B0938609809100 +:10210000870990918809A0918909B0918A0901965F +:10211000A11DB11D8093870990938809A093890917 +:10212000B0938A09BF91AF919F918F913F912F9169 +:102130000F900FBE0F901F901895CF92DF92EF92E5 +:10214000FF920F931F93E82FF92F05C0015011093B +:102150002109310961F1908196239417B9F305C0E3 +:10216000015011092109310911F19081962394132D +:10217000F7CFC12CD12CE12CF12C0AC08FEFC81A5B +:10218000D80AE80AF80A0C151D052E053F0579F056 +:1021900080818623841791F36C2D7D2D8E2D9F2DAC +:1021A0001F910F91FF90EF90DF90CF90089560E026 +:1021B00070E080E090E01F910F91FF90EF90DF9032 +:1021C000CF900895789484B5826084BD84B5816091 +:1021D00084BD85B5826085BD85B5816085BD8091F2 +:1021E0006E00816080936E0010928100809181006A +:1021F0008260809381008091810081608093810062 +:10220000809180008160809380008091B100846023 +:102210008093B1008091B00081608093B000809184 +:102220009100826080939100809191008160809301 +:102230009100809190008160809390008091A10036 +:1022400082608093A1008091A10081608093A100B1 +:102250008091A00081608093A00080912101826024 +:1022600080932101809121018160809321018091DF +:10227000200181608093200180917A0084608093A6 +:102280007A0080917A00826080937A0080917A004F +:10229000816080937A0080917A00806880937A00D0 +:1022A0001092C10061E087E00E941D0F61E088E1AB +:1022B0000E941D0F61E086E00E941D0F61E083E037 +:1022C0000E941D0F61E089E10E941D0F61E082E024 +:1022D0000E941D0F61E087E10E941D0F60E086E112 +:1022E0000E941D0F61E08DE00E941D0FC090E1046F +:1022F000D090E204E090E304F090E404C091DF04A5 +:10230000D091E00460E079E08DE390E0A7019601D0 +:102310000E945A14DA01C9010197A109B109B695C1 +:10232000A795979587959C01E889F98982E0808334 +:10233000C11481EED806E104F10421F02115E0E199 +:102340003E07A8F0E889F989108260E874E88EE118 +:1023500090E0A70196010E945A14DA01C901019781 +:10236000A109B109B695A795979587959C01EC852C +:10237000FD853083EE85FF852083188EEC89FD89ED +:1023800086E08083EA89FB89808180618083EA8995 +:10239000FB89808188608083EA89FB8980818068ED +:1023A0008083EA89FB8980818F7D80831092560922 +:1023B00010925509109258091092570910925C0911 +:1023C00010925B0910925A0910925909E3E2F9E060 +:1023D00080E090E021913191232B81F4FC01EE0FFC +:1023E000FF1FED5DF64F21EB34E0318320838C59E4 +:1023F0009F4F9093B4048093B30404C00196893135 +:10240000910541F710920F0410920E0423E0222E42 +:10241000312CC3E2D0E08DED94E00E94AB090E9424 +:1024200047102091D9043091DA04621B730B653F89 +:10243000714024F010920F0410920E0460E087E1C6 +:102440000E94A00EC1010197F1F761E087E10E94AF +:10245000A00ECE010197F1F760E087E10E94A00E87 +:10246000E2E0F3E06491ECEBF2E08491E82FF0E03D +:10247000EE0FFF1FE85AFD4F8591949100E412E49E +:102480002FE030E0462F0E949D10611571058105F7 +:10249000910549F0DC01CB010196A11DB11DBC01E4 +:1024A000CD019F7003C060E070E0CB012AE330E013 +:1024B00040E050E00E947C14CA01B9010E94ED1571 +:1024C0006B017C0120E030E040E751E40E943E15C2 +:1024D00087FD24C020E030E040EF51E4C701B601A1 +:1024E0000E943E1587FF0FC061E08DE00E94A00EA4 +:1024F00020E030E040EF51E4C701B6010E944315EF +:102500006B017C010EC060E08DE00E94A00EC12C2A +:10251000D12C80E8E82E8FE3F82E03C0C12CD12CFB +:10252000760160910E0470910F04072E000C880B49 +:10253000990B0E94ED152B013C0120911004309164 +:1025400011044091120450911304C701B6010E9476 +:10255000A216A30192010E94A2164B015C012091D8 +:102560000A0430910B0440910C0450910D04C701F2 +:10257000B6010E94A216A30192010E94A2166B014D +:102580007C0120E030E0A9010E949D1687FD16C065 +:1025900020E030E04FE753E4C701B6010E94A216E5 +:1025A0002AE037ED43E25EE30E9443150E94B51531 +:1025B00086E00E94590F60E070E015C060E070E0B6 +:1025C00086E00E94590F20E030E04FE753ECC7014E +:1025D000B6010E94A2162AE037ED43E25EE30E94B4 +:1025E00043150E94B51587E00E94590F20E030E0A6 +:1025F000A901C501B4010E949D1687FD16C020E007 +:1026000030E04FE753E4C501B4010E94A2162AE06E +:1026100037ED43E25EE30E9443150E94B51582E068 +:102620000E94590F60E070E015C060E070E082E049 +:102630000E94590F20E030E04FE753ECC501B40190 +:102640000E94A2162AE037ED43E25EE30E944315A2 +:102650000E94B51583E00E94590F0E9422106B0161 +:102660007C010E942210DC01CB018C199D09AE096E +:10267000BF09883E9340A105B10598F30E94F0027E +:10268000CACE109217041092160488EE93E0A0E0D0 +:10269000B0E08093180490931904A0931A04B093A7 +:1026A0001B048AE492E090931504809314048DEC4B +:1026B00090E090932104809320048CEC90E0909320 +:1026C00023048093220488EC90E090932504809367 +:1026D000240489EC90E090932704809326048AECEC +:1026E00090E090932904809328048EEC90E09093DE +:1026F0002B0480932A0410922D0410922E04109221 +:102700002F04109230048CE892E09093DE048093C2 +:10271000DD0484E194E09093E0048093DF0480E0A2 +:1027200091EEA0E0B0E08093E1049093E204A093E6 +:10273000E304B093E40410925F0984E792E090937D +:102740006E0980936D0910926F09109275091092AD +:1027500074091092760910927C0910927B091092EC +:102760007D091092810910928009E1EFF8E0119241 +:10277000119289E0E332F807D1F7E3E2F9E0119230 +:10278000119289E0E535F807D1F7E1EFF4E0119215 +:1027900086E0E13FF807D9F7E1EFF6E0119288E033 +:1027A000E13FF807D9F70E9447106093D90470936E +:1027B000DA048093DB049093DC0486E992E0909342 +:1027C000B2048093B10488E692E09093B8048093B9 +:1027D000B7048CE592E09093BA048093B904109208 +:1027E000BB041092BC041092BD041092BE0410925F +:1027F000BF041092C0041092C1041092C20410923F +:10280000C3041092C4041092C5041092C60490939D +:10281000C8048093C7041092C9041092CA0410928D +:10282000CB041092CC041092CD041092CE041092DE +:10283000CF041092D0041092D1041092D2041092BE +:10284000D3041092D40481E997E09093D604809346 +:10285000D50481E090E09093D8048093D70481E080 +:1028600094E09093B6048093B5040895DB018F93B0 +:102870009F930E94A314BF91AF91A29F800D911DC1 +:10288000A39F900DB29F900D1124089597FB072EE2 +:1028900016F4009407D077FD09D00E94AE1407FC0F +:1028A00005D03EF4909581959F4F08957095619560 +:1028B0007F4F0895A1E21A2EAA1BBB1BFD010DC07C +:1028C000AA1FBB1FEE1FFF1FA217B307E407F507E0 +:1028D00020F0A21BB30BE40BF50B661F771F881FBC +:1028E000991F1A9469F760957095809590959B0152 +:1028F000AC01BD01CF010895052E97FB1EF4009495 +:102900000E94931457FD07D00E945A1407FC03D06D +:102910004EF40C94931450954095309521953F4F6B +:102920004F4F5F4F089590958095709561957F4FBB +:102930008F4F9F4F0895EE0FFF1F881F8BBF07908B +:10294000F691E02D19940E94C214A59F900DB49F9A +:10295000900DA49F800D911D11240895AA1BBB1BEF +:1029600051E107C0AA1FBB1FA617B70710F0A61B8F +:10297000B70B881F991F5A95A9F780959095BC01B0 +:10298000CD010895A29FB001B39FC001A39F700D18 +:10299000811D1124911DB29F700D811D1124911D67 +:1029A00008955058BB27AA270E94E9140C94631677 +:1029B0000E94551638F00E945C1620F039F49F3FB3 +:1029C00019F426F40C9452160EF4E095E7FB0C94DF +:1029D0004C16E92F0E94741658F3BA176207730752 +:1029E0008407950720F079F4A6F50C9496160EF45A +:1029F000E0950B2EBA2FA02D0B01B90190010C010F +:102A0000CA01A0011124FF27591B99F0593F50F426 +:102A1000503E68F11A16F040A22F232F342F44277E +:102A2000585FF3CF469537952795A795F040539576 +:102A3000C9F77EF41F16BA0B620B730B840BBAF046 +:102A40009150A1F0FF0FBB1F661F771F881FC2F7B1 +:102A50000EC0BA0F621F731F841F48F487957795C5 +:102A60006795B795F7959E3F08F0B0CF9395880F7F +:102A700008F09927EE0F9795879508950E942816DC +:102A800008F481E008950E9457150C9463160E9483 +:102A90005C1658F00E94551640F029F45F3F29F06B +:102AA0000C944C1651110C9497160C9452160E94CB +:102AB000741668F39923B1F3552391F3951B550BC5 +:102AC000BB27AA2762177307840738F09F5F5F4F01 +:102AD000220F331F441FAA1FA9F335D00E2E3AF040 +:102AE000E0E832D091505040E695001CCAF72BD058 +:102AF000FE2F29D0660F771F881FBB1F26173707A9 +:102B00004807AB07B0E809F0BB0B802DBF01FF27DA +:102B100093585F4F3AF09E3F510578F00C944C1655 +:102B20000C9497165F3FE4F3983ED4F3869577951F +:102B30006795B795F7959F5FC9F7880F911D969593 +:102B4000879597F90895E1E0660F771F881FBB1FEF +:102B5000621773078407BA0720F0621B730B840B9C +:102B6000BA0BEE1F88F7E09508950E94BC15689493 +:102B7000B1110C94971608950E947C1688F09F5707 +:102B800098F0B92F9927B751B0F0E1F0660F771F91 +:102B9000881F991F1AF0BA95C9F714C0B13091F087 +:102BA0000E949616B1E008950C949616672F782F20 +:102BB0008827B85F39F0B93FCCF38695779567954C +:102BC000B395D9F73EF490958095709561957F4FB8 +:102BD0008F4F9F4F0895E89409C097FB3EF490955E +:102BE0008095709561957F4F8F4F9F4F9923A9F0E6 +:102BF000F92F96E9BB279395F69587957795679575 +:102C0000B795F111F8CFFAF4BB0F11F460FF1BC0B8 +:102C10006F5F7F4F8F4F9F4F16C0882311F096E94B +:102C200011C0772321F09EE8872F762F05C06623F9 +:102C300071F096E8862F70E060E02AF09A95660FB2 +:102C4000771F881FDAF7880F9695879597F908956B +:102C5000990F0008550FAA0BE0E8FEEF16161706AD +:102C6000E807F907C0F012161306E407F50798F015 +:102C7000621B730B840B950B39F40A2661F0232B2E +:102C8000242B252B21F408950A2609F4A140A695AA +:102C90008FEF811D811D089597F99F6780E870E08F +:102CA00060E008959FEF80EC089500240A941616C2 +:102CB000170618060906089500240A94121613062A +:102CC000140605060895092E0394000C11F48823B8 +:102CD00052F0BB0F40F4BF2B11F460FF04C06F5FD4 +:102CE0007F4F8F4F9F4F089557FD9058440F551FAA +:102CF00059F05F3F71F04795880F97FB991F61F07E +:102D00009F3F79F087950895121613061406551FF4 +:102D1000F2CF4695F1DF08C0161617061806991F60 +:102D2000F1CF86957105610508940895E894BB2755 +:102D300066277727CB0197F908950E94281608F493 +:102D40008FEF08950E94B5160C9463160E945516D5 +:102D500038F00E945C1620F0952311F00C944C166C +:102D60000C94521611240C9497160E94741670F34A +:102D7000959FC1F3950F50E0551F629FF001729F20 +:102D8000BB27F00DB11D639FAA27F00DB11DAA1F2F +:102D9000649F6627B00DA11D661F829F2227B00D7C +:102DA000A11D621F739FB00DA11D621F839FA00D07 +:102DB000611D221F749F3327A00D611D231F849F57 +:102DC000600D211D822F762F6A2F11249F575040AE +:102DD0009AF0F1F088234AF0EE0FFF1FBB1F661F29 +:102DE000771F881F91505040A9F79E3F510580F0F2 +:102DF0000C944C160C9497165F3FE4F3983ED4F372 +:102E0000869577956795B795F795E7959F5FC1F795 +:102E1000FE2B880F911D9695879597F908956F92CF +:102E20007F928F929F92AF92BF92CF92DF92EF925A +:102E3000FF920F931F93CF93DF93EC01009789F4D8 +:102E4000CB01DF91CF911F910F91FF90EF90DF9019 +:102E5000CF90BF90AF909F908F907F906F900C9489 +:102E60000618FC01E60FF71F9C0122503109E217FA +:102E7000F30708F4ACC0D9010D911C911197061706 +:102E80001707B0F00530110508F49FC0C80104977A +:102E90008617970708F499C002501109061B170BF3 +:102EA000019311936D937C93CF010E949B188DC069 +:102EB0005B01A01AB10A4C01800E911EA0918D09F0 +:102EC000B0918E0940E050E0E12CF12C109709F40C +:102ED0004AC0A815B905D1F56D907C901197630192 +:102EE00082E0C80ED11CCA14DB0480F1A3014A1988 +:102EF0005B096A0182E0C80ED11C1296BC90129741 +:102F00001396AC91B5E0CB16D10440F0B282A38306 +:102F100051834083D9016D937C930AC00E5F1F4F8C +:102F2000C301800F911FF90191838083EB2DFA2F4C +:102F3000E114F10431F0D7011396FC93EE9312974C +:102F400044C0F0938E09E0938D093FC08D919C9110 +:102F500011974817590708F4AC017D0112960D909E +:102F6000BC91A02DB3CF80918B0990918C098815CD +:102F70009905E1F446175707C8F480910002909133 +:102F80000102009741F48DB79EB740910402509121 +:102F90000502841B950BE817F907C8F4F0938C0918 +:102FA000E0938B09F901718360830FC0CB010E940C +:102FB00006187C01009759F0A801BE010E94FD1778 +:102FC000CE010E949B18C70104C0CE0102C080E060 +:102FD00090E0DF91CF911F910F91FF90EF90DF90E4 +:102FE000CF90BF90AF909F908F907F906F900895FB +:102FF00081E090E0F8940C943319FB01DC0102C0ED +:1030000001900D9241505040D8F70895CF93DF932F +:103010008230910510F482E090E0E0918D09F0910A +:103020008E0920E030E0C0E0D0E0309711F140811F +:10303000518148175907C0F04817590761F4828138 +:103040009381209719F09B838A832BC090938E09DC +:1030500080938D0926C02115310519F042175307B9 +:1030600018F49A01BE01DF01EF010280F381E02D27 +:10307000DCCF2115310509F1281B390B243031052E +:1030800090F412968D919C9113976115710521F022 +:10309000FB019383828304C090938E0980938D09F2 +:1030A000FD01329644C0FD01E20FF31F819391931D +:1030B000225031092D933C933AC020918B093091D5 +:1030C0008C09232B41F420910202309103023093AA +:1030D0008C0920938B092091000230910102211567 +:1030E000310541F42DB73EB74091040250910502DD +:1030F000241B350BE0918B09F0918C09E217F30743 +:10310000A0F42E1B3F0B2817390778F0AC014E5F57 +:103110005F4F2417350748F04E0F5F1F50938C09FF +:1031200040938B098193919302C0E0E0F0E0CF01DE +:10313000DF91CF9108950F931F93CF93DF93009763 +:1031400009F48CC0FC0132971382128200918D0920 +:1031500010918E090115110581F420813181820FB2 +:10316000931F20918B0930918C092817390779F525 +:10317000F0938C09E0938B0971C0D80140E050E0D6 +:10318000AE17BF0750F412962D913C911397AD01E5 +:103190002115310509F1D901F3CF9D01DA013383FE +:1031A000228360817181860F971F8217930769F4CC +:1031B000EC0128813981260F371F2E5F3F4F318365 +:1031C00020838A819B8193838283452B29F4F0930A +:1031D0008E09E0938D0942C01396FC93EE931297EB +:1031E000ED01499159919E01240F351FE217F30714 +:1031F00071F480819181840F951F029611969C93A2 +:103200008E938281938113969C938E931297E0E024 +:10321000F0E0D80112968D919C911397009719F0C8 +:10322000F8018C01F6CF8D919C9198012E5F3F4F54 +:10323000820F931F20918B0930918C092817390731 +:1032400069F4309729F410928E0910928D0902C00A +:103250001382128210938C0900938B09DF91CF9116 +:0A3260001F910F910895F894FFCF1D +:10326A0000008F098000726F7373657269616C5F09 +:10327A006D7367732F5265717565737450617261EE +:10328A006D0000000000BD0D430440043D04000031 +:10329A0000006B05250522051F0500000000950D9D +:1032AA00FB03F803F503000000008702F0011F0288 +:1032BA00CE0250022E024202000000000D07330621 +:1032CA00EC03E903000000003D075D06E603E303A3 +:1032DA0000000000F60C9708F203EF03000000005C +:1032EA009508950895089508000000003803AB0971 +:1032FA002903000000007906340331032E033966DE +:10330A003139356638383132343666646661323777 +:10331A0039386431643365656263613834610067E2 +:10332A00656F6D657472795F6D7367732F54776912 +:10333A007374004D6573736167652066726F6D20E3 +:10334A006465766963652064726F707065643A209B +:10335A006D657373616765206C617267657220744D +:10336A0068616E206275666665722E003461383453 +:10337A00326236356634313330383464633262311E +:10338A003066623438346561376631370067656F95 +:10339A006D657472795F6D7367732F566563746FA9 +:1033AA0072330039663065393862646136353938C6 +:1033BA003139383664646635336166613761343071 +:1033CA0065343900313161626437333163323539FA +:1033DA0033333236316364363138336264313264BE +:1033EA003632393500726F7373657269616C5F6D5D +:1033FA007367732F4C6F67003061643531663838F4 +:10340A0066633434383932663863313036383430AA +:10341A00373736343630303500726F7373657269F8 +:10342A00616C5F6D7367732F546F706963496E6661 +:10343A006F00636437313636633734633535326348 +:10344A00333131666263633266653561376263328E +:10345A003839007374645F6D7367732F54696D65CF +:0A346A00002F636D645F76656C004F +:00000001FF diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/libros_lib.a b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/libros_lib.a new file mode 100755 index 0000000..f799689 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/libros_lib.a differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/ros_lib/duration.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/ros_lib/duration.o new file mode 100755 index 0000000..0d8f6fd Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/ros_lib/duration.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/ros_lib/time.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/ros_lib/time.o new file mode 100755 index 0000000..382bded Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/lib2d4/ros_lib/time.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/libFrameworkArduino.a b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/libFrameworkArduino.a new file mode 100755 index 0000000..aff6294 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/libFrameworkArduino.a differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a new file mode 100755 index 0000000..8b277f0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/libFrameworkArduinoVariant.a @@ -0,0 +1 @@ +! diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/src/robotbase_34.ino.o b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/src/robotbase_34.ino.o new file mode 100755 index 0000000..c014b50 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/.pioenvs/megaADK/src/robotbase_34.ino.o differ diff --git a/case_study/arduino_lab/group_34/original/.pioenvs/structure.hash b/case_study/arduino_lab/group_34/original/.pioenvs/structure.hash new file mode 100755 index 0000000..c422e2e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/.pioenvs/structure.hash @@ -0,0 +1 @@ +1f542b955d0baf92109e4b6faae7768742d391bf \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/README.rst b/case_study/arduino_lab/group_34/original/README.rst new file mode 100755 index 0000000..fc64cfa --- /dev/null +++ b/case_study/arduino_lab/group_34/original/README.rst @@ -0,0 +1,29 @@ +.. Copyright (c) 2014-present PlatformIO + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +How to test PlatformIO based project +==================================== + +1. `Install PlatformIO Core `_ +2. Download `examples source code `_ +3. Extract ZIP archive +4. Run these commands: + +.. code-block:: bash + + # Change directory to example + > cd platformio-examples/unit-testing/wiring-blink + + # Test project + > platformio test + + # Test specific environment + > platformio test -e uno diff --git a/case_study/arduino_lab/group_34/original/lib/readme.txt b/case_study/arduino_lab/group_34/original/lib/readme.txt new file mode 100755 index 0000000..dbadc3d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/readme.txt @@ -0,0 +1,36 @@ + +This directory is intended for the project specific (private) libraries. +PlatformIO will compile them to static libraries and link to executable file. + +The source code of each library should be placed in separate directory, like +"lib/private_lib/[here are source files]". + +For example, see how can be organized `Foo` and `Bar` libraries: + +|--lib +| |--Bar +| | |--docs +| | |--examples +| | |--src +| | |- Bar.c +| | |- Bar.h +| |--Foo +| | |- Foo.c +| | |- Foo.h +| |- readme.txt --> THIS FILE +|- platformio.ini +|--src + |- main.c + +Then in `src/main.c` you should use: + +#include +#include + +// rest H/C/CPP code + +PlatformIO will find your libraries automatically, configure preprocessor's +include paths and build them. + +More information about PlatformIO Library Dependency Finder +- http://docs.platformio.org/page/librarymanager/ldf.html diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ArduinoHardware.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ArduinoHardware.h new file mode 100755 index 0000000..0f7ff6b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ArduinoHardware.h @@ -0,0 +1,106 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_ARDUINO_HARDWARE_H_ +#define ROS_ARDUINO_HARDWARE_H_ + +#if ARDUINO>=100 + #include // Arduino 1.0 +#else + #include // Arduino 0022 +#endif + +#if defined(__MK20DX128__) || defined(__MK20DX256__) + #include // Teensy 3.0 and 3.1 + #define SERIAL_CLASS usb_serial_class +#elif defined(_SAM3XA_) + #include // Arduino Due + #define SERIAL_CLASS UARTClass +#elif defined(USE_USBCON) + // Arduino Leonardo USB Serial Port + #define SERIAL_CLASS Serial_ +#else + #include // Arduino AVR + #define SERIAL_CLASS HardwareSerial +#endif + +class ArduinoHardware { + public: + ArduinoHardware(SERIAL_CLASS* io , long baud= 57600){ + iostream = io; + baud_ = baud; + } + ArduinoHardware() + { +#if defined(USBCON) and !(defined(USE_USBCON)) + /* Leonardo support */ + iostream = &Serial1; +#else + iostream = &Serial; +#endif + baud_ = 57600; + } + ArduinoHardware(ArduinoHardware& h){ + this->iostream = iostream; + this->baud_ = h.baud_; + } + + void setBaud(long baud){ + this->baud_= baud; + } + + int getBaud(){return baud_;} + + void init(){ +#if defined(USE_USBCON) + // Startup delay as a fail-safe to upload a new sketch + delay(3000); +#endif + iostream->begin(baud_); + } + + int read(){return iostream->read();}; + void write(uint8_t* data, int length){ + for(int i=0; iwrite(data[i]); + } + + unsigned long time(){return millis();} + + protected: + SERIAL_CLASS* iostream; + long baud_; +}; + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestAction.h new file mode 100755 index 0000000..7777571 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestAction_h +#define _ROS_actionlib_TestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestActionGoal.h" +#include "actionlib/TestActionResult.h" +#include "actionlib/TestActionFeedback.h" + +namespace actionlib +{ + + class TestAction : public ros::Msg + { + public: + actionlib::TestActionGoal action_goal; + actionlib::TestActionResult action_result; + actionlib::TestActionFeedback action_feedback; + + TestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestAction"; }; + const char * getMD5(){ return "991e87a72802262dfbe5d1b3cf6efc9a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionFeedback.h new file mode 100755 index 0000000..347d3f7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionFeedback_h +#define _ROS_actionlib_TestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestFeedback.h" + +namespace actionlib +{ + + class TestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestFeedback feedback; + + TestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionFeedback"; }; + const char * getMD5(){ return "6d3d0bf7fb3dda24779c010a9f3eb7cb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionGoal.h new file mode 100755 index 0000000..2ab1238 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionGoal_h +#define _ROS_actionlib_TestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestGoal.h" + +namespace actionlib +{ + + class TestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestGoal goal; + + TestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionGoal"; }; + const char * getMD5(){ return "348369c5b403676156094e8c159720bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionResult.h new file mode 100755 index 0000000..d7e388c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestActionResult_h +#define _ROS_actionlib_TestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestResult.h" + +namespace actionlib +{ + + class TestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestResult result; + + TestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestActionResult"; }; + const char * getMD5(){ return "3d669e3a63aa986c667ea7b0f46ce85e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestFeedback.h new file mode 100755 index 0000000..380f785 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestFeedback.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestFeedback_h +#define _ROS_actionlib_TestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestFeedback : public ros::Msg + { + public: + int32_t feedback; + + TestFeedback(): + feedback(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.real = this->feedback; + *(outbuffer + offset + 0) = (u_feedback.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_feedback.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_feedback.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_feedback.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->feedback); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_feedback; + u_feedback.base = 0; + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_feedback.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->feedback = u_feedback.real; + offset += sizeof(this->feedback); + return offset; + } + + const char * getType(){ return "actionlib/TestFeedback"; }; + const char * getMD5(){ return "49ceb5b32ea3af22073ede4a0328249e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestGoal.h new file mode 100755 index 0000000..4e2d676 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestGoal_h +#define _ROS_actionlib_TestGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestGoal : public ros::Msg + { + public: + int32_t goal; + + TestGoal(): + goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.real = this->goal; + *(outbuffer + offset + 0) = (u_goal.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_goal.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_goal.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_goal.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_goal; + u_goal.base = 0; + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_goal.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->goal = u_goal.real; + offset += sizeof(this->goal); + return offset; + } + + const char * getType(){ return "actionlib/TestGoal"; }; + const char * getMD5(){ return "18df0149936b7aa95588e3862476ebde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestAction.h new file mode 100755 index 0000000..2117590 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestAction_h +#define _ROS_actionlib_TestRequestAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TestRequestActionGoal.h" +#include "actionlib/TestRequestActionResult.h" +#include "actionlib/TestRequestActionFeedback.h" + +namespace actionlib +{ + + class TestRequestAction : public ros::Msg + { + public: + actionlib::TestRequestActionGoal action_goal; + actionlib::TestRequestActionResult action_result; + actionlib::TestRequestActionFeedback action_feedback; + + TestRequestAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestAction"; }; + const char * getMD5(){ return "dc44b1f4045dbf0d1db54423b3b86b30"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h new file mode 100755 index 0000000..ce98e9b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionFeedback_h +#define _ROS_actionlib_TestRequestActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestFeedback.h" + +namespace actionlib +{ + + class TestRequestActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestFeedback feedback; + + TestRequestActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionGoal.h new file mode 100755 index 0000000..563b22f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionGoal_h +#define _ROS_actionlib_TestRequestActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TestRequestGoal.h" + +namespace actionlib +{ + + class TestRequestActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TestRequestGoal goal; + + TestRequestActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionGoal"; }; + const char * getMD5(){ return "1889556d3fef88f821c7cb004e4251f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionResult.h new file mode 100755 index 0000000..67e32a4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TestRequestActionResult_h +#define _ROS_actionlib_TestRequestActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TestRequestResult.h" + +namespace actionlib +{ + + class TestRequestActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TestRequestResult result; + + TestRequestActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestActionResult"; }; + const char * getMD5(){ return "0476d1fdf437a3a6e7d6d0e9f5561298"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestFeedback.h new file mode 100755 index 0000000..f1fc247 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TestRequestFeedback_h +#define _ROS_actionlib_TestRequestFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestFeedback : public ros::Msg + { + public: + + TestRequestFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TestRequestFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestGoal.h new file mode 100755 index 0000000..8fd822e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestGoal.h @@ -0,0 +1,207 @@ +#ifndef _ROS_actionlib_TestRequestGoal_h +#define _ROS_actionlib_TestRequestGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace actionlib +{ + + class TestRequestGoal : public ros::Msg + { + public: + int32_t terminate_status; + bool ignore_cancel; + const char* result_text; + int32_t the_result; + bool is_simple_client; + ros::Duration delay_accept; + ros::Duration delay_terminate; + ros::Duration pause_status; + enum { TERMINATE_SUCCESS = 0 }; + enum { TERMINATE_ABORTED = 1 }; + enum { TERMINATE_REJECTED = 2 }; + enum { TERMINATE_LOSE = 3 }; + enum { TERMINATE_DROP = 4 }; + enum { TERMINATE_EXCEPTION = 5 }; + + TestRequestGoal(): + terminate_status(0), + ignore_cancel(0), + result_text(""), + the_result(0), + is_simple_client(0), + delay_accept(), + delay_terminate(), + pause_status() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.real = this->terminate_status; + *(outbuffer + offset + 0) = (u_terminate_status.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_terminate_status.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_terminate_status.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_terminate_status.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.real = this->ignore_cancel; + *(outbuffer + offset + 0) = (u_ignore_cancel.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text = strlen(this->result_text); + memcpy(outbuffer + offset, &length_result_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->result_text, length_result_text); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.real = this->is_simple_client; + *(outbuffer + offset + 0) = (u_is_simple_client.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_client); + *(outbuffer + offset + 0) = (this->delay_accept.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.sec); + *(outbuffer + offset + 0) = (this->delay_accept.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_accept.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_accept.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_accept.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_accept.nsec); + *(outbuffer + offset + 0) = (this->delay_terminate.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.sec); + *(outbuffer + offset + 0) = (this->delay_terminate.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->delay_terminate.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->delay_terminate.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->delay_terminate.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->delay_terminate.nsec); + *(outbuffer + offset + 0) = (this->pause_status.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.sec); + *(outbuffer + offset + 0) = (this->pause_status.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->pause_status.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->pause_status.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->pause_status.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->pause_status.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_terminate_status; + u_terminate_status.base = 0; + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_terminate_status.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->terminate_status = u_terminate_status.real; + offset += sizeof(this->terminate_status); + union { + bool real; + uint8_t base; + } u_ignore_cancel; + u_ignore_cancel.base = 0; + u_ignore_cancel.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->ignore_cancel = u_ignore_cancel.real; + offset += sizeof(this->ignore_cancel); + uint32_t length_result_text; + memcpy(&length_result_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_result_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_result_text-1]=0; + this->result_text = (char *)(inbuffer + offset-1); + offset += length_result_text; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_client; + u_is_simple_client.base = 0; + u_is_simple_client.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_client = u_is_simple_client.real; + offset += sizeof(this->is_simple_client); + this->delay_accept.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.sec); + this->delay_accept.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_accept.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_accept.nsec); + this->delay_terminate.sec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.sec); + this->delay_terminate.nsec = ((uint32_t) (*(inbuffer + offset))); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->delay_terminate.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->delay_terminate.nsec); + this->pause_status.sec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.sec); + this->pause_status.nsec = ((uint32_t) (*(inbuffer + offset))); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->pause_status.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->pause_status.nsec); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestGoal"; }; + const char * getMD5(){ return "db5d00ba98302d6c6dd3737e9a03ceea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestResult.h new file mode 100755 index 0000000..27b1425 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestRequestResult.h @@ -0,0 +1,78 @@ +#ifndef _ROS_actionlib_TestRequestResult_h +#define _ROS_actionlib_TestRequestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestRequestResult : public ros::Msg + { + public: + int32_t the_result; + bool is_simple_server; + + TestRequestResult(): + the_result(0), + is_simple_server(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.real = this->the_result; + *(outbuffer + offset + 0) = (u_the_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_the_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_the_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_the_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.real = this->is_simple_server; + *(outbuffer + offset + 0) = (u_is_simple_server.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_simple_server); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_the_result; + u_the_result.base = 0; + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_the_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->the_result = u_the_result.real; + offset += sizeof(this->the_result); + union { + bool real; + uint8_t base; + } u_is_simple_server; + u_is_simple_server.base = 0; + u_is_simple_server.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_simple_server = u_is_simple_server.real; + offset += sizeof(this->is_simple_server); + return offset; + } + + const char * getType(){ return "actionlib/TestRequestResult"; }; + const char * getMD5(){ return "61c2364524499c7c5017e2f3fce7ba06"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestResult.h new file mode 100755 index 0000000..a0bd838 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TestResult.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_TestResult_h +#define _ROS_actionlib_TestResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TestResult : public ros::Msg + { + public: + int32_t result; + + TestResult(): + result(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.real = this->result; + *(outbuffer + offset + 0) = (u_result.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_result.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_result.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_result.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->result); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_result; + u_result.base = 0; + u_result.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_result.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->result = u_result.real; + offset += sizeof(this->result); + return offset; + } + + const char * getType(){ return "actionlib/TestResult"; }; + const char * getMD5(){ return "034a8e20d6a306665e3a5b340fab3f09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsAction.h new file mode 100755 index 0000000..18ac4d8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsAction_h +#define _ROS_actionlib_TwoIntsAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib/TwoIntsActionGoal.h" +#include "actionlib/TwoIntsActionResult.h" +#include "actionlib/TwoIntsActionFeedback.h" + +namespace actionlib +{ + + class TwoIntsAction : public ros::Msg + { + public: + actionlib::TwoIntsActionGoal action_goal; + actionlib::TwoIntsActionResult action_result; + actionlib::TwoIntsActionFeedback action_feedback; + + TwoIntsAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsAction"; }; + const char * getMD5(){ return "6d1aa538c4bd6183a2dfb7fcac41ee50"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h new file mode 100755 index 0000000..1df0fba --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionFeedback_h +#define _ROS_actionlib_TwoIntsActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsFeedback.h" + +namespace actionlib +{ + + class TwoIntsActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsFeedback feedback; + + TwoIntsActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h new file mode 100755 index 0000000..dc3e013 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionGoal_h +#define _ROS_actionlib_TwoIntsActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib/TwoIntsGoal.h" + +namespace actionlib +{ + + class TwoIntsActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib::TwoIntsGoal goal; + + TwoIntsActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionGoal"; }; + const char * getMD5(){ return "684a2db55d6ffb8046fb9d6764ce0860"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionResult.h new file mode 100755 index 0000000..f6d3397 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_TwoIntsActionResult_h +#define _ROS_actionlib_TwoIntsActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib/TwoIntsResult.h" + +namespace actionlib +{ + + class TwoIntsActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib::TwoIntsResult result; + + TwoIntsActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsActionResult"; }; + const char * getMD5(){ return "3ba7dea8b8cddcae4528ade4ef74b6e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsFeedback.h new file mode 100755 index 0000000..3789c4d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_actionlib_TwoIntsFeedback_h +#define _ROS_actionlib_TwoIntsFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsFeedback : public ros::Msg + { + public: + + TwoIntsFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsGoal.h new file mode 100755 index 0000000..1fb5639 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsGoal.h @@ -0,0 +1,100 @@ +#ifndef _ROS_actionlib_TwoIntsGoal_h +#define _ROS_actionlib_TwoIntsGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsGoal : public ros::Msg + { + public: + int64_t a; + int64_t b; + + TwoIntsGoal(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsGoal"; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsResult.h new file mode 100755 index 0000000..901a523 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib/TwoIntsResult.h @@ -0,0 +1,69 @@ +#ifndef _ROS_actionlib_TwoIntsResult_h +#define _ROS_actionlib_TwoIntsResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib +{ + + class TwoIntsResult : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResult(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return "actionlib/TwoIntsResult"; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalID.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalID.h new file mode 100755 index 0000000..989dc6b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalID.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_msgs_GoalID_h +#define _ROS_actionlib_msgs_GoalID_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace actionlib_msgs +{ + + class GoalID : public ros::Msg + { + public: + ros::Time stamp; + const char* id; + + GoalID(): + stamp(), + id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalID"; }; + const char * getMD5(){ return "302881f31927c1df708a2dbab0e80ee8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalStatus.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalStatus.h new file mode 100755 index 0000000..b728926 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalStatus.h @@ -0,0 +1,75 @@ +#ifndef _ROS_actionlib_msgs_GoalStatus_h +#define _ROS_actionlib_msgs_GoalStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_msgs/GoalID.h" + +namespace actionlib_msgs +{ + + class GoalStatus : public ros::Msg + { + public: + actionlib_msgs::GoalID goal_id; + uint8_t status; + const char* text; + enum { PENDING = 0 }; + enum { ACTIVE = 1 }; + enum { PREEMPTED = 2 }; + enum { SUCCEEDED = 3 }; + enum { ABORTED = 4 }; + enum { REJECTED = 5 }; + enum { PREEMPTING = 6 }; + enum { RECALLING = 7 }; + enum { RECALLED = 8 }; + enum { LOST = 9 }; + + GoalStatus(): + goal_id(), + status(0), + text("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->goal_id.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->status >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->goal_id.deserialize(inbuffer + offset); + this->status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->status); + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatus"; }; + const char * getMD5(){ return "d388f9b87b3c471f784434d671988d4a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h new file mode 100755 index 0000000..8bff742 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_msgs/GoalStatusArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_actionlib_msgs_GoalStatusArray_h +#define _ROS_actionlib_msgs_GoalStatusArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" + +namespace actionlib_msgs +{ + + class GoalStatusArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_list_length; + actionlib_msgs::GoalStatus st_status_list; + actionlib_msgs::GoalStatus * status_list; + + GoalStatusArray(): + header(), + status_list_length(0), status_list(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_list_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->status_list[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_list_lengthT = *(inbuffer + offset++); + if(status_list_lengthT > status_list_length) + this->status_list = (actionlib_msgs::GoalStatus*)realloc(this->status_list, status_list_lengthT * sizeof(actionlib_msgs::GoalStatus)); + offset += 3; + status_list_length = status_list_lengthT; + for( uint8_t i = 0; i < status_list_length; i++){ + offset += this->st_status_list.deserialize(inbuffer + offset); + memcpy( &(this->status_list[i]), &(this->st_status_list), sizeof(actionlib_msgs::GoalStatus)); + } + return offset; + } + + const char * getType(){ return "actionlib_msgs/GoalStatusArray"; }; + const char * getMD5(){ return "8b2b82f13216d0a8ea88bd3af735e619"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h new file mode 100755 index 0000000..65a963d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingAction_h +#define _ROS_actionlib_tutorials_AveragingAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/AveragingActionGoal.h" +#include "actionlib_tutorials/AveragingActionResult.h" +#include "actionlib_tutorials/AveragingActionFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingAction : public ros::Msg + { + public: + actionlib_tutorials::AveragingActionGoal action_goal; + actionlib_tutorials::AveragingActionResult action_result; + actionlib_tutorials::AveragingActionFeedback action_feedback; + + AveragingAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingAction"; }; + const char * getMD5(){ return "628678f2b4fa6a5951746a4a2d39e716"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h new file mode 100755 index 0000000..97fda36 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionFeedback_h +#define _ROS_actionlib_tutorials_AveragingActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingFeedback.h" + +namespace actionlib_tutorials +{ + + class AveragingActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingFeedback feedback; + + AveragingActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionFeedback"; }; + const char * getMD5(){ return "78a4a09241b1791069223ae7ebd5b16b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h new file mode 100755 index 0000000..4b225e9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionGoal_h +#define _ROS_actionlib_tutorials_AveragingActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/AveragingGoal.h" + +namespace actionlib_tutorials +{ + + class AveragingActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::AveragingGoal goal; + + AveragingActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionGoal"; }; + const char * getMD5(){ return "1561825b734ebd6039851c501e3fb570"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h new file mode 100755 index 0000000..e4d5128 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_AveragingActionResult_h +#define _ROS_actionlib_tutorials_AveragingActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/AveragingResult.h" + +namespace actionlib_tutorials +{ + + class AveragingActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::AveragingResult result; + + AveragingActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingActionResult"; }; + const char * getMD5(){ return "8672cb489d347580acdcd05c5d497497"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h new file mode 100755 index 0000000..a987900 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingFeedback.h @@ -0,0 +1,130 @@ +#ifndef _ROS_actionlib_tutorials_AveragingFeedback_h +#define _ROS_actionlib_tutorials_AveragingFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingFeedback : public ros::Msg + { + public: + int32_t sample; + float data; + float mean; + float std_dev; + + AveragingFeedback(): + sample(0), + data(0), + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.real = this->sample; + *(outbuffer + offset + 0) = (u_sample.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sample.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sample.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sample.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sample; + u_sample.base = 0; + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sample.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sample = u_sample.real; + offset += sizeof(this->sample); + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingFeedback"; }; + const char * getMD5(){ return "9e8dfc53c2f2a032ca33fa80ec46fd4f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h new file mode 100755 index 0000000..5b631c5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_tutorials_AveragingGoal_h +#define _ROS_actionlib_tutorials_AveragingGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingGoal : public ros::Msg + { + public: + int32_t samples; + + AveragingGoal(): + samples(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.real = this->samples; + *(outbuffer + offset + 0) = (u_samples.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_samples.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_samples.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_samples.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->samples); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_samples; + u_samples.base = 0; + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_samples.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->samples = u_samples.real; + offset += sizeof(this->samples); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingGoal"; }; + const char * getMD5(){ return "32c9b10ef9b253faa93b93f564762c8f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h new file mode 100755 index 0000000..ce08c43 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/AveragingResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_actionlib_tutorials_AveragingResult_h +#define _ROS_actionlib_tutorials_AveragingResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class AveragingResult : public ros::Msg + { + public: + float mean; + float std_dev; + + AveragingResult(): + mean(0), + std_dev(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.real = this->mean; + *(outbuffer + offset + 0) = (u_mean.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_mean.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_mean.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_mean.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.real = this->std_dev; + *(outbuffer + offset + 0) = (u_std_dev.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_std_dev.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_std_dev.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_std_dev.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->std_dev); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_mean; + u_mean.base = 0; + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_mean.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->mean = u_mean.real; + offset += sizeof(this->mean); + union { + float real; + uint32_t base; + } u_std_dev; + u_std_dev.base = 0; + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_std_dev.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->std_dev = u_std_dev.real; + offset += sizeof(this->std_dev); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/AveragingResult"; }; + const char * getMD5(){ return "d5c7decf6df75ffb4367a05c1bcc7612"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h new file mode 100755 index 0000000..9432e1c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciAction_h +#define _ROS_actionlib_tutorials_FibonacciAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "actionlib_tutorials/FibonacciActionGoal.h" +#include "actionlib_tutorials/FibonacciActionResult.h" +#include "actionlib_tutorials/FibonacciActionFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciAction : public ros::Msg + { + public: + actionlib_tutorials::FibonacciActionGoal action_goal; + actionlib_tutorials::FibonacciActionResult action_result; + actionlib_tutorials::FibonacciActionFeedback action_feedback; + + FibonacciAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciAction"; }; + const char * getMD5(){ return "f59df5767bf7634684781c92598b2406"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h new file mode 100755 index 0000000..3a1e341 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionFeedback_h +#define _ROS_actionlib_tutorials_FibonacciActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciFeedback.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciFeedback feedback; + + FibonacciActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionFeedback"; }; + const char * getMD5(){ return "73b8497a9f629a31c0020900e4148f07"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h new file mode 100755 index 0000000..459561c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionGoal_h +#define _ROS_actionlib_tutorials_FibonacciActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "actionlib_tutorials/FibonacciGoal.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + actionlib_tutorials::FibonacciGoal goal; + + FibonacciActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionGoal"; }; + const char * getMD5(){ return "006871c7fa1d0e3d5fe2226bf17b2a94"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h new file mode 100755 index 0000000..14ed870 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciActionResult_h +#define _ROS_actionlib_tutorials_FibonacciActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "actionlib_tutorials/FibonacciResult.h" + +namespace actionlib_tutorials +{ + + class FibonacciActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + actionlib_tutorials::FibonacciResult result; + + FibonacciActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciActionResult"; }; + const char * getMD5(){ return "bee73a9fe29ae25e966e105f5553dd03"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h new file mode 100755 index 0000000..5a09ac1 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciFeedback.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciFeedback_h +#define _ROS_actionlib_tutorials_FibonacciFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciFeedback : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciFeedback(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciFeedback"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h new file mode 100755 index 0000000..3cec227 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciGoal.h @@ -0,0 +1,61 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciGoal_h +#define _ROS_actionlib_tutorials_FibonacciGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciGoal : public ros::Msg + { + public: + int32_t order; + + FibonacciGoal(): + order(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.real = this->order; + *(outbuffer + offset + 0) = (u_order.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_order.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_order.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_order.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->order); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_order; + u_order.base = 0; + u_order.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_order.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->order = u_order.real; + offset += sizeof(this->order); + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciGoal"; }; + const char * getMD5(){ return "6889063349a00b249bd1661df429d822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h new file mode 100755 index 0000000..db15770 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/actionlib_tutorials/FibonacciResult.h @@ -0,0 +1,77 @@ +#ifndef _ROS_actionlib_tutorials_FibonacciResult_h +#define _ROS_actionlib_tutorials_FibonacciResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace actionlib_tutorials +{ + + class FibonacciResult : public ros::Msg + { + public: + uint8_t sequence_length; + int32_t st_sequence; + int32_t * sequence; + + FibonacciResult(): + sequence_length(0), sequence(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = sequence_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_sequencei; + u_sequencei.real = this->sequence[i]; + *(outbuffer + offset + 0) = (u_sequencei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sequencei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sequencei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sequencei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sequence[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t sequence_lengthT = *(inbuffer + offset++); + if(sequence_lengthT > sequence_length) + this->sequence = (int32_t*)realloc(this->sequence, sequence_lengthT * sizeof(int32_t)); + offset += 3; + sequence_length = sequence_lengthT; + for( uint8_t i = 0; i < sequence_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_sequence; + u_st_sequence.base = 0; + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_sequence.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_sequence = u_st_sequence.real; + offset += sizeof(this->st_sequence); + memcpy( &(this->sequence[i]), &(this->st_sequence), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "actionlib_tutorials/FibonacciResult"; }; + const char * getMD5(){ return "b81e37d2a31925a0e8ae261a8699cb79"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/bond/Constants.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/bond/Constants.h new file mode 100755 index 0000000..9594342 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/bond/Constants.h @@ -0,0 +1,44 @@ +#ifndef _ROS_bond_Constants_h +#define _ROS_bond_Constants_h + +#include +#include +#include +#include "ros/msg.h" + +namespace bond +{ + + class Constants : public ros::Msg + { + public: + enum { DEAD_PUBLISH_PERIOD = 0.05 }; + enum { DEFAULT_CONNECT_TIMEOUT = 10.0 }; + enum { DEFAULT_HEARTBEAT_TIMEOUT = 4.0 }; + enum { DEFAULT_DISCONNECT_TIMEOUT = 2.0 }; + enum { DEFAULT_HEARTBEAT_PERIOD = 1.0 }; + enum { DISABLE_HEARTBEAT_TIMEOUT_PARAM = /bond_disable_heartbeat_timeout }; + + Constants() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "bond/Constants"; }; + const char * getMD5(){ return "6fc594dc1d7bd7919077042712f8c8b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/bond/Status.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/bond/Status.h new file mode 100755 index 0000000..1fdb04a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/bond/Status.h @@ -0,0 +1,138 @@ +#ifndef _ROS_bond_Status_h +#define _ROS_bond_Status_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace bond +{ + + class Status : public ros::Msg + { + public: + std_msgs::Header header; + const char* id; + const char* instance_id; + bool active; + float heartbeat_timeout; + float heartbeat_period; + + Status(): + header(), + id(""), + instance_id(""), + active(0), + heartbeat_timeout(0), + heartbeat_period(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + uint32_t length_instance_id = strlen(this->instance_id); + memcpy(outbuffer + offset, &length_instance_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->instance_id, length_instance_id); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.real = this->active; + *(outbuffer + offset + 0) = (u_active.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.real = this->heartbeat_timeout; + *(outbuffer + offset + 0) = (u_heartbeat_timeout.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_timeout.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_timeout.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_timeout.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.real = this->heartbeat_period; + *(outbuffer + offset + 0) = (u_heartbeat_period.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_heartbeat_period.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_heartbeat_period.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_heartbeat_period.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->heartbeat_period); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + uint32_t length_instance_id; + memcpy(&length_instance_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_instance_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_instance_id-1]=0; + this->instance_id = (char *)(inbuffer + offset-1); + offset += length_instance_id; + union { + bool real; + uint8_t base; + } u_active; + u_active.base = 0; + u_active.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->active = u_active.real; + offset += sizeof(this->active); + union { + float real; + uint32_t base; + } u_heartbeat_timeout; + u_heartbeat_timeout.base = 0; + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_timeout.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_timeout = u_heartbeat_timeout.real; + offset += sizeof(this->heartbeat_timeout); + union { + float real; + uint32_t base; + } u_heartbeat_period; + u_heartbeat_period.base = 0; + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_heartbeat_period.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->heartbeat_period = u_heartbeat_period.real; + offset += sizeof(this->heartbeat_period); + return offset; + } + + const char * getType(){ return "bond/Status"; }; + const char * getMD5(){ return "eacc84bf5d65b6777d4c50f463dfb9c8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h new file mode 100755 index 0000000..aa36c45 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryAction_h +#define _ROS_control_msgs_FollowJointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/FollowJointTrajectoryActionGoal.h" +#include "control_msgs/FollowJointTrajectoryActionResult.h" +#include "control_msgs/FollowJointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryAction : public ros::Msg + { + public: + control_msgs::FollowJointTrajectoryActionGoal action_goal; + control_msgs::FollowJointTrajectoryActionResult action_result; + control_msgs::FollowJointTrajectoryActionFeedback action_feedback; + + FollowJointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryAction"; }; + const char * getMD5(){ return "bc4f9b743838566551c0390c65f1a248"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h new file mode 100755 index 0000000..bf9b2c6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryFeedback feedback; + + FollowJointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "d8920dc4eae9fc107e00999cce4be641"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h new file mode 100755 index 0000000..de889cb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/FollowJointTrajectoryGoal.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::FollowJointTrajectoryGoal goal; + + FollowJointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionGoal"; }; + const char * getMD5(){ return "cff5c1d533bf2f82dd0138d57f4304bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h new file mode 100755 index 0000000..252abb3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryActionResult_h +#define _ROS_control_msgs_FollowJointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/FollowJointTrajectoryResult.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::FollowJointTrajectoryResult result; + + FollowJointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryActionResult"; }; + const char * getMD5(){ return "c4fb3b000dc9da4fd99699380efcc5d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h new file mode 100755 index 0000000..50c5466 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryFeedback.h @@ -0,0 +1,88 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryFeedback_h +#define _ROS_control_msgs_FollowJointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryFeedback : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + FollowJointTrajectoryFeedback(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryFeedback"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h new file mode 100755 index 0000000..2a8f9b1 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryGoal.h @@ -0,0 +1,107 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryGoal_h +#define _ROS_control_msgs_FollowJointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "control_msgs/JointTolerance.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + uint8_t path_tolerance_length; + control_msgs::JointTolerance st_path_tolerance; + control_msgs::JointTolerance * path_tolerance; + uint8_t goal_tolerance_length; + control_msgs::JointTolerance st_goal_tolerance; + control_msgs::JointTolerance * goal_tolerance; + ros::Duration goal_time_tolerance; + + FollowJointTrajectoryGoal(): + trajectory(), + path_tolerance_length(0), path_tolerance(NULL), + goal_tolerance_length(0), goal_tolerance(NULL), + goal_time_tolerance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + *(outbuffer + offset++) = path_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->path_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = goal_tolerance_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->goal_tolerance[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->goal_time_tolerance.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.sec); + *(outbuffer + offset + 0) = (this->goal_time_tolerance.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->goal_time_tolerance.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->goal_time_tolerance.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->goal_time_tolerance.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + uint8_t path_tolerance_lengthT = *(inbuffer + offset++); + if(path_tolerance_lengthT > path_tolerance_length) + this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + path_tolerance_length = path_tolerance_lengthT; + for( uint8_t i = 0; i < path_tolerance_length; i++){ + offset += this->st_path_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->path_tolerance[i]), &(this->st_path_tolerance), sizeof(control_msgs::JointTolerance)); + } + uint8_t goal_tolerance_lengthT = *(inbuffer + offset++); + if(goal_tolerance_lengthT > goal_tolerance_length) + this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance)); + offset += 3; + goal_tolerance_length = goal_tolerance_lengthT; + for( uint8_t i = 0; i < goal_tolerance_length; i++){ + offset += this->st_goal_tolerance.deserialize(inbuffer + offset); + memcpy( &(this->goal_tolerance[i]), &(this->st_goal_tolerance), sizeof(control_msgs::JointTolerance)); + } + this->goal_time_tolerance.sec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.sec); + this->goal_time_tolerance.nsec = ((uint32_t) (*(inbuffer + offset))); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->goal_time_tolerance.nsec); + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryGoal"; }; + const char * getMD5(){ return "69636787b6ecbde4d61d711979bc7ecb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h new file mode 100755 index 0000000..0d55930 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/FollowJointTrajectoryResult.h @@ -0,0 +1,83 @@ +#ifndef _ROS_control_msgs_FollowJointTrajectoryResult_h +#define _ROS_control_msgs_FollowJointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class FollowJointTrajectoryResult : public ros::Msg + { + public: + int32_t error_code; + const char* error_string; + enum { SUCCESSFUL = 0 }; + enum { INVALID_GOAL = -1 }; + enum { INVALID_JOINTS = -2 }; + enum { OLD_HEADER_TIMESTAMP = -3 }; + enum { PATH_TOLERANCE_VIOLATED = -4 }; + enum { GOAL_TOLERANCE_VIOLATED = -5 }; + + FollowJointTrajectoryResult(): + error_code(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.real = this->error_code; + *(outbuffer + offset + 0) = (u_error_code.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_error_code.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_error_code.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_error_code.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->error_code); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_error_code; + u_error_code.base = 0; + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_error_code.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->error_code = u_error_code.real; + offset += sizeof(this->error_code); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "control_msgs/FollowJointTrajectoryResult"; }; + const char * getMD5(){ return "493383b18409bfb604b4e26c676401d2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommand.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommand.h new file mode 100755 index 0000000..a2f65e0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommand.h @@ -0,0 +1,46 @@ +#ifndef _ROS_control_msgs_GripperCommand_h +#define _ROS_control_msgs_GripperCommand_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommand : public ros::Msg + { + public: + float position; + float max_effort; + + GripperCommand(): + position(0), + max_effort(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->max_effort); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_effort)); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommand"; }; + const char * getMD5(){ return "680acaff79486f017132a7f198d40f08"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandAction.h new file mode 100755 index 0000000..111229e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandAction_h +#define _ROS_control_msgs_GripperCommandAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommandActionGoal.h" +#include "control_msgs/GripperCommandActionResult.h" +#include "control_msgs/GripperCommandActionFeedback.h" + +namespace control_msgs +{ + + class GripperCommandAction : public ros::Msg + { + public: + control_msgs::GripperCommandActionGoal action_goal; + control_msgs::GripperCommandActionResult action_result; + control_msgs::GripperCommandActionFeedback action_feedback; + + GripperCommandAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandAction"; }; + const char * getMD5(){ return "950b2a6ebe831f5d4f4ceaba3d8be01e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h new file mode 100755 index 0000000..14f3771 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionFeedback_h +#define _ROS_control_msgs_GripperCommandActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandFeedback.h" + +namespace control_msgs +{ + + class GripperCommandActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandFeedback feedback; + + GripperCommandActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionFeedback"; }; + const char * getMD5(){ return "653dff30c045f5e6ff3feb3409f4558d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h new file mode 100755 index 0000000..8a09301 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionGoal_h +#define _ROS_control_msgs_GripperCommandActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/GripperCommandGoal.h" + +namespace control_msgs +{ + + class GripperCommandActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::GripperCommandGoal goal; + + GripperCommandActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionGoal"; }; + const char * getMD5(){ return "aa581f648a35ed681db2ec0bf7a82bea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h new file mode 100755 index 0000000..1a7ea75 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_GripperCommandActionResult_h +#define _ROS_control_msgs_GripperCommandActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/GripperCommandResult.h" + +namespace control_msgs +{ + + class GripperCommandActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::GripperCommandResult result; + + GripperCommandActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandActionResult"; }; + const char * getMD5(){ return "143702cb2df0f163c5283cedc5efc6b6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h new file mode 100755 index 0000000..efc889b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandFeedback.h @@ -0,0 +1,80 @@ +#ifndef _ROS_control_msgs_GripperCommandFeedback_h +#define _ROS_control_msgs_GripperCommandFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandFeedback : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandFeedback(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandFeedback"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandGoal.h new file mode 100755 index 0000000..aec6aa2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandGoal.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_GripperCommandGoal_h +#define _ROS_control_msgs_GripperCommandGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/GripperCommand.h" + +namespace control_msgs +{ + + class GripperCommandGoal : public ros::Msg + { + public: + control_msgs::GripperCommand command; + + GripperCommandGoal(): + command() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->command.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->command.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandGoal"; }; + const char * getMD5(){ return "86fd82f4ddc48a4cb6856cfa69217e43"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandResult.h new file mode 100755 index 0000000..7fb51df --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/GripperCommandResult.h @@ -0,0 +1,80 @@ +#ifndef _ROS_control_msgs_GripperCommandResult_h +#define _ROS_control_msgs_GripperCommandResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class GripperCommandResult : public ros::Msg + { + public: + float position; + float effort; + bool stalled; + bool reached_goal; + + GripperCommandResult(): + position(0), + effort(0), + stalled(0), + reached_goal(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.real = this->stalled; + *(outbuffer + offset + 0) = (u_stalled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.real = this->reached_goal; + *(outbuffer + offset + 0) = (u_reached_goal.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->reached_goal); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + union { + bool real; + uint8_t base; + } u_stalled; + u_stalled.base = 0; + u_stalled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->stalled = u_stalled.real; + offset += sizeof(this->stalled); + union { + bool real; + uint8_t base; + } u_reached_goal; + u_reached_goal.base = 0; + u_reached_goal.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->reached_goal = u_reached_goal.real; + offset += sizeof(this->reached_goal); + return offset; + } + + const char * getType(){ return "control_msgs/GripperCommandResult"; }; + const char * getMD5(){ return "e4cbff56d3562bcf113da5a5adeef91f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointControllerState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointControllerState.h new file mode 100755 index 0000000..8de8213 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointControllerState.h @@ -0,0 +1,83 @@ +#ifndef _ROS_control_msgs_JointControllerState_h +#define _ROS_control_msgs_JointControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class JointControllerState : public ros::Msg + { + public: + std_msgs::Header header; + float set_point; + float process_value; + float process_value_dot; + float error; + float time_step; + float command; + float p; + float i; + float d; + float i_clamp; + + JointControllerState(): + header(), + set_point(0), + process_value(0), + process_value_dot(0), + error(0), + time_step(0), + command(0), + p(0), + i(0), + d(0), + i_clamp(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->set_point); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value); + offset += serializeAvrFloat64(outbuffer + offset, this->process_value_dot); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->command); + offset += serializeAvrFloat64(outbuffer + offset, this->p); + offset += serializeAvrFloat64(outbuffer + offset, this->i); + offset += serializeAvrFloat64(outbuffer + offset, this->d); + offset += serializeAvrFloat64(outbuffer + offset, this->i_clamp); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->set_point)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->process_value_dot)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->command)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->p)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->d)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->i_clamp)); + return offset; + } + + const char * getType(){ return "control_msgs/JointControllerState"; }; + const char * getMD5(){ return "c0d034a7bf20aeb1c37f3eccb7992b69"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTolerance.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTolerance.h new file mode 100755 index 0000000..9593f37 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTolerance.h @@ -0,0 +1,66 @@ +#ifndef _ROS_control_msgs_JointTolerance_h +#define _ROS_control_msgs_JointTolerance_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTolerance : public ros::Msg + { + public: + const char* name; + float position; + float velocity; + float acceleration; + + JointTolerance(): + name(""), + position(0), + velocity(0), + acceleration(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->acceleration)); + return offset; + } + + const char * getType(){ return "control_msgs/JointTolerance"; }; + const char * getMD5(){ return "f544fe9c16cf04547e135dd6063ff5be"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h new file mode 100755 index 0000000..b619e9f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryAction_h +#define _ROS_control_msgs_JointTrajectoryAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/JointTrajectoryActionGoal.h" +#include "control_msgs/JointTrajectoryActionResult.h" +#include "control_msgs/JointTrajectoryActionFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryAction : public ros::Msg + { + public: + control_msgs::JointTrajectoryActionGoal action_goal; + control_msgs::JointTrajectoryActionResult action_result; + control_msgs::JointTrajectoryActionFeedback action_feedback; + + JointTrajectoryAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryAction"; }; + const char * getMD5(){ return "a04ba3ee8f6a2d0985a6aeaf23d9d7ad"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h new file mode 100755 index 0000000..463a4e9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionFeedback_h +#define _ROS_control_msgs_JointTrajectoryActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryFeedback.h" + +namespace control_msgs +{ + + class JointTrajectoryActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryFeedback feedback; + + JointTrajectoryActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h new file mode 100755 index 0000000..fb2862d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionGoal_h +#define _ROS_control_msgs_JointTrajectoryActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/JointTrajectoryGoal.h" + +namespace control_msgs +{ + + class JointTrajectoryActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::JointTrajectoryGoal goal; + + JointTrajectoryActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionGoal"; }; + const char * getMD5(){ return "a99e83ef6185f9fdd7693efe99623a86"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h new file mode 100755 index 0000000..accb4d0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_JointTrajectoryActionResult_h +#define _ROS_control_msgs_JointTrajectoryActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/JointTrajectoryResult.h" + +namespace control_msgs +{ + + class JointTrajectoryActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::JointTrajectoryResult result; + + JointTrajectoryActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h new file mode 100755 index 0000000..f4bc6b8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryControllerState.h @@ -0,0 +1,88 @@ +#ifndef _ROS_control_msgs_JointTrajectoryControllerState_h +#define _ROS_control_msgs_JointTrajectoryControllerState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace control_msgs +{ + + class JointTrajectoryControllerState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + trajectory_msgs::JointTrajectoryPoint desired; + trajectory_msgs::JointTrajectoryPoint actual; + trajectory_msgs::JointTrajectoryPoint error; + + JointTrajectoryControllerState(): + header(), + joint_names_length(0), joint_names(NULL), + desired(), + actual(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + offset += this->desired.serialize(outbuffer + offset); + offset += this->actual.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + offset += this->desired.deserialize(inbuffer + offset); + offset += this->actual.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryControllerState"; }; + const char * getMD5(){ return "10817c60c2486ef6b33e97dcd87f4474"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h new file mode 100755 index 0000000..9dfe808 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryFeedback_h +#define _ROS_control_msgs_JointTrajectoryFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryFeedback : public ros::Msg + { + public: + + JointTrajectoryFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h new file mode 100755 index 0000000..b0cacb7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryGoal.h @@ -0,0 +1,43 @@ +#ifndef _ROS_control_msgs_JointTrajectoryGoal_h +#define _ROS_control_msgs_JointTrajectoryGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" + +namespace control_msgs +{ + + class JointTrajectoryGoal : public ros::Msg + { + public: + trajectory_msgs::JointTrajectory trajectory; + + JointTrajectoryGoal(): + trajectory() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->trajectory.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->trajectory.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryGoal"; }; + const char * getMD5(){ return "2a0eff76c870e8595636c2a562ca298e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h new file mode 100755 index 0000000..623ed9c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/JointTrajectoryResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_JointTrajectoryResult_h +#define _ROS_control_msgs_JointTrajectoryResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class JointTrajectoryResult : public ros::Msg + { + public: + + JointTrajectoryResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/JointTrajectoryResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadAction.h new file mode 100755 index 0000000..a27be21 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadAction_h +#define _ROS_control_msgs_PointHeadAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/PointHeadActionGoal.h" +#include "control_msgs/PointHeadActionResult.h" +#include "control_msgs/PointHeadActionFeedback.h" + +namespace control_msgs +{ + + class PointHeadAction : public ros::Msg + { + public: + control_msgs::PointHeadActionGoal action_goal; + control_msgs::PointHeadActionResult action_result; + control_msgs::PointHeadActionFeedback action_feedback; + + PointHeadAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadAction"; }; + const char * getMD5(){ return "7252920f1243de1b741f14f214125371"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h new file mode 100755 index 0000000..8e04bd0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionFeedback_h +#define _ROS_control_msgs_PointHeadActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadFeedback.h" + +namespace control_msgs +{ + + class PointHeadActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadFeedback feedback; + + PointHeadActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionFeedback"; }; + const char * getMD5(){ return "33c9244957176bbba97dd641119e8460"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h new file mode 100755 index 0000000..133d532 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionGoal_h +#define _ROS_control_msgs_PointHeadActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/PointHeadGoal.h" + +namespace control_msgs +{ + + class PointHeadActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::PointHeadGoal goal; + + PointHeadActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionGoal"; }; + const char * getMD5(){ return "b53a8323d0ba7b310ba17a2d3a82a6b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionResult.h new file mode 100755 index 0000000..db855d2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_PointHeadActionResult_h +#define _ROS_control_msgs_PointHeadActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/PointHeadResult.h" + +namespace control_msgs +{ + + class PointHeadActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::PointHeadResult result; + + PointHeadActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadFeedback.h new file mode 100755 index 0000000..4e78f2d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadFeedback.h @@ -0,0 +1,42 @@ +#ifndef _ROS_control_msgs_PointHeadFeedback_h +#define _ROS_control_msgs_PointHeadFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadFeedback : public ros::Msg + { + public: + float pointing_angle_error; + + PointHeadFeedback(): + pointing_angle_error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->pointing_angle_error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->pointing_angle_error)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadFeedback"; }; + const char * getMD5(){ return "cce80d27fd763682da8805a73316cab4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadGoal.h new file mode 100755 index 0000000..65ec646 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadGoal.h @@ -0,0 +1,91 @@ +#ifndef _ROS_control_msgs_PointHeadGoal_h +#define _ROS_control_msgs_PointHeadGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PointStamped.h" +#include "geometry_msgs/Vector3.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class PointHeadGoal : public ros::Msg + { + public: + geometry_msgs::PointStamped target; + geometry_msgs::Vector3 pointing_axis; + const char* pointing_frame; + ros::Duration min_duration; + float max_velocity; + + PointHeadGoal(): + target(), + pointing_axis(), + pointing_frame(""), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->target.serialize(outbuffer + offset); + offset += this->pointing_axis.serialize(outbuffer + offset); + uint32_t length_pointing_frame = strlen(this->pointing_frame); + memcpy(outbuffer + offset, &length_pointing_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame); + offset += length_pointing_frame; + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->target.deserialize(inbuffer + offset); + offset += this->pointing_axis.deserialize(inbuffer + offset); + uint32_t length_pointing_frame; + memcpy(&length_pointing_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_pointing_frame-1]=0; + this->pointing_frame = (char *)(inbuffer + offset-1); + offset += length_pointing_frame; + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadGoal"; }; + const char * getMD5(){ return "8b92b1cd5e06c8a94c917dc3209a4c1d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadResult.h new file mode 100755 index 0000000..53f789e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/PointHeadResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_PointHeadResult_h +#define _ROS_control_msgs_PointHeadResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class PointHeadResult : public ros::Msg + { + public: + + PointHeadResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/PointHeadResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/QueryCalibrationState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/QueryCalibrationState.h new file mode 100755 index 0000000..b3c1bbf --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/QueryCalibrationState.h @@ -0,0 +1,87 @@ +#ifndef _ROS_SERVICE_QueryCalibrationState_h +#define _ROS_SERVICE_QueryCalibrationState_h +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + +static const char QUERYCALIBRATIONSTATE[] = "control_msgs/QueryCalibrationState"; + + class QueryCalibrationStateRequest : public ros::Msg + { + public: + + QueryCalibrationStateRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class QueryCalibrationStateResponse : public ros::Msg + { + public: + bool is_calibrated; + + QueryCalibrationStateResponse(): + is_calibrated(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.real = this->is_calibrated; + *(outbuffer + offset + 0) = (u_is_calibrated.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_calibrated); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_is_calibrated; + u_is_calibrated.base = 0; + u_is_calibrated.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_calibrated = u_is_calibrated.real; + offset += sizeof(this->is_calibrated); + return offset; + } + + const char * getType(){ return QUERYCALIBRATIONSTATE; }; + const char * getMD5(){ return "28af3beedcb84986b8e470dc5470507d"; }; + + }; + + class QueryCalibrationState { + public: + typedef QueryCalibrationStateRequest Request; + typedef QueryCalibrationStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h new file mode 100755 index 0000000..1859d7f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/QueryTrajectoryState.h @@ -0,0 +1,185 @@ +#ifndef _ROS_SERVICE_QueryTrajectoryState_h +#define _ROS_SERVICE_QueryTrajectoryState_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace control_msgs +{ + +static const char QUERYTRAJECTORYSTATE[] = "control_msgs/QueryTrajectoryState"; + + class QueryTrajectoryStateRequest : public ros::Msg + { + public: + ros::Time time; + + QueryTrajectoryStateRequest(): + time() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.sec); + *(outbuffer + offset + 0) = (this->time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->time.sec = ((uint32_t) (*(inbuffer + offset))); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.sec); + this->time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time.nsec); + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "556a4fb76023a469987922359d08a844"; }; + + }; + + class QueryTrajectoryStateResponse : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t acceleration_length; + float st_acceleration; + float * acceleration; + + QueryTrajectoryStateResponse(): + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + acceleration_length(0), acceleration(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = acceleration_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->acceleration[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t acceleration_lengthT = *(inbuffer + offset++); + if(acceleration_lengthT > acceleration_length) + this->acceleration = (float*)realloc(this->acceleration, acceleration_lengthT * sizeof(float)); + offset += 3; + acceleration_length = acceleration_lengthT; + for( uint8_t i = 0; i < acceleration_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_acceleration)); + memcpy( &(this->acceleration[i]), &(this->st_acceleration), sizeof(float)); + } + return offset; + } + + const char * getType(){ return QUERYTRAJECTORYSTATE; }; + const char * getMD5(){ return "1f1a6554ad060f44d013e71868403c1a"; }; + + }; + + class QueryTrajectoryState { + public: + typedef QueryTrajectoryStateRequest Request; + typedef QueryTrajectoryStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h new file mode 100755 index 0000000..25bc0f6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionAction_h +#define _ROS_control_msgs_SingleJointPositionAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "control_msgs/SingleJointPositionActionGoal.h" +#include "control_msgs/SingleJointPositionActionResult.h" +#include "control_msgs/SingleJointPositionActionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionAction : public ros::Msg + { + public: + control_msgs::SingleJointPositionActionGoal action_goal; + control_msgs::SingleJointPositionActionResult action_result; + control_msgs::SingleJointPositionActionFeedback action_feedback; + + SingleJointPositionAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionAction"; }; + const char * getMD5(){ return "c4a786b7d53e5d0983decf967a5a779e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h new file mode 100755 index 0000000..3cb7efd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionFeedback_h +#define _ROS_control_msgs_SingleJointPositionActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionFeedback.h" + +namespace control_msgs +{ + + class SingleJointPositionActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionFeedback feedback; + + SingleJointPositionActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionFeedback"; }; + const char * getMD5(){ return "3503b7cf8972f90d245850a5d8796cfa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h new file mode 100755 index 0000000..1337710 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionGoal_h +#define _ROS_control_msgs_SingleJointPositionActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "control_msgs/SingleJointPositionGoal.h" + +namespace control_msgs +{ + + class SingleJointPositionActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + control_msgs::SingleJointPositionGoal goal; + + SingleJointPositionActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionGoal"; }; + const char * getMD5(){ return "4b0d3d091471663e17749c1d0db90f61"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h new file mode 100755 index 0000000..8f11e6e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_control_msgs_SingleJointPositionActionResult_h +#define _ROS_control_msgs_SingleJointPositionActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "control_msgs/SingleJointPositionResult.h" + +namespace control_msgs +{ + + class SingleJointPositionActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + control_msgs::SingleJointPositionResult result; + + SingleJointPositionActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionActionResult"; }; + const char * getMD5(){ return "1eb06eeff08fa7ea874431638cb52332"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h new file mode 100755 index 0000000..3c8dd15 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionFeedback.h @@ -0,0 +1,55 @@ +#ifndef _ROS_control_msgs_SingleJointPositionFeedback_h +#define _ROS_control_msgs_SingleJointPositionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace control_msgs +{ + + class SingleJointPositionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + float position; + float velocity; + float error; + + SingleJointPositionFeedback(): + header(), + position(0), + velocity(0), + error(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->position); + offset += serializeAvrFloat64(outbuffer + offset, this->velocity); + offset += serializeAvrFloat64(outbuffer + offset, this->error); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->velocity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->error)); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionFeedback"; }; + const char * getMD5(){ return "8cee65610a3d08e0a1bded82f146f1fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h new file mode 100755 index 0000000..036c31c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionGoal.h @@ -0,0 +1,69 @@ +#ifndef _ROS_control_msgs_SingleJointPositionGoal_h +#define _ROS_control_msgs_SingleJointPositionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace control_msgs +{ + + class SingleJointPositionGoal : public ros::Msg + { + public: + float position; + ros::Duration min_duration; + float max_velocity; + + SingleJointPositionGoal(): + position(0), + min_duration(), + max_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->position); + *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.sec); + *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_duration.nsec); + offset += serializeAvrFloat64(outbuffer + offset, this->max_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position)); + this->min_duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.sec); + this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->min_duration.nsec); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_velocity)); + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionGoal"; }; + const char * getMD5(){ return "fbaaa562a23a013fd5053e5f72cbb35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h new file mode 100755 index 0000000..7593425 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/control_msgs/SingleJointPositionResult.h @@ -0,0 +1,38 @@ +#ifndef _ROS_control_msgs_SingleJointPositionResult_h +#define _ROS_control_msgs_SingleJointPositionResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace control_msgs +{ + + class SingleJointPositionResult : public ros::Msg + { + public: + + SingleJointPositionResult() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "control_msgs/SingleJointPositionResult"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h new file mode 100755 index 0000000..0dbf042 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/AddDiagnostics.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_AddDiagnostics_h +#define _ROS_SERVICE_AddDiagnostics_h +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + +static const char ADDDIAGNOSTICS[] = "diagnostic_msgs/AddDiagnostics"; + + class AddDiagnosticsRequest : public ros::Msg + { + public: + const char* load_namespace; + + AddDiagnosticsRequest(): + load_namespace("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_load_namespace = strlen(this->load_namespace); + memcpy(outbuffer + offset, &length_load_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->load_namespace, length_load_namespace); + offset += length_load_namespace; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_load_namespace; + memcpy(&length_load_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_load_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_load_namespace-1]=0; + this->load_namespace = (char *)(inbuffer + offset-1); + offset += length_load_namespace; + return offset; + } + + const char * getType(){ return ADDDIAGNOSTICS; }; + const char * getMD5(){ return "c26cf6e164288fbc6050d74f838bcdf0"; }; + + }; + + class AddDiagnosticsResponse : public ros::Msg + { + public: + bool success; + const char* message; + + AddDiagnosticsResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return ADDDIAGNOSTICS; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class AddDiagnostics { + public: + typedef AddDiagnosticsRequest Request; + typedef AddDiagnosticsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h new file mode 100755 index 0000000..d530b09 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/DiagnosticArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticArray_h +#define _ROS_diagnostic_msgs_DiagnosticArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + + class DiagnosticArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + DiagnosticArray(): + header(), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticArray"; }; + const char * getMD5(){ return "60810da900de1dd6ddd437c3503511da"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h new file mode 100755 index 0000000..4cf2e88 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/DiagnosticStatus.h @@ -0,0 +1,128 @@ +#ifndef _ROS_diagnostic_msgs_DiagnosticStatus_h +#define _ROS_diagnostic_msgs_DiagnosticStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/KeyValue.h" + +namespace diagnostic_msgs +{ + + class DiagnosticStatus : public ros::Msg + { + public: + int8_t level; + const char* name; + const char* message; + const char* hardware_id; + uint8_t values_length; + diagnostic_msgs::KeyValue st_values; + diagnostic_msgs::KeyValue * values; + enum { OK = 0 }; + enum { WARN = 1 }; + enum { ERROR = 2 }; + enum { STALE = 3 }; + + DiagnosticStatus(): + level(0), + name(""), + message(""), + hardware_id(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + uint32_t length_hardware_id = strlen(this->hardware_id); + memcpy(outbuffer + offset, &length_hardware_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->hardware_id, length_hardware_id); + offset += length_hardware_id; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->values[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + uint32_t length_hardware_id; + memcpy(&length_hardware_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_hardware_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_hardware_id-1]=0; + this->hardware_id = (char *)(inbuffer + offset-1); + offset += length_hardware_id; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (diagnostic_msgs::KeyValue*)realloc(this->values, values_lengthT * sizeof(diagnostic_msgs::KeyValue)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + offset += this->st_values.deserialize(inbuffer + offset); + memcpy( &(this->values[i]), &(this->st_values), sizeof(diagnostic_msgs::KeyValue)); + } + return offset; + } + + const char * getType(){ return "diagnostic_msgs/DiagnosticStatus"; }; + const char * getMD5(){ return "d0ce08bc6e5ba34c7754f563a9cabaf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/KeyValue.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/KeyValue.h new file mode 100755 index 0000000..7b48800 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/KeyValue.h @@ -0,0 +1,70 @@ +#ifndef _ROS_diagnostic_msgs_KeyValue_h +#define _ROS_diagnostic_msgs_KeyValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace diagnostic_msgs +{ + + class KeyValue : public ros::Msg + { + public: + const char* key; + const char* value; + + KeyValue(): + key(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_key = strlen(this->key); + memcpy(outbuffer + offset, &length_key, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->key, length_key); + offset += length_key; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_key; + memcpy(&length_key, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_key; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_key-1]=0; + this->key = (char *)(inbuffer + offset-1); + offset += length_key; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "diagnostic_msgs/KeyValue"; }; + const char * getMD5(){ return "cf57fdc6617a881a88c16e768132149c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/SelfTest.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/SelfTest.h new file mode 100755 index 0000000..50b599d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/diagnostic_msgs/SelfTest.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_SelfTest_h +#define _ROS_SERVICE_SelfTest_h +#include +#include +#include +#include "ros/msg.h" +#include "diagnostic_msgs/DiagnosticStatus.h" + +namespace diagnostic_msgs +{ + +static const char SELFTEST[] = "diagnostic_msgs/SelfTest"; + + class SelfTestRequest : public ros::Msg + { + public: + + SelfTestRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SelfTestResponse : public ros::Msg + { + public: + const char* id; + int8_t passed; + uint8_t status_length; + diagnostic_msgs::DiagnosticStatus st_status; + diagnostic_msgs::DiagnosticStatus * status; + + SelfTestResponse(): + id(""), + passed(0), + status_length(0), status(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_id = strlen(this->id); + memcpy(outbuffer + offset, &length_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->id, length_id); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.real = this->passed; + *(outbuffer + offset + 0) = (u_passed.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->passed); + *(outbuffer + offset++) = status_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->status[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_id; + memcpy(&length_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_id-1]=0; + this->id = (char *)(inbuffer + offset-1); + offset += length_id; + union { + int8_t real; + uint8_t base; + } u_passed; + u_passed.base = 0; + u_passed.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->passed = u_passed.real; + offset += sizeof(this->passed); + uint8_t status_lengthT = *(inbuffer + offset++); + if(status_lengthT > status_length) + this->status = (diagnostic_msgs::DiagnosticStatus*)realloc(this->status, status_lengthT * sizeof(diagnostic_msgs::DiagnosticStatus)); + offset += 3; + status_length = status_lengthT; + for( uint8_t i = 0; i < status_length; i++){ + offset += this->st_status.deserialize(inbuffer + offset); + memcpy( &(this->status[i]), &(this->st_status), sizeof(diagnostic_msgs::DiagnosticStatus)); + } + return offset; + } + + const char * getType(){ return SELFTEST; }; + const char * getMD5(){ return "ac21b1bab7ab17546986536c22eb34e9"; }; + + }; + + class SelfTest { + public: + typedef SelfTestRequest Request; + typedef SelfTestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/ConfigString.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/ConfigString.h new file mode 100755 index 0000000..539ebcc --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/ConfigString.h @@ -0,0 +1,70 @@ +#ifndef _ROS_driver_base_ConfigString_h +#define _ROS_driver_base_ConfigString_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigString : public ros::Msg + { + public: + const char* name; + const char* value; + + ConfigString(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "driver_base/ConfigString"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/ConfigValue.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/ConfigValue.h new file mode 100755 index 0000000..33b32a0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/ConfigValue.h @@ -0,0 +1,58 @@ +#ifndef _ROS_driver_base_ConfigValue_h +#define _ROS_driver_base_ConfigValue_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class ConfigValue : public ros::Msg + { + public: + const char* name; + float value; + + ConfigValue(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + const char * getType(){ return "driver_base/ConfigValue"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/SensorLevels.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/SensorLevels.h new file mode 100755 index 0000000..4a4ffd2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/driver_base/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_driver_base_SensorLevels_h +#define _ROS_driver_base_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace driver_base +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "driver_base/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/duration.cpp b/case_study/arduino_lab/group_34/original/lib/ros_lib/duration.cpp new file mode 100755 index 0000000..f471c33 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/duration.cpp @@ -0,0 +1,81 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSecSigned(int32_t &sec, int32_t &nsec) + { + int32_t nsec_part = nsec; + int32_t sec_part = sec; + + while (nsec_part > 1000000000L) + { + nsec_part -= 1000000000L; + ++sec_part; + } + while (nsec_part < 0) + { + nsec_part += 1000000000L; + --sec_part; + } + sec = sec_part; + nsec = nsec_part; + } + + Duration& Duration::operator+=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator-=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + + Duration& Duration::operator*=(double scale){ + sec *= scale; + nsec *= scale; + normalizeSecNSecSigned(sec, nsec); + return *this; + } + +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h new file mode 100755 index 0000000..23df990 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/BoolParameter.h @@ -0,0 +1,71 @@ +#ifndef _ROS_dynamic_reconfigure_BoolParameter_h +#define _ROS_dynamic_reconfigure_BoolParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class BoolParameter : public ros::Msg + { + public: + const char* name; + bool value; + + BoolParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/BoolParameter"; }; + const char * getMD5(){ return "23f05028c1a699fb83e22401228c3a9e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Config.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Config.h new file mode 100755 index 0000000..0658228 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Config.h @@ -0,0 +1,143 @@ +#ifndef _ROS_dynamic_reconfigure_Config_h +#define _ROS_dynamic_reconfigure_Config_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/BoolParameter.h" +#include "dynamic_reconfigure/IntParameter.h" +#include "dynamic_reconfigure/StrParameter.h" +#include "dynamic_reconfigure/DoubleParameter.h" +#include "dynamic_reconfigure/GroupState.h" + +namespace dynamic_reconfigure +{ + + class Config : public ros::Msg + { + public: + uint8_t bools_length; + dynamic_reconfigure::BoolParameter st_bools; + dynamic_reconfigure::BoolParameter * bools; + uint8_t ints_length; + dynamic_reconfigure::IntParameter st_ints; + dynamic_reconfigure::IntParameter * ints; + uint8_t strs_length; + dynamic_reconfigure::StrParameter st_strs; + dynamic_reconfigure::StrParameter * strs; + uint8_t doubles_length; + dynamic_reconfigure::DoubleParameter st_doubles; + dynamic_reconfigure::DoubleParameter * doubles; + uint8_t groups_length; + dynamic_reconfigure::GroupState st_groups; + dynamic_reconfigure::GroupState * groups; + + Config(): + bools_length(0), bools(NULL), + ints_length(0), ints(NULL), + strs_length(0), strs(NULL), + doubles_length(0), doubles(NULL), + groups_length(0), groups(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = bools_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->bools[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->ints[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = strs_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->strs[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = doubles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->doubles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t bools_lengthT = *(inbuffer + offset++); + if(bools_lengthT > bools_length) + this->bools = (dynamic_reconfigure::BoolParameter*)realloc(this->bools, bools_lengthT * sizeof(dynamic_reconfigure::BoolParameter)); + offset += 3; + bools_length = bools_lengthT; + for( uint8_t i = 0; i < bools_length; i++){ + offset += this->st_bools.deserialize(inbuffer + offset); + memcpy( &(this->bools[i]), &(this->st_bools), sizeof(dynamic_reconfigure::BoolParameter)); + } + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (dynamic_reconfigure::IntParameter*)realloc(this->ints, ints_lengthT * sizeof(dynamic_reconfigure::IntParameter)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + offset += this->st_ints.deserialize(inbuffer + offset); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(dynamic_reconfigure::IntParameter)); + } + uint8_t strs_lengthT = *(inbuffer + offset++); + if(strs_lengthT > strs_length) + this->strs = (dynamic_reconfigure::StrParameter*)realloc(this->strs, strs_lengthT * sizeof(dynamic_reconfigure::StrParameter)); + offset += 3; + strs_length = strs_lengthT; + for( uint8_t i = 0; i < strs_length; i++){ + offset += this->st_strs.deserialize(inbuffer + offset); + memcpy( &(this->strs[i]), &(this->st_strs), sizeof(dynamic_reconfigure::StrParameter)); + } + uint8_t doubles_lengthT = *(inbuffer + offset++); + if(doubles_lengthT > doubles_length) + this->doubles = (dynamic_reconfigure::DoubleParameter*)realloc(this->doubles, doubles_lengthT * sizeof(dynamic_reconfigure::DoubleParameter)); + offset += 3; + doubles_length = doubles_lengthT; + for( uint8_t i = 0; i < doubles_length; i++){ + offset += this->st_doubles.deserialize(inbuffer + offset); + memcpy( &(this->doubles[i]), &(this->st_doubles), sizeof(dynamic_reconfigure::DoubleParameter)); + } + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::GroupState*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::GroupState)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::GroupState)); + } + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Config"; }; + const char * getMD5(){ return "958f16a05573709014982821e6822580"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h new file mode 100755 index 0000000..3720189 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/ConfigDescription.h @@ -0,0 +1,72 @@ +#ifndef _ROS_dynamic_reconfigure_ConfigDescription_h +#define _ROS_dynamic_reconfigure_ConfigDescription_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Group.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + + class ConfigDescription : public ros::Msg + { + public: + uint8_t groups_length; + dynamic_reconfigure::Group st_groups; + dynamic_reconfigure::Group * groups; + dynamic_reconfigure::Config max; + dynamic_reconfigure::Config min; + dynamic_reconfigure::Config dflt; + + ConfigDescription(): + groups_length(0), groups(NULL), + max(), + min(), + dflt() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = groups_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->groups[i].serialize(outbuffer + offset); + } + offset += this->max.serialize(outbuffer + offset); + offset += this->min.serialize(outbuffer + offset); + offset += this->dflt.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t groups_lengthT = *(inbuffer + offset++); + if(groups_lengthT > groups_length) + this->groups = (dynamic_reconfigure::Group*)realloc(this->groups, groups_lengthT * sizeof(dynamic_reconfigure::Group)); + offset += 3; + groups_length = groups_lengthT; + for( uint8_t i = 0; i < groups_length; i++){ + offset += this->st_groups.deserialize(inbuffer + offset); + memcpy( &(this->groups[i]), &(this->st_groups), sizeof(dynamic_reconfigure::Group)); + } + offset += this->max.deserialize(inbuffer + offset); + offset += this->min.deserialize(inbuffer + offset); + offset += this->dflt.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ConfigDescription"; }; + const char * getMD5(){ return "757ce9d44ba8ddd801bb30bc456f946f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h new file mode 100755 index 0000000..1407bdb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/DoubleParameter.h @@ -0,0 +1,58 @@ +#ifndef _ROS_dynamic_reconfigure_DoubleParameter_h +#define _ROS_dynamic_reconfigure_DoubleParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class DoubleParameter : public ros::Msg + { + public: + const char* name; + float value; + + DoubleParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += serializeAvrFloat64(outbuffer + offset, this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->value)); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/DoubleParameter"; }; + const char * getMD5(){ return "d8512f27253c0f65f928a67c329cd658"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Group.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Group.h new file mode 100755 index 0000000..8e4c957 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Group.h @@ -0,0 +1,137 @@ +#ifndef _ROS_dynamic_reconfigure_Group_h +#define _ROS_dynamic_reconfigure_Group_h + +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/ParamDescription.h" + +namespace dynamic_reconfigure +{ + + class Group : public ros::Msg + { + public: + const char* name; + const char* type; + uint8_t parameters_length; + dynamic_reconfigure::ParamDescription st_parameters; + dynamic_reconfigure::ParamDescription * parameters; + int32_t parent; + int32_t id; + + Group(): + name(""), + type(""), + parameters_length(0), parameters(NULL), + parent(0), + id(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = parameters_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->parameters[i].serialize(outbuffer + offset); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t parameters_lengthT = *(inbuffer + offset++); + if(parameters_lengthT > parameters_length) + this->parameters = (dynamic_reconfigure::ParamDescription*)realloc(this->parameters, parameters_lengthT * sizeof(dynamic_reconfigure::ParamDescription)); + offset += 3; + parameters_length = parameters_lengthT; + for( uint8_t i = 0; i < parameters_length; i++){ + offset += this->st_parameters.deserialize(inbuffer + offset); + memcpy( &(this->parameters[i]), &(this->st_parameters), sizeof(dynamic_reconfigure::ParamDescription)); + } + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/Group"; }; + const char * getMD5(){ return "9e8cd9e9423c94823db3614dd8b1cf7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/GroupState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/GroupState.h new file mode 100755 index 0000000..f2b137a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/GroupState.h @@ -0,0 +1,117 @@ +#ifndef _ROS_dynamic_reconfigure_GroupState_h +#define _ROS_dynamic_reconfigure_GroupState_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class GroupState : public ros::Msg + { + public: + const char* name; + bool state; + int32_t id; + int32_t parent; + + GroupState(): + name(""), + state(0), + id(0), + parent(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.real = this->state; + *(outbuffer + offset + 0) = (u_state.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.real = this->parent; + *(outbuffer + offset + 0) = (u_parent.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_parent.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_parent.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_parent.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + bool real; + uint8_t base; + } u_state; + u_state.base = 0; + u_state.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->state = u_state.real; + offset += sizeof(this->state); + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_parent; + u_parent.base = 0; + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_parent.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->parent = u_parent.real; + offset += sizeof(this->parent); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/GroupState"; }; + const char * getMD5(){ return "a2d87f51dc22930325041a2f8b1571f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h new file mode 100755 index 0000000..c9e90be --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/IntParameter.h @@ -0,0 +1,77 @@ +#ifndef _ROS_dynamic_reconfigure_IntParameter_h +#define _ROS_dynamic_reconfigure_IntParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class IntParameter : public ros::Msg + { + public: + const char* name; + int32_t value; + + IntParameter(): + name(""), + value(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.real = this->value; + *(outbuffer + offset + 0) = (u_value.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_value.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_value.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_value.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->value); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + union { + int32_t real; + uint32_t base; + } u_value; + u_value.base = 0; + u_value.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_value.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->value = u_value.real; + offset += sizeof(this->value); + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/IntParameter"; }; + const char * getMD5(){ return "65fedc7a0cbfb8db035e46194a350bf1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h new file mode 100755 index 0000000..ed6a26e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/ParamDescription.h @@ -0,0 +1,114 @@ +#ifndef _ROS_dynamic_reconfigure_ParamDescription_h +#define _ROS_dynamic_reconfigure_ParamDescription_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class ParamDescription : public ros::Msg + { + public: + const char* name; + const char* type; + uint32_t level; + const char* description; + const char* edit_method; + + ParamDescription(): + name(""), + type(""), + level(0), + description(""), + edit_method("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->level >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->level >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->level >> (8 * 3)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + uint32_t length_edit_method = strlen(this->edit_method); + memcpy(outbuffer + offset, &length_edit_method, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->edit_method, length_edit_method); + offset += length_edit_method; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + this->level = ((uint32_t) (*(inbuffer + offset))); + this->level |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->level |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->level |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->level); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + uint32_t length_edit_method; + memcpy(&length_edit_method, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_edit_method; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_edit_method-1]=0; + this->edit_method = (char *)(inbuffer + offset-1); + offset += length_edit_method; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/ParamDescription"; }; + const char * getMD5(){ return "7434fcb9348c13054e0c3b267c8cb34d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h new file mode 100755 index 0000000..4f5f4fe --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/Reconfigure.h @@ -0,0 +1,79 @@ +#ifndef _ROS_SERVICE_Reconfigure_h +#define _ROS_SERVICE_Reconfigure_h +#include +#include +#include +#include "ros/msg.h" +#include "dynamic_reconfigure/Config.h" + +namespace dynamic_reconfigure +{ + +static const char RECONFIGURE[] = "dynamic_reconfigure/Reconfigure"; + + class ReconfigureRequest : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureRequest(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class ReconfigureResponse : public ros::Msg + { + public: + dynamic_reconfigure::Config config; + + ReconfigureResponse(): + config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return RECONFIGURE; }; + const char * getMD5(){ return "ac41a77620a4a0348b7001641796a8a1"; }; + + }; + + class Reconfigure { + public: + typedef ReconfigureRequest Request; + typedef ReconfigureResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h new file mode 100755 index 0000000..8f85722 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/SensorLevels.h @@ -0,0 +1,41 @@ +#ifndef _ROS_dynamic_reconfigure_SensorLevels_h +#define _ROS_dynamic_reconfigure_SensorLevels_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class SensorLevels : public ros::Msg + { + public: + enum { RECONFIGURE_CLOSE = 3 }; + enum { RECONFIGURE_STOP = 1 }; + enum { RECONFIGURE_RUNNING = 0 }; + + SensorLevels() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/SensorLevels"; }; + const char * getMD5(){ return "6322637bee96d5489db6e2127c47602c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h new file mode 100755 index 0000000..2cdabdb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/dynamic_reconfigure/StrParameter.h @@ -0,0 +1,70 @@ +#ifndef _ROS_dynamic_reconfigure_StrParameter_h +#define _ROS_dynamic_reconfigure_StrParameter_h + +#include +#include +#include +#include "ros/msg.h" + +namespace dynamic_reconfigure +{ + + class StrParameter : public ros::Msg + { + public: + const char* name; + const char* value; + + StrParameter(): + name(""), + value("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_value = strlen(this->value); + memcpy(outbuffer + offset, &length_value, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->value, length_value); + offset += length_value; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_value; + memcpy(&length_value, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_value; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_value-1]=0; + this->value = (char *)(inbuffer + offset-1); + offset += length_value; + return offset; + } + + const char * getType(){ return "dynamic_reconfigure/StrParameter"; }; + const char * getMD5(){ return "bc6ccc4a57f61779c8eaae61e9f422e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ADC/ADC.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ADC/ADC.pde new file mode 100755 index 0000000..a6cabe9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ADC/ADC.pde @@ -0,0 +1,52 @@ +/* + * rosserial ADC Example + * + * This is a poor man's Oscilloscope. It does not have the sampling + * rate or accuracy of a commerical scope, but it is great to get + * an analog value into ROS in a pinch. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +rosserial_arduino::Adc adc_msg; +ros::Publisher p("adc", &adc_msg); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); +} + +//We average the analog reading to elminate some of the noise +int averageAnalog(int pin){ + int v=0; + for(int i=0; i<4; i++) v+= analogRead(pin); + return v/4; +} + +long adc_timer; + +void loop() +{ + adc_msg.adc0 = averageAnalog(0); + adc_msg.adc1 = averageAnalog(1); + adc_msg.adc2 = averageAnalog(2); + adc_msg.adc3 = averageAnalog(3); + adc_msg.adc4 = averageAnalog(4); + adc_msg.adc5 = averageAnalog(5); + + p.publish(&adc_msg); + + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Blink/Blink.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Blink/Blink.pde new file mode 100755 index 0000000..4e9e185 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Blink/Blink.pde @@ -0,0 +1,29 @@ +/* + * rosserial Subscriber Example + * Blinks an LED on callback + */ + +#include +#include + +ros::NodeHandle nh; + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", &messageCb ); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(sub); +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/BlinkM/BlinkM.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/BlinkM/BlinkM.pde new file mode 100755 index 0000000..f54ea28 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/BlinkM/BlinkM.pde @@ -0,0 +1,162 @@ +/* +* RosSerial BlinkM Example +* This program shows how to control a blinkm +* from an arduino using RosSerial +*/ + +#include + + +#include +#include + + +//include Wire/ twi for the BlinkM +#include +extern "C" { +#include "utility/twi.h" +} + +#include "BlinkM_funcs.h" +const byte blinkm_addr = 0x09; //default blinkm address + + +void setLED( bool solid, char color) +{ + + if (solid) + { + switch (color) + { + + case 'w': // white + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0xff); + break; + + case 'r': //RED + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0); + break; + + case 'g':// Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0); + break; + + case 'b':// Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0xff); + break; + + case 'c':// Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0xff,0xff); + break; + + case 'm': // Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0,0xff); + break; + + case 'y': // yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0xff,0xff,0); + break; + + default: // Black + BlinkM_stopScript( blinkm_addr ); + BlinkM_fadeToRGB( blinkm_addr, 0,0,0); + break; + } + } + + + else + { + switch (color) + { + case 'r': // Blink Red + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 3,0,0 ); + break; + case 'w': // Blink white + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 2,0,0 ); + break; + case 'g': // Blink Green + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 4,0,0 ); + break; + + case 'b': // Blink Blue + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 5,0,0 ); + break; + + case 'c': //Blink Cyan + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 6,0,0 ); + break; + + case 'm': //Blink Magenta + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 7,0,0 ); + break; + + case 'y': //Blink Yellow + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 8,0,0 ); + break; + + default: //OFF + BlinkM_stopScript( blinkm_addr ); + BlinkM_playScript( blinkm_addr, 9,0,0 ); + break; + } + + } +} + +void light_cb( const std_msgs::String& light_cmd){ + bool solid =false; + char color; + if (strlen( (const char* ) light_cmd.data) ==2 ){ + solid = (light_cmd.data[0] == 'S') || (light_cmd.data[0] == 's'); + color = light_cmd.data[1]; + } + else{ + solid= false; + color = light_cmd.data[0]; + } + + setLED(solid, color); +} + + + +ros::NodeHandle nh; +ros::Subscriber sub("blinkm" , light_cb); + + +void setup() +{ + + pinMode(13, OUTPUT); //set up the LED + + BlinkM_beginWithPower(); + delay(100); + BlinkM_stopScript(blinkm_addr); // turn off startup script + setLED(false, 0); //turn off the led + + nh.initNode(); + nh.subscribe(sub); + +} + +void loop() +{ + nh.spinOnce(); + delay(1); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h new file mode 100755 index 0000000..94cabeb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/BlinkM/BlinkM_funcs.h @@ -0,0 +1,440 @@ +/* + * BlinkM_funcs.h -- Arduino 'library' to control BlinkM + * -------------- + * + * + * Note: original version of this file lives with the BlinkMTester sketch + * + * Note: all the functions are declared 'static' because + * it saves about 1.5 kbyte in code space in final compiled sketch. + * A C++ library of this costs a 1kB more. + * + * 2007-8, Tod E. Kurt, ThingM, http://thingm.com/ + * + * version: 20081101 + * + * history: + * 20080101 - initial release + * 20080203 - added setStartupParam(), bugfix receiveBytes() from Dan Julio + * 20081101 - fixed to work with Arduino-0012, added MaxM commands, + * added test script read/write functions, cleaned up some functions + * 20090121 - added I2C bus scan functions, has dependencies on private + * functions inside Wire library, so might break in the future + * 20100420 - added BlinkM_startPower and _stopPower + * + */ + +#include + +extern "C" { +#include "utility/twi.h" // from Wire library, so we can do bus scanning +} + + +// format of light script lines: duration, command, arg1,arg2,arg3 +typedef struct _blinkm_script_line { + uint8_t dur; + uint8_t cmd[4]; // cmd,arg1,arg2,arg3 +} blinkm_script_line; + + +// Call this first (when powering BlinkM from a power supply) +static void BlinkM_begin() +{ + Wire.begin(); // join i2c bus (address optional for master) +} + +/* + * actually can't do this either, because twi_init() has THREE callocs in it too + * +static void BlinkM_reset() +{ + twi_init(); // can't just call Wire.begin() again because of calloc()s there +} +*/ + +// +// each call to twi_writeTo() should return 0 if device is there +// or other value (usually 2) if nothing is at that address +// +static void BlinkM_scanI2CBus(byte from, byte to, + void(*callback)(byte add, byte result) ) +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr = from; addr <= to; addr++ ) { + rc = twi_writeTo(addr, &data, 0, 1, 1); + callback( addr, rc ); + } +} + +// +// +static int8_t BlinkM_findFirstI2CDevice() +{ + byte rc; + byte data = 0; // not used, just an address to feed to twi_writeTo() + for( byte addr=1; addr < 120; addr++ ) { // only scan addrs 1-120 + rc = twi_writeTo(addr, &data, 0, 1, 1); + if( rc == 0 ) return addr; // found an address + } + return -1; // no device found in range given +} + +// FIXME: make this more Arduino-like +static void BlinkM_startPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC |= _BV(pwrpin) | _BV(gndpin); // make outputs + PORTC &=~ _BV(gndpin); + PORTC |= _BV(pwrpin); +} + +// FIXME: make this more Arduino-like +static void BlinkM_stopPowerWithPins(byte pwrpin, byte gndpin) +{ + DDRC &=~ (_BV(pwrpin) | _BV(gndpin)); +} + +// +static void BlinkM_startPower() +{ + BlinkM_startPowerWithPins( PORTC3, PORTC2 ); +} + +// +static void BlinkM_stopPower() +{ + BlinkM_stopPowerWithPins( PORTC3, PORTC2 ); +} + +// General version of BlinkM_beginWithPower(). +// Call this first when BlinkM is plugged directly into Arduino +static void BlinkM_beginWithPowerPins(byte pwrpin, byte gndpin) +{ + BlinkM_startPowerWithPins(pwrpin,gndpin); + delay(100); // wait for things to stabilize + Wire.begin(); +} + +// Call this first when BlinkM is plugged directly into Arduino +// FIXME: make this more Arduino-like +static void BlinkM_beginWithPower() +{ + BlinkM_beginWithPowerPins( PORTC3, PORTC2 ); +} + +// sends a generic command +static void BlinkM_sendCmd(byte addr, byte* cmd, int cmdlen) +{ + Wire.beginTransmission(addr); + for( byte i=0; idur = Wire.read(); + script_line->cmd[0] = Wire.read(); + script_line->cmd[1] = Wire.read(); + script_line->cmd[2] = Wire.read(); + script_line->cmd[3] = Wire.read(); +} + +// +static void BlinkM_writeScriptLine(byte addr, byte script_id, + byte pos, byte dur, + byte cmd, byte arg1, byte arg2, byte arg3) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing line:"); Serial.print(pos,DEC); + Serial.print(" with cmd:"); Serial.print(cmd); + Serial.print(" arg1:"); Serial.println(arg1,HEX); +#endif + Wire.beginTransmission(addr); + Wire.write('W'); + Wire.write(script_id); + Wire.write(pos); + Wire.write(dur); + Wire.write(cmd); + Wire.write(arg1); + Wire.write(arg2); + Wire.write(arg3); + Wire.endTransmission(); + +} + +// +static void BlinkM_writeScript(byte addr, byte script_id, + byte len, byte reps, + blinkm_script_line* lines) +{ +#ifdef BLINKM_FUNCS_DEBUG + Serial.print("writing script to addr:"); Serial.print(addr,DEC); + Serial.print(", script_id:"); Serial.println(script_id,DEC); +#endif + for(byte i=0; i < len; i++) { + blinkm_script_line l = lines[i]; + BlinkM_writeScriptLine( addr, script_id, i, l.dur, + l.cmd[0], l.cmd[1], l.cmd[2], l.cmd[3]); + delay(20); // must wait for EEPROM to be programmed + } + BlinkM_setScriptLengthReps(addr, script_id, len, reps); +} + +// +static void BlinkM_setStartupParams(byte addr, byte mode, byte script_id, + byte reps, byte fadespeed, byte timeadj) +{ + Wire.beginTransmission(addr); + Wire.write('B'); + Wire.write(mode); // default 0x01 == Play script + Wire.write(script_id); // default 0x00 == script #0 + Wire.write(reps); // default 0x00 == repeat infinitely + Wire.write(fadespeed); // default 0x08 == usually overridden by sketch + Wire.write(timeadj); // default 0x00 == sometimes overridden by sketch + Wire.endTransmission(); +} + + +// Gets digital inputs of the BlinkM +// returns -1 on failure +static int BlinkM_getInputsO(byte addr) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)1); + if( Wire.available() ) { + byte b = Wire.read(); + return b; + } + return -1; +} + +// Gets digital inputs of the BlinkM +// stores them in passed in array +// returns -1 on failure +static int BlinkM_getInputs(byte addr, byte inputs[]) +{ + Wire.beginTransmission(addr); + Wire.write('i'); + Wire.endTransmission(); + Wire.requestFrom(addr, (byte)4); + while( Wire.available() < 4 ) ; // FIXME: wait until we get 4 bytes + + inputs[0] = Wire.read(); + inputs[1] = Wire.read(); + inputs[2] = Wire.read(); + inputs[3] = Wire.read(); + + return 0; +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Clapper/Clapper.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Clapper/Clapper.pde new file mode 100755 index 0000000..712b6f9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Clapper/Clapper.pde @@ -0,0 +1,94 @@ +/* + * rosserial Clapper Example + * + * This code is a very simple example of the kinds of + * custom sensors that you can easily set up with rosserial + * and Arduino. This code uses a microphone attached to + * analog pin 5 detect two claps (2 loud sounds). + * You can use this clapper, for example, to command a robot + * in the area to come do your bidding. + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif +#include +#include + +ros::NodeHandle nh; + +std_msgs::Empty clap_msg; +ros::Publisher p("clap", &clap_msg); + +enum clapper_state { clap1, clap_one_waiting, pause, clap2}; +clapper_state clap; + +int volume_thresh = 200; //a clap sound needs to be: + //abs(clap_volume) > average noise + volume_thresh +int mic_pin = 5; +int adc_ave=0; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + + nh.advertise(p); + + //measure the average volume of the noise in the area + for (int i =0; i<10;i++) adc_ave += analogRead(mic_pin); + adc_ave /= 10; +} + +long event_timer; + +void loop() +{ + int mic_val = 0; + for(int i=0; i<4; i++) mic_val += analogRead(mic_pin); + + mic_val = mic_val/4-adc_ave; + + switch(clap){ + case clap1: + if (abs(mic_val) > volume_thresh){ + clap = clap_one_waiting; + event_timer = millis(); + } + break; + case clap_one_waiting: + if ( (abs(mic_val) < 30) && ( (millis() - event_timer) > 20 ) ) + { + clap= pause; + event_timer = millis(); + + } + break; + case pause: // make sure there is a pause between + // the loud sounds + if ( mic_val > volume_thresh) + { + clap = clap1; + + } + else if ( (millis()-event_timer)> 60) { + clap = clap2; + event_timer = millis(); + + } + break; + case clap2: + if (abs(mic_val) > volume_thresh){ //we have got a double clap! + clap = clap1; + p.publish(&clap_msg); + } + else if ( (millis()-event_timer)> 200) { + clap= clap1; // no clap detected, reset state machine + } + + break; + } + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde new file mode 100755 index 0000000..2474413 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/HelloWorld/HelloWorld.pde @@ -0,0 +1,28 @@ +/* + * rosserial Publisher Example + * Prints "hello world!" + */ + +#include +#include + +ros::NodeHandle nh; + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(1000); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/IrRanger/IrRanger.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/IrRanger/IrRanger.pde new file mode 100755 index 0000000..240b5a1 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/IrRanger/IrRanger.pde @@ -0,0 +1,64 @@ +/* + * rosserial IR Ranger Example + * + * This example is calibrated for the Sharp GP2D120XJ00F. + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "range_data", &range_msg); + +const int analog_pin = 0; +unsigned long range_timer; + +/* + * getRange() - samples the analog input from the ranger + * and converts it into meters. + */ +float getRange(int pin_num){ + int sample; + // Get data + sample = analogRead(pin_num)/4; + // if the ADC reading is too low, + // then we are really far away from anything + if(sample < 10) + return 254; // max range + // Magic numbers to get cm + sample= 1309/(sample-3); + return (sample - 1)/100; //convert to meters +} + +char frameid[] = "/ir_ranger"; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + range_msg.radiation_type = sensor_msgs::Range::INFRARED; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.01; + range_msg.min_range = 0.03; + range_msg.max_range = 0.4; + +} + +void loop() +{ + // publish the range value every 50 milliseconds + // since it takes that long for the sensor to stabilize + if ( (millis()-range_timer) > 50){ + range_msg.range = getRange(analog_pin); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_timer = millis() + 50; + } + nh.spinOnce(); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Logging/Logging.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Logging/Logging.pde new file mode 100755 index 0000000..400a9cd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Logging/Logging.pde @@ -0,0 +1,45 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + + +char debug[]= "debug statements"; +char info[] = "infos"; +char warn[] = "warnings"; +char error[] = "errors"; +char fatal[] = "fatalities"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + + nh.logdebug(debug); + nh.loginfo(info); + nh.logwarn(warn); + nh.logerror(error); + nh.logfatal(fatal); + + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Odom/Odom.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Odom/Odom.pde new file mode 100755 index 0000000..5841020 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Odom/Odom.pde @@ -0,0 +1,53 @@ +/* + * rosserial Planar Odometry Example + */ + +#include +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +double x = 1.0; +double y = 0.0; +double theta = 1.57; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + // drive in a circle + double dx = 0.2; + double dtheta = 0.18; + x += cos(theta)*dx*0.1; + y += sin(theta)*dx*0.1; + theta += dtheta*0.1; + if(theta > 3.14) + theta=-3.14; + + // tf odom->base_link + t.header.frame_id = odom; + t.child_frame_id = base_link; + + t.transform.translation.x = x; + t.transform.translation.y = y; + + t.transform.rotation = tf::createQuaternionFromYaw(theta); + t.header.stamp = nh.now(); + + broadcaster.sendTransform(t); + nh.spinOnce(); + + delay(10); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde new file mode 100755 index 0000000..75093a9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceClient/ServiceClient.pde @@ -0,0 +1,38 @@ +/* + * rosserial Service Client + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +ros::ServiceClient client("test_srv"); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.serviceClient(client); + nh.advertise(chatter); + while(!nh.connected()) nh.spinOnce(); + nh.loginfo("Startup complete"); +} + +void loop() +{ + Test::Request req; + Test::Response res; + req.input = hello; + client.call(req, res); + str_msg.data = res.output; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(100); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceClient/client.py b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceClient/client.py new file mode 100755 index 0000000..3b27bd5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceClient/client.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +""" +Sample code to use with ServiceClient.pde +""" + +import roslib; roslib.load_manifest("rosserial_arduino") +import rospy + +from rosserial_arduino.srv import * + +def callback(req): + print "The arduino is calling! Please send it a message:" + t = TestResponse() + t.output = raw_input() + return t + +rospy.init_node("service_client_test") +rospy.Service("test_srv", Test, callback) +rospy.spin() diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde new file mode 100755 index 0000000..2d3fd70 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServiceServer/ServiceServer.pde @@ -0,0 +1,40 @@ +/* + * rosserial Service Server + */ + +#include +#include +#include + +ros::NodeHandle nh; +using rosserial_arduino::Test; + +int i; +void callback(const Test::Request & req, Test::Response & res){ + if((i++)%2) + res.output = "hello"; + else + res.output = "world"; +} + +ros::ServiceServer server("test_srv",&callback); + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + nh.initNode(); + nh.advertiseService(server); + nh.advertise(chatter); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServoControl/ServoControl.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServoControl/ServoControl.pde new file mode 100755 index 0000000..24db409 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/ServoControl/ServoControl.pde @@ -0,0 +1,49 @@ +/* + * rosserial Servo Control Example + * + * This sketch demonstrates the control of hobby R/C servos + * using ROS and the arduiono + * + * For the full tutorial write up, visit + * www.ros.org/wiki/rosserial_arduino_demos + * + * For more information on the Arduino Servo Library + * Checkout : + * http://www.arduino.cc/en/Reference/Servo + */ + +#if (ARDUINO >= 100) + #include +#else + #include +#endif + +#include +#include +#include + +ros::NodeHandle nh; + +Servo servo; + +void servo_cb( const std_msgs::UInt16& cmd_msg){ + servo.write(cmd_msg.data); //set servo angle, should be from 0-180 + digitalWrite(13, HIGH-digitalRead(13)); //toggle led +} + + +ros::Subscriber sub("servo", servo_cb); + +void setup(){ + pinMode(13, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + servo.attach(9); //attach it to pin 9 +} + +void loop(){ + nh.spinOnce(); + delay(1); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Temperature/Temperature.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Temperature/Temperature.pde new file mode 100755 index 0000000..2c2f865 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Temperature/Temperature.pde @@ -0,0 +1,72 @@ +/* + * rosserial Temperature Sensor Example + * + * This tutorial demonstrates the usage of the + * Sparkfun TMP102 Digital Temperature Breakout board + * http://www.sparkfun.com/products/9418 + * + * Source Code Based off of: + * http://wiring.org.co/learning/libraries/tmp102sparkfun.html + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +std_msgs::Float32 temp_msg; +ros::Publisher pub_temp("temperature", &temp_msg); + + +// From the datasheet the BMP module address LSB distinguishes +// between read (1) and write (0) operations, corresponding to +// address 0x91 (read) and 0x90 (write). +// shift the address 1 bit right (0x91 or 0x90), the Wire library only needs the 7 +// most significant bits for the address 0x91 >> 1 = 0x48 +// 0x90 >> 1 = 0x48 (72) + +int sensorAddress = 0x91 >> 1; // From datasheet sensor address is 0x91 + // shift the address 1 bit right, the Wire library only needs the 7 + // most significant bits for the address + + +void setup() +{ + Wire.begin(); // join i2c bus (address optional for master) + + nh.initNode(); + nh.advertise(pub_temp); + +} + +long publisher_timer; + +void loop() +{ + + if (millis() > publisher_timer) { + // step 1: request reading from sensor + Wire.requestFrom(sensorAddress,2); + delay(10); + if (2 <= Wire.available()) // if two bytes were received + { + byte msb; + byte lsb; + int temperature; + + msb = Wire.read(); // receive high byte (full degrees) + lsb = Wire.read(); // receive low byte (fraction degrees) + temperature = ((msb) << 4); // MSB + temperature |= (lsb >> 4); // LSB + + temp_msg.data = temperature*0.0625; + pub_temp.publish(&temp_msg); + } + + publisher_timer = millis() + 1000; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/TimeTF/TimeTF.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/TimeTF/TimeTF.pde new file mode 100755 index 0000000..16fbb70 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/TimeTF/TimeTF.pde @@ -0,0 +1,37 @@ +/* + * rosserial Time and TF Example + * Publishes a transform at current time + */ + +#include +#include +#include + +ros::NodeHandle nh; + +geometry_msgs::TransformStamped t; +tf::TransformBroadcaster broadcaster; + +char base_link[] = "/base_link"; +char odom[] = "/odom"; + +void setup() +{ + nh.initNode(); + broadcaster.init(nh); +} + +void loop() +{ + t.header.frame_id = odom; + t.child_frame_id = base_link; + t.transform.translation.x = 1.0; + t.transform.rotation.x = 0.0; + t.transform.rotation.y = 0.0; + t.transform.rotation.z = 0.0; + t.transform.rotation.w = 1.0; + t.header.stamp = nh.now(); + broadcaster.sendTransform(t); + nh.spinOnce(); + delay(10); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde new file mode 100755 index 0000000..d5870cb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/Ultrasound/Ultrasound.pde @@ -0,0 +1,61 @@ +/* + * rosserial Ultrasound Example + * + * This example is for the Maxbotix Ultrasound rangers. + */ + +#include +#include +#include + +ros::NodeHandle nh; + +sensor_msgs::Range range_msg; +ros::Publisher pub_range( "/ultrasound", &range_msg); + +const int adc_pin = 0; + +char frameid[] = "/ultrasound"; + +float getRange_Ultrasound(int pin_num){ + int val = 0; + for(int i=0; i<4; i++) val += analogRead(pin_num); + float range = val; + return range /322.519685; // (0.0124023437 /4) ; //cvt to meters +} + +void setup() +{ + nh.initNode(); + nh.advertise(pub_range); + + + range_msg.radiation_type = sensor_msgs::Range::ULTRASOUND; + range_msg.header.frame_id = frameid; + range_msg.field_of_view = 0.1; // fake + range_msg.min_range = 0.0; + range_msg.max_range = 6.47; + + pinMode(8,OUTPUT); + digitalWrite(8, LOW); +} + + +long range_time; + +void loop() +{ + + //publish the adc value every 50 milliseconds + //since it takes that long for the sensor to stablize + if ( millis() >= range_time ){ + int r =0; + + range_msg.range = getRange_Ultrasound(5); + range_msg.header.stamp = nh.now(); + pub_range.publish(&range_msg); + range_time = millis() + 50; + } + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/button_example/button_example.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/button_example/button_example.pde new file mode 100755 index 0000000..0404542 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/button_example/button_example.pde @@ -0,0 +1,61 @@ +/* + * Button Example for Rosserial + */ + +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Bool pushed_msg; +ros::Publisher pub_button("pushed", &pushed_msg); + +const int button_pin = 7; +const int led_pin = 13; + +bool last_reading; +long last_debounce_time=0; +long debounce_delay=50; +bool published = true; + +void setup() +{ + nh.initNode(); + nh.advertise(pub_button); + + //initialize an LED output pin + //and a input pin for our push button + pinMode(led_pin, OUTPUT); + pinMode(button_pin, INPUT); + + //Enable the pullup resistor on the button + digitalWrite(button_pin, HIGH); + + //The button is a normally button + last_reading = ! digitalRead(button_pin); + +} + +void loop() +{ + + bool reading = ! digitalRead(button_pin); + + if (last_reading!= reading){ + last_debounce_time = millis(); + published = false; + } + + //if the button value has not changed for the debounce delay, we know its stable + if ( !published && (millis() - last_debounce_time) > debounce_delay) { + digitalWrite(led_pin, reading); + pushed_msg.data = reading; + pub_button.publish(&pushed_msg); + published = true; + } + + last_reading = reading; + + nh.spinOnce(); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/pubsub/pubsub.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/pubsub/pubsub.pde new file mode 100755 index 0000000..753d8ed --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/examples/pubsub/pubsub.pde @@ -0,0 +1,40 @@ +/* + * rosserial PubSub Example + * Prints "hello world!" and toggles led + */ + +#include +#include +#include + +ros::NodeHandle nh; + + +void messageCb( const std_msgs::Empty& toggle_msg){ + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber sub("toggle_led", messageCb ); + + + +std_msgs::String str_msg; +ros::Publisher chatter("chatter", &str_msg); + +char hello[13] = "hello world!"; + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(chatter); + nh.subscribe(sub); +} + +void loop() +{ + str_msg.data = hello; + chatter.publish( &str_msg ); + nh.spinOnce(); + delay(500); +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h new file mode 100755 index 0000000..7dd6bc0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ApplyBodyWrench.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_ApplyBodyWrench_h +#define _ROS_SERVICE_ApplyBodyWrench_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "geometry_msgs/Wrench.h" +#include "ros/time.h" +#include "geometry_msgs/Point.h" + +namespace gazebo_msgs +{ + +static const char APPLYBODYWRENCH[] = "gazebo_msgs/ApplyBodyWrench"; + + class ApplyBodyWrenchRequest : public ros::Msg + { + public: + const char* body_name; + const char* reference_frame; + geometry_msgs::Point reference_point; + geometry_msgs::Wrench wrench; + ros::Time start_time; + ros::Duration duration; + + ApplyBodyWrenchRequest(): + body_name(""), + reference_frame(""), + reference_point(), + wrench(), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + offset += this->reference_point.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + offset += this->reference_point.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "e37e6adf97eba5095baa77dffb71e5bd"; }; + + }; + + class ApplyBodyWrenchResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyBodyWrenchResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYBODYWRENCH; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyBodyWrench { + public: + typedef ApplyBodyWrenchRequest Request; + typedef ApplyBodyWrenchResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h new file mode 100755 index 0000000..99e071c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ApplyJointEffort.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_ApplyJointEffort_h +#define _ROS_SERVICE_ApplyJointEffort_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace gazebo_msgs +{ + +static const char APPLYJOINTEFFORT[] = "gazebo_msgs/ApplyJointEffort"; + + class ApplyJointEffortRequest : public ros::Msg + { + public: + const char* joint_name; + float effort; + ros::Time start_time; + ros::Duration duration; + + ApplyJointEffortRequest(): + joint_name(""), + effort(0), + start_time(), + duration() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += serializeAvrFloat64(outbuffer + offset, this->effort); + *(outbuffer + offset + 0) = (this->start_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.sec); + *(outbuffer + offset + 0) = (this->start_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->start_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->start_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->start_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->start_time.nsec); + *(outbuffer + offset + 0) = (this->duration.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.sec); + *(outbuffer + offset + 0) = (this->duration.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->duration.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->duration.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->duration.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->duration.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->effort)); + this->start_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.sec); + this->start_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->start_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->start_time.nsec); + this->duration.sec = ((uint32_t) (*(inbuffer + offset))); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.sec); + this->duration.nsec = ((uint32_t) (*(inbuffer + offset))); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->duration.nsec); + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2c3396ab9af67a509ecd2167a8fe41a2"; }; + + }; + + class ApplyJointEffortResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + ApplyJointEffortResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return APPLYJOINTEFFORT; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class ApplyJointEffort { + public: + typedef ApplyJointEffortRequest Request; + typedef ApplyJointEffortResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/BodyRequest.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/BodyRequest.h new file mode 100755 index 0000000..99dae8a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/BodyRequest.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_BodyRequest_h +#define _ROS_SERVICE_BodyRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char BODYREQUEST[] = "gazebo_msgs/BodyRequest"; + + class BodyRequestRequest : public ros::Msg + { + public: + const char* body_name; + + BodyRequestRequest(): + body_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_body_name = strlen(this->body_name); + memcpy(outbuffer + offset, &length_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_name, length_body_name); + offset += length_body_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_body_name; + memcpy(&length_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_body_name-1]=0; + this->body_name = (char *)(inbuffer + offset-1); + offset += length_body_name; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "5eade9afe7f232d78005bd0cafeab755"; }; + + }; + + class BodyRequestResponse : public ros::Msg + { + public: + + BodyRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return BODYREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class BodyRequest { + public: + typedef BodyRequestRequest Request; + typedef BodyRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ContactState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ContactState.h new file mode 100755 index 0000000..a1966f0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ContactState.h @@ -0,0 +1,172 @@ +#ifndef _ROS_gazebo_msgs_ContactState_h +#define _ROS_gazebo_msgs_ContactState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Wrench.h" +#include "geometry_msgs/Vector3.h" + +namespace gazebo_msgs +{ + + class ContactState : public ros::Msg + { + public: + const char* info; + const char* collision1_name; + const char* collision2_name; + uint8_t wrenches_length; + geometry_msgs::Wrench st_wrenches; + geometry_msgs::Wrench * wrenches; + geometry_msgs::Wrench total_wrench; + uint8_t contact_positions_length; + geometry_msgs::Vector3 st_contact_positions; + geometry_msgs::Vector3 * contact_positions; + uint8_t contact_normals_length; + geometry_msgs::Vector3 st_contact_normals; + geometry_msgs::Vector3 * contact_normals; + uint8_t depths_length; + float st_depths; + float * depths; + + ContactState(): + info(""), + collision1_name(""), + collision2_name(""), + wrenches_length(0), wrenches(NULL), + total_wrench(), + contact_positions_length(0), contact_positions(NULL), + contact_normals_length(0), contact_normals(NULL), + depths_length(0), depths(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + uint32_t length_collision1_name = strlen(this->collision1_name); + memcpy(outbuffer + offset, &length_collision1_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision1_name, length_collision1_name); + offset += length_collision1_name; + uint32_t length_collision2_name = strlen(this->collision2_name); + memcpy(outbuffer + offset, &length_collision2_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->collision2_name, length_collision2_name); + offset += length_collision2_name; + *(outbuffer + offset++) = wrenches_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->wrenches[i].serialize(outbuffer + offset); + } + offset += this->total_wrench.serialize(outbuffer + offset); + *(outbuffer + offset++) = contact_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->contact_positions[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = contact_normals_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->contact_normals[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = depths_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < depths_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->depths[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + uint32_t length_collision1_name; + memcpy(&length_collision1_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision1_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision1_name-1]=0; + this->collision1_name = (char *)(inbuffer + offset-1); + offset += length_collision1_name; + uint32_t length_collision2_name; + memcpy(&length_collision2_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_collision2_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_collision2_name-1]=0; + this->collision2_name = (char *)(inbuffer + offset-1); + offset += length_collision2_name; + uint8_t wrenches_lengthT = *(inbuffer + offset++); + if(wrenches_lengthT > wrenches_length) + this->wrenches = (geometry_msgs::Wrench*)realloc(this->wrenches, wrenches_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrenches_length = wrenches_lengthT; + for( uint8_t i = 0; i < wrenches_length; i++){ + offset += this->st_wrenches.deserialize(inbuffer + offset); + memcpy( &(this->wrenches[i]), &(this->st_wrenches), sizeof(geometry_msgs::Wrench)); + } + offset += this->total_wrench.deserialize(inbuffer + offset); + uint8_t contact_positions_lengthT = *(inbuffer + offset++); + if(contact_positions_lengthT > contact_positions_length) + this->contact_positions = (geometry_msgs::Vector3*)realloc(this->contact_positions, contact_positions_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_positions_length = contact_positions_lengthT; + for( uint8_t i = 0; i < contact_positions_length; i++){ + offset += this->st_contact_positions.deserialize(inbuffer + offset); + memcpy( &(this->contact_positions[i]), &(this->st_contact_positions), sizeof(geometry_msgs::Vector3)); + } + uint8_t contact_normals_lengthT = *(inbuffer + offset++); + if(contact_normals_lengthT > contact_normals_length) + this->contact_normals = (geometry_msgs::Vector3*)realloc(this->contact_normals, contact_normals_lengthT * sizeof(geometry_msgs::Vector3)); + offset += 3; + contact_normals_length = contact_normals_lengthT; + for( uint8_t i = 0; i < contact_normals_length; i++){ + offset += this->st_contact_normals.deserialize(inbuffer + offset); + memcpy( &(this->contact_normals[i]), &(this->st_contact_normals), sizeof(geometry_msgs::Vector3)); + } + uint8_t depths_lengthT = *(inbuffer + offset++); + if(depths_lengthT > depths_length) + this->depths = (float*)realloc(this->depths, depths_lengthT * sizeof(float)); + offset += 3; + depths_length = depths_lengthT; + for( uint8_t i = 0; i < depths_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_depths)); + memcpy( &(this->depths[i]), &(this->st_depths), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactState"; }; + const char * getMD5(){ return "48c0ffb054b8c444f870cecea1ee50d9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ContactsState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ContactsState.h new file mode 100755 index 0000000..38da01f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ContactsState.h @@ -0,0 +1,64 @@ +#ifndef _ROS_gazebo_msgs_ContactsState_h +#define _ROS_gazebo_msgs_ContactsState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "gazebo_msgs/ContactState.h" + +namespace gazebo_msgs +{ + + class ContactsState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t states_length; + gazebo_msgs::ContactState st_states; + gazebo_msgs::ContactState * states; + + ContactsState(): + header(), + states_length(0), states(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->states[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t states_lengthT = *(inbuffer + offset++); + if(states_lengthT > states_length) + this->states = (gazebo_msgs::ContactState*)realloc(this->states, states_lengthT * sizeof(gazebo_msgs::ContactState)); + offset += 3; + states_length = states_lengthT; + for( uint8_t i = 0; i < states_length; i++){ + offset += this->st_states.deserialize(inbuffer + offset); + memcpy( &(this->states[i]), &(this->st_states), sizeof(gazebo_msgs::ContactState)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ContactsState"; }; + const char * getMD5(){ return "acbcb1601a8e525bf72509f18e6f668d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/DeleteModel.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/DeleteModel.h new file mode 100755 index 0000000..2c744d8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/DeleteModel.h @@ -0,0 +1,119 @@ +#ifndef _ROS_SERVICE_DeleteModel_h +#define _ROS_SERVICE_DeleteModel_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char DELETEMODEL[] = "gazebo_msgs/DeleteModel"; + + class DeleteModelRequest : public ros::Msg + { + public: + const char* model_name; + + DeleteModelRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class DeleteModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + DeleteModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return DELETEMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class DeleteModel { + public: + typedef DeleteModelRequest Request; + typedef DeleteModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h new file mode 100755 index 0000000..361eae6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetJointProperties.h @@ -0,0 +1,191 @@ +#ifndef _ROS_SERVICE_GetJointProperties_h +#define _ROS_SERVICE_GetJointProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETJOINTPROPERTIES[] = "gazebo_msgs/GetJointProperties"; + + class GetJointPropertiesRequest : public ros::Msg + { + public: + const char* joint_name; + + GetJointPropertiesRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class GetJointPropertiesResponse : public ros::Msg + { + public: + uint8_t type; + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t position_length; + float st_position; + float * position; + uint8_t rate_length; + float st_rate; + float * rate; + bool success; + const char* status_message; + enum { REVOLUTE = 0 }; + enum { CONTINUOUS = 1 }; + enum { PRISMATIC = 2 }; + enum { FIXED = 3 }; + enum { BALL = 4 }; + enum { UNIVERSAL = 5 }; + + GetJointPropertiesResponse(): + type(0), + damping_length(0), damping(NULL), + position_length(0), position(NULL), + rate_length(0), rate(NULL), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = rate_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < rate_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->rate[i]); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t rate_lengthT = *(inbuffer + offset++); + if(rate_lengthT > rate_length) + this->rate = (float*)realloc(this->rate, rate_lengthT * sizeof(float)); + offset += 3; + rate_length = rate_lengthT; + for( uint8_t i = 0; i < rate_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_rate)); + memcpy( &(this->rate[i]), &(this->st_rate), sizeof(float)); + } + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETJOINTPROPERTIES; }; + const char * getMD5(){ return "cd7b30a39faa372283dc94c5f6457f82"; }; + + }; + + class GetJointProperties { + public: + typedef GetJointPropertiesRequest Request; + typedef GetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h new file mode 100755 index 0000000..12ea8dc --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetLinkProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_GetLinkProperties_h +#define _ROS_SERVICE_GetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char GETLINKPROPERTIES[] = "gazebo_msgs/GetLinkProperties"; + + class GetLinkPropertiesRequest : public ros::Msg + { + public: + const char* link_name; + + GetLinkPropertiesRequest(): + link_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "7d82d60381f1b66a30f2157f60884345"; }; + + }; + + class GetLinkPropertiesResponse : public ros::Msg + { + public: + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + bool success; + const char* status_message; + + GetLinkPropertiesResponse(): + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKPROPERTIES; }; + const char * getMD5(){ return "a8619f92d17cfcc3958c0fd13299443d"; }; + + }; + + class GetLinkProperties { + public: + typedef GetLinkPropertiesRequest Request; + typedef GetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetLinkState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetLinkState.h new file mode 100755 index 0000000..5e9ed3a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetLinkState.h @@ -0,0 +1,140 @@ +#ifndef _ROS_SERVICE_GetLinkState_h +#define _ROS_SERVICE_GetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char GETLINKSTATE[] = "gazebo_msgs/GetLinkState"; + + class GetLinkStateRequest : public ros::Msg + { + public: + const char* link_name; + const char* reference_frame; + + GetLinkStateRequest(): + link_name(""), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "7551675c30aaa71f7c288d4864552001"; }; + + }; + + class GetLinkStateResponse : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + bool success; + const char* status_message; + + GetLinkStateResponse(): + link_state(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETLINKSTATE; }; + const char * getMD5(){ return "8ba55ad34f9c072e75c0de57b089753b"; }; + + }; + + class GetLinkState { + public: + typedef GetLinkStateRequest Request; + typedef GetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h new file mode 100755 index 0000000..3574fe5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetModelProperties.h @@ -0,0 +1,296 @@ +#ifndef _ROS_SERVICE_GetModelProperties_h +#define _ROS_SERVICE_GetModelProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETMODELPROPERTIES[] = "gazebo_msgs/GetModelProperties"; + + class GetModelPropertiesRequest : public ros::Msg + { + public: + const char* model_name; + + GetModelPropertiesRequest(): + model_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "ea31c8eab6fc401383cf528a7c0984ba"; }; + + }; + + class GetModelPropertiesResponse : public ros::Msg + { + public: + const char* parent_model_name; + const char* canonical_body_name; + uint8_t body_names_length; + char* st_body_names; + char* * body_names; + uint8_t geom_names_length; + char* st_geom_names; + char* * geom_names; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t child_model_names_length; + char* st_child_model_names; + char* * child_model_names; + bool is_static; + bool success; + const char* status_message; + + GetModelPropertiesResponse(): + parent_model_name(""), + canonical_body_name(""), + body_names_length(0), body_names(NULL), + geom_names_length(0), geom_names(NULL), + joint_names_length(0), joint_names(NULL), + child_model_names_length(0), child_model_names(NULL), + is_static(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_parent_model_name = strlen(this->parent_model_name); + memcpy(outbuffer + offset, &length_parent_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->parent_model_name, length_parent_model_name); + offset += length_parent_model_name; + uint32_t length_canonical_body_name = strlen(this->canonical_body_name); + memcpy(outbuffer + offset, &length_canonical_body_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->canonical_body_name, length_canonical_body_name); + offset += length_canonical_body_name; + *(outbuffer + offset++) = body_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_body_namesi = strlen(this->body_names[i]); + memcpy(outbuffer + offset, &length_body_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->body_names[i], length_body_namesi); + offset += length_body_namesi; + } + *(outbuffer + offset++) = geom_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_geom_namesi = strlen(this->geom_names[i]); + memcpy(outbuffer + offset, &length_geom_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->geom_names[i], length_geom_namesi); + offset += length_geom_namesi; + } + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = child_model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_child_model_namesi = strlen(this->child_model_names[i]); + memcpy(outbuffer + offset, &length_child_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_model_names[i], length_child_model_namesi); + offset += length_child_model_namesi; + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.real = this->is_static; + *(outbuffer + offset + 0) = (u_is_static.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_parent_model_name; + memcpy(&length_parent_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_parent_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_parent_model_name-1]=0; + this->parent_model_name = (char *)(inbuffer + offset-1); + offset += length_parent_model_name; + uint32_t length_canonical_body_name; + memcpy(&length_canonical_body_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_canonical_body_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_canonical_body_name-1]=0; + this->canonical_body_name = (char *)(inbuffer + offset-1); + offset += length_canonical_body_name; + uint8_t body_names_lengthT = *(inbuffer + offset++); + if(body_names_lengthT > body_names_length) + this->body_names = (char**)realloc(this->body_names, body_names_lengthT * sizeof(char*)); + offset += 3; + body_names_length = body_names_lengthT; + for( uint8_t i = 0; i < body_names_length; i++){ + uint32_t length_st_body_names; + memcpy(&length_st_body_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_body_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_body_names-1]=0; + this->st_body_names = (char *)(inbuffer + offset-1); + offset += length_st_body_names; + memcpy( &(this->body_names[i]), &(this->st_body_names), sizeof(char*)); + } + uint8_t geom_names_lengthT = *(inbuffer + offset++); + if(geom_names_lengthT > geom_names_length) + this->geom_names = (char**)realloc(this->geom_names, geom_names_lengthT * sizeof(char*)); + offset += 3; + geom_names_length = geom_names_lengthT; + for( uint8_t i = 0; i < geom_names_length; i++){ + uint32_t length_st_geom_names; + memcpy(&length_st_geom_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_geom_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_geom_names-1]=0; + this->st_geom_names = (char *)(inbuffer + offset-1); + offset += length_st_geom_names; + memcpy( &(this->geom_names[i]), &(this->st_geom_names), sizeof(char*)); + } + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t child_model_names_lengthT = *(inbuffer + offset++); + if(child_model_names_lengthT > child_model_names_length) + this->child_model_names = (char**)realloc(this->child_model_names, child_model_names_lengthT * sizeof(char*)); + offset += 3; + child_model_names_length = child_model_names_lengthT; + for( uint8_t i = 0; i < child_model_names_length; i++){ + uint32_t length_st_child_model_names; + memcpy(&length_st_child_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_child_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_child_model_names-1]=0; + this->st_child_model_names = (char *)(inbuffer + offset-1); + offset += length_st_child_model_names; + memcpy( &(this->child_model_names[i]), &(this->st_child_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_is_static; + u_is_static.base = 0; + u_is_static.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_static = u_is_static.real; + offset += sizeof(this->is_static); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELPROPERTIES; }; + const char * getMD5(){ return "b7f370938ef77b464b95f1bab3ec5028"; }; + + }; + + class GetModelProperties { + public: + typedef GetModelPropertiesRequest Request; + typedef GetModelPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetModelState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetModelState.h new file mode 100755 index 0000000..799c432 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetModelState.h @@ -0,0 +1,145 @@ +#ifndef _ROS_SERVICE_GetModelState_h +#define _ROS_SERVICE_GetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + +static const char GETMODELSTATE[] = "gazebo_msgs/GetModelState"; + + class GetModelStateRequest : public ros::Msg + { + public: + const char* model_name; + const char* relative_entity_name; + + GetModelStateRequest(): + model_name(""), + relative_entity_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_relative_entity_name = strlen(this->relative_entity_name); + memcpy(outbuffer + offset, &length_relative_entity_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->relative_entity_name, length_relative_entity_name); + offset += length_relative_entity_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_relative_entity_name; + memcpy(&length_relative_entity_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_relative_entity_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_relative_entity_name-1]=0; + this->relative_entity_name = (char *)(inbuffer + offset-1); + offset += length_relative_entity_name; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "19d412713cefe4a67437e17a951e759e"; }; + + }; + + class GetModelStateResponse : public ros::Msg + { + public: + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + bool success; + const char* status_message; + + GetModelStateResponse(): + pose(), + twist(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETMODELSTATE; }; + const char * getMD5(){ return "1f8f991dc94e0cb27fe61383e0f576bb"; }; + + }; + + class GetModelState { + public: + typedef GetModelStateRequest Request; + typedef GetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h new file mode 100755 index 0000000..9713896 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetPhysicsProperties.h @@ -0,0 +1,138 @@ +#ifndef _ROS_SERVICE_GetPhysicsProperties_h +#define _ROS_SERVICE_GetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char GETPHYSICSPROPERTIES[] = "gazebo_msgs/GetPhysicsProperties"; + + class GetPhysicsPropertiesRequest : public ros::Msg + { + public: + + GetPhysicsPropertiesRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPhysicsPropertiesResponse : public ros::Msg + { + public: + float time_step; + bool pause; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + bool success; + const char* status_message; + + GetPhysicsPropertiesResponse(): + time_step(0), + pause(0), + max_update_rate(0), + gravity(), + ode_config(), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.real = this->pause; + *(outbuffer + offset + 0) = (u_pause.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->pause); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + union { + bool real; + uint8_t base; + } u_pause; + u_pause.base = 0; + u_pause.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->pause = u_pause.real; + offset += sizeof(this->pause); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "575a5e74786981b7df2e3afc567693a6"; }; + + }; + + class GetPhysicsProperties { + public: + typedef GetPhysicsPropertiesRequest Request; + typedef GetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h new file mode 100755 index 0000000..a179500 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/GetWorldProperties.h @@ -0,0 +1,156 @@ +#ifndef _ROS_SERVICE_GetWorldProperties_h +#define _ROS_SERVICE_GetWorldProperties_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char GETWORLDPROPERTIES[] = "gazebo_msgs/GetWorldProperties"; + + class GetWorldPropertiesRequest : public ros::Msg + { + public: + + GetWorldPropertiesRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetWorldPropertiesResponse : public ros::Msg + { + public: + float sim_time; + uint8_t model_names_length; + char* st_model_names; + char* * model_names; + bool rendering_enabled; + bool success; + const char* status_message; + + GetWorldPropertiesResponse(): + sim_time(0), + model_names_length(0), model_names(NULL), + rendering_enabled(0), + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->sim_time); + *(outbuffer + offset++) = model_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_model_namesi = strlen(this->model_names[i]); + memcpy(outbuffer + offset, &length_model_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_names[i], length_model_namesi); + offset += length_model_namesi; + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.real = this->rendering_enabled; + *(outbuffer + offset + 0) = (u_rendering_enabled.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sim_time)); + uint8_t model_names_lengthT = *(inbuffer + offset++); + if(model_names_lengthT > model_names_length) + this->model_names = (char**)realloc(this->model_names, model_names_lengthT * sizeof(char*)); + offset += 3; + model_names_length = model_names_lengthT; + for( uint8_t i = 0; i < model_names_length; i++){ + uint32_t length_st_model_names; + memcpy(&length_st_model_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_model_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_model_names-1]=0; + this->st_model_names = (char *)(inbuffer + offset-1); + offset += length_st_model_names; + memcpy( &(this->model_names[i]), &(this->st_model_names), sizeof(char*)); + } + union { + bool real; + uint8_t base; + } u_rendering_enabled; + u_rendering_enabled.base = 0; + u_rendering_enabled.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->rendering_enabled = u_rendering_enabled.real; + offset += sizeof(this->rendering_enabled); + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return GETWORLDPROPERTIES; }; + const char * getMD5(){ return "36bb0f2eccf4d8be971410c22818ba3f"; }; + + }; + + class GetWorldProperties { + public: + typedef GetWorldPropertiesRequest Request; + typedef GetWorldPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/JointRequest.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/JointRequest.h new file mode 100755 index 0000000..17029cb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/JointRequest.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_JointRequest_h +#define _ROS_SERVICE_JointRequest_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char JOINTREQUEST[] = "gazebo_msgs/JointRequest"; + + class JointRequestRequest : public ros::Msg + { + public: + const char* joint_name; + + JointRequestRequest(): + joint_name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "0be1351618e1dc030eb7959d9a4902de"; }; + + }; + + class JointRequestResponse : public ros::Msg + { + public: + + JointRequestResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return JOINTREQUEST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class JointRequest { + public: + typedef JointRequestRequest Request; + typedef JointRequestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/LinkState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/LinkState.h new file mode 100755 index 0000000..6c87024 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/LinkState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_gazebo_msgs_LinkState_h +#define _ROS_gazebo_msgs_LinkState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkState : public ros::Msg + { + public: + const char* link_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + LinkState(): + link_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkState"; }; + const char * getMD5(){ return "0818ebbf28ce3a08d48ab1eaa7309ebe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/LinkStates.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/LinkStates.h new file mode 100755 index 0000000..2dc1c83 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/LinkStates.h @@ -0,0 +1,112 @@ +#ifndef _ROS_gazebo_msgs_LinkStates_h +#define _ROS_gazebo_msgs_LinkStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class LinkStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + LinkStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/LinkStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ModelState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ModelState.h new file mode 100755 index 0000000..15ae191 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ModelState.h @@ -0,0 +1,80 @@ +#ifndef _ROS_gazebo_msgs_ModelState_h +#define _ROS_gazebo_msgs_ModelState_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelState : public ros::Msg + { + public: + const char* model_name; + geometry_msgs::Pose pose; + geometry_msgs::Twist twist; + const char* reference_frame; + + ModelState(): + model_name(""), + pose(), + twist(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelState"; }; + const char * getMD5(){ return "9330fd35f2fcd82d457e54bd54e10593"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ModelStates.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ModelStates.h new file mode 100755 index 0000000..aeb9f21 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ModelStates.h @@ -0,0 +1,112 @@ +#ifndef _ROS_gazebo_msgs_ModelStates_h +#define _ROS_gazebo_msgs_ModelStates_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" + +namespace gazebo_msgs +{ + + class ModelStates : public ros::Msg + { + public: + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + + ModelStates(): + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ModelStates"; }; + const char * getMD5(){ return "48c080191eb15c41858319b4d8a609c2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h new file mode 100755 index 0000000..1711110 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ODEJointProperties.h @@ -0,0 +1,238 @@ +#ifndef _ROS_gazebo_msgs_ODEJointProperties_h +#define _ROS_gazebo_msgs_ODEJointProperties_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEJointProperties : public ros::Msg + { + public: + uint8_t damping_length; + float st_damping; + float * damping; + uint8_t hiStop_length; + float st_hiStop; + float * hiStop; + uint8_t loStop_length; + float st_loStop; + float * loStop; + uint8_t erp_length; + float st_erp; + float * erp; + uint8_t cfm_length; + float st_cfm; + float * cfm; + uint8_t stop_erp_length; + float st_stop_erp; + float * stop_erp; + uint8_t stop_cfm_length; + float st_stop_cfm; + float * stop_cfm; + uint8_t fudge_factor_length; + float st_fudge_factor; + float * fudge_factor; + uint8_t fmax_length; + float st_fmax; + float * fmax; + uint8_t vel_length; + float st_vel; + float * vel; + + ODEJointProperties(): + damping_length(0), damping(NULL), + hiStop_length(0), hiStop(NULL), + loStop_length(0), loStop(NULL), + erp_length(0), erp(NULL), + cfm_length(0), cfm(NULL), + stop_erp_length(0), stop_erp(NULL), + stop_cfm_length(0), stop_cfm(NULL), + fudge_factor_length(0), fudge_factor(NULL), + fmax_length(0), fmax(NULL), + vel_length(0), vel(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = damping_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < damping_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->damping[i]); + } + *(outbuffer + offset++) = hiStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->hiStop[i]); + } + *(outbuffer + offset++) = loStop_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->loStop[i]); + } + *(outbuffer + offset++) = erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->erp[i]); + } + *(outbuffer + offset++) = cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->cfm[i]); + } + *(outbuffer + offset++) = stop_erp_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_erp[i]); + } + *(outbuffer + offset++) = stop_cfm_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->stop_cfm[i]); + } + *(outbuffer + offset++) = fudge_factor_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fudge_factor[i]); + } + *(outbuffer + offset++) = fmax_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->fmax[i]); + } + *(outbuffer + offset++) = vel_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vel_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->vel[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t damping_lengthT = *(inbuffer + offset++); + if(damping_lengthT > damping_length) + this->damping = (float*)realloc(this->damping, damping_lengthT * sizeof(float)); + offset += 3; + damping_length = damping_lengthT; + for( uint8_t i = 0; i < damping_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_damping)); + memcpy( &(this->damping[i]), &(this->st_damping), sizeof(float)); + } + uint8_t hiStop_lengthT = *(inbuffer + offset++); + if(hiStop_lengthT > hiStop_length) + this->hiStop = (float*)realloc(this->hiStop, hiStop_lengthT * sizeof(float)); + offset += 3; + hiStop_length = hiStop_lengthT; + for( uint8_t i = 0; i < hiStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_hiStop)); + memcpy( &(this->hiStop[i]), &(this->st_hiStop), sizeof(float)); + } + uint8_t loStop_lengthT = *(inbuffer + offset++); + if(loStop_lengthT > loStop_length) + this->loStop = (float*)realloc(this->loStop, loStop_lengthT * sizeof(float)); + offset += 3; + loStop_length = loStop_lengthT; + for( uint8_t i = 0; i < loStop_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_loStop)); + memcpy( &(this->loStop[i]), &(this->st_loStop), sizeof(float)); + } + uint8_t erp_lengthT = *(inbuffer + offset++); + if(erp_lengthT > erp_length) + this->erp = (float*)realloc(this->erp, erp_lengthT * sizeof(float)); + offset += 3; + erp_length = erp_lengthT; + for( uint8_t i = 0; i < erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_erp)); + memcpy( &(this->erp[i]), &(this->st_erp), sizeof(float)); + } + uint8_t cfm_lengthT = *(inbuffer + offset++); + if(cfm_lengthT > cfm_length) + this->cfm = (float*)realloc(this->cfm, cfm_lengthT * sizeof(float)); + offset += 3; + cfm_length = cfm_lengthT; + for( uint8_t i = 0; i < cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_cfm)); + memcpy( &(this->cfm[i]), &(this->st_cfm), sizeof(float)); + } + uint8_t stop_erp_lengthT = *(inbuffer + offset++); + if(stop_erp_lengthT > stop_erp_length) + this->stop_erp = (float*)realloc(this->stop_erp, stop_erp_lengthT * sizeof(float)); + offset += 3; + stop_erp_length = stop_erp_lengthT; + for( uint8_t i = 0; i < stop_erp_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_erp)); + memcpy( &(this->stop_erp[i]), &(this->st_stop_erp), sizeof(float)); + } + uint8_t stop_cfm_lengthT = *(inbuffer + offset++); + if(stop_cfm_lengthT > stop_cfm_length) + this->stop_cfm = (float*)realloc(this->stop_cfm, stop_cfm_lengthT * sizeof(float)); + offset += 3; + stop_cfm_length = stop_cfm_lengthT; + for( uint8_t i = 0; i < stop_cfm_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_stop_cfm)); + memcpy( &(this->stop_cfm[i]), &(this->st_stop_cfm), sizeof(float)); + } + uint8_t fudge_factor_lengthT = *(inbuffer + offset++); + if(fudge_factor_lengthT > fudge_factor_length) + this->fudge_factor = (float*)realloc(this->fudge_factor, fudge_factor_lengthT * sizeof(float)); + offset += 3; + fudge_factor_length = fudge_factor_lengthT; + for( uint8_t i = 0; i < fudge_factor_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fudge_factor)); + memcpy( &(this->fudge_factor[i]), &(this->st_fudge_factor), sizeof(float)); + } + uint8_t fmax_lengthT = *(inbuffer + offset++); + if(fmax_lengthT > fmax_length) + this->fmax = (float*)realloc(this->fmax, fmax_lengthT * sizeof(float)); + offset += 3; + fmax_length = fmax_lengthT; + for( uint8_t i = 0; i < fmax_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_fmax)); + memcpy( &(this->fmax[i]), &(this->st_fmax), sizeof(float)); + } + uint8_t vel_lengthT = *(inbuffer + offset++); + if(vel_lengthT > vel_length) + this->vel = (float*)realloc(this->vel, vel_lengthT * sizeof(float)); + offset += 3; + vel_length = vel_lengthT; + for( uint8_t i = 0; i < vel_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_vel)); + memcpy( &(this->vel[i]), &(this->st_vel), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEJointProperties"; }; + const char * getMD5(){ return "1b744c32a920af979f53afe2f9c3511f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h new file mode 100755 index 0000000..079d7bd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/ODEPhysics.h @@ -0,0 +1,115 @@ +#ifndef _ROS_gazebo_msgs_ODEPhysics_h +#define _ROS_gazebo_msgs_ODEPhysics_h + +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + + class ODEPhysics : public ros::Msg + { + public: + bool auto_disable_bodies; + uint32_t sor_pgs_precon_iters; + uint32_t sor_pgs_iters; + float sor_pgs_w; + float sor_pgs_rms_error_tol; + float contact_surface_layer; + float contact_max_correcting_vel; + float cfm; + float erp; + uint32_t max_contacts; + + ODEPhysics(): + auto_disable_bodies(0), + sor_pgs_precon_iters(0), + sor_pgs_iters(0), + sor_pgs_w(0), + sor_pgs_rms_error_tol(0), + contact_surface_layer(0), + contact_max_correcting_vel(0), + cfm(0), + erp(0), + max_contacts(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.real = this->auto_disable_bodies; + *(outbuffer + offset + 0) = (u_auto_disable_bodies.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->auto_disable_bodies); + *(outbuffer + offset + 0) = (this->sor_pgs_precon_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_precon_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_precon_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_precon_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_precon_iters); + *(outbuffer + offset + 0) = (this->sor_pgs_iters >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->sor_pgs_iters >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->sor_pgs_iters >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->sor_pgs_iters >> (8 * 3)) & 0xFF; + offset += sizeof(this->sor_pgs_iters); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_w); + offset += serializeAvrFloat64(outbuffer + offset, this->sor_pgs_rms_error_tol); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_surface_layer); + offset += serializeAvrFloat64(outbuffer + offset, this->contact_max_correcting_vel); + offset += serializeAvrFloat64(outbuffer + offset, this->cfm); + offset += serializeAvrFloat64(outbuffer + offset, this->erp); + *(outbuffer + offset + 0) = (this->max_contacts >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->max_contacts >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->max_contacts >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->max_contacts >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_contacts); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_auto_disable_bodies; + u_auto_disable_bodies.base = 0; + u_auto_disable_bodies.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->auto_disable_bodies = u_auto_disable_bodies.real; + offset += sizeof(this->auto_disable_bodies); + this->sor_pgs_precon_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_precon_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_precon_iters); + this->sor_pgs_iters = ((uint32_t) (*(inbuffer + offset))); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->sor_pgs_iters |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->sor_pgs_iters); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_w)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->sor_pgs_rms_error_tol)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_surface_layer)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->contact_max_correcting_vel)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->cfm)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->erp)); + this->max_contacts = ((uint32_t) (*(inbuffer + offset))); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->max_contacts |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->max_contacts); + return offset; + } + + const char * getType(){ return "gazebo_msgs/ODEPhysics"; }; + const char * getMD5(){ return "667d56ddbd547918c32d1934503dc335"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h new file mode 100755 index 0000000..1804fd4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetJointProperties.h @@ -0,0 +1,124 @@ +#ifndef _ROS_SERVICE_SetJointProperties_h +#define _ROS_SERVICE_SetJointProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ODEJointProperties.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTPROPERTIES[] = "gazebo_msgs/SetJointProperties"; + + class SetJointPropertiesRequest : public ros::Msg + { + public: + const char* joint_name; + gazebo_msgs::ODEJointProperties ode_joint_config; + + SetJointPropertiesRequest(): + joint_name(""), + ode_joint_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_joint_name = strlen(this->joint_name); + memcpy(outbuffer + offset, &length_joint_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_name, length_joint_name); + offset += length_joint_name; + offset += this->ode_joint_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_joint_name; + memcpy(&length_joint_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_joint_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_joint_name-1]=0; + this->joint_name = (char *)(inbuffer + offset-1); + offset += length_joint_name; + offset += this->ode_joint_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "331fd8f35fd27e3c1421175590258e26"; }; + + }; + + class SetJointPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointProperties { + public: + typedef SetJointPropertiesRequest Request; + typedef SetJointPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h new file mode 100755 index 0000000..da5b3e9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetJointTrajectory.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_SetJointTrajectory_h +#define _ROS_SERVICE_SetJointTrajectory_h +#include +#include +#include +#include "ros/msg.h" +#include "trajectory_msgs/JointTrajectory.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETJOINTTRAJECTORY[] = "gazebo_msgs/SetJointTrajectory"; + + class SetJointTrajectoryRequest : public ros::Msg + { + public: + const char* model_name; + trajectory_msgs::JointTrajectory joint_trajectory; + geometry_msgs::Pose model_pose; + bool set_model_pose; + bool disable_physics_updates; + + SetJointTrajectoryRequest(): + model_name(""), + joint_trajectory(), + model_pose(), + set_model_pose(0), + disable_physics_updates(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + offset += this->joint_trajectory.serialize(outbuffer + offset); + offset += this->model_pose.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.real = this->set_model_pose; + *(outbuffer + offset + 0) = (u_set_model_pose.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.real = this->disable_physics_updates; + *(outbuffer + offset + 0) = (u_disable_physics_updates.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + offset += this->joint_trajectory.deserialize(inbuffer + offset); + offset += this->model_pose.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_set_model_pose; + u_set_model_pose.base = 0; + u_set_model_pose.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->set_model_pose = u_set_model_pose.real; + offset += sizeof(this->set_model_pose); + union { + bool real; + uint8_t base; + } u_disable_physics_updates; + u_disable_physics_updates.base = 0; + u_disable_physics_updates.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->disable_physics_updates = u_disable_physics_updates.real; + offset += sizeof(this->disable_physics_updates); + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "649dd2eba5ffd358069238825f9f85ab"; }; + + }; + + class SetJointTrajectoryResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetJointTrajectoryResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETJOINTTRAJECTORY; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetJointTrajectory { + public: + typedef SetJointTrajectoryRequest Request; + typedef SetJointTrajectoryResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h new file mode 100755 index 0000000..644164a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetLinkProperties.h @@ -0,0 +1,169 @@ +#ifndef _ROS_SERVICE_SetLinkProperties_h +#define _ROS_SERVICE_SetLinkProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SETLINKPROPERTIES[] = "gazebo_msgs/SetLinkProperties"; + + class SetLinkPropertiesRequest : public ros::Msg + { + public: + const char* link_name; + geometry_msgs::Pose com; + bool gravity_mode; + float mass; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + SetLinkPropertiesRequest(): + link_name(""), + com(), + gravity_mode(0), + mass(0), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_link_name = strlen(this->link_name); + memcpy(outbuffer + offset, &length_link_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->link_name, length_link_name); + offset += length_link_name; + offset += this->com.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.real = this->gravity_mode; + *(outbuffer + offset + 0) = (u_gravity_mode.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->gravity_mode); + offset += serializeAvrFloat64(outbuffer + offset, this->mass); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_link_name; + memcpy(&length_link_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_link_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_link_name-1]=0; + this->link_name = (char *)(inbuffer + offset-1); + offset += length_link_name; + offset += this->com.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_gravity_mode; + u_gravity_mode.base = 0; + u_gravity_mode.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->gravity_mode = u_gravity_mode.real; + offset += sizeof(this->gravity_mode); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->mass)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "68ac74a4be01b165bc305b5ccdc45e91"; }; + + }; + + class SetLinkPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkProperties { + public: + typedef SetLinkPropertiesRequest Request; + typedef SetLinkPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetLinkState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetLinkState.h new file mode 100755 index 0000000..dad0051 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetLinkState.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetLinkState_h +#define _ROS_SERVICE_SetLinkState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/LinkState.h" + +namespace gazebo_msgs +{ + +static const char SETLINKSTATE[] = "gazebo_msgs/SetLinkState"; + + class SetLinkStateRequest : public ros::Msg + { + public: + gazebo_msgs::LinkState link_state; + + SetLinkStateRequest(): + link_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->link_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->link_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "22a2c757d56911b6f27868159e9a872d"; }; + + }; + + class SetLinkStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetLinkStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETLINKSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetLinkState { + public: + typedef SetLinkStateRequest Request; + typedef SetLinkStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h new file mode 100755 index 0000000..5b963b4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetModelConfiguration.h @@ -0,0 +1,187 @@ +#ifndef _ROS_SERVICE_SetModelConfiguration_h +#define _ROS_SERVICE_SetModelConfiguration_h +#include +#include +#include +#include "ros/msg.h" + +namespace gazebo_msgs +{ + +static const char SETMODELCONFIGURATION[] = "gazebo_msgs/SetModelConfiguration"; + + class SetModelConfigurationRequest : public ros::Msg + { + public: + const char* model_name; + const char* urdf_param_name; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t joint_positions_length; + float st_joint_positions; + float * joint_positions; + + SetModelConfigurationRequest(): + model_name(""), + urdf_param_name(""), + joint_names_length(0), joint_names(NULL), + joint_positions_length(0), joint_positions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_urdf_param_name = strlen(this->urdf_param_name); + memcpy(outbuffer + offset, &length_urdf_param_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->urdf_param_name, length_urdf_param_name); + offset += length_urdf_param_name; + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = joint_positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->joint_positions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_urdf_param_name; + memcpy(&length_urdf_param_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_urdf_param_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_urdf_param_name-1]=0; + this->urdf_param_name = (char *)(inbuffer + offset-1); + offset += length_urdf_param_name; + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t joint_positions_lengthT = *(inbuffer + offset++); + if(joint_positions_lengthT > joint_positions_length) + this->joint_positions = (float*)realloc(this->joint_positions, joint_positions_lengthT * sizeof(float)); + offset += 3; + joint_positions_length = joint_positions_lengthT; + for( uint8_t i = 0; i < joint_positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_joint_positions)); + memcpy( &(this->joint_positions[i]), &(this->st_joint_positions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "160eae60f51fabff255480c70afa289f"; }; + + }; + + class SetModelConfigurationResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelConfigurationResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELCONFIGURATION; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelConfiguration { + public: + typedef SetModelConfigurationRequest Request; + typedef SetModelConfigurationResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetModelState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetModelState.h new file mode 100755 index 0000000..5d8222e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetModelState.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetModelState_h +#define _ROS_SERVICE_SetModelState_h +#include +#include +#include +#include "ros/msg.h" +#include "gazebo_msgs/ModelState.h" + +namespace gazebo_msgs +{ + +static const char SETMODELSTATE[] = "gazebo_msgs/SetModelState"; + + class SetModelStateRequest : public ros::Msg + { + public: + gazebo_msgs::ModelState model_state; + + SetModelStateRequest(): + model_state() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->model_state.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->model_state.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "cb042b0e91880f4661b29ea5b6234350"; }; + + }; + + class SetModelStateResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetModelStateResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETMODELSTATE; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetModelState { + public: + typedef SetModelStateRequest Request; + typedef SetModelStateResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h new file mode 100755 index 0000000..9a5534e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SetPhysicsProperties.h @@ -0,0 +1,121 @@ +#ifndef _ROS_SERVICE_SetPhysicsProperties_h +#define _ROS_SERVICE_SetPhysicsProperties_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "gazebo_msgs/ODEPhysics.h" + +namespace gazebo_msgs +{ + +static const char SETPHYSICSPROPERTIES[] = "gazebo_msgs/SetPhysicsProperties"; + + class SetPhysicsPropertiesRequest : public ros::Msg + { + public: + float time_step; + float max_update_rate; + geometry_msgs::Vector3 gravity; + gazebo_msgs::ODEPhysics ode_config; + + SetPhysicsPropertiesRequest(): + time_step(0), + max_update_rate(0), + gravity(), + ode_config() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->time_step); + offset += serializeAvrFloat64(outbuffer + offset, this->max_update_rate); + offset += this->gravity.serialize(outbuffer + offset); + offset += this->ode_config.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->time_step)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_update_rate)); + offset += this->gravity.deserialize(inbuffer + offset); + offset += this->ode_config.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "abd9f82732b52b92e9d6bb36e6a82452"; }; + + }; + + class SetPhysicsPropertiesResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetPhysicsPropertiesResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETPHYSICSPROPERTIES; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetPhysicsProperties { + public: + typedef SetPhysicsPropertiesRequest Request; + typedef SetPhysicsPropertiesResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SpawnModel.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SpawnModel.h new file mode 100755 index 0000000..8eeb9c9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/SpawnModel.h @@ -0,0 +1,172 @@ +#ifndef _ROS_SERVICE_SpawnModel_h +#define _ROS_SERVICE_SpawnModel_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace gazebo_msgs +{ + +static const char SPAWNMODEL[] = "gazebo_msgs/SpawnModel"; + + class SpawnModelRequest : public ros::Msg + { + public: + const char* model_name; + const char* model_xml; + const char* robot_namespace; + geometry_msgs::Pose initial_pose; + const char* reference_frame; + + SpawnModelRequest(): + model_name(""), + model_xml(""), + robot_namespace(""), + initial_pose(), + reference_frame("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_model_name = strlen(this->model_name); + memcpy(outbuffer + offset, &length_model_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_name, length_model_name); + offset += length_model_name; + uint32_t length_model_xml = strlen(this->model_xml); + memcpy(outbuffer + offset, &length_model_xml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->model_xml, length_model_xml); + offset += length_model_xml; + uint32_t length_robot_namespace = strlen(this->robot_namespace); + memcpy(outbuffer + offset, &length_robot_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->robot_namespace, length_robot_namespace); + offset += length_robot_namespace; + offset += this->initial_pose.serialize(outbuffer + offset); + uint32_t length_reference_frame = strlen(this->reference_frame); + memcpy(outbuffer + offset, &length_reference_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->reference_frame, length_reference_frame); + offset += length_reference_frame; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_model_name; + memcpy(&length_model_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_name-1]=0; + this->model_name = (char *)(inbuffer + offset-1); + offset += length_model_name; + uint32_t length_model_xml; + memcpy(&length_model_xml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_model_xml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_model_xml-1]=0; + this->model_xml = (char *)(inbuffer + offset-1); + offset += length_model_xml; + uint32_t length_robot_namespace; + memcpy(&length_robot_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_robot_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_robot_namespace-1]=0; + this->robot_namespace = (char *)(inbuffer + offset-1); + offset += length_robot_namespace; + offset += this->initial_pose.deserialize(inbuffer + offset); + uint32_t length_reference_frame; + memcpy(&length_reference_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_reference_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_reference_frame-1]=0; + this->reference_frame = (char *)(inbuffer + offset-1); + offset += length_reference_frame; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "6d0eba5753761cd57e6263a056b79930"; }; + + }; + + class SpawnModelResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SpawnModelResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SPAWNMODEL; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SpawnModel { + public: + typedef SpawnModelRequest Request; + typedef SpawnModelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/WorldState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/WorldState.h new file mode 100755 index 0000000..9ea0ae6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/gazebo_msgs/WorldState.h @@ -0,0 +1,138 @@ +#ifndef _ROS_gazebo_msgs_WorldState_h +#define _ROS_gazebo_msgs_WorldState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace gazebo_msgs +{ + + class WorldState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t pose_length; + geometry_msgs::Pose st_pose; + geometry_msgs::Pose * pose; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + WorldState(): + header(), + name_length(0), name(NULL), + pose_length(0), pose(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = pose_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->pose[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t pose_lengthT = *(inbuffer + offset++); + if(pose_lengthT > pose_length) + this->pose = (geometry_msgs::Pose*)realloc(this->pose, pose_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + pose_length = pose_lengthT; + for( uint8_t i = 0; i < pose_length; i++){ + offset += this->st_pose.deserialize(inbuffer + offset); + memcpy( &(this->pose[i]), &(this->st_pose), sizeof(geometry_msgs::Pose)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "gazebo_msgs/WorldState"; }; + const char * getMD5(){ return "de1a9de3ab7ba97ac0e9ec01a4eb481e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Accel.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Accel.h new file mode 100755 index 0000000..c3bedcf --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Accel.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Accel_h +#define _ROS_geometry_msgs_Accel_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Accel : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Accel(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Accel"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelStamped.h new file mode 100755 index 0000000..121060d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_AccelStamped_h +#define _ROS_geometry_msgs_AccelStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Accel accel; + + AccelStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelStamped"; }; + const char * getMD5(){ return "d8a98a5d81351b6eb0578c78557e7659"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h new file mode 100755 index 0000000..89f39d0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovariance_h +#define _ROS_geometry_msgs_AccelWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Accel.h" + +namespace geometry_msgs +{ + + class AccelWithCovariance : public ros::Msg + { + public: + geometry_msgs::Accel accel; + float covariance[36]; + + AccelWithCovariance(): + accel(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->accel.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->accel.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovariance"; }; + const char * getMD5(){ return "ad5a718d699c6be72a02b8d6a139f334"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h new file mode 100755 index 0000000..d548139 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/AccelWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_AccelWithCovarianceStamped_h +#define _ROS_geometry_msgs_AccelWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/AccelWithCovariance.h" + +namespace geometry_msgs +{ + + class AccelWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::AccelWithCovariance accel; + + AccelWithCovarianceStamped(): + header(), + accel() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->accel.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->accel.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/AccelWithCovarianceStamped"; }; + const char * getMD5(){ return "96adb295225031ec8d57fb4251b0a886"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Inertia.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Inertia.h new file mode 100755 index 0000000..c7f719a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Inertia.h @@ -0,0 +1,71 @@ +#ifndef _ROS_geometry_msgs_Inertia_h +#define _ROS_geometry_msgs_Inertia_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Inertia : public ros::Msg + { + public: + float m; + geometry_msgs::Vector3 com; + float ixx; + float ixy; + float ixz; + float iyy; + float iyz; + float izz; + + Inertia(): + m(0), + com(), + ixx(0), + ixy(0), + ixz(0), + iyy(0), + iyz(0), + izz(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->m); + offset += this->com.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->ixx); + offset += serializeAvrFloat64(outbuffer + offset, this->ixy); + offset += serializeAvrFloat64(outbuffer + offset, this->ixz); + offset += serializeAvrFloat64(outbuffer + offset, this->iyy); + offset += serializeAvrFloat64(outbuffer + offset, this->iyz); + offset += serializeAvrFloat64(outbuffer + offset, this->izz); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->m)); + offset += this->com.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixx)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->ixz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyy)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->iyz)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->izz)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Inertia"; }; + const char * getMD5(){ return "1d26e4bb6c83ff141c5cf0d883c2b0fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/InertiaStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/InertiaStamped.h new file mode 100755 index 0000000..33cb756 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/InertiaStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_InertiaStamped_h +#define _ROS_geometry_msgs_InertiaStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Inertia.h" + +namespace geometry_msgs +{ + + class InertiaStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Inertia inertia; + + InertiaStamped(): + header(), + inertia() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->inertia.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->inertia.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/InertiaStamped"; }; + const char * getMD5(){ return "ddee48caeab5a966c5e8d166654a9ac7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Point.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Point.h new file mode 100755 index 0000000..92e1b42 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Point.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Point_h +#define _ROS_geometry_msgs_Point_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point : public ros::Msg + { + public: + float x; + float y; + float z; + + Point(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Point32.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Point32.h new file mode 100755 index 0000000..15be573 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Point32.h @@ -0,0 +1,107 @@ +#ifndef _ROS_geometry_msgs_Point32_h +#define _ROS_geometry_msgs_Point32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Point32 : public ros::Msg + { + public: + float x; + float y; + float z; + + Point32(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.real = this->z; + *(outbuffer + offset + 0) = (u_z.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_z.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_z.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_z.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_z; + u_z.base = 0; + u_z.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_z.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->z = u_z.real; + offset += sizeof(this->z); + return offset; + } + + const char * getType(){ return "geometry_msgs/Point32"; }; + const char * getMD5(){ return "cc153912f1453b708d221682bc23d9ac"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PointStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PointStamped.h new file mode 100755 index 0000000..76cb588 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PointStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PointStamped_h +#define _ROS_geometry_msgs_PointStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace geometry_msgs +{ + + class PointStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Point point; + + PointStamped(): + header(), + point() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->point.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->point.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PointStamped"; }; + const char * getMD5(){ return "c63aecb41bfdfd6b7e1fac37c7cbe7bf"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Polygon.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Polygon.h new file mode 100755 index 0000000..1d99362 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Polygon.h @@ -0,0 +1,59 @@ +#ifndef _ROS_geometry_msgs_Polygon_h +#define _ROS_geometry_msgs_Polygon_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point32.h" + +namespace geometry_msgs +{ + + class Polygon : public ros::Msg + { + public: + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + + Polygon(): + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/Polygon"; }; + const char * getMD5(){ return "cd60a26494a087f577976f0329fa120e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PolygonStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PolygonStamped.h new file mode 100755 index 0000000..1f90c35 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PolygonStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PolygonStamped_h +#define _ROS_geometry_msgs_PolygonStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Polygon.h" + +namespace geometry_msgs +{ + + class PolygonStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Polygon polygon; + + PolygonStamped(): + header(), + polygon() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->polygon.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->polygon.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PolygonStamped"; }; + const char * getMD5(){ return "c6be8f7dc3bee7fe9e8d296070f53340"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Pose.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Pose.h new file mode 100755 index 0000000..facec0f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Pose.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Pose_h +#define _ROS_geometry_msgs_Pose_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Point.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Pose : public ros::Msg + { + public: + geometry_msgs::Point position; + geometry_msgs::Quaternion orientation; + + Pose(): + position(), + orientation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->position.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->position.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose"; }; + const char * getMD5(){ return "e45d45a5a1ce597b249e23fb30fc871f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Pose2D.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Pose2D.h new file mode 100755 index 0000000..a011718 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Pose2D.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Pose2D_h +#define _ROS_geometry_msgs_Pose2D_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Pose2D : public ros::Msg + { + public: + float x; + float y; + float theta; + + Pose2D(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->theta)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Pose2D"; }; + const char * getMD5(){ return "938fa65709584ad8e77d238529be13b8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseArray.h new file mode 100755 index 0000000..e7a5050 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseArray.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_PoseArray_h +#define _ROS_geometry_msgs_PoseArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseArray : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::Pose st_poses; + geometry_msgs::Pose * poses; + + PoseArray(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::Pose*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::Pose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::Pose)); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseArray"; }; + const char * getMD5(){ return "916c28c5764443f268b296bb671b9d97"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseStamped.h new file mode 100755 index 0000000..ae466ab --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PoseStamped_h +#define _ROS_geometry_msgs_PoseStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + + PoseStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseStamped"; }; + const char * getMD5(){ return "d3812c3cbc69362b77dc0b19b345f8f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h new file mode 100755 index 0000000..d2091e6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovariance_h +#define _ROS_geometry_msgs_PoseWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Pose.h" + +namespace geometry_msgs +{ + + class PoseWithCovariance : public ros::Msg + { + public: + geometry_msgs::Pose pose; + float covariance[36]; + + PoseWithCovariance(): + pose(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->pose.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->pose.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovariance"; }; + const char * getMD5(){ return "c23e848cf1b7533a8d7c259073a97e6f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h new file mode 100755 index 0000000..586a930 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/PoseWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_PoseWithCovarianceStamped_h +#define _ROS_geometry_msgs_PoseWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" + +namespace geometry_msgs +{ + + class PoseWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::PoseWithCovariance pose; + + PoseWithCovarianceStamped(): + header(), + pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/PoseWithCovarianceStamped"; }; + const char * getMD5(){ return "953b798c0f514ff060a53a3498ce6246"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Quaternion.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Quaternion.h new file mode 100755 index 0000000..69cddbe --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Quaternion.h @@ -0,0 +1,54 @@ +#ifndef _ROS_geometry_msgs_Quaternion_h +#define _ROS_geometry_msgs_Quaternion_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Quaternion : public ros::Msg + { + public: + float x; + float y; + float z; + float w; + + Quaternion(): + x(0), + y(0), + z(0), + w(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->w); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->w)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Quaternion"; }; + const char * getMD5(){ return "a779879fadf0160734f906b8c19c7004"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h new file mode 100755 index 0000000..c2e0fcf --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/QuaternionStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_QuaternionStamped_h +#define _ROS_geometry_msgs_QuaternionStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class QuaternionStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion quaternion; + + QuaternionStamped(): + header(), + quaternion() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->quaternion.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->quaternion.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/QuaternionStamped"; }; + const char * getMD5(){ return "e57f1e547e0e1fd13504588ffc8334e2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Transform.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Transform.h new file mode 100755 index 0000000..94cf738 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Transform.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Transform_h +#define _ROS_geometry_msgs_Transform_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" +#include "geometry_msgs/Quaternion.h" + +namespace geometry_msgs +{ + + class Transform : public ros::Msg + { + public: + geometry_msgs::Vector3 translation; + geometry_msgs::Quaternion rotation; + + Transform(): + translation(), + rotation() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->translation.serialize(outbuffer + offset); + offset += this->rotation.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->translation.deserialize(inbuffer + offset); + offset += this->rotation.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Transform"; }; + const char * getMD5(){ return "ac9eff44abf714214112b05d54a3cf9b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TransformStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TransformStamped.h new file mode 100755 index 0000000..d42125e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TransformStamped.h @@ -0,0 +1,64 @@ +#ifndef _ROS_geometry_msgs_TransformStamped_h +#define _ROS_geometry_msgs_TransformStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" + +namespace geometry_msgs +{ + + class TransformStamped : public ros::Msg + { + public: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::Transform transform; + + TransformStamped(): + header(), + child_frame_id(""), + transform() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->transform.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->transform.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TransformStamped"; }; + const char * getMD5(){ return "b5764a33bfeb3588febc2682852579b0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Twist.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Twist.h new file mode 100755 index 0000000..6133c64 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Twist.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Twist_h +#define _ROS_geometry_msgs_Twist_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Twist : public ros::Msg + { + public: + geometry_msgs::Vector3 linear; + geometry_msgs::Vector3 angular; + + Twist(): + linear(), + angular() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->linear.serialize(outbuffer + offset); + offset += this->angular.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->linear.deserialize(inbuffer + offset); + offset += this->angular.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Twist"; }; + const char * getMD5(){ return "9f195f881246fdfa2798d1d3eebca84a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistStamped.h new file mode 100755 index 0000000..bf39940 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_TwistStamped_h +#define _ROS_geometry_msgs_TwistStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Twist twist; + + TwistStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistStamped"; }; + const char * getMD5(){ return "98d34b0043a2093cf9d9345ab6eef12e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h new file mode 100755 index 0000000..c30e300 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistWithCovariance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovariance_h +#define _ROS_geometry_msgs_TwistWithCovariance_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Twist.h" + +namespace geometry_msgs +{ + + class TwistWithCovariance : public ros::Msg + { + public: + geometry_msgs::Twist twist; + float covariance[36]; + + TwistWithCovariance(): + twist(), + covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->twist.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->twist.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 36; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->covariance[i])); + } + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovariance"; }; + const char * getMD5(){ return "1fe8a28e6890a4cc3ae4c3ca5c7d82e6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h new file mode 100755 index 0000000..5ea6c8e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/TwistWithCovarianceStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_TwistWithCovarianceStamped_h +#define _ROS_geometry_msgs_TwistWithCovarianceStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace geometry_msgs +{ + + class TwistWithCovarianceStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::TwistWithCovariance twist; + + TwistWithCovarianceStamped(): + header(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/TwistWithCovarianceStamped"; }; + const char * getMD5(){ return "8927a1a12fb2607ceea095b2dc440a96"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Vector3.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Vector3.h new file mode 100755 index 0000000..af3f253 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Vector3.h @@ -0,0 +1,50 @@ +#ifndef _ROS_geometry_msgs_Vector3_h +#define _ROS_geometry_msgs_Vector3_h + +#include +#include +#include +#include "ros/msg.h" + +namespace geometry_msgs +{ + + class Vector3 : public ros::Msg + { + public: + float x; + float y; + float z; + + Vector3(): + x(0), + y(0), + z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3"; }; + const char * getMD5(){ return "4a842b65f413084dc2b10fb484ea7f17"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h new file mode 100755 index 0000000..589d571 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Vector3Stamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_Vector3Stamped_h +#define _ROS_geometry_msgs_Vector3Stamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Vector3Stamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 vector; + + Vector3Stamped(): + header(), + vector() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->vector.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->vector.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Vector3Stamped"; }; + const char * getMD5(){ return "7b324c7325e683bf02a9b14b01090ec7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Wrench.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Wrench.h new file mode 100755 index 0000000..d95bf1b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/Wrench.h @@ -0,0 +1,47 @@ +#ifndef _ROS_geometry_msgs_Wrench_h +#define _ROS_geometry_msgs_Wrench_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Vector3.h" + +namespace geometry_msgs +{ + + class Wrench : public ros::Msg + { + public: + geometry_msgs::Vector3 force; + geometry_msgs::Vector3 torque; + + Wrench(): + force(), + torque() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->force.serialize(outbuffer + offset); + offset += this->torque.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->force.deserialize(inbuffer + offset); + offset += this->torque.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/Wrench"; }; + const char * getMD5(){ return "4f539cf138b23283b520fd271b567936"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/WrenchStamped.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/WrenchStamped.h new file mode 100755 index 0000000..86becdc --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/geometry_msgs/WrenchStamped.h @@ -0,0 +1,48 @@ +#ifndef _ROS_geometry_msgs_WrenchStamped_h +#define _ROS_geometry_msgs_WrenchStamped_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Wrench.h" + +namespace geometry_msgs +{ + + class WrenchStamped : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Wrench wrench; + + WrenchStamped(): + header(), + wrench() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->wrench.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->wrench.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "geometry_msgs/WrenchStamped"; }; + const char * getMD5(){ return "d78d3cb249ce23087ade7e7d0c40cfa7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/laser_assembler/AssembleScans.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/laser_assembler/AssembleScans.h new file mode 100755 index 0000000..eda9160 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/laser_assembler/AssembleScans.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_AssembleScans_h +#define _ROS_SERVICE_AssembleScans_h +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "sensor_msgs/PointCloud.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS[] = "laser_assembler/AssembleScans"; + + class AssembleScansRequest : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + AssembleScansRequest(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScansResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud cloud; + + AssembleScansResponse(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS; }; + const char * getMD5(){ return "4217b28a903e4ad7869a83b3653110ff"; }; + + }; + + class AssembleScans { + public: + typedef AssembleScansRequest Request; + typedef AssembleScansResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/laser_assembler/AssembleScans2.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/laser_assembler/AssembleScans2.h new file mode 100755 index 0000000..244f919 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/laser_assembler/AssembleScans2.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_AssembleScans2_h +#define _ROS_SERVICE_AssembleScans2_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" +#include "ros/time.h" + +namespace laser_assembler +{ + +static const char ASSEMBLESCANS2[] = "laser_assembler/AssembleScans2"; + + class AssembleScans2Request : public ros::Msg + { + public: + ros::Time begin; + ros::Time end; + + AssembleScans2Request(): + begin(), + end() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->begin.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.sec); + *(outbuffer + offset + 0) = (this->begin.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->begin.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->begin.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->begin.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->begin.nsec); + *(outbuffer + offset + 0) = (this->end.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.sec); + *(outbuffer + offset + 0) = (this->end.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->end.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->end.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->end.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->end.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->begin.sec = ((uint32_t) (*(inbuffer + offset))); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.sec); + this->begin.nsec = ((uint32_t) (*(inbuffer + offset))); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->begin.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->begin.nsec); + this->end.sec = ((uint32_t) (*(inbuffer + offset))); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.sec); + this->end.nsec = ((uint32_t) (*(inbuffer + offset))); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->end.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->end.nsec); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "b341004f74e15bf5e1b2053a9183bdc7"; }; + + }; + + class AssembleScans2Response : public ros::Msg + { + public: + sensor_msgs::PointCloud2 cloud; + + AssembleScans2Response(): + cloud() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->cloud.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->cloud.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return ASSEMBLESCANS2; }; + const char * getMD5(){ return "96cec5374164b3b3d1d7ef5d7628a7ed"; }; + + }; + + class AssembleScans2 { + public: + typedef AssembleScans2Request Request; + typedef AssembleScans2Response Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetMapROI.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetMapROI.h new file mode 100755 index 0000000..68e5053 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetMapROI.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_GetMapROI_h +#define _ROS_SERVICE_GetMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + +static const char GETMAPROI[] = "map_msgs/GetMapROI"; + + class GetMapROIRequest : public ros::Msg + { + public: + float x; + float y; + float l_x; + float l_y; + + GetMapROIRequest(): + x(0), + y(0), + l_x(0), + l_y(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "43c2ff8f45af555c0eaf070c401e9a47"; }; + + }; + + class GetMapROIResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid sub_map; + + GetMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAPROI; }; + const char * getMD5(){ return "4d1986519c00d81967d2891a606b234c"; }; + + }; + + class GetMapROI { + public: + typedef GetMapROIRequest Request; + typedef GetMapROIResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetPointMap.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetPointMap.h new file mode 100755 index 0000000..3f7cfbe --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetPointMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_GetPointMap_h +#define _ROS_SERVICE_GetPointMap_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAP[] = "map_msgs/GetPointMap"; + + class GetPointMapRequest : public ros::Msg + { + public: + + GetPointMapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetPointMapResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 map; + + GetPointMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAP; }; + const char * getMD5(){ return "b84fbb39505086eb6a62d933c75cb7b4"; }; + + }; + + class GetPointMap { + public: + typedef GetPointMapRequest Request; + typedef GetPointMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetPointMapROI.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetPointMapROI.h new file mode 100755 index 0000000..6ecbddf --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/GetPointMapROI.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_GetPointMapROI_h +#define _ROS_SERVICE_GetPointMapROI_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + +static const char GETPOINTMAPROI[] = "map_msgs/GetPointMapROI"; + + class GetPointMapROIRequest : public ros::Msg + { + public: + float x; + float y; + float z; + float r; + float l_x; + float l_y; + float l_z; + + GetPointMapROIRequest(): + x(0), + y(0), + z(0), + r(0), + l_x(0), + l_y(0), + l_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->z); + offset += serializeAvrFloat64(outbuffer + offset, this->r); + offset += serializeAvrFloat64(outbuffer + offset, this->l_x); + offset += serializeAvrFloat64(outbuffer + offset, this->l_y); + offset += serializeAvrFloat64(outbuffer + offset, this->l_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->r)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->l_z)); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "895f7e437a9a6dd225316872b187a303"; }; + + }; + + class GetPointMapROIResponse : public ros::Msg + { + public: + sensor_msgs::PointCloud2 sub_map; + + GetPointMapROIResponse(): + sub_map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->sub_map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->sub_map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOINTMAPROI; }; + const char * getMD5(){ return "313769f8b0e724525c6463336cbccd63"; }; + + }; + + class GetPointMapROI { + public: + typedef GetPointMapROIRequest Request; + typedef GetPointMapROIResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h new file mode 100755 index 0000000..b86417d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/OccupancyGridUpdate.h @@ -0,0 +1,146 @@ +#ifndef _ROS_map_msgs_OccupancyGridUpdate_h +#define _ROS_map_msgs_OccupancyGridUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace map_msgs +{ + + class OccupancyGridUpdate : public ros::Msg + { + public: + std_msgs::Header header; + int32_t x; + int32_t y; + uint32_t width; + uint32_t height; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGridUpdate(): + header(), + x(0), + y(0), + width(0), + height(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int32_t real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + int32_t real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "map_msgs/OccupancyGridUpdate"; }; + const char * getMD5(){ return "b295be292b335c34718bd939deebe1c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/PointCloud2Update.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/PointCloud2Update.h new file mode 100755 index 0000000..116f2eb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/PointCloud2Update.h @@ -0,0 +1,62 @@ +#ifndef _ROS_map_msgs_PointCloud2Update_h +#define _ROS_map_msgs_PointCloud2Update_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" + +namespace map_msgs +{ + + class PointCloud2Update : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t type; + sensor_msgs::PointCloud2 points; + enum { ADD = 0 }; + enum { DELETE = 1 }; + + PointCloud2Update(): + header(), + type(0), + points() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->type >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->type >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->type >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + offset += this->points.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->type = ((uint32_t) (*(inbuffer + offset))); + this->type |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->type |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->type |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->type); + offset += this->points.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "map_msgs/PointCloud2Update"; }; + const char * getMD5(){ return "6c58e4f249ae9cd2b24fb1ee0f99195e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMap.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMap.h new file mode 100755 index 0000000..7e9e9e0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMap.h @@ -0,0 +1,51 @@ +#ifndef _ROS_map_msgs_ProjectedMap_h +#define _ROS_map_msgs_ProjectedMap_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace map_msgs +{ + + class ProjectedMap : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + float min_z; + float max_z; + + ProjectedMap(): + map(), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + const char * getType(){ return "map_msgs/ProjectedMap"; }; + const char * getMD5(){ return "7bbe8f96e45089681dc1ea7d023cbfca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h new file mode 100755 index 0000000..993c9fa --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMapInfo.h @@ -0,0 +1,78 @@ +#ifndef _ROS_map_msgs_ProjectedMapInfo_h +#define _ROS_map_msgs_ProjectedMapInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace map_msgs +{ + + class ProjectedMapInfo : public ros::Msg + { + public: + const char* frame_id; + float x; + float y; + float width; + float height; + float min_z; + float max_z; + + ProjectedMapInfo(): + frame_id(""), + x(0), + y(0), + width(0), + height(0), + min_z(0), + max_z(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + offset += serializeAvrFloat64(outbuffer + offset, this->x); + offset += serializeAvrFloat64(outbuffer + offset, this->y); + offset += serializeAvrFloat64(outbuffer + offset, this->width); + offset += serializeAvrFloat64(outbuffer + offset, this->height); + offset += serializeAvrFloat64(outbuffer + offset, this->min_z); + offset += serializeAvrFloat64(outbuffer + offset, this->max_z); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->x)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->y)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->width)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->height)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->min_z)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->max_z)); + return offset; + } + + const char * getType(){ return "map_msgs/ProjectedMapInfo"; }; + const char * getMD5(){ return "2dc10595ae94de23f22f8a6d2a0eef7a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h new file mode 100755 index 0000000..0f48d32 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/ProjectedMapsInfo.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_ProjectedMapsInfo_h +#define _ROS_SERVICE_ProjectedMapsInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char PROJECTEDMAPSINFO[] = "map_msgs/ProjectedMapsInfo"; + + class ProjectedMapsInfoRequest : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + ProjectedMapsInfoRequest(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class ProjectedMapsInfoResponse : public ros::Msg + { + public: + + ProjectedMapsInfoResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return PROJECTEDMAPSINFO; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class ProjectedMapsInfo { + public: + typedef ProjectedMapsInfoRequest Request; + typedef ProjectedMapsInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/SaveMap.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/SaveMap.h new file mode 100755 index 0000000..e5db8c2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/SaveMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_SaveMap_h +#define _ROS_SERVICE_SaveMap_h +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/String.h" + +namespace map_msgs +{ + +static const char SAVEMAP[] = "map_msgs/SaveMap"; + + class SaveMapRequest : public ros::Msg + { + public: + std_msgs::String filename; + + SaveMapRequest(): + filename() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->filename.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->filename.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "716e25f9d9dc76ceba197f93cbf05dc7"; }; + + }; + + class SaveMapResponse : public ros::Msg + { + public: + + SaveMapResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SAVEMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SaveMap { + public: + typedef SaveMapRequest Request; + typedef SaveMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/SetMapProjections.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/SetMapProjections.h new file mode 100755 index 0000000..ff344fb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/map_msgs/SetMapProjections.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_SetMapProjections_h +#define _ROS_SERVICE_SetMapProjections_h +#include +#include +#include +#include "ros/msg.h" +#include "map_msgs/ProjectedMapInfo.h" + +namespace map_msgs +{ + +static const char SETMAPPROJECTIONS[] = "map_msgs/SetMapProjections"; + + class SetMapProjectionsRequest : public ros::Msg + { + public: + + SetMapProjectionsRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetMapProjectionsResponse : public ros::Msg + { + public: + uint8_t projected_maps_info_length; + map_msgs::ProjectedMapInfo st_projected_maps_info; + map_msgs::ProjectedMapInfo * projected_maps_info; + + SetMapProjectionsResponse(): + projected_maps_info_length(0), projected_maps_info(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = projected_maps_info_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->projected_maps_info[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t projected_maps_info_lengthT = *(inbuffer + offset++); + if(projected_maps_info_lengthT > projected_maps_info_length) + this->projected_maps_info = (map_msgs::ProjectedMapInfo*)realloc(this->projected_maps_info, projected_maps_info_lengthT * sizeof(map_msgs::ProjectedMapInfo)); + offset += 3; + projected_maps_info_length = projected_maps_info_lengthT; + for( uint8_t i = 0; i < projected_maps_info_length; i++){ + offset += this->st_projected_maps_info.deserialize(inbuffer + offset); + memcpy( &(this->projected_maps_info[i]), &(this->st_projected_maps_info), sizeof(map_msgs::ProjectedMapInfo)); + } + return offset; + } + + const char * getType(){ return SETMAPPROJECTIONS; }; + const char * getMD5(){ return "d7980a33202421c8cd74565e57a4d229"; }; + + }; + + class SetMapProjections { + public: + typedef SetMapProjectionsRequest Request; + typedef SetMapProjectionsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMap.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMap.h new file mode 100755 index 0000000..5fa87e8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMap.h @@ -0,0 +1,75 @@ +#ifndef _ROS_SERVICE_GetMap_h +#define _ROS_SERVICE_GetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + +static const char GETMAP[] = "nav_msgs/GetMap"; + + class GetMapRequest : public ros::Msg + { + public: + + GetMapRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetMapResponse : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResponse(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETMAP; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + + class GetMap { + public: + typedef GetMapRequest Request; + typedef GetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapAction.h new file mode 100755 index 0000000..774101b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapAction_h +#define _ROS_nav_msgs_GetMapAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/GetMapActionGoal.h" +#include "nav_msgs/GetMapActionResult.h" +#include "nav_msgs/GetMapActionFeedback.h" + +namespace nav_msgs +{ + + class GetMapAction : public ros::Msg + { + public: + nav_msgs::GetMapActionGoal action_goal; + nav_msgs::GetMapActionResult action_result; + nav_msgs::GetMapActionFeedback action_feedback; + + GetMapAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapAction"; }; + const char * getMD5(){ return "e611ad23fbf237c031b7536416dc7cd7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h new file mode 100755 index 0000000..e5445b3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionFeedback_h +#define _ROS_nav_msgs_GetMapActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapFeedback.h" + +namespace nav_msgs +{ + + class GetMapActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapFeedback feedback; + + GetMapActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h new file mode 100755 index 0000000..644be5c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionGoal_h +#define _ROS_nav_msgs_GetMapActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "nav_msgs/GetMapGoal.h" + +namespace nav_msgs +{ + + class GetMapActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + nav_msgs::GetMapGoal goal; + + GetMapActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionGoal"; }; + const char * getMD5(){ return "4b30be6cd12b9e72826df56b481f40e0"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionResult.h new file mode 100755 index 0000000..b635cfd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_nav_msgs_GetMapActionResult_h +#define _ROS_nav_msgs_GetMapActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "nav_msgs/GetMapResult.h" + +namespace nav_msgs +{ + + class GetMapActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + nav_msgs::GetMapResult result; + + GetMapActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapActionResult"; }; + const char * getMD5(){ return "ac66e5b9a79bb4bbd33dab245236c892"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapFeedback.h new file mode 100755 index 0000000..e3b4560 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapFeedback_h +#define _ROS_nav_msgs_GetMapFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapFeedback : public ros::Msg + { + public: + + GetMapFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapGoal.h new file mode 100755 index 0000000..88a17c5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapGoal.h @@ -0,0 +1,38 @@ +#ifndef _ROS_nav_msgs_GetMapGoal_h +#define _ROS_nav_msgs_GetMapGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace nav_msgs +{ + + class GetMapGoal : public ros::Msg + { + public: + + GetMapGoal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapGoal"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapResult.h new file mode 100755 index 0000000..005b639 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetMapResult.h @@ -0,0 +1,43 @@ +#ifndef _ROS_nav_msgs_GetMapResult_h +#define _ROS_nav_msgs_GetMapResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" + +namespace nav_msgs +{ + + class GetMapResult : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + + GetMapResult(): + map() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/GetMapResult"; }; + const char * getMD5(){ return "6cdd0a18e0aff5b0a3ca2326a89b54ff"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetPlan.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetPlan.h new file mode 100755 index 0000000..1ea3f32 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GetPlan.h @@ -0,0 +1,107 @@ +#ifndef _ROS_SERVICE_GetPlan_h +#define _ROS_SERVICE_GetPlan_h +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/PoseStamped.h" +#include "nav_msgs/Path.h" + +namespace nav_msgs +{ + +static const char GETPLAN[] = "nav_msgs/GetPlan"; + + class GetPlanRequest : public ros::Msg + { + public: + geometry_msgs::PoseStamped start; + geometry_msgs::PoseStamped goal; + float tolerance; + + GetPlanRequest(): + start(), + goal(), + tolerance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->start.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.real = this->tolerance; + *(outbuffer + offset + 0) = (u_tolerance.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_tolerance.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_tolerance.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_tolerance.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->tolerance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->start.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_tolerance; + u_tolerance.base = 0; + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_tolerance.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->tolerance = u_tolerance.real; + offset += sizeof(this->tolerance); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "e25a43e0752bcca599a8c2eef8282df8"; }; + + }; + + class GetPlanResponse : public ros::Msg + { + public: + nav_msgs::Path plan; + + GetPlanResponse(): + plan() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->plan.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->plan.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPLAN; }; + const char * getMD5(){ return "0002bc113c0259d71f6cf8cbc9430e18"; }; + + }; + + class GetPlan { + public: + typedef GetPlanRequest Request; + typedef GetPlanResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GridCells.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GridCells.h new file mode 100755 index 0000000..c65160c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/GridCells.h @@ -0,0 +1,110 @@ +#ifndef _ROS_nav_msgs_GridCells_h +#define _ROS_nav_msgs_GridCells_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" + +namespace nav_msgs +{ + + class GridCells : public ros::Msg + { + public: + std_msgs::Header header; + float cell_width; + float cell_height; + uint8_t cells_length; + geometry_msgs::Point st_cells; + geometry_msgs::Point * cells; + + GridCells(): + header(), + cell_width(0), + cell_height(0), + cells_length(0), cells(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.real = this->cell_width; + *(outbuffer + offset + 0) = (u_cell_width.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_width.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_width.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_width.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.real = this->cell_height; + *(outbuffer + offset + 0) = (u_cell_height.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_height.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_height.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_height.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_height); + *(outbuffer + offset++) = cells_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->cells[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_cell_width; + u_cell_width.base = 0; + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_width.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_width = u_cell_width.real; + offset += sizeof(this->cell_width); + union { + float real; + uint32_t base; + } u_cell_height; + u_cell_height.base = 0; + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_cell_height.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->cell_height = u_cell_height.real; + offset += sizeof(this->cell_height); + uint8_t cells_lengthT = *(inbuffer + offset++); + if(cells_lengthT > cells_length) + this->cells = (geometry_msgs::Point*)realloc(this->cells, cells_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + cells_length = cells_lengthT; + for( uint8_t i = 0; i < cells_length; i++){ + offset += this->st_cells.deserialize(inbuffer + offset); + memcpy( &(this->cells[i]), &(this->st_cells), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/GridCells"; }; + const char * getMD5(){ return "b9e4f5df6d28e272ebde00a3994830f5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/MapMetaData.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/MapMetaData.h new file mode 100755 index 0000000..e9e73d8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/MapMetaData.h @@ -0,0 +1,113 @@ +#ifndef _ROS_nav_msgs_MapMetaData_h +#define _ROS_nav_msgs_MapMetaData_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "geometry_msgs/Pose.h" + +namespace nav_msgs +{ + + class MapMetaData : public ros::Msg + { + public: + ros::Time map_load_time; + float resolution; + uint32_t width; + uint32_t height; + geometry_msgs::Pose origin; + + MapMetaData(): + map_load_time(), + resolution(0), + width(0), + height(0), + origin() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->map_load_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.sec); + *(outbuffer + offset + 0) = (this->map_load_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->map_load_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->map_load_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->map_load_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.real = this->resolution; + *(outbuffer + offset + 0) = (u_resolution.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_resolution.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_resolution.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_resolution.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->resolution); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + offset += this->origin.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->map_load_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.sec); + this->map_load_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->map_load_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->map_load_time.nsec); + union { + float real; + uint32_t base; + } u_resolution; + u_resolution.base = 0; + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_resolution.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->resolution = u_resolution.real; + offset += sizeof(this->resolution); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + offset += this->origin.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/MapMetaData"; }; + const char * getMD5(){ return "10cfc8a2818024d3248802c00c95f11b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/OccupancyGrid.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/OccupancyGrid.h new file mode 100755 index 0000000..6cc22b7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/OccupancyGrid.h @@ -0,0 +1,81 @@ +#ifndef _ROS_nav_msgs_OccupancyGrid_h +#define _ROS_nav_msgs_OccupancyGrid_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "nav_msgs/MapMetaData.h" + +namespace nav_msgs +{ + + class OccupancyGrid : public ros::Msg + { + public: + std_msgs::Header header; + nav_msgs::MapMetaData info; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + OccupancyGrid(): + header(), + info(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->info.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->info.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/OccupancyGrid"; }; + const char * getMD5(){ return "3381f2d731d4076ec5c71b0759edbe4e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/Odometry.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/Odometry.h new file mode 100755 index 0000000..7966ea5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/Odometry.h @@ -0,0 +1,69 @@ +#ifndef _ROS_nav_msgs_Odometry_h +#define _ROS_nav_msgs_Odometry_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseWithCovariance.h" +#include "geometry_msgs/TwistWithCovariance.h" + +namespace nav_msgs +{ + + class Odometry : public ros::Msg + { + public: + std_msgs::Header header; + const char* child_frame_id; + geometry_msgs::PoseWithCovariance pose; + geometry_msgs::TwistWithCovariance twist; + + Odometry(): + header(), + child_frame_id(""), + pose(), + twist() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_child_frame_id = strlen(this->child_frame_id); + memcpy(outbuffer + offset, &length_child_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->child_frame_id, length_child_frame_id); + offset += length_child_frame_id; + offset += this->pose.serialize(outbuffer + offset); + offset += this->twist.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_child_frame_id; + memcpy(&length_child_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_child_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_child_frame_id-1]=0; + this->child_frame_id = (char *)(inbuffer + offset-1); + offset += length_child_frame_id; + offset += this->pose.deserialize(inbuffer + offset); + offset += this->twist.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "nav_msgs/Odometry"; }; + const char * getMD5(){ return "cd5e73d190d741a2f92e81eda573aca7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/Path.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/Path.h new file mode 100755 index 0000000..88d2301 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/Path.h @@ -0,0 +1,64 @@ +#ifndef _ROS_nav_msgs_Path_h +#define _ROS_nav_msgs_Path_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/PoseStamped.h" + +namespace nav_msgs +{ + + class Path : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t poses_length; + geometry_msgs::PoseStamped st_poses; + geometry_msgs::PoseStamped * poses; + + Path(): + header(), + poses_length(0), poses(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (geometry_msgs::PoseStamped*)realloc(this->poses, poses_lengthT * sizeof(geometry_msgs::PoseStamped)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(geometry_msgs::PoseStamped)); + } + return offset; + } + + const char * getType(){ return "nav_msgs/Path"; }; + const char * getMD5(){ return "6227e2b7e9cce15051f669a5e197bbf7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/SetMap.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/SetMap.h new file mode 100755 index 0000000..436f95d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nav_msgs/SetMap.h @@ -0,0 +1,97 @@ +#ifndef _ROS_SERVICE_SetMap_h +#define _ROS_SERVICE_SetMap_h +#include +#include +#include +#include "ros/msg.h" +#include "nav_msgs/OccupancyGrid.h" +#include "geometry_msgs/PoseWithCovarianceStamped.h" + +namespace nav_msgs +{ + +static const char SETMAP[] = "nav_msgs/SetMap"; + + class SetMapRequest : public ros::Msg + { + public: + nav_msgs::OccupancyGrid map; + geometry_msgs::PoseWithCovarianceStamped initial_pose; + + SetMapRequest(): + map(), + initial_pose() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->map.serialize(outbuffer + offset); + offset += this->initial_pose.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->map.deserialize(inbuffer + offset); + offset += this->initial_pose.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "91149a20d7be299b87c340df8cc94fd4"; }; + + }; + + class SetMapResponse : public ros::Msg + { + public: + bool success; + + SetMapResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return SETMAP; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class SetMap { + public: + typedef SetMapRequest Request; + typedef SetMapResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletList.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletList.h new file mode 100755 index 0000000..6cb0cd1 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_NodeletList_h +#define _ROS_SERVICE_NodeletList_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLIST[] = "nodelet/NodeletList"; + + class NodeletListRequest : public ros::Msg + { + public: + + NodeletListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class NodeletListResponse : public ros::Msg + { + public: + uint8_t nodelets_length; + char* st_nodelets; + char* * nodelets; + + NodeletListResponse(): + nodelets_length(0), nodelets(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = nodelets_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_nodeletsi = strlen(this->nodelets[i]); + memcpy(outbuffer + offset, &length_nodeletsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->nodelets[i], length_nodeletsi); + offset += length_nodeletsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t nodelets_lengthT = *(inbuffer + offset++); + if(nodelets_lengthT > nodelets_length) + this->nodelets = (char**)realloc(this->nodelets, nodelets_lengthT * sizeof(char*)); + offset += 3; + nodelets_length = nodelets_lengthT; + for( uint8_t i = 0; i < nodelets_length; i++){ + uint32_t length_st_nodelets; + memcpy(&length_st_nodelets, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_nodelets; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_nodelets-1]=0; + this->st_nodelets = (char *)(inbuffer + offset-1); + offset += length_st_nodelets; + memcpy( &(this->nodelets[i]), &(this->st_nodelets), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return NODELETLIST; }; + const char * getMD5(){ return "99c7b10e794f5600b8030e697e946ca7"; }; + + }; + + class NodeletList { + public: + typedef NodeletListRequest Request; + typedef NodeletListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletLoad.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletLoad.h new file mode 100755 index 0000000..17d85de --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletLoad.h @@ -0,0 +1,231 @@ +#ifndef _ROS_SERVICE_NodeletLoad_h +#define _ROS_SERVICE_NodeletLoad_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETLOAD[] = "nodelet/NodeletLoad"; + + class NodeletLoadRequest : public ros::Msg + { + public: + const char* name; + const char* type; + uint8_t remap_source_args_length; + char* st_remap_source_args; + char* * remap_source_args; + uint8_t remap_target_args_length; + char* st_remap_target_args; + char* * remap_target_args; + uint8_t my_argv_length; + char* st_my_argv; + char* * my_argv; + const char* bond_id; + + NodeletLoadRequest(): + name(""), + type(""), + remap_source_args_length(0), remap_source_args(NULL), + remap_target_args_length(0), remap_target_args(NULL), + my_argv_length(0), my_argv(NULL), + bond_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + *(outbuffer + offset++) = remap_source_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_remap_source_argsi = strlen(this->remap_source_args[i]); + memcpy(outbuffer + offset, &length_remap_source_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_source_args[i], length_remap_source_argsi); + offset += length_remap_source_argsi; + } + *(outbuffer + offset++) = remap_target_args_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_remap_target_argsi = strlen(this->remap_target_args[i]); + memcpy(outbuffer + offset, &length_remap_target_argsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->remap_target_args[i], length_remap_target_argsi); + offset += length_remap_target_argsi; + } + *(outbuffer + offset++) = my_argv_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_my_argvi = strlen(this->my_argv[i]); + memcpy(outbuffer + offset, &length_my_argvi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->my_argv[i], length_my_argvi); + offset += length_my_argvi; + } + uint32_t length_bond_id = strlen(this->bond_id); + memcpy(outbuffer + offset, &length_bond_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->bond_id, length_bond_id); + offset += length_bond_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + uint8_t remap_source_args_lengthT = *(inbuffer + offset++); + if(remap_source_args_lengthT > remap_source_args_length) + this->remap_source_args = (char**)realloc(this->remap_source_args, remap_source_args_lengthT * sizeof(char*)); + offset += 3; + remap_source_args_length = remap_source_args_lengthT; + for( uint8_t i = 0; i < remap_source_args_length; i++){ + uint32_t length_st_remap_source_args; + memcpy(&length_st_remap_source_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_source_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_source_args-1]=0; + this->st_remap_source_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_source_args; + memcpy( &(this->remap_source_args[i]), &(this->st_remap_source_args), sizeof(char*)); + } + uint8_t remap_target_args_lengthT = *(inbuffer + offset++); + if(remap_target_args_lengthT > remap_target_args_length) + this->remap_target_args = (char**)realloc(this->remap_target_args, remap_target_args_lengthT * sizeof(char*)); + offset += 3; + remap_target_args_length = remap_target_args_lengthT; + for( uint8_t i = 0; i < remap_target_args_length; i++){ + uint32_t length_st_remap_target_args; + memcpy(&length_st_remap_target_args, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_remap_target_args; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_remap_target_args-1]=0; + this->st_remap_target_args = (char *)(inbuffer + offset-1); + offset += length_st_remap_target_args; + memcpy( &(this->remap_target_args[i]), &(this->st_remap_target_args), sizeof(char*)); + } + uint8_t my_argv_lengthT = *(inbuffer + offset++); + if(my_argv_lengthT > my_argv_length) + this->my_argv = (char**)realloc(this->my_argv, my_argv_lengthT * sizeof(char*)); + offset += 3; + my_argv_length = my_argv_lengthT; + for( uint8_t i = 0; i < my_argv_length; i++){ + uint32_t length_st_my_argv; + memcpy(&length_st_my_argv, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_my_argv; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_my_argv-1]=0; + this->st_my_argv = (char *)(inbuffer + offset-1); + offset += length_st_my_argv; + memcpy( &(this->my_argv[i]), &(this->st_my_argv), sizeof(char*)); + } + uint32_t length_bond_id; + memcpy(&length_bond_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_bond_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_bond_id-1]=0; + this->bond_id = (char *)(inbuffer + offset-1); + offset += length_bond_id; + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "c6e28cc4d2e259249d96cfb50658fbec"; }; + + }; + + class NodeletLoadResponse : public ros::Msg + { + public: + bool success; + + NodeletLoadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletLoad { + public: + typedef NodeletLoadRequest Request; + typedef NodeletLoadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletUnload.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletUnload.h new file mode 100755 index 0000000..0f1c1df --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/nodelet/NodeletUnload.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_NodeletUnload_h +#define _ROS_SERVICE_NodeletUnload_h +#include +#include +#include +#include "ros/msg.h" + +namespace nodelet +{ + +static const char NODELETUNLOAD[] = "nodelet/NodeletUnload"; + + class NodeletUnloadRequest : public ros::Msg + { + public: + const char* name; + + NodeletUnloadRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class NodeletUnloadResponse : public ros::Msg + { + public: + bool success; + + NodeletUnloadResponse(): + success(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + return offset; + } + + const char * getType(){ return NODELETUNLOAD; }; + const char * getMD5(){ return "358e233cde0c8a8bcfea4ce193f8fc15"; }; + + }; + + class NodeletUnload { + public: + typedef NodeletUnloadRequest Request; + typedef NodeletUnloadResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h new file mode 100755 index 0000000..87ede8b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/ModelCoefficients.h @@ -0,0 +1,82 @@ +#ifndef _ROS_pcl_msgs_ModelCoefficients_h +#define _ROS_pcl_msgs_ModelCoefficients_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class ModelCoefficients : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t values_length; + float st_values; + float * values; + + ModelCoefficients(): + header(), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/ModelCoefficients"; }; + const char * getMD5(){ return "ca27dea75e72cb894cd36f9e5005e93e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/PointIndices.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/PointIndices.h new file mode 100755 index 0000000..5e55370 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/PointIndices.h @@ -0,0 +1,82 @@ +#ifndef _ROS_pcl_msgs_PointIndices_h +#define _ROS_pcl_msgs_PointIndices_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace pcl_msgs +{ + + class PointIndices : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t indices_length; + int32_t st_indices; + int32_t * indices; + + PointIndices(): + header(), + indices_length(0), indices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = indices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_indicesi; + u_indicesi.real = this->indices[i]; + *(outbuffer + offset + 0) = (u_indicesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_indicesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_indicesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_indicesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t indices_lengthT = *(inbuffer + offset++); + if(indices_lengthT > indices_length) + this->indices = (int32_t*)realloc(this->indices, indices_lengthT * sizeof(int32_t)); + offset += 3; + indices_length = indices_lengthT; + for( uint8_t i = 0; i < indices_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_indices; + u_st_indices.base = 0; + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_indices.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_indices = u_st_indices.real; + offset += sizeof(this->st_indices); + memcpy( &(this->indices[i]), &(this->st_indices), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PointIndices"; }; + const char * getMD5(){ return "458c7998b7eaf99908256472e273b3d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/PolygonMesh.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/PolygonMesh.h new file mode 100755 index 0000000..eac8917 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/PolygonMesh.h @@ -0,0 +1,69 @@ +#ifndef _ROS_pcl_msgs_PolygonMesh_h +#define _ROS_pcl_msgs_PolygonMesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointCloud2.h" +#include "pcl_msgs/Vertices.h" + +namespace pcl_msgs +{ + + class PolygonMesh : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::PointCloud2 cloud; + uint8_t polygons_length; + pcl_msgs::Vertices st_polygons; + pcl_msgs::Vertices * polygons; + + PolygonMesh(): + header(), + cloud(), + polygons_length(0), polygons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->cloud.serialize(outbuffer + offset); + *(outbuffer + offset++) = polygons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->polygons[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->cloud.deserialize(inbuffer + offset); + uint8_t polygons_lengthT = *(inbuffer + offset++); + if(polygons_lengthT > polygons_length) + this->polygons = (pcl_msgs::Vertices*)realloc(this->polygons, polygons_lengthT * sizeof(pcl_msgs::Vertices)); + offset += 3; + polygons_length = polygons_lengthT; + for( uint8_t i = 0; i < polygons_length; i++){ + offset += this->st_polygons.deserialize(inbuffer + offset); + memcpy( &(this->polygons[i]), &(this->st_polygons), sizeof(pcl_msgs::Vertices)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/PolygonMesh"; }; + const char * getMD5(){ return "45a5fc6ad2cde8489600a790acc9a38a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/Vertices.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/Vertices.h new file mode 100755 index 0000000..47479b4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/pcl_msgs/Vertices.h @@ -0,0 +1,66 @@ +#ifndef _ROS_pcl_msgs_Vertices_h +#define _ROS_pcl_msgs_Vertices_h + +#include +#include +#include +#include "ros/msg.h" + +namespace pcl_msgs +{ + + class Vertices : public ros::Msg + { + public: + uint8_t vertices_length; + uint32_t st_vertices; + uint32_t * vertices; + + Vertices(): + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + *(outbuffer + offset + 0) = (this->vertices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (uint32_t*)realloc(this->vertices, vertices_lengthT * sizeof(uint32_t)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + this->st_vertices = ((uint32_t) (*(inbuffer + offset))); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_vertices |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_vertices); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "pcl_msgs/Vertices"; }; + const char * getMD5(){ return "39bd7b1c23763ddd1b882b97cb7cfe11"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/polled_camera/GetPolledImage.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/polled_camera/GetPolledImage.h new file mode 100755 index 0000000..31da9e7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/polled_camera/GetPolledImage.h @@ -0,0 +1,194 @@ +#ifndef _ROS_SERVICE_GetPolledImage_h +#define _ROS_SERVICE_GetPolledImage_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/RegionOfInterest.h" +#include "ros/duration.h" +#include "ros/time.h" + +namespace polled_camera +{ + +static const char GETPOLLEDIMAGE[] = "polled_camera/GetPolledImage"; + + class GetPolledImageRequest : public ros::Msg + { + public: + const char* response_namespace; + ros::Duration timeout; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + GetPolledImageRequest(): + response_namespace(""), + timeout(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_response_namespace = strlen(this->response_namespace); + memcpy(outbuffer + offset, &length_response_namespace, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_namespace, length_response_namespace); + offset += length_response_namespace; + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_response_namespace; + memcpy(&length_response_namespace, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_namespace; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_namespace-1]=0; + this->response_namespace = (char *)(inbuffer + offset-1); + offset += length_response_namespace; + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "c77ed43e530fd48e9e7a2a93845e154c"; }; + + }; + + class GetPolledImageResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + ros::Time stamp; + + GetPolledImageResponse(): + success(0), + status_message(""), + stamp() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + return offset; + } + + const char * getType(){ return GETPOLLEDIMAGE; }; + const char * getMD5(){ return "dbf1f851bc511800e6129ccd5a3542ab"; }; + + }; + + class GetPolledImage { + public: + typedef GetPolledImageRequest Request; + typedef GetPolledImageResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros.h new file mode 100755 index 0000000..447cf32 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros.h @@ -0,0 +1,58 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_H_ +#define _ROS_H_ + +#include "ros/node_handle.h" +#include "ArduinoHardware.h" + +namespace ros +{ +#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega168__) + /* downsize our buffers */ + typedef NodeHandle_ NodeHandle; + +#elif defined(__AVR_ATmega328P__) + + typedef NodeHandle_ NodeHandle; + +#else + + typedef NodeHandle_ NodeHandle; + +#endif +} + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/duration.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/duration.h new file mode 100755 index 0000000..ab889cd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/duration.h @@ -0,0 +1,67 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_DURATION_H_ +#define _ROS_DURATION_H_ + +#include +#include + +namespace ros { + + void normalizeSecNSecSigned(int32_t& sec, int32_t& nsec); + + class Duration + { + public: + int32_t sec, nsec; + + Duration() : sec(0), nsec(0) {} + Duration(int32_t _sec, int32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSecSigned(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); }; + + Duration& operator+=(const Duration &rhs); + Duration& operator-=(const Duration &rhs); + Duration& operator*=(double scale); + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/msg.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/msg.h new file mode 100755 index 0000000..87f2e5c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/msg.h @@ -0,0 +1,129 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_MSG_H_ +#define _ROS_MSG_H_ + +#include + +namespace ros { + +/* Base Message Type */ +class Msg +{ +public: + virtual int serialize(unsigned char *outbuffer) const = 0; + virtual int deserialize(unsigned char *data) = 0; + virtual const char * getType() = 0; + virtual const char * getMD5() = 0; + + /** + * @brief This tricky function handles promoting a 32bit float to a 64bit + * double, so that AVR can publish messages containing float64 + * fields, despite AVV having no native support for double. + * + * @param[out] outbuffer pointer for buffer to serialize to. + * @param[in] f value to serialize. + * + * @return number of bytes to advance the buffer pointer. + * + */ + static int serializeAvrFloat64(unsigned char* outbuffer, const float f) + { + const int32_t* val = (int32_t*) &f; + int32_t exp = ((*val >> 23) & 255); + if (exp != 0) + { + exp += 1023 - 127; + } + + int32_t sig = *val; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = 0; + *(outbuffer++) = (sig << 5) & 0xff; + *(outbuffer++) = (sig >> 3) & 0xff; + *(outbuffer++) = (sig >> 11) & 0xff; + *(outbuffer++) = ((exp << 4) & 0xF0) | ((sig >> 19) & 0x0F); + *(outbuffer++) = (exp >> 4) & 0x7F; + + // Mark negative bit as necessary. + if (f < 0) + { + *(outbuffer - 1) |= 0x80; + } + + return 8; + } + + /** + * @brief This tricky function handles demoting a 64bit double to a + * 32bit float, so that AVR can understand messages containing + * float64 fields, despite AVR having no native support for double. + * + * @param[in] inbuffer pointer for buffer to deserialize from. + * @param[out] f pointer to place the deserialized value in. + * + * @return number of bytes to advance the buffer pointer. + */ + static int deserializeAvrFloat64(const unsigned char* inbuffer, float* f) + { + uint32_t* val = (uint32_t*)f; + inbuffer += 3; + + // Copy truncated mantissa. + *val = ((uint32_t)(*(inbuffer++)) >> 5 & 0x07); + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 3; + *val |= ((uint32_t)(*(inbuffer++)) & 0xff) << 11; + *val |= ((uint32_t)(*inbuffer) & 0x0f) << 19; + + // Copy truncated exponent. + uint32_t exp = ((uint32_t)(*(inbuffer++)) & 0xf0)>>4; + exp |= ((uint32_t)(*inbuffer) & 0x7f) << 4; + if (exp != 0) + { + *val |= ((exp) - 1023 + 127) << 23; + } + + // Copy negative sign. + *val |= ((uint32_t)(*(inbuffer++)) & 0x80) << 24; + + return 8; + } + +}; + +} // namespace ros + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/node_handle.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/node_handle.h new file mode 100755 index 0000000..9babaff --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/node_handle.h @@ -0,0 +1,543 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_NODE_HANDLE_H_ +#define ROS_NODE_HANDLE_H_ + +#include + +#include "std_msgs/Time.h" +#include "rosserial_msgs/TopicInfo.h" +#include "rosserial_msgs/Log.h" +#include "rosserial_msgs/RequestParam.h" + +#define SYNC_SECONDS 5 + +#define MODE_FIRST_FF 0 +/* + * The second sync byte is a protocol version. It's value is 0xff for the first + * version of the rosserial protocol (used up to hydro), 0xfe for the second version + * (introduced in hydro), 0xfd for the next, and so on. Its purpose is to enable + * detection of mismatched protocol versions (e.g. hydro rosserial_python with groovy + * rosserial_arduino. It must be changed in both this file and in + * rosserial_python/src/rosserial_python/SerialClient.py + */ +#define MODE_PROTOCOL_VER 1 +#define PROTOCOL_VER1 0xff // through groovy +#define PROTOCOL_VER2 0xfe // in hydro +#define PROTOCOL_VER PROTOCOL_VER2 +#define MODE_SIZE_L 2 +#define MODE_SIZE_H 3 +#define MODE_SIZE_CHECKSUM 4 // checksum for msg size received from size L and H +#define MODE_TOPIC_L 5 // waiting for topic id +#define MODE_TOPIC_H 6 +#define MODE_MESSAGE 7 +#define MODE_MSG_CHECKSUM 8 // checksum for msg and topic id + + +#define MSG_TIMEOUT 20 //20 milliseconds to recieve all of message data + +#include "msg.h" + +namespace ros { + + class NodeHandleBase_{ + public: + virtual int publish(int id, const Msg* msg)=0; + virtual int spinOnce()=0; + virtual bool connected()=0; + }; +} + +#include "publisher.h" +#include "subscriber.h" +#include "service_server.h" +#include "service_client.h" + +namespace ros { + + using rosserial_msgs::TopicInfo; + + /* Node Handle */ + template + class NodeHandle_ : public NodeHandleBase_ + { + protected: + Hardware hardware_; + + /* time used for syncing */ + uint32_t rt_time; + + /* used for computing current time */ + uint32_t sec_offset, nsec_offset; + + uint8_t message_in[INPUT_SIZE]; + uint8_t message_out[OUTPUT_SIZE]; + + Publisher * publishers[MAX_PUBLISHERS]; + Subscriber_ * subscribers[MAX_SUBSCRIBERS]; + + /* + * Setup Functions + */ + public: + NodeHandle_() : configured_(false) { + + for(unsigned int i=0; i< MAX_PUBLISHERS; i++) + publishers[i] = 0; + + for(unsigned int i=0; i< MAX_SUBSCRIBERS; i++) + subscribers[i] = 0; + + for(unsigned int i=0; i< INPUT_SIZE; i++) + message_in[i] = 0; + + for(unsigned int i=0; i< OUTPUT_SIZE; i++) + message_out[i] = 0; + + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + req_param_resp.floats_length = 0; + req_param_resp.floats = NULL; + req_param_resp.ints_length = 0; + req_param_resp.ints = NULL; + } + + Hardware* getHardware(){ + return &hardware_; + } + + /* Start serial, initialize buffers */ + void initNode(){ + hardware_.init(); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + /* Start a named port, which may be network server IP, initialize buffers */ + void initNode(char *portName){ + hardware_.init(portName); + mode_ = 0; + bytes_ = 0; + index_ = 0; + topic_ = 0; + }; + + protected: + //State machine variables for spinOnce + int mode_; + int bytes_; + int topic_; + int index_; + int checksum_; + + bool configured_; + + /* used for syncing the time */ + uint32_t last_sync_time; + uint32_t last_sync_receive_time; + uint32_t last_msg_timeout_time; + + public: + /* This function goes in your loop() function, it handles + * serial input and callbacks for subscribers. + */ + + + virtual int spinOnce(){ + + /* restart if timed out */ + uint32_t c_time = hardware_.time(); + if( (c_time - last_sync_receive_time) > (SYNC_SECONDS*2200) ){ + configured_ = false; + } + + /* reset if message has timed out */ + if ( mode_ != MODE_FIRST_FF){ + if (c_time > last_msg_timeout_time){ + mode_ = MODE_FIRST_FF; + } + } + + /* while available buffer, read data */ + while( true ) + { + int data = hardware_.read(); + if( data < 0 ) + break; + checksum_ += data; + if( mode_ == MODE_MESSAGE ){ /* message data being recieved */ + message_in[index_++] = data; + bytes_--; + if(bytes_ == 0) /* is message complete? if so, checksum */ + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_FIRST_FF ){ + if(data == 0xff){ + mode_++; + last_msg_timeout_time = c_time + MSG_TIMEOUT; + } + else if( hardware_.time() - c_time > (SYNC_SECONDS)){ + /* We have been stuck in spinOnce too long, return error */ + configured_=false; + return -2; + } + }else if( mode_ == MODE_PROTOCOL_VER ){ + if(data == PROTOCOL_VER){ + mode_++; + }else{ + mode_ = MODE_FIRST_FF; + if (configured_ == false) + requestSyncTime(); /* send a msg back showing our protocol version */ + } + }else if( mode_ == MODE_SIZE_L ){ /* bottom half of message size */ + bytes_ = data; + index_ = 0; + mode_++; + checksum_ = data; /* first byte for calculating size checksum */ + }else if( mode_ == MODE_SIZE_H ){ /* top half of message size */ + bytes_ += data<<8; + mode_++; + }else if( mode_ == MODE_SIZE_CHECKSUM ){ + if( (checksum_%256) == 255) + mode_++; + else + mode_ = MODE_FIRST_FF; /* Abandon the frame if the msg len is wrong */ + }else if( mode_ == MODE_TOPIC_L ){ /* bottom half of topic id */ + topic_ = data; + mode_++; + checksum_ = data; /* first byte included in checksum */ + }else if( mode_ == MODE_TOPIC_H ){ /* top half of topic id */ + topic_ += data<<8; + mode_ = MODE_MESSAGE; + if(bytes_ == 0) + mode_ = MODE_MSG_CHECKSUM; + }else if( mode_ == MODE_MSG_CHECKSUM ){ /* do checksum */ + mode_ = MODE_FIRST_FF; + if( (checksum_%256) == 255){ + if(topic_ == TopicInfo::ID_PUBLISHER){ + requestSyncTime(); + negotiateTopics(); + last_sync_time = c_time; + last_sync_receive_time = c_time; + return -1; + }else if(topic_ == TopicInfo::ID_TIME){ + syncTime(message_in); + }else if (topic_ == TopicInfo::ID_PARAMETER_REQUEST){ + req_param_resp.deserialize(message_in); + param_recieved= true; + }else if(topic_ == TopicInfo::ID_TX_STOP){ + configured_ = false; + }else{ + if(subscribers[topic_-100]) + subscribers[topic_-100]->callback( message_in ); + } + } + } + } + + /* occasionally sync time */ + if( configured_ && ((c_time-last_sync_time) > (SYNC_SECONDS*500) )){ + requestSyncTime(); + last_sync_time = c_time; + } + + return 0; + } + + + /* Are we connected to the PC? */ + virtual bool connected() { + return configured_; + }; + + /******************************************************************** + * Time functions + */ + + void requestSyncTime() + { + std_msgs::Time t; + publish(TopicInfo::ID_TIME, &t); + rt_time = hardware_.time(); + } + + void syncTime(uint8_t * data) + { + std_msgs::Time t; + uint32_t offset = hardware_.time() - rt_time; + + t.deserialize(data); + t.data.sec += offset/1000; + t.data.nsec += (offset%1000)*1000000UL; + + this->setNow(t.data); + last_sync_receive_time = hardware_.time(); + } + + Time now() + { + uint32_t ms = hardware_.time(); + Time current_time; + current_time.sec = ms/1000 + sec_offset; + current_time.nsec = (ms%1000)*1000000UL + nsec_offset; + normalizeSecNSec(current_time.sec, current_time.nsec); + return current_time; + } + + void setNow( Time & new_now ) + { + uint32_t ms = hardware_.time(); + sec_offset = new_now.sec - ms/1000 - 1; + nsec_offset = new_now.nsec - (ms%1000)*1000000UL + 1000000000UL; + normalizeSecNSec(sec_offset, nsec_offset); + } + + /******************************************************************** + * Topic Management + */ + + /* Register a new publisher */ + bool advertise(Publisher & p) + { + for(int i = 0; i < MAX_PUBLISHERS; i++){ + if(publishers[i] == 0){ // empty slot + publishers[i] = &p; + p.id_ = i+100+MAX_SUBSCRIBERS; + p.nh_ = this; + return true; + } + } + return false; + } + + /* Register a new subscriber */ + template + bool subscribe(Subscriber< MsgT> & s){ + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &s; + s.id_ = i+100; + return true; + } + } + return false; + } + + /* Register a new Service Server */ + template + bool advertiseService(ServiceServer& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + /* Register a new Service Client */ + template + bool serviceClient(ServiceClient& srv){ + bool v = advertise(srv.pub); + for(int i = 0; i < MAX_SUBSCRIBERS; i++){ + if(subscribers[i] == 0){ // empty slot + subscribers[i] = (Subscriber_*) &srv; + srv.id_ = i+100; + return v; + } + } + return false; + } + + void negotiateTopics() + { + rosserial_msgs::TopicInfo ti; + int i; + for(i = 0; i < MAX_PUBLISHERS; i++) + { + if(publishers[i] != 0) // non-empty slot + { + ti.topic_id = publishers[i]->id_; + ti.topic_name = (char *) publishers[i]->topic_; + ti.message_type = (char *) publishers[i]->msg_->getType(); + ti.md5sum = (char *) publishers[i]->msg_->getMD5(); + ti.buffer_size = OUTPUT_SIZE; + publish( publishers[i]->getEndpointType(), &ti ); + } + } + for(i = 0; i < MAX_SUBSCRIBERS; i++) + { + if(subscribers[i] != 0) // non-empty slot + { + ti.topic_id = subscribers[i]->id_; + ti.topic_name = (char *) subscribers[i]->topic_; + ti.message_type = (char *) subscribers[i]->getMsgType(); + ti.md5sum = (char *) subscribers[i]->getMsgMD5(); + ti.buffer_size = INPUT_SIZE; + publish( subscribers[i]->getEndpointType(), &ti ); + } + } + configured_ = true; + } + + virtual int publish(int id, const Msg * msg) + { + if(id >= 100 && !configured_) + return 0; + + /* serialize message */ + uint16_t l = msg->serialize(message_out+7); + + /* setup the header */ + message_out[0] = 0xff; + message_out[1] = PROTOCOL_VER; + message_out[2] = (uint8_t) ((uint16_t)l&255); + message_out[3] = (uint8_t) ((uint16_t)l>>8); + message_out[4] = 255 - ((message_out[2] + message_out[3])%256); + message_out[5] = (uint8_t) ((int16_t)id&255); + message_out[6] = (uint8_t) ((int16_t)id>>8); + + /* calculate checksum */ + int chk = 0; + for(int i =5; i end_time) return false; + } + return true; + } + + public: + bool getParam(const char* name, int* param, int length =1){ + if (requestParam(name) ){ + if (length == req_param_resp.ints_length){ + //copy it over + for(int i=0; ipublish(id_, msg); }; + int getEndpointType(){ return endpoint_; } + + const char * topic_; + Msg *msg_; + // id_ and no_ are set by NodeHandle when we advertise + int id_; + NodeHandleBase_* nh_; + + private: + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/service_client.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/service_client.h new file mode 100755 index 0000000..06522f2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/service_client.h @@ -0,0 +1,83 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_CLIENT_H_ +#define _ROS_SERVICE_CLIENT_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceClient : public Subscriber_ { + public: + ServiceClient(const char* topic_name) : + pub(topic_name, &req, rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->waiting = true; + } + + virtual void call(const MReq & request, MRes & response) + { + if(!pub.nh_->connected()) return; + ret = &response; + waiting = true; + pub.publish(&request); + while(waiting && pub.nh_->connected()) + if(pub.nh_->spinOnce() < 0) break; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + ret->deserialize(data); + waiting = false; + } + virtual const char * getMsgType(){ return this->resp.getType(); } + virtual const char * getMsgMD5(){ return this->resp.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_CLIENT + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + MRes * ret; + bool waiting; + Publisher pub; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/service_server.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/service_server.h new file mode 100755 index 0000000..67a3e0a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/service_server.h @@ -0,0 +1,76 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _ROS_SERVICE_SERVER_H_ +#define _ROS_SERVICE_SERVER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +#include "publisher.h" +#include "subscriber.h" + +namespace ros { + + template + class ServiceServer : public Subscriber_ { + public: + typedef void(*CallbackT)(const MReq&, MRes&); + + ServiceServer(const char* topic_name, CallbackT cb) : + pub(topic_name, &resp, rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_PUBLISHER) + { + this->topic_ = topic_name; + this->cb_ = cb; + } + + // these refer to the subscriber + virtual void callback(unsigned char *data){ + req.deserialize(data); + cb_(req,resp); + pub.publish(&resp); + } + virtual const char * getMsgType(){ return this->req.getType(); } + virtual const char * getMsgMD5(){ return this->req.getMD5(); } + virtual int getEndpointType(){ return rosserial_msgs::TopicInfo::ID_SERVICE_SERVER + rosserial_msgs::TopicInfo::ID_SUBSCRIBER; } + + MReq req; + MRes resp; + Publisher pub; + private: + CallbackT cb_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/subscriber.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/subscriber.h new file mode 100755 index 0000000..5464646 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/subscriber.h @@ -0,0 +1,88 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_SUBSCRIBER_H_ +#define ROS_SUBSCRIBER_H_ + +#include "rosserial_msgs/TopicInfo.h" + +namespace ros { + + /* Base class for objects subscribers. */ + class Subscriber_ + { + public: + virtual void callback(unsigned char *data)=0; + virtual int getEndpointType()=0; + + // id_ is set by NodeHandle when we advertise + int id_; + + virtual const char * getMsgType()=0; + virtual const char * getMsgMD5()=0; + const char * topic_; + }; + + + /* Actual subscriber, templated on message type. */ + template + class Subscriber: public Subscriber_{ + public: + typedef void(*CallbackT)(const MsgT&); + MsgT msg; + + Subscriber(const char * topic_name, CallbackT cb, int endpoint=rosserial_msgs::TopicInfo::ID_SUBSCRIBER) : + cb_(cb), + endpoint_(endpoint) + { + topic_ = topic_name; + }; + + virtual void callback(unsigned char* data){ + msg.deserialize(data); + this->cb_(msg); + } + + virtual const char * getMsgType(){ return this->msg.getType(); } + virtual const char * getMsgMD5(){ return this->msg.getMD5(); } + virtual int getEndpointType(){ return endpoint_; } + + private: + CallbackT cb_; + int endpoint_; + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/time.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/time.h new file mode 100755 index 0000000..6141261 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/ros/time.h @@ -0,0 +1,73 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TIME_H_ +#define ROS_TIME_H_ + +#include +#include + +#include "ros/duration.h" + +namespace ros +{ + void normalizeSecNSec(uint32_t &sec, uint32_t &nsec); + + class Time + { + public: + uint32_t sec, nsec; + + Time() : sec(0), nsec(0) {} + Time(uint32_t _sec, uint32_t _nsec) : sec(_sec), nsec(_nsec) + { + normalizeSecNSec(sec, nsec); + } + + double toSec() const { return (double)sec + 1e-9*(double)nsec; }; + void fromSec(double t) { sec = (uint32_t) floor(t); nsec = (uint32_t) round((t-sec) * 1e9); }; + + uint32_t toNsec() { return (uint32_t)sec*1000000000ull + (uint32_t)nsec; }; + Time& fromNSec(int32_t t); + + Time& operator +=(const Duration &rhs); + Time& operator -=(const Duration &rhs); + + static Time now(); + static void setNow( Time & new_now); + }; + +} + +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/Empty.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/Empty.h new file mode 100755 index 0000000..df021b7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char EMPTY[] = "roscpp/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/GetLoggers.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/GetLoggers.h new file mode 100755 index 0000000..0574cd7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/GetLoggers.h @@ -0,0 +1,91 @@ +#ifndef _ROS_SERVICE_GetLoggers_h +#define _ROS_SERVICE_GetLoggers_h +#include +#include +#include +#include "ros/msg.h" +#include "roscpp/Logger.h" + +namespace roscpp +{ + +static const char GETLOGGERS[] = "roscpp/GetLoggers"; + + class GetLoggersRequest : public ros::Msg + { + public: + + GetLoggersRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class GetLoggersResponse : public ros::Msg + { + public: + uint8_t loggers_length; + roscpp::Logger st_loggers; + roscpp::Logger * loggers; + + GetLoggersResponse(): + loggers_length(0), loggers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = loggers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->loggers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t loggers_lengthT = *(inbuffer + offset++); + if(loggers_lengthT > loggers_length) + this->loggers = (roscpp::Logger*)realloc(this->loggers, loggers_lengthT * sizeof(roscpp::Logger)); + offset += 3; + loggers_length = loggers_lengthT; + for( uint8_t i = 0; i < loggers_length; i++){ + offset += this->st_loggers.deserialize(inbuffer + offset); + memcpy( &(this->loggers[i]), &(this->st_loggers), sizeof(roscpp::Logger)); + } + return offset; + } + + const char * getType(){ return GETLOGGERS; }; + const char * getMD5(){ return "32e97e85527d4678a8f9279894bb64b0"; }; + + }; + + class GetLoggers { + public: + typedef GetLoggersRequest Request; + typedef GetLoggersResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/Logger.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/Logger.h new file mode 100755 index 0000000..a67fb51 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/Logger.h @@ -0,0 +1,70 @@ +#ifndef _ROS_roscpp_Logger_h +#define _ROS_roscpp_Logger_h + +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + + class Logger : public ros::Msg + { + public: + const char* name; + const char* level; + + Logger(): + name(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return "roscpp/Logger"; }; + const char * getMD5(){ return "a6069a2ff40db7bd32143dd66e1f408e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/SetLoggerLevel.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/SetLoggerLevel.h new file mode 100755 index 0000000..dddee2e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp/SetLoggerLevel.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_SetLoggerLevel_h +#define _ROS_SERVICE_SetLoggerLevel_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp +{ + +static const char SETLOGGERLEVEL[] = "roscpp/SetLoggerLevel"; + + class SetLoggerLevelRequest : public ros::Msg + { + public: + const char* logger; + const char* level; + + SetLoggerLevelRequest(): + logger(""), + level("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_logger = strlen(this->logger); + memcpy(outbuffer + offset, &length_logger, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->logger, length_logger); + offset += length_logger; + uint32_t length_level = strlen(this->level); + memcpy(outbuffer + offset, &length_level, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->level, length_level); + offset += length_level; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_logger; + memcpy(&length_logger, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_logger; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_logger-1]=0; + this->logger = (char *)(inbuffer + offset-1); + offset += length_logger; + uint32_t length_level; + memcpy(&length_level, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_level; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_level-1]=0; + this->level = (char *)(inbuffer + offset-1); + offset += length_level; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "51da076440d78ca1684d36c868df61ea"; }; + + }; + + class SetLoggerLevelResponse : public ros::Msg + { + public: + + SetLoggerLevelResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETLOGGERLEVEL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetLoggerLevel { + public: + typedef SetLoggerLevelRequest Request; + typedef SetLoggerLevelResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp_tutorials/TwoInts.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp_tutorials/TwoInts.h new file mode 100755 index 0000000..f35797c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/roscpp_tutorials/TwoInts.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_TwoInts_h +#define _ROS_SERVICE_TwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace roscpp_tutorials +{ + +static const char TWOINTS[] = "roscpp_tutorials/TwoInts"; + + class TwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + TwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class TwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + TwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return TWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class TwoInts { + public: + typedef TwoIntsRequest Request; + typedef TwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/Clock.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/Clock.h new file mode 100755 index 0000000..10a3c0c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/Clock.h @@ -0,0 +1,61 @@ +#ifndef _ROS_rosgraph_msgs_Clock_h +#define _ROS_rosgraph_msgs_Clock_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace rosgraph_msgs +{ + + class Clock : public ros::Msg + { + public: + ros::Time clock; + + Clock(): + clock() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->clock.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.sec); + *(outbuffer + offset + 0) = (this->clock.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->clock.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->clock.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->clock.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->clock.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->clock.sec = ((uint32_t) (*(inbuffer + offset))); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.sec); + this->clock.nsec = ((uint32_t) (*(inbuffer + offset))); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->clock.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->clock.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Clock"; }; + const char * getMD5(){ return "a9c97c1d230cfc112e270351a944ee47"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/Log.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/Log.h new file mode 100755 index 0000000..439dd36 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/Log.h @@ -0,0 +1,173 @@ +#ifndef _ROS_rosgraph_msgs_Log_h +#define _ROS_rosgraph_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rosgraph_msgs +{ + + class Log : public ros::Msg + { + public: + std_msgs::Header header; + int8_t level; + const char* name; + const char* msg; + const char* file; + const char* function; + uint32_t line; + uint8_t topics_length; + char* st_topics; + char* * topics; + enum { DEBUG = 1 }; + enum { INFO = 2 }; + enum { WARN = 4 }; + enum { ERROR = 8 }; + enum { FATAL = 16 }; + + Log(): + header(), + level(0), + name(""), + msg(""), + file(""), + function(""), + line(0), + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.real = this->level; + *(outbuffer + offset + 0) = (u_level.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + uint32_t length_file = strlen(this->file); + memcpy(outbuffer + offset, &length_file, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->file, length_file); + offset += length_file; + uint32_t length_function = strlen(this->function); + memcpy(outbuffer + offset, &length_function, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->function, length_function); + offset += length_function; + *(outbuffer + offset + 0) = (this->line >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->line >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->line >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->line >> (8 * 3)) & 0xFF; + offset += sizeof(this->line); + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + int8_t real; + uint8_t base; + } u_level; + u_level.base = 0; + u_level.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->level = u_level.real; + offset += sizeof(this->level); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + uint32_t length_file; + memcpy(&length_file, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_file; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_file-1]=0; + this->file = (char *)(inbuffer + offset-1); + offset += length_file; + uint32_t length_function; + memcpy(&length_function, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_function; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_function-1]=0; + this->function = (char *)(inbuffer + offset-1); + offset += length_function; + this->line = ((uint32_t) (*(inbuffer + offset))); + this->line |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->line |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->line |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->line); + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "rosgraph_msgs/Log"; }; + const char * getMD5(){ return "acffd30cd6b6de30f120938c17c593fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h new file mode 100755 index 0000000..2c6fd65 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosgraph_msgs/TopicStatistics.h @@ -0,0 +1,333 @@ +#ifndef _ROS_rosgraph_msgs_TopicStatistics_h +#define _ROS_rosgraph_msgs_TopicStatistics_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace rosgraph_msgs +{ + + class TopicStatistics : public ros::Msg + { + public: + const char* topic; + const char* node_pub; + const char* node_sub; + ros::Time window_start; + ros::Time window_stop; + int32_t delivered_msgs; + int32_t dropped_msgs; + int32_t traffic; + ros::Duration period_mean; + ros::Duration period_stddev; + ros::Duration period_max; + ros::Duration stamp_age_mean; + ros::Duration stamp_age_stddev; + ros::Duration stamp_age_max; + + TopicStatistics(): + topic(""), + node_pub(""), + node_sub(""), + window_start(), + window_stop(), + delivered_msgs(0), + dropped_msgs(0), + traffic(0), + period_mean(), + period_stddev(), + period_max(), + stamp_age_mean(), + stamp_age_stddev(), + stamp_age_max() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + uint32_t length_node_pub = strlen(this->node_pub); + memcpy(outbuffer + offset, &length_node_pub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_pub, length_node_pub); + offset += length_node_pub; + uint32_t length_node_sub = strlen(this->node_sub); + memcpy(outbuffer + offset, &length_node_sub, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->node_sub, length_node_sub); + offset += length_node_sub; + *(outbuffer + offset + 0) = (this->window_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.sec); + *(outbuffer + offset + 0) = (this->window_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_start.nsec); + *(outbuffer + offset + 0) = (this->window_stop.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.sec); + *(outbuffer + offset + 0) = (this->window_stop.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->window_stop.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->window_stop.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->window_stop.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.real = this->delivered_msgs; + *(outbuffer + offset + 0) = (u_delivered_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delivered_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delivered_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delivered_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.real = this->dropped_msgs; + *(outbuffer + offset + 0) = (u_dropped_msgs.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_dropped_msgs.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_dropped_msgs.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_dropped_msgs.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.real = this->traffic; + *(outbuffer + offset + 0) = (u_traffic.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_traffic.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_traffic.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_traffic.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->traffic); + *(outbuffer + offset + 0) = (this->period_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.sec); + *(outbuffer + offset + 0) = (this->period_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_mean.nsec); + *(outbuffer + offset + 0) = (this->period_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.sec); + *(outbuffer + offset + 0) = (this->period_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_stddev.nsec); + *(outbuffer + offset + 0) = (this->period_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.sec); + *(outbuffer + offset + 0) = (this->period_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->period_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->period_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->period_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->period_max.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.sec); + *(outbuffer + offset + 0) = (this->stamp_age_mean.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_mean.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_mean.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_mean.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_mean.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.sec); + *(outbuffer + offset + 0) = (this->stamp_age_stddev.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_stddev.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_stddev.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_stddev.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_stddev.nsec); + *(outbuffer + offset + 0) = (this->stamp_age_max.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.sec); + *(outbuffer + offset + 0) = (this->stamp_age_max.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp_age_max.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp_age_max.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp_age_max.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + uint32_t length_node_pub; + memcpy(&length_node_pub, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_pub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_pub-1]=0; + this->node_pub = (char *)(inbuffer + offset-1); + offset += length_node_pub; + uint32_t length_node_sub; + memcpy(&length_node_sub, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_node_sub; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_node_sub-1]=0; + this->node_sub = (char *)(inbuffer + offset-1); + offset += length_node_sub; + this->window_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.sec); + this->window_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_start.nsec); + this->window_stop.sec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.sec); + this->window_stop.nsec = ((uint32_t) (*(inbuffer + offset))); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->window_stop.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->window_stop.nsec); + union { + int32_t real; + uint32_t base; + } u_delivered_msgs; + u_delivered_msgs.base = 0; + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delivered_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delivered_msgs = u_delivered_msgs.real; + offset += sizeof(this->delivered_msgs); + union { + int32_t real; + uint32_t base; + } u_dropped_msgs; + u_dropped_msgs.base = 0; + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_dropped_msgs.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->dropped_msgs = u_dropped_msgs.real; + offset += sizeof(this->dropped_msgs); + union { + int32_t real; + uint32_t base; + } u_traffic; + u_traffic.base = 0; + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_traffic.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->traffic = u_traffic.real; + offset += sizeof(this->traffic); + this->period_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.sec); + this->period_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_mean.nsec); + this->period_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.sec); + this->period_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_stddev.nsec); + this->period_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.sec); + this->period_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->period_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->period_max.nsec); + this->stamp_age_mean.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.sec); + this->stamp_age_mean.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_mean.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_mean.nsec); + this->stamp_age_stddev.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.sec); + this->stamp_age_stddev.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_stddev.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_stddev.nsec); + this->stamp_age_max.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.sec); + this->stamp_age_max.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp_age_max.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp_age_max.nsec); + return offset; + } + + const char * getType(){ return "rosgraph_msgs/TopicStatistics"; }; + const char * getMD5(){ return "10152ed868c5097a5e2e4a89d7daa710"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h new file mode 100755 index 0000000..37332a0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/AddTwoInts.h @@ -0,0 +1,163 @@ +#ifndef _ROS_SERVICE_AddTwoInts_h +#define _ROS_SERVICE_AddTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char ADDTWOINTS[] = "rospy_tutorials/AddTwoInts"; + + class AddTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int64_t b; + + AddTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_b.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_b.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_b.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_b.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int64_t real; + uint64_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_b.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "36d09b846be0b371c5f190354dd3153e"; }; + + }; + + class AddTwoIntsResponse : public ros::Msg + { + public: + int64_t sum; + + AddTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_sum.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_sum.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_sum.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_sum.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_sum.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return ADDTWOINTS; }; + const char * getMD5(){ return "b88405221c77b1878a3cbbfff53428d7"; }; + + }; + + class AddTwoInts { + public: + typedef AddTwoIntsRequest Request; + typedef AddTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h new file mode 100755 index 0000000..f76f277 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/BadTwoInts.h @@ -0,0 +1,147 @@ +#ifndef _ROS_SERVICE_BadTwoInts_h +#define _ROS_SERVICE_BadTwoInts_h +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + +static const char BADTWOINTS[] = "rospy_tutorials/BadTwoInts"; + + class BadTwoIntsRequest : public ros::Msg + { + public: + int64_t a; + int32_t b; + + BadTwoIntsRequest(): + a(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_a.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_a.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_a.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_a.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_a.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->a = u_a.real; + offset += sizeof(this->a); + union { + int32_t real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "29bb5c7dea8bf822f53e94b0ee5a3a56"; }; + + }; + + class BadTwoIntsResponse : public ros::Msg + { + public: + int32_t sum; + + BadTwoIntsResponse(): + sum(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.real = this->sum; + *(outbuffer + offset + 0) = (u_sum.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_sum.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_sum.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_sum.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->sum); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_sum; + u_sum.base = 0; + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_sum.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->sum = u_sum.real; + offset += sizeof(this->sum); + return offset; + } + + const char * getType(){ return BADTWOINTS; }; + const char * getMD5(){ return "0ba699c25c9418c0366f3595c0c8e8ec"; }; + + }; + + class BadTwoInts { + public: + typedef BadTwoIntsRequest Request; + typedef BadTwoIntsResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/Floats.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/Floats.h new file mode 100755 index 0000000..113468d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/Floats.h @@ -0,0 +1,77 @@ +#ifndef _ROS_rospy_tutorials_Floats_h +#define _ROS_rospy_tutorials_Floats_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rospy_tutorials +{ + + class Floats : public ros::Msg + { + public: + uint8_t data_length; + float st_data; + float * data; + + Floats(): + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "rospy_tutorials/Floats"; }; + const char * getMD5(){ return "420cd38b6b071cd49f2970c3e2cee511"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/HeaderString.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/HeaderString.h new file mode 100755 index 0000000..f53759c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rospy_tutorials/HeaderString.h @@ -0,0 +1,59 @@ +#ifndef _ROS_rospy_tutorials_HeaderString_h +#define _ROS_rospy_tutorials_HeaderString_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace rospy_tutorials +{ + + class HeaderString : public ros::Msg + { + public: + std_msgs::Header header; + const char* data; + + HeaderString(): + header(), + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "rospy_tutorials/HeaderString"; }; + const char * getMD5(){ return "c99a9440709e4d4a9716d55b8270d5e7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_arduino/Adc.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_arduino/Adc.h new file mode 100755 index 0000000..21114c7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_arduino/Adc.h @@ -0,0 +1,86 @@ +#ifndef _ROS_rosserial_arduino_Adc_h +#define _ROS_rosserial_arduino_Adc_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + + class Adc : public ros::Msg + { + public: + uint16_t adc0; + uint16_t adc1; + uint16_t adc2; + uint16_t adc3; + uint16_t adc4; + uint16_t adc5; + + Adc(): + adc0(0), + adc1(0), + adc2(0), + adc3(0), + adc4(0), + adc5(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->adc0 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc0 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc0); + *(outbuffer + offset + 0) = (this->adc1 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc1 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc1); + *(outbuffer + offset + 0) = (this->adc2 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc2 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc2); + *(outbuffer + offset + 0) = (this->adc3 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc3 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc3); + *(outbuffer + offset + 0) = (this->adc4 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc4 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc4); + *(outbuffer + offset + 0) = (this->adc5 >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->adc5 >> (8 * 1)) & 0xFF; + offset += sizeof(this->adc5); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->adc0 = ((uint16_t) (*(inbuffer + offset))); + this->adc0 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc0); + this->adc1 = ((uint16_t) (*(inbuffer + offset))); + this->adc1 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc1); + this->adc2 = ((uint16_t) (*(inbuffer + offset))); + this->adc2 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc2); + this->adc3 = ((uint16_t) (*(inbuffer + offset))); + this->adc3 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc3); + this->adc4 = ((uint16_t) (*(inbuffer + offset))); + this->adc4 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc4); + this->adc5 = ((uint16_t) (*(inbuffer + offset))); + this->adc5 |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->adc5); + return offset; + } + + const char * getType(){ return "rosserial_arduino/Adc"; }; + const char * getMD5(){ return "6d7853a614e2e821319068311f2af25b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_arduino/Test.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_arduino/Test.h new file mode 100755 index 0000000..e132728 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_arduino/Test.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_Test_h +#define _ROS_SERVICE_Test_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_arduino +{ + +static const char TEST[] = "rosserial_arduino/Test"; + + class TestRequest : public ros::Msg + { + public: + const char* input; + + TestRequest(): + input("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_input = strlen(this->input); + memcpy(outbuffer + offset, &length_input, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->input, length_input); + offset += length_input; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_input; + memcpy(&length_input, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_input; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_input-1]=0; + this->input = (char *)(inbuffer + offset-1); + offset += length_input; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "39e92f1778057359c64c7b8a7d7b19de"; }; + + }; + + class TestResponse : public ros::Msg + { + public: + const char* output; + + TestResponse(): + output("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_output = strlen(this->output); + memcpy(outbuffer + offset, &length_output, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->output, length_output); + offset += length_output; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_output; + memcpy(&length_output, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_output; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_output-1]=0; + this->output = (char *)(inbuffer + offset-1); + offset += length_output; + return offset; + } + + const char * getType(){ return TEST; }; + const char * getMD5(){ return "0825d95fdfa2c8f4bbb4e9c74bccd3fd"; }; + + }; + + class Test { + public: + typedef TestRequest Request; + typedef TestResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/Log.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/Log.h new file mode 100755 index 0000000..bcd6fd6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/Log.h @@ -0,0 +1,65 @@ +#ifndef _ROS_rosserial_msgs_Log_h +#define _ROS_rosserial_msgs_Log_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class Log : public ros::Msg + { + public: + uint8_t level; + const char* msg; + enum { ROSDEBUG = 0 }; + enum { INFO = 1 }; + enum { WARN = 2 }; + enum { ERROR = 3 }; + enum { FATAL = 4 }; + + Log(): + level(0), + msg("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->level >> (8 * 0)) & 0xFF; + offset += sizeof(this->level); + uint32_t length_msg = strlen(this->msg); + memcpy(outbuffer + offset, &length_msg, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->msg, length_msg); + offset += length_msg; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->level = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->level); + uint32_t length_msg; + memcpy(&length_msg, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_msg; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_msg-1]=0; + this->msg = (char *)(inbuffer + offset-1); + offset += length_msg; + return offset; + } + + const char * getType(){ return "rosserial_msgs/Log"; }; + const char * getMD5(){ return "11abd731c25933261cd6183bd12d6295"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h new file mode 100755 index 0000000..98af72e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestMessageInfo.h @@ -0,0 +1,118 @@ +#ifndef _ROS_SERVICE_RequestMessageInfo_h +#define _ROS_SERVICE_RequestMessageInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTMESSAGEINFO[] = "rosserial_msgs/RequestMessageInfo"; + + class RequestMessageInfoRequest : public ros::Msg + { + public: + const char* type; + + RequestMessageInfoRequest(): + type("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_type = strlen(this->type); + memcpy(outbuffer + offset, &length_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->type, length_type); + offset += length_type; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_type; + memcpy(&length_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_type-1]=0; + this->type = (char *)(inbuffer + offset-1); + offset += length_type; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "dc67331de85cf97091b7d45e5c64ab75"; }; + + }; + + class RequestMessageInfoResponse : public ros::Msg + { + public: + const char* md5; + const char* definition; + + RequestMessageInfoResponse(): + md5(""), + definition("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_md5 = strlen(this->md5); + memcpy(outbuffer + offset, &length_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5, length_md5); + offset += length_md5; + uint32_t length_definition = strlen(this->definition); + memcpy(outbuffer + offset, &length_definition, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->definition, length_definition); + offset += length_definition; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_md5; + memcpy(&length_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5-1]=0; + this->md5 = (char *)(inbuffer + offset-1); + offset += length_md5; + uint32_t length_definition; + memcpy(&length_definition, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_definition; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_definition-1]=0; + this->definition = (char *)(inbuffer + offset-1); + offset += length_definition; + return offset; + } + + const char * getType(){ return REQUESTMESSAGEINFO; }; + const char * getMD5(){ return "fe452186a069bed40f09b8628fe5eac8"; }; + + }; + + class RequestMessageInfo { + public: + typedef RequestMessageInfoRequest Request; + typedef RequestMessageInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestParam.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestParam.h new file mode 100755 index 0000000..f4c76bd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestParam.h @@ -0,0 +1,196 @@ +#ifndef _ROS_SERVICE_RequestParam_h +#define _ROS_SERVICE_RequestParam_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTPARAM[] = "rosserial_msgs/RequestParam"; + + class RequestParamRequest : public ros::Msg + { + public: + const char* name; + + RequestParamRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class RequestParamResponse : public ros::Msg + { + public: + uint8_t ints_length; + int32_t st_ints; + int32_t * ints; + uint8_t floats_length; + float st_floats; + float * floats; + uint8_t strings_length; + char* st_strings; + char* * strings; + + RequestParamResponse(): + ints_length(0), ints(NULL), + floats_length(0), floats(NULL), + strings_length(0), strings(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = ints_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_intsi; + u_intsi.real = this->ints[i]; + *(outbuffer + offset + 0) = (u_intsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ints[i]); + } + *(outbuffer + offset++) = floats_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_floatsi; + u_floatsi.real = this->floats[i]; + *(outbuffer + offset + 0) = (u_floatsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_floatsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_floatsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_floatsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->floats[i]); + } + *(outbuffer + offset++) = strings_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_stringsi = strlen(this->strings[i]); + memcpy(outbuffer + offset, &length_stringsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->strings[i], length_stringsi); + offset += length_stringsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t ints_lengthT = *(inbuffer + offset++); + if(ints_lengthT > ints_length) + this->ints = (int32_t*)realloc(this->ints, ints_lengthT * sizeof(int32_t)); + offset += 3; + ints_length = ints_lengthT; + for( uint8_t i = 0; i < ints_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_ints; + u_st_ints.base = 0; + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ints.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ints = u_st_ints.real; + offset += sizeof(this->st_ints); + memcpy( &(this->ints[i]), &(this->st_ints), sizeof(int32_t)); + } + uint8_t floats_lengthT = *(inbuffer + offset++); + if(floats_lengthT > floats_length) + this->floats = (float*)realloc(this->floats, floats_lengthT * sizeof(float)); + offset += 3; + floats_length = floats_lengthT; + for( uint8_t i = 0; i < floats_length; i++){ + union { + float real; + uint32_t base; + } u_st_floats; + u_st_floats.base = 0; + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_floats.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_floats = u_st_floats.real; + offset += sizeof(this->st_floats); + memcpy( &(this->floats[i]), &(this->st_floats), sizeof(float)); + } + uint8_t strings_lengthT = *(inbuffer + offset++); + if(strings_lengthT > strings_length) + this->strings = (char**)realloc(this->strings, strings_lengthT * sizeof(char*)); + offset += 3; + strings_length = strings_lengthT; + for( uint8_t i = 0; i < strings_length; i++){ + uint32_t length_st_strings; + memcpy(&length_st_strings, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_strings; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_strings-1]=0; + this->st_strings = (char *)(inbuffer + offset-1); + offset += length_st_strings; + memcpy( &(this->strings[i]), &(this->st_strings), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return REQUESTPARAM; }; + const char * getMD5(){ return "9f0e98bda65981986ddf53afa7a40e49"; }; + + }; + + class RequestParam { + public: + typedef RequestParamRequest Request; + typedef RequestParamResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h new file mode 100755 index 0000000..90b47c5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/RequestServiceInfo.h @@ -0,0 +1,134 @@ +#ifndef _ROS_SERVICE_RequestServiceInfo_h +#define _ROS_SERVICE_RequestServiceInfo_h +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + +static const char REQUESTSERVICEINFO[] = "rosserial_msgs/RequestServiceInfo"; + + class RequestServiceInfoRequest : public ros::Msg + { + public: + const char* service; + + RequestServiceInfoRequest(): + service("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service = strlen(this->service); + memcpy(outbuffer + offset, &length_service, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service, length_service); + offset += length_service; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service; + memcpy(&length_service, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service-1]=0; + this->service = (char *)(inbuffer + offset-1); + offset += length_service; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "1cbcfa13b08f6d36710b9af8741e6112"; }; + + }; + + class RequestServiceInfoResponse : public ros::Msg + { + public: + const char* service_md5; + const char* request_md5; + const char* response_md5; + + RequestServiceInfoResponse(): + service_md5(""), + request_md5(""), + response_md5("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_service_md5 = strlen(this->service_md5); + memcpy(outbuffer + offset, &length_service_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->service_md5, length_service_md5); + offset += length_service_md5; + uint32_t length_request_md5 = strlen(this->request_md5); + memcpy(outbuffer + offset, &length_request_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->request_md5, length_request_md5); + offset += length_request_md5; + uint32_t length_response_md5 = strlen(this->response_md5); + memcpy(outbuffer + offset, &length_response_md5, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->response_md5, length_response_md5); + offset += length_response_md5; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_service_md5; + memcpy(&length_service_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_service_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_service_md5-1]=0; + this->service_md5 = (char *)(inbuffer + offset-1); + offset += length_service_md5; + uint32_t length_request_md5; + memcpy(&length_request_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_request_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_request_md5-1]=0; + this->request_md5 = (char *)(inbuffer + offset-1); + offset += length_request_md5; + uint32_t length_response_md5; + memcpy(&length_response_md5, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_response_md5; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_response_md5-1]=0; + this->response_md5 = (char *)(inbuffer + offset-1); + offset += length_response_md5; + return offset; + } + + const char * getType(){ return REQUESTSERVICEINFO; }; + const char * getMD5(){ return "c3d6dd25b909596479fbbc6559fa6874"; }; + + }; + + class RequestServiceInfo { + public: + typedef RequestServiceInfoRequest Request; + typedef RequestServiceInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/TopicInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/TopicInfo.h new file mode 100755 index 0000000..c4daf2d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/rosserial_msgs/TopicInfo.h @@ -0,0 +1,125 @@ +#ifndef _ROS_rosserial_msgs_TopicInfo_h +#define _ROS_rosserial_msgs_TopicInfo_h + +#include +#include +#include +#include "ros/msg.h" + +namespace rosserial_msgs +{ + + class TopicInfo : public ros::Msg + { + public: + uint16_t topic_id; + const char* topic_name; + const char* message_type; + const char* md5sum; + int32_t buffer_size; + enum { ID_PUBLISHER = 0 }; + enum { ID_SUBSCRIBER = 1 }; + enum { ID_SERVICE_SERVER = 2 }; + enum { ID_SERVICE_CLIENT = 4 }; + enum { ID_PARAMETER_REQUEST = 6 }; + enum { ID_LOG = 7 }; + enum { ID_TIME = 10 }; + enum { ID_TX_STOP = 11 }; + + TopicInfo(): + topic_id(0), + topic_name(""), + message_type(""), + md5sum(""), + buffer_size(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->topic_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->topic_id >> (8 * 1)) & 0xFF; + offset += sizeof(this->topic_id); + uint32_t length_topic_name = strlen(this->topic_name); + memcpy(outbuffer + offset, &length_topic_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic_name, length_topic_name); + offset += length_topic_name; + uint32_t length_message_type = strlen(this->message_type); + memcpy(outbuffer + offset, &length_message_type, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message_type, length_message_type); + offset += length_message_type; + uint32_t length_md5sum = strlen(this->md5sum); + memcpy(outbuffer + offset, &length_md5sum, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->md5sum, length_md5sum); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.real = this->buffer_size; + *(outbuffer + offset + 0) = (u_buffer_size.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buffer_size.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buffer_size.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buffer_size.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buffer_size); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->topic_id = ((uint16_t) (*(inbuffer + offset))); + this->topic_id |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->topic_id); + uint32_t length_topic_name; + memcpy(&length_topic_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic_name-1]=0; + this->topic_name = (char *)(inbuffer + offset-1); + offset += length_topic_name; + uint32_t length_message_type; + memcpy(&length_message_type, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message_type; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message_type-1]=0; + this->message_type = (char *)(inbuffer + offset-1); + offset += length_message_type; + uint32_t length_md5sum; + memcpy(&length_md5sum, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_md5sum; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_md5sum-1]=0; + this->md5sum = (char *)(inbuffer + offset-1); + offset += length_md5sum; + union { + int32_t real; + uint32_t base; + } u_buffer_size; + u_buffer_size.base = 0; + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_buffer_size.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->buffer_size = u_buffer_size.real; + offset += sizeof(this->buffer_size); + return offset; + } + + const char * getType(){ return "rosserial_msgs/TopicInfo"; }; + const char * getMD5(){ return "0ad51f88fc44892f8c10684077646005"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/BatteryState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/BatteryState.h new file mode 100755 index 0000000..0328963 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/BatteryState.h @@ -0,0 +1,308 @@ +#ifndef _ROS_sensor_msgs_BatteryState_h +#define _ROS_sensor_msgs_BatteryState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class BatteryState : public ros::Msg + { + public: + std_msgs::Header header; + float voltage; + float current; + float charge; + float capacity; + float design_capacity; + float percentage; + uint8_t power_supply_status; + uint8_t power_supply_health; + uint8_t power_supply_technology; + bool present; + uint8_t cell_voltage_length; + float st_cell_voltage; + float * cell_voltage; + const char* location; + const char* serial_number; + enum { POWER_SUPPLY_STATUS_UNKNOWN = 0 }; + enum { POWER_SUPPLY_STATUS_CHARGING = 1 }; + enum { POWER_SUPPLY_STATUS_DISCHARGING = 2 }; + enum { POWER_SUPPLY_STATUS_NOT_CHARGING = 3 }; + enum { POWER_SUPPLY_STATUS_FULL = 4 }; + enum { POWER_SUPPLY_HEALTH_UNKNOWN = 0 }; + enum { POWER_SUPPLY_HEALTH_GOOD = 1 }; + enum { POWER_SUPPLY_HEALTH_OVERHEAT = 2 }; + enum { POWER_SUPPLY_HEALTH_DEAD = 3 }; + enum { POWER_SUPPLY_HEALTH_OVERVOLTAGE = 4 }; + enum { POWER_SUPPLY_HEALTH_UNSPEC_FAILURE = 5 }; + enum { POWER_SUPPLY_HEALTH_COLD = 6 }; + enum { POWER_SUPPLY_HEALTH_WATCHDOG_TIMER_EXPIRE = 7 }; + enum { POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE = 8 }; + enum { POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0 }; + enum { POWER_SUPPLY_TECHNOLOGY_NIMH = 1 }; + enum { POWER_SUPPLY_TECHNOLOGY_LION = 2 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIPO = 3 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIFE = 4 }; + enum { POWER_SUPPLY_TECHNOLOGY_NICD = 5 }; + enum { POWER_SUPPLY_TECHNOLOGY_LIMN = 6 }; + + BatteryState(): + header(), + voltage(0), + current(0), + charge(0), + capacity(0), + design_capacity(0), + percentage(0), + power_supply_status(0), + power_supply_health(0), + power_supply_technology(0), + present(0), + cell_voltage_length(0), cell_voltage(NULL), + location(""), + serial_number("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.real = this->voltage; + *(outbuffer + offset + 0) = (u_voltage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_voltage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_voltage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_voltage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.real = this->current; + *(outbuffer + offset + 0) = (u_current.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_current.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_current.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_current.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_charge; + u_charge.real = this->charge; + *(outbuffer + offset + 0) = (u_charge.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_charge.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_charge.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_charge.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.real = this->capacity; + *(outbuffer + offset + 0) = (u_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.real = this->design_capacity; + *(outbuffer + offset + 0) = (u_design_capacity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_design_capacity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_design_capacity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_design_capacity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.real = this->percentage; + *(outbuffer + offset + 0) = (u_percentage.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_percentage.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_percentage.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_percentage.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->percentage); + *(outbuffer + offset + 0) = (this->power_supply_status >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_status); + *(outbuffer + offset + 0) = (this->power_supply_health >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_health); + *(outbuffer + offset + 0) = (this->power_supply_technology >> (8 * 0)) & 0xFF; + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.real = this->present; + *(outbuffer + offset + 0) = (u_present.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->present); + *(outbuffer + offset++) = cell_voltage_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_cell_voltagei; + u_cell_voltagei.real = this->cell_voltage[i]; + *(outbuffer + offset + 0) = (u_cell_voltagei.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_cell_voltagei.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_cell_voltagei.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_cell_voltagei.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->cell_voltage[i]); + } + uint32_t length_location = strlen(this->location); + memcpy(outbuffer + offset, &length_location, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->location, length_location); + offset += length_location; + uint32_t length_serial_number = strlen(this->serial_number); + memcpy(outbuffer + offset, &length_serial_number, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->serial_number, length_serial_number); + offset += length_serial_number; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_voltage; + u_voltage.base = 0; + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->voltage = u_voltage.real; + offset += sizeof(this->voltage); + union { + float real; + uint32_t base; + } u_current; + u_current.base = 0; + u_current.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_current.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->current = u_current.real; + offset += sizeof(this->current); + union { + float real; + uint32_t base; + } u_charge; + u_charge.base = 0; + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_charge.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->charge = u_charge.real; + offset += sizeof(this->charge); + union { + float real; + uint32_t base; + } u_capacity; + u_capacity.base = 0; + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->capacity = u_capacity.real; + offset += sizeof(this->capacity); + union { + float real; + uint32_t base; + } u_design_capacity; + u_design_capacity.base = 0; + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_design_capacity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->design_capacity = u_design_capacity.real; + offset += sizeof(this->design_capacity); + union { + float real; + uint32_t base; + } u_percentage; + u_percentage.base = 0; + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_percentage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->percentage = u_percentage.real; + offset += sizeof(this->percentage); + this->power_supply_status = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_status); + this->power_supply_health = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_health); + this->power_supply_technology = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->power_supply_technology); + union { + bool real; + uint8_t base; + } u_present; + u_present.base = 0; + u_present.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->present = u_present.real; + offset += sizeof(this->present); + uint8_t cell_voltage_lengthT = *(inbuffer + offset++); + if(cell_voltage_lengthT > cell_voltage_length) + this->cell_voltage = (float*)realloc(this->cell_voltage, cell_voltage_lengthT * sizeof(float)); + offset += 3; + cell_voltage_length = cell_voltage_lengthT; + for( uint8_t i = 0; i < cell_voltage_length; i++){ + union { + float real; + uint32_t base; + } u_st_cell_voltage; + u_st_cell_voltage.base = 0; + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_cell_voltage.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_cell_voltage = u_st_cell_voltage.real; + offset += sizeof(this->st_cell_voltage); + memcpy( &(this->cell_voltage[i]), &(this->st_cell_voltage), sizeof(float)); + } + uint32_t length_location; + memcpy(&length_location, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_location; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_location-1]=0; + this->location = (char *)(inbuffer + offset-1); + offset += length_location; + uint32_t length_serial_number; + memcpy(&length_serial_number, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_serial_number; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_serial_number-1]=0; + this->serial_number = (char *)(inbuffer + offset-1); + offset += length_serial_number; + return offset; + } + + const char * getType(){ return "sensor_msgs/BatteryState"; }; + const char * getMD5(){ return "476f837fa6771f6e16e3bf4ef96f8770"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/CameraInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/CameraInfo.h new file mode 100755 index 0000000..55280ed --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/CameraInfo.h @@ -0,0 +1,156 @@ +#ifndef _ROS_sensor_msgs_CameraInfo_h +#define _ROS_sensor_msgs_CameraInfo_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace sensor_msgs +{ + + class CameraInfo : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* distortion_model; + uint8_t D_length; + float st_D; + float * D; + float K[9]; + float R[9]; + float P[12]; + uint32_t binning_x; + uint32_t binning_y; + sensor_msgs::RegionOfInterest roi; + + CameraInfo(): + header(), + height(0), + width(0), + distortion_model(""), + D_length(0), D(NULL), + K(), + R(), + P(), + binning_x(0), + binning_y(0), + roi() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_distortion_model = strlen(this->distortion_model); + memcpy(outbuffer + offset, &length_distortion_model, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->distortion_model, length_distortion_model); + offset += length_distortion_model; + *(outbuffer + offset++) = D_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < D_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->D[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->K[i]); + } + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->R[i]); + } + for( uint8_t i = 0; i < 12; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->P[i]); + } + *(outbuffer + offset + 0) = (this->binning_x >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_x >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_x >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_x >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_x); + *(outbuffer + offset + 0) = (this->binning_y >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->binning_y >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->binning_y >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->binning_y >> (8 * 3)) & 0xFF; + offset += sizeof(this->binning_y); + offset += this->roi.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_distortion_model; + memcpy(&length_distortion_model, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_distortion_model; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_distortion_model-1]=0; + this->distortion_model = (char *)(inbuffer + offset-1); + offset += length_distortion_model; + uint8_t D_lengthT = *(inbuffer + offset++); + if(D_lengthT > D_length) + this->D = (float*)realloc(this->D, D_lengthT * sizeof(float)); + offset += 3; + D_length = D_lengthT; + for( uint8_t i = 0; i < D_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_D)); + memcpy( &(this->D[i]), &(this->st_D), sizeof(float)); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->K[i])); + } + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->R[i])); + } + for( uint8_t i = 0; i < 12; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->P[i])); + } + this->binning_x = ((uint32_t) (*(inbuffer + offset))); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_x |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_x); + this->binning_y = ((uint32_t) (*(inbuffer + offset))); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->binning_y |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->binning_y); + offset += this->roi.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "sensor_msgs/CameraInfo"; }; + const char * getMD5(){ return "c9a58c1b0b154e0e6da7578cb991d214"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h new file mode 100755 index 0000000..ed58158 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/ChannelFloat32.h @@ -0,0 +1,93 @@ +#ifndef _ROS_sensor_msgs_ChannelFloat32_h +#define _ROS_sensor_msgs_ChannelFloat32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class ChannelFloat32 : public ros::Msg + { + public: + const char* name; + uint8_t values_length; + float st_values; + float * values; + + ChannelFloat32(): + name(""), + values_length(0), values(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset++) = values_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_valuesi; + u_valuesi.real = this->values[i]; + *(outbuffer + offset + 0) = (u_valuesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_valuesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_valuesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_valuesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->values[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint8_t values_lengthT = *(inbuffer + offset++); + if(values_lengthT > values_length) + this->values = (float*)realloc(this->values, values_lengthT * sizeof(float)); + offset += 3; + values_length = values_lengthT; + for( uint8_t i = 0; i < values_length; i++){ + union { + float real; + uint32_t base; + } u_st_values; + u_st_values.base = 0; + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_values.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_values = u_st_values.real; + offset += sizeof(this->st_values); + memcpy( &(this->values[i]), &(this->st_values), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/ChannelFloat32"; }; + const char * getMD5(){ return "3d40139cdd33dfedcb71ffeeeb42ae7f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/CompressedImage.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/CompressedImage.h new file mode 100755 index 0000000..fdda842 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/CompressedImage.h @@ -0,0 +1,81 @@ +#ifndef _ROS_sensor_msgs_CompressedImage_h +#define _ROS_sensor_msgs_CompressedImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class CompressedImage : public ros::Msg + { + public: + std_msgs::Header header; + const char* format; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + CompressedImage(): + header(), + format(""), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_format = strlen(this->format); + memcpy(outbuffer + offset, &length_format, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->format, length_format); + offset += length_format; + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_format; + memcpy(&length_format, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_format; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_format-1]=0; + this->format = (char *)(inbuffer + offset-1); + offset += length_format; + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/CompressedImage"; }; + const char * getMD5(){ return "8f7a12909da2c9d3332d540a0977563f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/FluidPressure.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/FluidPressure.h new file mode 100755 index 0000000..b24e211 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/FluidPressure.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_FluidPressure_h +#define _ROS_sensor_msgs_FluidPressure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class FluidPressure : public ros::Msg + { + public: + std_msgs::Header header; + float fluid_pressure; + float variance; + + FluidPressure(): + header(), + fluid_pressure(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->fluid_pressure); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->fluid_pressure)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/FluidPressure"; }; + const char * getMD5(){ return "804dc5cea1c5306d6a2eb80b9833befe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Illuminance.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Illuminance.h new file mode 100755 index 0000000..7e21795 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Illuminance.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_Illuminance_h +#define _ROS_sensor_msgs_Illuminance_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Illuminance : public ros::Msg + { + public: + std_msgs::Header header; + float illuminance; + float variance; + + Illuminance(): + header(), + illuminance(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->illuminance); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->illuminance)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Illuminance"; }; + const char * getMD5(){ return "8cf5febb0952fca9d650c3d11a81a188"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Image.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Image.h new file mode 100755 index 0000000..2b7ba85 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Image.h @@ -0,0 +1,123 @@ +#ifndef _ROS_sensor_msgs_Image_h +#define _ROS_sensor_msgs_Image_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Image : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + const char* encoding; + uint8_t is_bigendian; + uint32_t step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + Image(): + header(), + height(0), + width(0), + encoding(""), + is_bigendian(0), + step(0), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + uint32_t length_encoding = strlen(this->encoding); + memcpy(outbuffer + offset, &length_encoding, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->encoding, length_encoding); + offset += length_encoding; + *(outbuffer + offset + 0) = (this->is_bigendian >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->step >> (8 * 3)) & 0xFF; + offset += sizeof(this->step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint32_t length_encoding; + memcpy(&length_encoding, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_encoding; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_encoding-1]=0; + this->encoding = (char *)(inbuffer + offset-1); + offset += length_encoding; + this->is_bigendian = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->is_bigendian); + this->step = ((uint32_t) (*(inbuffer + offset))); + this->step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Image"; }; + const char * getMD5(){ return "060021388200f6f0f447d0fcd9c64743"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Imu.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Imu.h new file mode 100755 index 0000000..7f7116e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Imu.h @@ -0,0 +1,81 @@ +#ifndef _ROS_sensor_msgs_Imu_h +#define _ROS_sensor_msgs_Imu_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Quaternion.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class Imu : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Quaternion orientation; + float orientation_covariance[9]; + geometry_msgs::Vector3 angular_velocity; + float angular_velocity_covariance[9]; + geometry_msgs::Vector3 linear_acceleration; + float linear_acceleration_covariance[9]; + + Imu(): + header(), + orientation(), + orientation_covariance(), + angular_velocity(), + angular_velocity_covariance(), + linear_acceleration(), + linear_acceleration_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->orientation.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->orientation_covariance[i]); + } + offset += this->angular_velocity.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->angular_velocity_covariance[i]); + } + offset += this->linear_acceleration.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->linear_acceleration_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->orientation.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->orientation_covariance[i])); + } + offset += this->angular_velocity.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->angular_velocity_covariance[i])); + } + offset += this->linear_acceleration.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->linear_acceleration_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Imu"; }; + const char * getMD5(){ return "6a62c6daae103f4ff57a132d6f95cec2"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JointState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JointState.h new file mode 100755 index 0000000..387b7f4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JointState.h @@ -0,0 +1,135 @@ +#ifndef _ROS_sensor_msgs_JointState_h +#define _ROS_sensor_msgs_JointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class JointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t name_length; + char* st_name; + char* * name; + uint8_t position_length; + float st_position; + float * position; + uint8_t velocity_length; + float st_velocity; + float * velocity; + uint8_t effort_length; + float st_effort; + float * effort; + + JointState(): + header(), + name_length(0), name(NULL), + position_length(0), position(NULL), + velocity_length(0), velocity(NULL), + effort_length(0), effort(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = name_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_namei = strlen(this->name[i]); + memcpy(outbuffer + offset, &length_namei, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name[i], length_namei); + offset += length_namei; + } + *(outbuffer + offset++) = position_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < position_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position[i]); + } + *(outbuffer + offset++) = velocity_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocity[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t name_lengthT = *(inbuffer + offset++); + if(name_lengthT > name_length) + this->name = (char**)realloc(this->name, name_lengthT * sizeof(char*)); + offset += 3; + name_length = name_lengthT; + for( uint8_t i = 0; i < name_length; i++){ + uint32_t length_st_name; + memcpy(&length_st_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_name-1]=0; + this->st_name = (char *)(inbuffer + offset-1); + offset += length_st_name; + memcpy( &(this->name[i]), &(this->st_name), sizeof(char*)); + } + uint8_t position_lengthT = *(inbuffer + offset++); + if(position_lengthT > position_length) + this->position = (float*)realloc(this->position, position_lengthT * sizeof(float)); + offset += 3; + position_length = position_lengthT; + for( uint8_t i = 0; i < position_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_position)); + memcpy( &(this->position[i]), &(this->st_position), sizeof(float)); + } + uint8_t velocity_lengthT = *(inbuffer + offset++); + if(velocity_lengthT > velocity_length) + this->velocity = (float*)realloc(this->velocity, velocity_lengthT * sizeof(float)); + offset += 3; + velocity_length = velocity_lengthT; + for( uint8_t i = 0; i < velocity_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocity)); + memcpy( &(this->velocity[i]), &(this->st_velocity), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JointState"; }; + const char * getMD5(){ return "3066dcd76a6cfaef579bd0f34173e9fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Joy.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Joy.h new file mode 100755 index 0000000..f8b5721 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Joy.h @@ -0,0 +1,121 @@ +#ifndef _ROS_sensor_msgs_Joy_h +#define _ROS_sensor_msgs_Joy_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Joy : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t axes_length; + float st_axes; + float * axes; + uint8_t buttons_length; + int32_t st_buttons; + int32_t * buttons; + + Joy(): + header(), + axes_length(0), axes(NULL), + buttons_length(0), buttons(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = axes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_axesi; + u_axesi.real = this->axes[i]; + *(outbuffer + offset + 0) = (u_axesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_axesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_axesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_axesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->axes[i]); + } + *(outbuffer + offset++) = buttons_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_buttonsi; + u_buttonsi.real = this->buttons[i]; + *(outbuffer + offset + 0) = (u_buttonsi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_buttonsi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_buttonsi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_buttonsi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->buttons[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t axes_lengthT = *(inbuffer + offset++); + if(axes_lengthT > axes_length) + this->axes = (float*)realloc(this->axes, axes_lengthT * sizeof(float)); + offset += 3; + axes_length = axes_lengthT; + for( uint8_t i = 0; i < axes_length; i++){ + union { + float real; + uint32_t base; + } u_st_axes; + u_st_axes.base = 0; + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_axes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_axes = u_st_axes.real; + offset += sizeof(this->st_axes); + memcpy( &(this->axes[i]), &(this->st_axes), sizeof(float)); + } + uint8_t buttons_lengthT = *(inbuffer + offset++); + if(buttons_lengthT > buttons_length) + this->buttons = (int32_t*)realloc(this->buttons, buttons_lengthT * sizeof(int32_t)); + offset += 3; + buttons_length = buttons_lengthT; + for( uint8_t i = 0; i < buttons_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_buttons; + u_st_buttons.base = 0; + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_buttons.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_buttons = u_st_buttons.real; + offset += sizeof(this->st_buttons); + memcpy( &(this->buttons[i]), &(this->st_buttons), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/Joy"; }; + const char * getMD5(){ return "5a9ea5f83505693b71e785041e67a8bb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JoyFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JoyFeedback.h new file mode 100755 index 0000000..dfea009 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JoyFeedback.h @@ -0,0 +1,76 @@ +#ifndef _ROS_sensor_msgs_JoyFeedback_h +#define _ROS_sensor_msgs_JoyFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class JoyFeedback : public ros::Msg + { + public: + uint8_t type; + uint8_t id; + float intensity; + enum { TYPE_LED = 0 }; + enum { TYPE_RUMBLE = 1 }; + enum { TYPE_BUZZER = 2 }; + + JoyFeedback(): + type(0), + id(0), + intensity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.real = this->intensity; + *(outbuffer + offset + 0) = (u_intensity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + this->id = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->id); + union { + float real; + uint32_t base; + } u_intensity; + u_intensity.base = 0; + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_intensity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->intensity = u_intensity.real; + offset += sizeof(this->intensity); + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedback"; }; + const char * getMD5(){ return "f4dcd73460360d98f36e55ee7f2e46f1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h new file mode 100755 index 0000000..9f0de2b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/JoyFeedbackArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_sensor_msgs_JoyFeedbackArray_h +#define _ROS_sensor_msgs_JoyFeedbackArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/JoyFeedback.h" + +namespace sensor_msgs +{ + + class JoyFeedbackArray : public ros::Msg + { + public: + uint8_t array_length; + sensor_msgs::JoyFeedback st_array; + sensor_msgs::JoyFeedback * array; + + JoyFeedbackArray(): + array_length(0), array(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = array_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->array[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t array_lengthT = *(inbuffer + offset++); + if(array_lengthT > array_length) + this->array = (sensor_msgs::JoyFeedback*)realloc(this->array, array_lengthT * sizeof(sensor_msgs::JoyFeedback)); + offset += 3; + array_length = array_lengthT; + for( uint8_t i = 0; i < array_length; i++){ + offset += this->st_array.deserialize(inbuffer + offset); + memcpy( &(this->array[i]), &(this->st_array), sizeof(sensor_msgs::JoyFeedback)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/JoyFeedbackArray"; }; + const char * getMD5(){ return "cde5730a895b1fc4dee6f91b754b213d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/LaserEcho.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/LaserEcho.h new file mode 100755 index 0000000..8d48ba5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/LaserEcho.h @@ -0,0 +1,77 @@ +#ifndef _ROS_sensor_msgs_LaserEcho_h +#define _ROS_sensor_msgs_LaserEcho_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class LaserEcho : public ros::Msg + { + public: + uint8_t echoes_length; + float st_echoes; + float * echoes; + + LaserEcho(): + echoes_length(0), echoes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = echoes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_echoesi; + u_echoesi.real = this->echoes[i]; + *(outbuffer + offset + 0) = (u_echoesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_echoesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_echoesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_echoesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->echoes[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t echoes_lengthT = *(inbuffer + offset++); + if(echoes_lengthT > echoes_length) + this->echoes = (float*)realloc(this->echoes, echoes_lengthT * sizeof(float)); + offset += 3; + echoes_length = echoes_lengthT; + for( uint8_t i = 0; i < echoes_length; i++){ + union { + float real; + uint32_t base; + } u_st_echoes; + u_st_echoes.base = 0; + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_echoes.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_echoes = u_st_echoes.real; + offset += sizeof(this->st_echoes); + memcpy( &(this->echoes[i]), &(this->st_echoes), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserEcho"; }; + const char * getMD5(){ return "8bc5ae449b200fba4d552b4225586696"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/LaserScan.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/LaserScan.h new file mode 100755 index 0000000..8276622 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/LaserScan.h @@ -0,0 +1,282 @@ +#ifndef _ROS_sensor_msgs_LaserScan_h +#define _ROS_sensor_msgs_LaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class LaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + float st_ranges; + float * ranges; + uint8_t intensities_length; + float st_intensities; + float * intensities; + + LaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_rangesi; + u_rangesi.real = this->ranges[i]; + *(outbuffer + offset + 0) = (u_rangesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_rangesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_rangesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_rangesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->ranges[i]); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_intensitiesi; + u_intensitiesi.real = this->intensities[i]; + *(outbuffer + offset + 0) = (u_intensitiesi.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_intensitiesi.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_intensitiesi.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_intensitiesi.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->intensities[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (float*)realloc(this->ranges, ranges_lengthT * sizeof(float)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + union { + float real; + uint32_t base; + } u_st_ranges; + u_st_ranges.base = 0; + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_ranges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_ranges = u_st_ranges.real; + offset += sizeof(this->st_ranges); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(float)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (float*)realloc(this->intensities, intensities_lengthT * sizeof(float)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + union { + float real; + uint32_t base; + } u_st_intensities; + u_st_intensities.base = 0; + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_intensities.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_intensities = u_st_intensities.real; + offset += sizeof(this->st_intensities); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/LaserScan"; }; + const char * getMD5(){ return "90c7ef2dc6895d81024acba2ac42f369"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MagneticField.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MagneticField.h new file mode 100755 index 0000000..b4a37c2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MagneticField.h @@ -0,0 +1,56 @@ +#ifndef _ROS_sensor_msgs_MagneticField_h +#define _ROS_sensor_msgs_MagneticField_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Vector3.h" + +namespace sensor_msgs +{ + + class MagneticField : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Vector3 magnetic_field; + float magnetic_field_covariance[9]; + + MagneticField(): + header(), + magnetic_field(), + magnetic_field_covariance() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->magnetic_field.serialize(outbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->magnetic_field_covariance[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->magnetic_field.deserialize(inbuffer + offset); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->magnetic_field_covariance[i])); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MagneticField"; }; + const char * getMD5(){ return "2f3b0b43eed0c9501de0fa3ff89a45aa"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h new file mode 100755 index 0000000..af5ab91 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MultiDOFJointState.h @@ -0,0 +1,138 @@ +#ifndef _ROS_sensor_msgs_MultiDOFJointState_h +#define _ROS_sensor_msgs_MultiDOFJointState_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "geometry_msgs/Wrench.h" + +namespace sensor_msgs +{ + + class MultiDOFJointState : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t twist_length; + geometry_msgs::Twist st_twist; + geometry_msgs::Twist * twist; + uint8_t wrench_length; + geometry_msgs::Wrench st_wrench; + geometry_msgs::Wrench * wrench; + + MultiDOFJointState(): + header(), + joint_names_length(0), joint_names(NULL), + transforms_length(0), transforms(NULL), + twist_length(0), twist(NULL), + wrench_length(0), wrench(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = twist_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->twist[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = wrench_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->wrench[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t twist_lengthT = *(inbuffer + offset++); + if(twist_lengthT > twist_length) + this->twist = (geometry_msgs::Twist*)realloc(this->twist, twist_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + twist_length = twist_lengthT; + for( uint8_t i = 0; i < twist_length; i++){ + offset += this->st_twist.deserialize(inbuffer + offset); + memcpy( &(this->twist[i]), &(this->st_twist), sizeof(geometry_msgs::Twist)); + } + uint8_t wrench_lengthT = *(inbuffer + offset++); + if(wrench_lengthT > wrench_length) + this->wrench = (geometry_msgs::Wrench*)realloc(this->wrench, wrench_lengthT * sizeof(geometry_msgs::Wrench)); + offset += 3; + wrench_length = wrench_lengthT; + for( uint8_t i = 0; i < wrench_length; i++){ + offset += this->st_wrench.deserialize(inbuffer + offset); + memcpy( &(this->wrench[i]), &(this->st_wrench), sizeof(geometry_msgs::Wrench)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiDOFJointState"; }; + const char * getMD5(){ return "690f272f0640d2631c305eeb8301e59d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h new file mode 100755 index 0000000..142be5f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/MultiEchoLaserScan.h @@ -0,0 +1,245 @@ +#ifndef _ROS_sensor_msgs_MultiEchoLaserScan_h +#define _ROS_sensor_msgs_MultiEchoLaserScan_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/LaserEcho.h" + +namespace sensor_msgs +{ + + class MultiEchoLaserScan : public ros::Msg + { + public: + std_msgs::Header header; + float angle_min; + float angle_max; + float angle_increment; + float time_increment; + float scan_time; + float range_min; + float range_max; + uint8_t ranges_length; + sensor_msgs::LaserEcho st_ranges; + sensor_msgs::LaserEcho * ranges; + uint8_t intensities_length; + sensor_msgs::LaserEcho st_intensities; + sensor_msgs::LaserEcho * intensities; + + MultiEchoLaserScan(): + header(), + angle_min(0), + angle_max(0), + angle_increment(0), + time_increment(0), + scan_time(0), + range_min(0), + range_max(0), + ranges_length(0), ranges(NULL), + intensities_length(0), intensities(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.real = this->angle_min; + *(outbuffer + offset + 0) = (u_angle_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.real = this->angle_max; + *(outbuffer + offset + 0) = (u_angle_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.real = this->angle_increment; + *(outbuffer + offset + 0) = (u_angle_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angle_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angle_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angle_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.real = this->time_increment; + *(outbuffer + offset + 0) = (u_time_increment.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_time_increment.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_time_increment.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_time_increment.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.real = this->scan_time; + *(outbuffer + offset + 0) = (u_scan_time.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scan_time.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scan_time.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scan_time.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.real = this->range_min; + *(outbuffer + offset + 0) = (u_range_min.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_min.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_min.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_min.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.real = this->range_max; + *(outbuffer + offset + 0) = (u_range_max.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range_max.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range_max.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range_max.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range_max); + *(outbuffer + offset++) = ranges_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->ranges[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = intensities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->intensities[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_angle_min; + u_angle_min.base = 0; + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_min = u_angle_min.real; + offset += sizeof(this->angle_min); + union { + float real; + uint32_t base; + } u_angle_max; + u_angle_max.base = 0; + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_max = u_angle_max.real; + offset += sizeof(this->angle_max); + union { + float real; + uint32_t base; + } u_angle_increment; + u_angle_increment.base = 0; + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angle_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angle_increment = u_angle_increment.real; + offset += sizeof(this->angle_increment); + union { + float real; + uint32_t base; + } u_time_increment; + u_time_increment.base = 0; + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_time_increment.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->time_increment = u_time_increment.real; + offset += sizeof(this->time_increment); + union { + float real; + uint32_t base; + } u_scan_time; + u_scan_time.base = 0; + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scan_time.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scan_time = u_scan_time.real; + offset += sizeof(this->scan_time); + union { + float real; + uint32_t base; + } u_range_min; + u_range_min.base = 0; + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_min.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_min = u_range_min.real; + offset += sizeof(this->range_min); + union { + float real; + uint32_t base; + } u_range_max; + u_range_max.base = 0; + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range_max.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range_max = u_range_max.real; + offset += sizeof(this->range_max); + uint8_t ranges_lengthT = *(inbuffer + offset++); + if(ranges_lengthT > ranges_length) + this->ranges = (sensor_msgs::LaserEcho*)realloc(this->ranges, ranges_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + ranges_length = ranges_lengthT; + for( uint8_t i = 0; i < ranges_length; i++){ + offset += this->st_ranges.deserialize(inbuffer + offset); + memcpy( &(this->ranges[i]), &(this->st_ranges), sizeof(sensor_msgs::LaserEcho)); + } + uint8_t intensities_lengthT = *(inbuffer + offset++); + if(intensities_lengthT > intensities_length) + this->intensities = (sensor_msgs::LaserEcho*)realloc(this->intensities, intensities_lengthT * sizeof(sensor_msgs::LaserEcho)); + offset += 3; + intensities_length = intensities_lengthT; + for( uint8_t i = 0; i < intensities_length; i++){ + offset += this->st_intensities.deserialize(inbuffer + offset); + memcpy( &(this->intensities[i]), &(this->st_intensities), sizeof(sensor_msgs::LaserEcho)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/MultiEchoLaserScan"; }; + const char * getMD5(){ return "6fefb0c6da89d7c8abe4b339f5c2f8fb"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/NavSatFix.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/NavSatFix.h new file mode 100755 index 0000000..ba06e0c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/NavSatFix.h @@ -0,0 +1,78 @@ +#ifndef _ROS_sensor_msgs_NavSatFix_h +#define _ROS_sensor_msgs_NavSatFix_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/NavSatStatus.h" + +namespace sensor_msgs +{ + + class NavSatFix : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::NavSatStatus status; + float latitude; + float longitude; + float altitude; + float position_covariance[9]; + uint8_t position_covariance_type; + enum { COVARIANCE_TYPE_UNKNOWN = 0 }; + enum { COVARIANCE_TYPE_APPROXIMATED = 1 }; + enum { COVARIANCE_TYPE_DIAGONAL_KNOWN = 2 }; + enum { COVARIANCE_TYPE_KNOWN = 3 }; + + NavSatFix(): + header(), + status(), + latitude(0), + longitude(0), + altitude(0), + position_covariance(), + position_covariance_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->latitude); + offset += serializeAvrFloat64(outbuffer + offset, this->longitude); + offset += serializeAvrFloat64(outbuffer + offset, this->altitude); + for( uint8_t i = 0; i < 9; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->position_covariance[i]); + } + *(outbuffer + offset + 0) = (this->position_covariance_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->position_covariance_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->latitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->longitude)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->altitude)); + for( uint8_t i = 0; i < 9; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->position_covariance[i])); + } + this->position_covariance_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->position_covariance_type); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatFix"; }; + const char * getMD5(){ return "2d3a8cd499b9b4a0249fb98fd05cfa48"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/NavSatStatus.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/NavSatStatus.h new file mode 100755 index 0000000..f696571 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/NavSatStatus.h @@ -0,0 +1,71 @@ +#ifndef _ROS_sensor_msgs_NavSatStatus_h +#define _ROS_sensor_msgs_NavSatStatus_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class NavSatStatus : public ros::Msg + { + public: + int8_t status; + uint16_t service; + enum { STATUS_NO_FIX = -1 }; + enum { STATUS_FIX = 0 }; + enum { STATUS_SBAS_FIX = 1 }; + enum { STATUS_GBAS_FIX = 2 }; + enum { SERVICE_GPS = 1 }; + enum { SERVICE_GLONASS = 2 }; + enum { SERVICE_COMPASS = 4 }; + enum { SERVICE_GALILEO = 8 }; + + NavSatStatus(): + status(0), + service(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.real = this->status; + *(outbuffer + offset + 0) = (u_status.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->status); + *(outbuffer + offset + 0) = (this->service >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->service >> (8 * 1)) & 0xFF; + offset += sizeof(this->service); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_status; + u_status.base = 0; + u_status.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->status = u_status.real; + offset += sizeof(this->status); + this->service = ((uint16_t) (*(inbuffer + offset))); + this->service |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->service); + return offset; + } + + const char * getType(){ return "sensor_msgs/NavSatStatus"; }; + const char * getMD5(){ return "331cdbddfa4bc96ffc3b9ad98900a54c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointCloud.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointCloud.h new file mode 100755 index 0000000..ce7f775 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointCloud.h @@ -0,0 +1,85 @@ +#ifndef _ROS_sensor_msgs_PointCloud_h +#define _ROS_sensor_msgs_PointCloud_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point32.h" +#include "sensor_msgs/ChannelFloat32.h" + +namespace sensor_msgs +{ + + class PointCloud : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t points_length; + geometry_msgs::Point32 st_points; + geometry_msgs::Point32 * points; + uint8_t channels_length; + sensor_msgs::ChannelFloat32 st_channels; + sensor_msgs::ChannelFloat32 * channels; + + PointCloud(): + header(), + points_length(0), points(NULL), + channels_length(0), channels(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = channels_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->channels[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point32*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point32)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point32)); + } + uint8_t channels_lengthT = *(inbuffer + offset++); + if(channels_lengthT > channels_length) + this->channels = (sensor_msgs::ChannelFloat32*)realloc(this->channels, channels_lengthT * sizeof(sensor_msgs::ChannelFloat32)); + offset += 3; + channels_length = channels_lengthT; + for( uint8_t i = 0; i < channels_length; i++){ + offset += this->st_channels.deserialize(inbuffer + offset); + memcpy( &(this->channels[i]), &(this->st_channels), sizeof(sensor_msgs::ChannelFloat32)); + } + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud"; }; + const char * getMD5(){ return "d8e9c3f5afbdd8a130fd1d2763945fca"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointCloud2.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointCloud2.h new file mode 100755 index 0000000..8b50802 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointCloud2.h @@ -0,0 +1,168 @@ +#ifndef _ROS_sensor_msgs_PointCloud2_h +#define _ROS_sensor_msgs_PointCloud2_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/PointField.h" + +namespace sensor_msgs +{ + + class PointCloud2 : public ros::Msg + { + public: + std_msgs::Header header; + uint32_t height; + uint32_t width; + uint8_t fields_length; + sensor_msgs::PointField st_fields; + sensor_msgs::PointField * fields; + bool is_bigendian; + uint32_t point_step; + uint32_t row_step; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + bool is_dense; + + PointCloud2(): + header(), + height(0), + width(0), + fields_length(0), fields(NULL), + is_bigendian(0), + point_step(0), + row_step(0), + data_length(0), data(NULL), + is_dense(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset++) = fields_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->fields[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.real = this->is_bigendian; + *(outbuffer + offset + 0) = (u_is_bigendian.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_bigendian); + *(outbuffer + offset + 0) = (this->point_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->point_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->point_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->point_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->point_step); + *(outbuffer + offset + 0) = (this->row_step >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->row_step >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->row_step >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->row_step >> (8 * 3)) & 0xFF; + offset += sizeof(this->row_step); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.real = this->is_dense; + *(outbuffer + offset + 0) = (u_is_dense.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->is_dense); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + uint8_t fields_lengthT = *(inbuffer + offset++); + if(fields_lengthT > fields_length) + this->fields = (sensor_msgs::PointField*)realloc(this->fields, fields_lengthT * sizeof(sensor_msgs::PointField)); + offset += 3; + fields_length = fields_lengthT; + for( uint8_t i = 0; i < fields_length; i++){ + offset += this->st_fields.deserialize(inbuffer + offset); + memcpy( &(this->fields[i]), &(this->st_fields), sizeof(sensor_msgs::PointField)); + } + union { + bool real; + uint8_t base; + } u_is_bigendian; + u_is_bigendian.base = 0; + u_is_bigendian.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_bigendian = u_is_bigendian.real; + offset += sizeof(this->is_bigendian); + this->point_step = ((uint32_t) (*(inbuffer + offset))); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->point_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->point_step); + this->row_step = ((uint32_t) (*(inbuffer + offset))); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->row_step |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->row_step); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + bool real; + uint8_t base; + } u_is_dense; + u_is_dense.base = 0; + u_is_dense.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->is_dense = u_is_dense.real; + offset += sizeof(this->is_dense); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointCloud2"; }; + const char * getMD5(){ return "1158d486dd51d683ce2f1be655c3c181"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointField.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointField.h new file mode 100755 index 0000000..5ef0d0e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/PointField.h @@ -0,0 +1,92 @@ +#ifndef _ROS_sensor_msgs_PointField_h +#define _ROS_sensor_msgs_PointField_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class PointField : public ros::Msg + { + public: + const char* name; + uint32_t offset; + uint8_t datatype; + uint32_t count; + enum { INT8 = 1 }; + enum { UINT8 = 2 }; + enum { INT16 = 3 }; + enum { UINT16 = 4 }; + enum { INT32 = 5 }; + enum { UINT32 = 6 }; + enum { FLOAT32 = 7 }; + enum { FLOAT64 = 8 }; + + PointField(): + name(""), + offset(0), + datatype(0), + count(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + *(outbuffer + offset + 0) = (this->offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->offset); + *(outbuffer + offset + 0) = (this->datatype >> (8 * 0)) & 0xFF; + offset += sizeof(this->datatype); + *(outbuffer + offset + 0) = (this->count >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->count >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->count >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->count >> (8 * 3)) & 0xFF; + offset += sizeof(this->count); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + this->offset = ((uint32_t) (*(inbuffer + offset))); + this->offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->offset); + this->datatype = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->datatype); + this->count = ((uint32_t) (*(inbuffer + offset))); + this->count |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->count |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->count |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->count); + return offset; + } + + const char * getType(){ return "sensor_msgs/PointField"; }; + const char * getMD5(){ return "268eacb2962780ceac86cbd17e328150"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Range.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Range.h new file mode 100755 index 0000000..a8ddcaa --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Range.h @@ -0,0 +1,143 @@ +#ifndef _ROS_sensor_msgs_Range_h +#define _ROS_sensor_msgs_Range_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Range : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t radiation_type; + float field_of_view; + float min_range; + float max_range; + float range; + enum { ULTRASOUND = 0 }; + enum { INFRARED = 1 }; + + Range(): + header(), + radiation_type(0), + field_of_view(0), + min_range(0), + max_range(0), + range(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->radiation_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.real = this->field_of_view; + *(outbuffer + offset + 0) = (u_field_of_view.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_field_of_view.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_field_of_view.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_field_of_view.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.real = this->min_range; + *(outbuffer + offset + 0) = (u_min_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.real = this->max_range; + *(outbuffer + offset + 0) = (u_max_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.real = this->range; + *(outbuffer + offset + 0) = (u_range.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_range.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_range.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_range.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->range); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->radiation_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->radiation_type); + union { + float real; + uint32_t base; + } u_field_of_view; + u_field_of_view.base = 0; + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_field_of_view.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->field_of_view = u_field_of_view.real; + offset += sizeof(this->field_of_view); + union { + float real; + uint32_t base; + } u_min_range; + u_min_range.base = 0; + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_range = u_min_range.real; + offset += sizeof(this->min_range); + union { + float real; + uint32_t base; + } u_max_range; + u_max_range.base = 0; + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_range = u_max_range.real; + offset += sizeof(this->max_range); + union { + float real; + uint32_t base; + } u_range; + u_range.base = 0; + u_range.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_range.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->range = u_range.real; + offset += sizeof(this->range); + return offset; + } + + const char * getType(){ return "sensor_msgs/Range"; }; + const char * getMD5(){ return "c005c34273dc426c67a020a87bc24148"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h new file mode 100755 index 0000000..ebdb9b3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/RegionOfInterest.h @@ -0,0 +1,103 @@ +#ifndef _ROS_sensor_msgs_RegionOfInterest_h +#define _ROS_sensor_msgs_RegionOfInterest_h + +#include +#include +#include +#include "ros/msg.h" + +namespace sensor_msgs +{ + + class RegionOfInterest : public ros::Msg + { + public: + uint32_t x_offset; + uint32_t y_offset; + uint32_t height; + uint32_t width; + bool do_rectify; + + RegionOfInterest(): + x_offset(0), + y_offset(0), + height(0), + width(0), + do_rectify(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->x_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->x_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->x_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->x_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->x_offset); + *(outbuffer + offset + 0) = (this->y_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->y_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->y_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->y_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->y_offset); + *(outbuffer + offset + 0) = (this->height >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->height >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->height >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->height >> (8 * 3)) & 0xFF; + offset += sizeof(this->height); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->width >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->width >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->width >> (8 * 3)) & 0xFF; + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.real = this->do_rectify; + *(outbuffer + offset + 0) = (u_do_rectify.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->do_rectify); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->x_offset = ((uint32_t) (*(inbuffer + offset))); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->x_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->x_offset); + this->y_offset = ((uint32_t) (*(inbuffer + offset))); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->y_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->y_offset); + this->height = ((uint32_t) (*(inbuffer + offset))); + this->height |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->height |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->height |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->height); + this->width = ((uint32_t) (*(inbuffer + offset))); + this->width |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->width |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->width |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->width); + union { + bool real; + uint8_t base; + } u_do_rectify; + u_do_rectify.base = 0; + u_do_rectify.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->do_rectify = u_do_rectify.real; + offset += sizeof(this->do_rectify); + return offset; + } + + const char * getType(){ return "sensor_msgs/RegionOfInterest"; }; + const char * getMD5(){ return "bdb633039d588fcccb441a4d43ccfe09"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h new file mode 100755 index 0000000..2ec392a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/RelativeHumidity.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_RelativeHumidity_h +#define _ROS_sensor_msgs_RelativeHumidity_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class RelativeHumidity : public ros::Msg + { + public: + std_msgs::Header header; + float relative_humidity; + float variance; + + RelativeHumidity(): + header(), + relative_humidity(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->relative_humidity); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->relative_humidity)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/RelativeHumidity"; }; + const char * getMD5(){ return "8730015b05955b7e992ce29a2678d90f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h new file mode 100755 index 0000000..9f49b67 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/SetCameraInfo.h @@ -0,0 +1,108 @@ +#ifndef _ROS_SERVICE_SetCameraInfo_h +#define _ROS_SERVICE_SetCameraInfo_h +#include +#include +#include +#include "ros/msg.h" +#include "sensor_msgs/CameraInfo.h" + +namespace sensor_msgs +{ + +static const char SETCAMERAINFO[] = "sensor_msgs/SetCameraInfo"; + + class SetCameraInfoRequest : public ros::Msg + { + public: + sensor_msgs::CameraInfo camera_info; + + SetCameraInfoRequest(): + camera_info() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->camera_info.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->camera_info.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "ee34be01fdeee563d0d99cd594d5581d"; }; + + }; + + class SetCameraInfoResponse : public ros::Msg + { + public: + bool success; + const char* status_message; + + SetCameraInfoResponse(): + success(0), + status_message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_status_message = strlen(this->status_message); + memcpy(outbuffer + offset, &length_status_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->status_message, length_status_message); + offset += length_status_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_status_message; + memcpy(&length_status_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_status_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_status_message-1]=0; + this->status_message = (char *)(inbuffer + offset-1); + offset += length_status_message; + return offset; + } + + const char * getType(){ return SETCAMERAINFO; }; + const char * getMD5(){ return "2ec6f3eff0161f4257b808b12bc830c2"; }; + + }; + + class SetCameraInfo { + public: + typedef SetCameraInfoRequest Request; + typedef SetCameraInfoResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Temperature.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Temperature.h new file mode 100755 index 0000000..f630a39 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/Temperature.h @@ -0,0 +1,51 @@ +#ifndef _ROS_sensor_msgs_Temperature_h +#define _ROS_sensor_msgs_Temperature_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace sensor_msgs +{ + + class Temperature : public ros::Msg + { + public: + std_msgs::Header header; + float temperature; + float variance; + + Temperature(): + header(), + temperature(0), + variance(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += serializeAvrFloat64(outbuffer + offset, this->temperature); + offset += serializeAvrFloat64(outbuffer + offset, this->variance); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->temperature)); + offset += deserializeAvrFloat64(inbuffer + offset, &(this->variance)); + return offset; + } + + const char * getType(){ return "sensor_msgs/Temperature"; }; + const char * getMD5(){ return "ff71b307acdbe7c871a5a6d7ed359100"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/TimeReference.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/TimeReference.h new file mode 100755 index 0000000..eab85e6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/sensor_msgs/TimeReference.h @@ -0,0 +1,82 @@ +#ifndef _ROS_sensor_msgs_TimeReference_h +#define _ROS_sensor_msgs_TimeReference_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "ros/time.h" + +namespace sensor_msgs +{ + + class TimeReference : public ros::Msg + { + public: + std_msgs::Header header; + ros::Time time_ref; + const char* source; + + TimeReference(): + header(), + time_ref(), + source("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->time_ref.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.sec); + *(outbuffer + offset + 0) = (this->time_ref.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_ref.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_ref.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_ref.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_ref.nsec); + uint32_t length_source = strlen(this->source); + memcpy(outbuffer + offset, &length_source, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source, length_source); + offset += length_source; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + this->time_ref.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.sec); + this->time_ref.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_ref.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_ref.nsec); + uint32_t length_source; + memcpy(&length_source, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source-1]=0; + this->source = (char *)(inbuffer + offset-1); + offset += length_source; + return offset; + } + + const char * getType(){ return "sensor_msgs/TimeReference"; }; + const char * getMD5(){ return "fded64a0265108ba86c3d38fb11c0c16"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/Mesh.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/Mesh.h new file mode 100755 index 0000000..8a12baa --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/Mesh.h @@ -0,0 +1,80 @@ +#ifndef _ROS_shape_msgs_Mesh_h +#define _ROS_shape_msgs_Mesh_h + +#include +#include +#include +#include "ros/msg.h" +#include "shape_msgs/MeshTriangle.h" +#include "geometry_msgs/Point.h" + +namespace shape_msgs +{ + + class Mesh : public ros::Msg + { + public: + uint8_t triangles_length; + shape_msgs::MeshTriangle st_triangles; + shape_msgs::MeshTriangle * triangles; + uint8_t vertices_length; + geometry_msgs::Point st_vertices; + geometry_msgs::Point * vertices; + + Mesh(): + triangles_length(0), triangles(NULL), + vertices_length(0), vertices(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = triangles_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->triangles[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = vertices_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->vertices[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t triangles_lengthT = *(inbuffer + offset++); + if(triangles_lengthT > triangles_length) + this->triangles = (shape_msgs::MeshTriangle*)realloc(this->triangles, triangles_lengthT * sizeof(shape_msgs::MeshTriangle)); + offset += 3; + triangles_length = triangles_lengthT; + for( uint8_t i = 0; i < triangles_length; i++){ + offset += this->st_triangles.deserialize(inbuffer + offset); + memcpy( &(this->triangles[i]), &(this->st_triangles), sizeof(shape_msgs::MeshTriangle)); + } + uint8_t vertices_lengthT = *(inbuffer + offset++); + if(vertices_lengthT > vertices_length) + this->vertices = (geometry_msgs::Point*)realloc(this->vertices, vertices_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + vertices_length = vertices_lengthT; + for( uint8_t i = 0; i < vertices_length; i++){ + offset += this->st_vertices.deserialize(inbuffer + offset); + memcpy( &(this->vertices[i]), &(this->st_vertices), sizeof(geometry_msgs::Point)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Mesh"; }; + const char * getMD5(){ return "1ffdae9486cd3316a121c578b47a85cc"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/MeshTriangle.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/MeshTriangle.h new file mode 100755 index 0000000..1cb7e99 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/MeshTriangle.h @@ -0,0 +1,54 @@ +#ifndef _ROS_shape_msgs_MeshTriangle_h +#define _ROS_shape_msgs_MeshTriangle_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class MeshTriangle : public ros::Msg + { + public: + uint32_t vertex_indices[3]; + + MeshTriangle(): + vertex_indices() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + for( uint8_t i = 0; i < 3; i++){ + *(outbuffer + offset + 0) = (this->vertex_indices[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->vertex_indices[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->vertex_indices[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->vertex_indices[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 3; i++){ + this->vertex_indices[i] = ((uint32_t) (*(inbuffer + offset))); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->vertex_indices[i] |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->vertex_indices[i]); + } + return offset; + } + + const char * getType(){ return "shape_msgs/MeshTriangle"; }; + const char * getMD5(){ return "23688b2e6d2de3d32fe8af104a903253"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/Plane.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/Plane.h new file mode 100755 index 0000000..b6c4d77 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/Plane.h @@ -0,0 +1,46 @@ +#ifndef _ROS_shape_msgs_Plane_h +#define _ROS_shape_msgs_Plane_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class Plane : public ros::Msg + { + public: + float coef[4]; + + Plane(): + coef() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->coef[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + for( uint8_t i = 0; i < 4; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->coef[i])); + } + return offset; + } + + const char * getType(){ return "shape_msgs/Plane"; }; + const char * getMD5(){ return "2c1b92ed8f31492f8e73f6a4a44ca796"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/SolidPrimitive.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/SolidPrimitive.h new file mode 100755 index 0000000..ba1974d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/shape_msgs/SolidPrimitive.h @@ -0,0 +1,76 @@ +#ifndef _ROS_shape_msgs_SolidPrimitive_h +#define _ROS_shape_msgs_SolidPrimitive_h + +#include +#include +#include +#include "ros/msg.h" + +namespace shape_msgs +{ + + class SolidPrimitive : public ros::Msg + { + public: + uint8_t type; + uint8_t dimensions_length; + float st_dimensions; + float * dimensions; + enum { BOX = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { CONE = 4 }; + enum { BOX_X = 0 }; + enum { BOX_Y = 1 }; + enum { BOX_Z = 2 }; + enum { SPHERE_RADIUS = 0 }; + enum { CYLINDER_HEIGHT = 0 }; + enum { CYLINDER_RADIUS = 1 }; + enum { CONE_HEIGHT = 0 }; + enum { CONE_RADIUS = 1 }; + + SolidPrimitive(): + type(0), + dimensions_length(0), dimensions(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = dimensions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->dimensions[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t dimensions_lengthT = *(inbuffer + offset++); + if(dimensions_lengthT > dimensions_length) + this->dimensions = (float*)realloc(this->dimensions, dimensions_lengthT * sizeof(float)); + offset += 3; + dimensions_length = dimensions_lengthT; + for( uint8_t i = 0; i < dimensions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_dimensions)); + memcpy( &(this->dimensions[i]), &(this->st_dimensions), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "shape_msgs/SolidPrimitive"; }; + const char * getMD5(){ return "d8f8cbc74c5ff283fca29569ccefb45d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h new file mode 100755 index 0000000..aa0b000 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerInitialStatusCmd.h @@ -0,0 +1,102 @@ +#ifndef _ROS_smach_msgs_SmachContainerInitialStatusCmd_h +#define _ROS_smach_msgs_SmachContainerInitialStatusCmd_h + +#include +#include +#include +#include "ros/msg.h" + +namespace smach_msgs +{ + + class SmachContainerInitialStatusCmd : public ros::Msg + { + public: + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + const char* local_data; + + SmachContainerInitialStatusCmd(): + path(""), + initial_states_length(0), initial_states(NULL), + local_data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerInitialStatusCmd"; }; + const char * getMD5(){ return "45f8cf31fc29b829db77f23001f788d6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h new file mode 100755 index 0000000..73300de --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerStatus.h @@ -0,0 +1,155 @@ +#ifndef _ROS_smach_msgs_SmachContainerStatus_h +#define _ROS_smach_msgs_SmachContainerStatus_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStatus : public ros::Msg + { + public: + std_msgs::Header header; + const char* path; + uint8_t initial_states_length; + char* st_initial_states; + char* * initial_states; + uint8_t active_states_length; + char* st_active_states; + char* * active_states; + const char* local_data; + const char* info; + + SmachContainerStatus(): + header(), + path(""), + initial_states_length(0), initial_states(NULL), + active_states_length(0), active_states(NULL), + local_data(""), + info("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = initial_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_initial_statesi = strlen(this->initial_states[i]); + memcpy(outbuffer + offset, &length_initial_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->initial_states[i], length_initial_statesi); + offset += length_initial_statesi; + } + *(outbuffer + offset++) = active_states_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_active_statesi = strlen(this->active_states[i]); + memcpy(outbuffer + offset, &length_active_statesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->active_states[i], length_active_statesi); + offset += length_active_statesi; + } + uint32_t length_local_data = strlen(this->local_data); + memcpy(outbuffer + offset, &length_local_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->local_data, length_local_data); + offset += length_local_data; + uint32_t length_info = strlen(this->info); + memcpy(outbuffer + offset, &length_info, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->info, length_info); + offset += length_info; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t initial_states_lengthT = *(inbuffer + offset++); + if(initial_states_lengthT > initial_states_length) + this->initial_states = (char**)realloc(this->initial_states, initial_states_lengthT * sizeof(char*)); + offset += 3; + initial_states_length = initial_states_lengthT; + for( uint8_t i = 0; i < initial_states_length; i++){ + uint32_t length_st_initial_states; + memcpy(&length_st_initial_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_initial_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_initial_states-1]=0; + this->st_initial_states = (char *)(inbuffer + offset-1); + offset += length_st_initial_states; + memcpy( &(this->initial_states[i]), &(this->st_initial_states), sizeof(char*)); + } + uint8_t active_states_lengthT = *(inbuffer + offset++); + if(active_states_lengthT > active_states_length) + this->active_states = (char**)realloc(this->active_states, active_states_lengthT * sizeof(char*)); + offset += 3; + active_states_length = active_states_lengthT; + for( uint8_t i = 0; i < active_states_length; i++){ + uint32_t length_st_active_states; + memcpy(&length_st_active_states, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_active_states; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_active_states-1]=0; + this->st_active_states = (char *)(inbuffer + offset-1); + offset += length_st_active_states; + memcpy( &(this->active_states[i]), &(this->st_active_states), sizeof(char*)); + } + uint32_t length_local_data; + memcpy(&length_local_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_local_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_local_data-1]=0; + this->local_data = (char *)(inbuffer + offset-1); + offset += length_local_data; + uint32_t length_info; + memcpy(&length_info, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_info; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_info-1]=0; + this->info = (char *)(inbuffer + offset-1); + offset += length_info; + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStatus"; }; + const char * getMD5(){ return "5ba2bb79ac19e3842d562a191f2a675b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h new file mode 100755 index 0000000..c03ed2e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/smach_msgs/SmachContainerStructure.h @@ -0,0 +1,219 @@ +#ifndef _ROS_smach_msgs_SmachContainerStructure_h +#define _ROS_smach_msgs_SmachContainerStructure_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace smach_msgs +{ + + class SmachContainerStructure : public ros::Msg + { + public: + std_msgs::Header header; + const char* path; + uint8_t children_length; + char* st_children; + char* * children; + uint8_t internal_outcomes_length; + char* st_internal_outcomes; + char* * internal_outcomes; + uint8_t outcomes_from_length; + char* st_outcomes_from; + char* * outcomes_from; + uint8_t outcomes_to_length; + char* st_outcomes_to; + char* * outcomes_to; + uint8_t container_outcomes_length; + char* st_container_outcomes; + char* * container_outcomes; + + SmachContainerStructure(): + header(), + path(""), + children_length(0), children(NULL), + internal_outcomes_length(0), internal_outcomes(NULL), + outcomes_from_length(0), outcomes_from(NULL), + outcomes_to_length(0), outcomes_to(NULL), + container_outcomes_length(0), container_outcomes(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_path = strlen(this->path); + memcpy(outbuffer + offset, &length_path, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->path, length_path); + offset += length_path; + *(outbuffer + offset++) = children_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_childreni = strlen(this->children[i]); + memcpy(outbuffer + offset, &length_childreni, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->children[i], length_childreni); + offset += length_childreni; + } + *(outbuffer + offset++) = internal_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_internal_outcomesi = strlen(this->internal_outcomes[i]); + memcpy(outbuffer + offset, &length_internal_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->internal_outcomes[i], length_internal_outcomesi); + offset += length_internal_outcomesi; + } + *(outbuffer + offset++) = outcomes_from_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_outcomes_fromi = strlen(this->outcomes_from[i]); + memcpy(outbuffer + offset, &length_outcomes_fromi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_from[i], length_outcomes_fromi); + offset += length_outcomes_fromi; + } + *(outbuffer + offset++) = outcomes_to_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_outcomes_toi = strlen(this->outcomes_to[i]); + memcpy(outbuffer + offset, &length_outcomes_toi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->outcomes_to[i], length_outcomes_toi); + offset += length_outcomes_toi; + } + *(outbuffer + offset++) = container_outcomes_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_container_outcomesi = strlen(this->container_outcomes[i]); + memcpy(outbuffer + offset, &length_container_outcomesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->container_outcomes[i], length_container_outcomesi); + offset += length_container_outcomesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_path; + memcpy(&length_path, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_path; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_path-1]=0; + this->path = (char *)(inbuffer + offset-1); + offset += length_path; + uint8_t children_lengthT = *(inbuffer + offset++); + if(children_lengthT > children_length) + this->children = (char**)realloc(this->children, children_lengthT * sizeof(char*)); + offset += 3; + children_length = children_lengthT; + for( uint8_t i = 0; i < children_length; i++){ + uint32_t length_st_children; + memcpy(&length_st_children, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_children; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_children-1]=0; + this->st_children = (char *)(inbuffer + offset-1); + offset += length_st_children; + memcpy( &(this->children[i]), &(this->st_children), sizeof(char*)); + } + uint8_t internal_outcomes_lengthT = *(inbuffer + offset++); + if(internal_outcomes_lengthT > internal_outcomes_length) + this->internal_outcomes = (char**)realloc(this->internal_outcomes, internal_outcomes_lengthT * sizeof(char*)); + offset += 3; + internal_outcomes_length = internal_outcomes_lengthT; + for( uint8_t i = 0; i < internal_outcomes_length; i++){ + uint32_t length_st_internal_outcomes; + memcpy(&length_st_internal_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_internal_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_internal_outcomes-1]=0; + this->st_internal_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_internal_outcomes; + memcpy( &(this->internal_outcomes[i]), &(this->st_internal_outcomes), sizeof(char*)); + } + uint8_t outcomes_from_lengthT = *(inbuffer + offset++); + if(outcomes_from_lengthT > outcomes_from_length) + this->outcomes_from = (char**)realloc(this->outcomes_from, outcomes_from_lengthT * sizeof(char*)); + offset += 3; + outcomes_from_length = outcomes_from_lengthT; + for( uint8_t i = 0; i < outcomes_from_length; i++){ + uint32_t length_st_outcomes_from; + memcpy(&length_st_outcomes_from, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_from; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_from-1]=0; + this->st_outcomes_from = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_from; + memcpy( &(this->outcomes_from[i]), &(this->st_outcomes_from), sizeof(char*)); + } + uint8_t outcomes_to_lengthT = *(inbuffer + offset++); + if(outcomes_to_lengthT > outcomes_to_length) + this->outcomes_to = (char**)realloc(this->outcomes_to, outcomes_to_lengthT * sizeof(char*)); + offset += 3; + outcomes_to_length = outcomes_to_lengthT; + for( uint8_t i = 0; i < outcomes_to_length; i++){ + uint32_t length_st_outcomes_to; + memcpy(&length_st_outcomes_to, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_outcomes_to; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_outcomes_to-1]=0; + this->st_outcomes_to = (char *)(inbuffer + offset-1); + offset += length_st_outcomes_to; + memcpy( &(this->outcomes_to[i]), &(this->st_outcomes_to), sizeof(char*)); + } + uint8_t container_outcomes_lengthT = *(inbuffer + offset++); + if(container_outcomes_lengthT > container_outcomes_length) + this->container_outcomes = (char**)realloc(this->container_outcomes, container_outcomes_lengthT * sizeof(char*)); + offset += 3; + container_outcomes_length = container_outcomes_lengthT; + for( uint8_t i = 0; i < container_outcomes_length; i++){ + uint32_t length_st_container_outcomes; + memcpy(&length_st_container_outcomes, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_container_outcomes; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_container_outcomes-1]=0; + this->st_container_outcomes = (char *)(inbuffer + offset-1); + offset += length_st_container_outcomes; + memcpy( &(this->container_outcomes[i]), &(this->st_container_outcomes), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "smach_msgs/SmachContainerStructure"; }; + const char * getMD5(){ return "3d3d1e0d0f99779ee9e58101a5dcf7ea"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Bool.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Bool.h new file mode 100755 index 0000000..1ec6d07 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Bool.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Bool_h +#define _ROS_std_msgs_Bool_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Bool : public ros::Msg + { + public: + bool data; + + Bool(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Bool"; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Byte.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Byte.h new file mode 100755 index 0000000..cbb1bc2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Byte.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Byte_h +#define _ROS_std_msgs_Byte_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Byte : public ros::Msg + { + public: + int8_t data; + + Byte(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Byte"; }; + const char * getMD5(){ return "ad736a2e8818154c487bb80fe42ce43b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/ByteMultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/ByteMultiArray.h new file mode 100755 index 0000000..a41a450 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/ByteMultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_ByteMultiArray_h +#define _ROS_std_msgs_ByteMultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class ByteMultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + ByteMultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/ByteMultiArray"; }; + const char * getMD5(){ return "70ea476cbcfd65ac2f68f3cda1e891fe"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Char.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Char.h new file mode 100755 index 0000000..977cc8b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Char.h @@ -0,0 +1,44 @@ +#ifndef _ROS_std_msgs_Char_h +#define _ROS_std_msgs_Char_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Char : public ros::Msg + { + public: + uint8_t data; + + Char(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Char"; }; + const char * getMD5(){ return "1bf77f25acecdedba0e224b162199717"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/ColorRGBA.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/ColorRGBA.h new file mode 100755 index 0000000..d458c91 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/ColorRGBA.h @@ -0,0 +1,130 @@ +#ifndef _ROS_std_msgs_ColorRGBA_h +#define _ROS_std_msgs_ColorRGBA_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class ColorRGBA : public ros::Msg + { + public: + float r; + float g; + float b; + float a; + + ColorRGBA(): + r(0), + g(0), + b(0), + a(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.real = this->r; + *(outbuffer + offset + 0) = (u_r.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_r.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_r.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_r.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.real = this->g; + *(outbuffer + offset + 0) = (u_g.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_g.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_g.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_g.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.real = this->b; + *(outbuffer + offset + 0) = (u_b.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.real = this->a; + *(outbuffer + offset + 0) = (u_a.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_a.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_a.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_a.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->a); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_r; + u_r.base = 0; + u_r.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_r.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->r = u_r.real; + offset += sizeof(this->r); + union { + float real; + uint32_t base; + } u_g; + u_g.base = 0; + u_g.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_g.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->g = u_g.real; + offset += sizeof(this->g); + union { + float real; + uint32_t base; + } u_b; + u_b.base = 0; + u_b.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b = u_b.real; + offset += sizeof(this->b); + union { + float real; + uint32_t base; + } u_a; + u_a.base = 0; + u_a.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_a.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->a = u_a.real; + offset += sizeof(this->a); + return offset; + } + + const char * getType(){ return "std_msgs/ColorRGBA"; }; + const char * getMD5(){ return "a29a96539573343b1310c73607334b00"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Duration.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Duration.h new file mode 100755 index 0000000..883a752 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Duration.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Duration_h +#define _ROS_std_msgs_Duration_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace std_msgs +{ + + class Duration : public ros::Msg + { + public: + ros::Duration data; + + Duration(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Duration"; }; + const char * getMD5(){ return "3e286caf4241d664e55f3ad380e2ae46"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Empty.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Empty.h new file mode 100755 index 0000000..440e5ed --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Empty.h @@ -0,0 +1,38 @@ +#ifndef _ROS_std_msgs_Empty_h +#define _ROS_std_msgs_Empty_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Empty : public ros::Msg + { + public: + + Empty() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "std_msgs/Empty"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float32.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float32.h new file mode 100755 index 0000000..b324c1b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float32.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Float32_h +#define _ROS_std_msgs_Float32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float32 : public ros::Msg + { + public: + float data; + + Float32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Float32"; }; + const char * getMD5(){ return "73fcbf46b49191e672908e50842a83d4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float32MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float32MultiArray.h new file mode 100755 index 0000000..51f9406 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float32MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Float32MultiArray_h +#define _ROS_std_msgs_Float32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + float real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float32MultiArray"; }; + const char * getMD5(){ return "6a40e0ffa6a17a503ac3f8616991b1f6"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float64.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float64.h new file mode 100755 index 0000000..3cc9fd0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float64.h @@ -0,0 +1,42 @@ +#ifndef _ROS_std_msgs_Float64_h +#define _ROS_std_msgs_Float64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Float64 : public ros::Msg + { + public: + float data; + + Float64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += serializeAvrFloat64(outbuffer + offset, this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += deserializeAvrFloat64(inbuffer + offset, &(this->data)); + return offset; + } + + const char * getType(){ return "std_msgs/Float64"; }; + const char * getMD5(){ return "fdb28210bfa9d7c91146260178d9a584"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float64MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float64MultiArray.h new file mode 100755 index 0000000..ab740b6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Float64MultiArray.h @@ -0,0 +1,63 @@ +#ifndef _ROS_std_msgs_Float64MultiArray_h +#define _ROS_std_msgs_Float64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Float64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + float st_data; + float * data; + + Float64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (float*)realloc(this->data, data_lengthT * sizeof(float)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_data)); + memcpy( &(this->data[i]), &(this->st_data), sizeof(float)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Float64MultiArray"; }; + const char * getMD5(){ return "4b7d974086d4060e7db4613a7e6c3ba4"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Header.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Header.h new file mode 100755 index 0000000..2aa0f7f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Header.h @@ -0,0 +1,89 @@ +#ifndef _ROS_std_msgs_Header_h +#define _ROS_std_msgs_Header_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Header : public ros::Msg + { + public: + uint32_t seq; + ros::Time stamp; + const char* frame_id; + + Header(): + seq(0), + stamp(), + frame_id("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->seq >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->seq >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->seq >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->seq >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq); + *(outbuffer + offset + 0) = (this->stamp.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.sec); + *(outbuffer + offset + 0) = (this->stamp.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stamp.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stamp.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stamp.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id = strlen(this->frame_id); + memcpy(outbuffer + offset, &length_frame_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_id, length_frame_id); + offset += length_frame_id; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->seq = ((uint32_t) (*(inbuffer + offset))); + this->seq |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->seq |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->seq |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->seq); + this->stamp.sec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.sec); + this->stamp.nsec = ((uint32_t) (*(inbuffer + offset))); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stamp.nsec); + uint32_t length_frame_id; + memcpy(&length_frame_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_id-1]=0; + this->frame_id = (char *)(inbuffer + offset-1); + offset += length_frame_id; + return offset; + } + + const char * getType(){ return "std_msgs/Header"; }; + const char * getMD5(){ return "2176decaecbce78abc3b96ef049fabed"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int16.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int16.h new file mode 100755 index 0000000..a83f7b2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int16.h @@ -0,0 +1,57 @@ +#ifndef _ROS_std_msgs_Int16_h +#define _ROS_std_msgs_Int16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int16 : public ros::Msg + { + public: + int16_t data; + + Int16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int16_t real; + uint16_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int16"; }; + const char * getMD5(){ return "8524586e34fbd7cb1c08c5f5f1ca0e57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int16MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int16MultiArray.h new file mode 100755 index 0000000..e70f4e2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int16MultiArray.h @@ -0,0 +1,78 @@ +#ifndef _ROS_std_msgs_Int16MultiArray_h +#define _ROS_std_msgs_Int16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int16_t st_data; + int16_t * data; + + Int16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int16_t*)realloc(this->data, data_lengthT * sizeof(int16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int16_t real; + uint16_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int16MultiArray"; }; + const char * getMD5(){ return "d9338d7f523fcb692fae9d0a0e9f067c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int32.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int32.h new file mode 100755 index 0000000..a2a364f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int32.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Int32_h +#define _ROS_std_msgs_Int32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int32 : public ros::Msg + { + public: + int32_t data; + + Int32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int32"; }; + const char * getMD5(){ return "da5909fbe378aeaf85e547e830cc1bb7"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int32MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int32MultiArray.h new file mode 100755 index 0000000..4df5ff5 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int32MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_Int32MultiArray_h +#define _ROS_std_msgs_Int32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int32_t st_data; + int32_t * data; + + Int32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int32_t*)realloc(this->data, data_lengthT * sizeof(int32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int32_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int32MultiArray"; }; + const char * getMD5(){ return "1d99f79f8b325b44fee908053e9c945b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int64.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int64.h new file mode 100755 index 0000000..4016081 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int64.h @@ -0,0 +1,69 @@ +#ifndef _ROS_std_msgs_Int64_h +#define _ROS_std_msgs_Int64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int64 : public ros::Msg + { + public: + int64_t data; + + Int64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_data.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_data.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_data.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_data.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int64_t real; + uint64_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int64"; }; + const char * getMD5(){ return "34add168574510e6e17f5d23ecc077ef"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int64MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int64MultiArray.h new file mode 100755 index 0000000..5733608 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int64MultiArray.h @@ -0,0 +1,90 @@ +#ifndef _ROS_std_msgs_Int64MultiArray_h +#define _ROS_std_msgs_Int64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int64_t st_data; + int64_t * data; + + Int64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_datai.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_datai.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_datai.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_datai.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int64_t*)realloc(this->data, data_lengthT * sizeof(int64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int64_t real; + uint64_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_st_data.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int64MultiArray"; }; + const char * getMD5(){ return "54865aa6c65be0448113a2afc6a49270"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int8.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int8.h new file mode 100755 index 0000000..b02ef77 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int8.h @@ -0,0 +1,55 @@ +#ifndef _ROS_std_msgs_Int8_h +#define _ROS_std_msgs_Int8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class Int8 : public ros::Msg + { + public: + int8_t data; + + Int8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int8_t real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/Int8"; }; + const char * getMD5(){ return "27ffa0c9c4b8fb8492252bcad9e5c57b"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int8MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int8MultiArray.h new file mode 100755 index 0000000..7bf8c9b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Int8MultiArray.h @@ -0,0 +1,76 @@ +#ifndef _ROS_std_msgs_Int8MultiArray_h +#define _ROS_std_msgs_Int8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class Int8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + int8_t st_data; + int8_t * data; + + Int8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (int8_t*)realloc(this->data, data_lengthT * sizeof(int8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + int8_t real; + uint8_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(int8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/Int8MultiArray"; }; + const char * getMD5(){ return "d7c1af35a1b4781bbe79e03dd94b7c13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/MultiArrayDimension.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/MultiArrayDimension.h new file mode 100755 index 0000000..7cae4ba --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/MultiArrayDimension.h @@ -0,0 +1,78 @@ +#ifndef _ROS_std_msgs_MultiArrayDimension_h +#define _ROS_std_msgs_MultiArrayDimension_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class MultiArrayDimension : public ros::Msg + { + public: + const char* label; + uint32_t size; + uint32_t stride; + + MultiArrayDimension(): + label(""), + size(0), + stride(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_label = strlen(this->label); + memcpy(outbuffer + offset, &length_label, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->label, length_label); + offset += length_label; + *(outbuffer + offset + 0) = (this->size >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->size >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->size >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->size >> (8 * 3)) & 0xFF; + offset += sizeof(this->size); + *(outbuffer + offset + 0) = (this->stride >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->stride >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->stride >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->stride >> (8 * 3)) & 0xFF; + offset += sizeof(this->stride); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_label; + memcpy(&length_label, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_label; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_label-1]=0; + this->label = (char *)(inbuffer + offset-1); + offset += length_label; + this->size = ((uint32_t) (*(inbuffer + offset))); + this->size |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->size |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->size |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->size); + this->stride = ((uint32_t) (*(inbuffer + offset))); + this->stride |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->stride |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->stride |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->stride); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayDimension"; }; + const char * getMD5(){ return "4cd0c83a8683deae40ecdac60e53bfa8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/MultiArrayLayout.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/MultiArrayLayout.h new file mode 100755 index 0000000..a30ff41 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/MultiArrayLayout.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_MultiArrayLayout_h +#define _ROS_std_msgs_MultiArrayLayout_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayDimension.h" + +namespace std_msgs +{ + + class MultiArrayLayout : public ros::Msg + { + public: + uint8_t dim_length; + std_msgs::MultiArrayDimension st_dim; + std_msgs::MultiArrayDimension * dim; + uint32_t data_offset; + + MultiArrayLayout(): + dim_length(0), dim(NULL), + data_offset(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = dim_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->dim[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->data_offset >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data_offset >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data_offset >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data_offset >> (8 * 3)) & 0xFF; + offset += sizeof(this->data_offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t dim_lengthT = *(inbuffer + offset++); + if(dim_lengthT > dim_length) + this->dim = (std_msgs::MultiArrayDimension*)realloc(this->dim, dim_lengthT * sizeof(std_msgs::MultiArrayDimension)); + offset += 3; + dim_length = dim_lengthT; + for( uint8_t i = 0; i < dim_length; i++){ + offset += this->st_dim.deserialize(inbuffer + offset); + memcpy( &(this->dim[i]), &(this->st_dim), sizeof(std_msgs::MultiArrayDimension)); + } + this->data_offset = ((uint32_t) (*(inbuffer + offset))); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data_offset |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data_offset); + return offset; + } + + const char * getType(){ return "std_msgs/MultiArrayLayout"; }; + const char * getMD5(){ return "0fed2a11c13e11c5571b4e2a995a91a3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/String.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/String.h new file mode 100755 index 0000000..f590500 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/String.h @@ -0,0 +1,54 @@ +#ifndef _ROS_std_msgs_String_h +#define _ROS_std_msgs_String_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class String : public ros::Msg + { + public: + const char* data; + + String(): + data("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_data = strlen(this->data); + memcpy(outbuffer + offset, &length_data, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->data, length_data); + offset += length_data; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_data; + memcpy(&length_data, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_data; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_data-1]=0; + this->data = (char *)(inbuffer + offset-1); + offset += length_data; + return offset; + } + + const char * getType(){ return "std_msgs/String"; }; + const char * getMD5(){ return "992ce8a1687cec8c8bd883ec73ca41d1"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Time.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Time.h new file mode 100755 index 0000000..d87047b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/Time.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_Time_h +#define _ROS_std_msgs_Time_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" + +namespace std_msgs +{ + + class Time : public ros::Msg + { + public: + ros::Time data; + + Time(): + data() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.sec); + *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->data.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data.sec = ((uint32_t) (*(inbuffer + offset))); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.sec); + this->data.nsec = ((uint32_t) (*(inbuffer + offset))); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data.nsec); + return offset; + } + + const char * getType(){ return "std_msgs/Time"; }; + const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt16.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt16.h new file mode 100755 index 0000000..dd3c0cb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt16.h @@ -0,0 +1,46 @@ +#ifndef _ROS_std_msgs_UInt16_h +#define _ROS_std_msgs_UInt16_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt16 : public ros::Msg + { + public: + uint16_t data; + + UInt16(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint16_t) (*(inbuffer + offset))); + this->data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt16"; }; + const char * getMD5(){ return "1df79edf208b629fe6b81923a544552d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt16MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt16MultiArray.h new file mode 100755 index 0000000..28bc27d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt16MultiArray.h @@ -0,0 +1,67 @@ +#ifndef _ROS_std_msgs_UInt16MultiArray_h +#define _ROS_std_msgs_UInt16MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt16MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint16_t st_data; + uint16_t * data; + + UInt16MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint16_t*)realloc(this->data, data_lengthT * sizeof(uint16_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint16_t) (*(inbuffer + offset))); + this->st_data |= ((uint16_t) (*(inbuffer + offset + 1))) << (8 * 1); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint16_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt16MultiArray"; }; + const char * getMD5(){ return "52f264f1c973c4b73790d384c6cb4484"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt32.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt32.h new file mode 100755 index 0000000..170208f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt32.h @@ -0,0 +1,50 @@ +#ifndef _ROS_std_msgs_UInt32_h +#define _ROS_std_msgs_UInt32_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt32 : public ros::Msg + { + public: + uint32_t data; + + UInt32(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint32_t) (*(inbuffer + offset))); + this->data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt32"; }; + const char * getMD5(){ return "304a39449588c7f8ce2df6e8001c5fce"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt32MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt32MultiArray.h new file mode 100755 index 0000000..8dd7e1b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt32MultiArray.h @@ -0,0 +1,71 @@ +#ifndef _ROS_std_msgs_UInt32MultiArray_h +#define _ROS_std_msgs_UInt32MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt32MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint32_t st_data; + uint32_t * data; + + UInt32MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->data[i] >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->data[i] >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->data[i] >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint32_t*)realloc(this->data, data_lengthT * sizeof(uint32_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint32_t) (*(inbuffer + offset))); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->st_data |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint32_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt32MultiArray"; }; + const char * getMD5(){ return "4d6a180abc9be191b96a7eda6c8a233d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt64.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt64.h new file mode 100755 index 0000000..d69b9fe --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt64.h @@ -0,0 +1,61 @@ +#ifndef _ROS_std_msgs_UInt64_h +#define _ROS_std_msgs_UInt64_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt64 : public ros::Msg + { + public: + uint64_t data; + + UInt64(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_data.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_data.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_data.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + uint64_t real; + uint32_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt64"; }; + const char * getMD5(){ return "1b2a79973e8bf53d7b53acb71299cb57"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt64MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt64MultiArray.h new file mode 100755 index 0000000..5510abe --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt64MultiArray.h @@ -0,0 +1,82 @@ +#ifndef _ROS_std_msgs_UInt64MultiArray_h +#define _ROS_std_msgs_UInt64MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt64MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint64_t st_data; + uint64_t * data; + + UInt64MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_datai; + u_datai.real = this->data[i]; + *(outbuffer + offset + 0) = (u_datai.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_datai.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_datai.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_datai.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint64_t*)realloc(this->data, data_lengthT * sizeof(uint64_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + union { + uint64_t real; + uint32_t base; + } u_st_data; + u_st_data.base = 0; + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_st_data.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->st_data = u_st_data.real; + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint64_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt64MultiArray"; }; + const char * getMD5(){ return "6088f127afb1d6c72927aa1247e945af"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt8.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt8.h new file mode 100755 index 0000000..15dbb6f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt8.h @@ -0,0 +1,44 @@ +#ifndef _ROS_std_msgs_UInt8_h +#define _ROS_std_msgs_UInt8_h + +#include +#include +#include +#include "ros/msg.h" + +namespace std_msgs +{ + + class UInt8 : public ros::Msg + { + public: + uint8_t data; + + UInt8(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->data >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return "std_msgs/UInt8"; }; + const char * getMD5(){ return "7c8164229e7d2c17eb95e9231617fdee"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt8MultiArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt8MultiArray.h new file mode 100755 index 0000000..8a2a616 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_msgs/UInt8MultiArray.h @@ -0,0 +1,65 @@ +#ifndef _ROS_std_msgs_UInt8MultiArray_h +#define _ROS_std_msgs_UInt8MultiArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/MultiArrayLayout.h" + +namespace std_msgs +{ + + class UInt8MultiArray : public ros::Msg + { + public: + std_msgs::MultiArrayLayout layout; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + + UInt8MultiArray(): + layout(), + data_length(0), data(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->layout.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->layout.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + return offset; + } + + const char * getType(){ return "std_msgs/UInt8MultiArray"; }; + const char * getMD5(){ return "82373f1612381bb6ee473b5cd6f5d89c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/Empty.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/Empty.h new file mode 100755 index 0000000..b040dd2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/Empty.h @@ -0,0 +1,70 @@ +#ifndef _ROS_SERVICE_Empty_h +#define _ROS_SERVICE_Empty_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char EMPTY[] = "std_srvs/Empty"; + + class EmptyRequest : public ros::Msg + { + public: + + EmptyRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class EmptyResponse : public ros::Msg + { + public: + + EmptyResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return EMPTY; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Empty { + public: + typedef EmptyRequest Request; + typedef EmptyResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/SetBool.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/SetBool.h new file mode 100755 index 0000000..796485b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/SetBool.h @@ -0,0 +1,120 @@ +#ifndef _ROS_SERVICE_SetBool_h +#define _ROS_SERVICE_SetBool_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char SETBOOL[] = "std_srvs/SetBool"; + + class SetBoolRequest : public ros::Msg + { + public: + bool data; + + SetBoolRequest(): + data(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.real = this->data; + *(outbuffer + offset + 0) = (u_data.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->data); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_data; + u_data.base = 0; + u_data.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->data = u_data.real; + offset += sizeof(this->data); + return offset; + } + + const char * getType(){ return SETBOOL; }; + const char * getMD5(){ return "8b94c1b53db61fb6aed406028ad6332a"; }; + + }; + + class SetBoolResponse : public ros::Msg + { + public: + bool success; + const char* message; + + SetBoolResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return SETBOOL; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class SetBool { + public: + typedef SetBoolRequest Request; + typedef SetBoolResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/Trigger.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/Trigger.h new file mode 100755 index 0000000..958d2b8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/std_srvs/Trigger.h @@ -0,0 +1,103 @@ +#ifndef _ROS_SERVICE_Trigger_h +#define _ROS_SERVICE_Trigger_h +#include +#include +#include +#include "ros/msg.h" + +namespace std_srvs +{ + +static const char TRIGGER[] = "std_srvs/Trigger"; + + class TriggerRequest : public ros::Msg + { + public: + + TriggerRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TriggerResponse : public ros::Msg + { + public: + bool success; + const char* message; + + TriggerResponse(): + success(0), + message("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.real = this->success; + *(outbuffer + offset + 0) = (u_success.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->success); + uint32_t length_message = strlen(this->message); + memcpy(outbuffer + offset, &length_message, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->message, length_message); + offset += length_message; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + bool real; + uint8_t base; + } u_success; + u_success.base = 0; + u_success.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->success = u_success.real; + offset += sizeof(this->success); + uint32_t length_message; + memcpy(&length_message, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_message; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_message-1]=0; + this->message = (char *)(inbuffer + offset-1); + offset += length_message; + return offset; + } + + const char * getType(){ return TRIGGER; }; + const char * getMD5(){ return "937c9679a518e3a18d831e57125ea522"; }; + + }; + + class Trigger { + public: + typedef TriggerRequest Request; + typedef TriggerResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/stereo_msgs/DisparityImage.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/stereo_msgs/DisparityImage.h new file mode 100755 index 0000000..53d557b --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/stereo_msgs/DisparityImage.h @@ -0,0 +1,168 @@ +#ifndef _ROS_stereo_msgs_DisparityImage_h +#define _ROS_stereo_msgs_DisparityImage_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "sensor_msgs/Image.h" +#include "sensor_msgs/RegionOfInterest.h" + +namespace stereo_msgs +{ + + class DisparityImage : public ros::Msg + { + public: + std_msgs::Header header; + sensor_msgs::Image image; + float f; + float T; + sensor_msgs::RegionOfInterest valid_window; + float min_disparity; + float max_disparity; + float delta_d; + + DisparityImage(): + header(), + image(), + f(0), + T(0), + valid_window(), + min_disparity(0), + max_disparity(0), + delta_d(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->image.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.real = this->f; + *(outbuffer + offset + 0) = (u_f.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_f.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_f.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_f.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.real = this->T; + *(outbuffer + offset + 0) = (u_T.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_T.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_T.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_T.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->T); + offset += this->valid_window.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.real = this->min_disparity; + *(outbuffer + offset + 0) = (u_min_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_min_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_min_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_min_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.real = this->max_disparity; + *(outbuffer + offset + 0) = (u_max_disparity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_max_disparity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_max_disparity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_max_disparity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.real = this->delta_d; + *(outbuffer + offset + 0) = (u_delta_d.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_delta_d.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_delta_d.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_delta_d.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->delta_d); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->image.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_f; + u_f.base = 0; + u_f.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_f.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->f = u_f.real; + offset += sizeof(this->f); + union { + float real; + uint32_t base; + } u_T; + u_T.base = 0; + u_T.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_T.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->T = u_T.real; + offset += sizeof(this->T); + offset += this->valid_window.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_min_disparity; + u_min_disparity.base = 0; + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_min_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->min_disparity = u_min_disparity.real; + offset += sizeof(this->min_disparity); + union { + float real; + uint32_t base; + } u_max_disparity; + u_max_disparity.base = 0; + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_max_disparity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->max_disparity = u_max_disparity.real; + offset += sizeof(this->max_disparity); + union { + float real; + uint32_t base; + } u_delta_d; + u_delta_d.base = 0; + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_delta_d.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->delta_d = u_delta_d.real; + offset += sizeof(this->delta_d); + return offset; + } + + const char * getType(){ return "stereo_msgs/DisparityImage"; }; + const char * getMD5(){ return "04a177815f75271039fa21f16acad8c9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/array_test/array_test.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/array_test/array_test.pde new file mode 100755 index 0000000..8aa72de --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/array_test/array_test.pde @@ -0,0 +1,49 @@ +/* + * rosserial::geometry_msgs::PoseArray Test + * Sums an array, publishes sum + */ + +#include +#include +#include + + +ros::NodeHandle nh; + + +bool set_; + + +geometry_msgs::Pose sum_msg; +ros::Publisher p("sum", &sum_msg); + +void messageCb(const geometry_msgs::PoseArray& msg){ + sum_msg.position.x = 0; + sum_msg.position.y = 0; + sum_msg.position.z = 0; + for(int i = 0; i < msg.poses_length; i++) + { + sum_msg.position.x += msg.poses[i].position.x; + sum_msg.position.y += msg.poses[i].position.y; + sum_msg.position.z += msg.poses[i].position.z; + } + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +ros::Subscriber s("poses",messageCb); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.subscribe(s); + nh.advertise(p); +} + +void loop() +{ + p.publish(&sum_msg); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/float64_test/float64_test.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/float64_test/float64_test.pde new file mode 100755 index 0000000..41a6f4a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/float64_test/float64_test.pde @@ -0,0 +1,38 @@ +/* + * rosserial::std_msgs::Float64 Test + * Receives a Float64 input, subtracts 1.0, and publishes it + */ + +#include +#include + + +ros::NodeHandle nh; + +float x; + +void messageCb( const std_msgs::Float64& msg){ + x = msg.data - 1.0; + digitalWrite(13, HIGH-digitalRead(13)); // blink the led +} + +std_msgs::Float64 test; +ros::Subscriber s("your_topic", &messageCb); +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); + nh.subscribe(s); +} + +void loop() +{ + test.data = x; + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/time_test/time_test.pde b/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/time_test/time_test.pde new file mode 100755 index 0000000..c5fa739 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tests/time_test/time_test.pde @@ -0,0 +1,30 @@ +/* + * rosserial::std_msgs::Time Test + * Publishes current time + */ + +#include +#include +#include + + +ros::NodeHandle nh; + +std_msgs::Time test; +ros::Publisher p("my_topic", &test); + +void setup() +{ + pinMode(13, OUTPUT); + nh.initNode(); + nh.advertise(p); +} + +void loop() +{ + test.data = nh.now(); + p.publish( &test ); + nh.spinOnce(); + delay(10); +} + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/FrameGraph.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/FrameGraph.h new file mode 100755 index 0000000..b7d2f31 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/FrameGraph.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf +{ + +static const char FRAMEGRAPH[] = "tf/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* dot_graph; + + FrameGraphResponse(): + dot_graph("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_dot_graph = strlen(this->dot_graph); + memcpy(outbuffer + offset, &length_dot_graph, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->dot_graph, length_dot_graph); + offset += length_dot_graph; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_dot_graph; + memcpy(&length_dot_graph, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_dot_graph; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_dot_graph-1]=0; + this->dot_graph = (char *)(inbuffer + offset-1); + offset += length_dot_graph; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "c4af9ac907e58e906eb0b6e3c58478c0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/tf.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/tf.h new file mode 100755 index 0000000..a2888e3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/tf.h @@ -0,0 +1,56 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TF_H_ +#define ROS_TF_H_ + +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + static inline geometry_msgs::Quaternion createQuaternionFromYaw(double yaw) + { + geometry_msgs::Quaternion q; + q.x = 0; + q.y = 0; + q.z = sin(yaw * 0.5); + q.w = cos(yaw * 0.5); + return q; + } + +} + +#endif + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/tfMessage.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/tfMessage.h new file mode 100755 index 0000000..e8b3eb7 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/tfMessage.h @@ -0,0 +1,59 @@ +#ifndef _ROS_tf_tfMessage_h +#define _ROS_tf_tfMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf +{ + + class tfMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + tfMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf/tfMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/transform_broadcaster.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/transform_broadcaster.h new file mode 100755 index 0000000..817eaba --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf/transform_broadcaster.h @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef ROS_TRANSFORM_BROADCASTER_H_ +#define ROS_TRANSFORM_BROADCASTER_H_ + +#include "tfMessage.h" + +namespace tf +{ + + class TransformBroadcaster + { + public: + TransformBroadcaster() : publisher_("/tf", &internal_msg) {} + + void init(ros::NodeHandle &nh) + { + nh.advertise(publisher_); + } + + void sendTransform(geometry_msgs::TransformStamped &transform) + { + internal_msg.transforms_length = 1; + internal_msg.transforms = &transform; + publisher_.publish(&internal_msg); + } + + private: + tf::tfMessage internal_msg; + ros::Publisher publisher_; + }; + +} + +#endif + diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/FrameGraph.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/FrameGraph.h new file mode 100755 index 0000000..a703dd2 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/FrameGraph.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_FrameGraph_h +#define _ROS_SERVICE_FrameGraph_h +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + +static const char FRAMEGRAPH[] = "tf2_msgs/FrameGraph"; + + class FrameGraphRequest : public ros::Msg + { + public: + + FrameGraphRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class FrameGraphResponse : public ros::Msg + { + public: + const char* frame_yaml; + + FrameGraphResponse(): + frame_yaml("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_frame_yaml = strlen(this->frame_yaml); + memcpy(outbuffer + offset, &length_frame_yaml, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->frame_yaml, length_frame_yaml); + offset += length_frame_yaml; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_frame_yaml; + memcpy(&length_frame_yaml, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_frame_yaml; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_frame_yaml-1]=0; + this->frame_yaml = (char *)(inbuffer + offset-1); + offset += length_frame_yaml; + return offset; + } + + const char * getType(){ return FRAMEGRAPH; }; + const char * getMD5(){ return "437ea58e9463815a0d511c7326b686b0"; }; + + }; + + class FrameGraph { + public: + typedef FrameGraphRequest Request; + typedef FrameGraphResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h new file mode 100755 index 0000000..2a0178f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformAction_h +#define _ROS_tf2_msgs_LookupTransformAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "tf2_msgs/LookupTransformActionGoal.h" +#include "tf2_msgs/LookupTransformActionResult.h" +#include "tf2_msgs/LookupTransformActionFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformAction : public ros::Msg + { + public: + tf2_msgs::LookupTransformActionGoal action_goal; + tf2_msgs::LookupTransformActionResult action_result; + tf2_msgs::LookupTransformActionFeedback action_feedback; + + LookupTransformAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformAction"; }; + const char * getMD5(){ return "7ee01ba91a56c2245c610992dbaa3c37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h new file mode 100755 index 0000000..f0de7af --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionFeedback_h +#define _ROS_tf2_msgs_LookupTransformActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformFeedback.h" + +namespace tf2_msgs +{ + + class LookupTransformActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformFeedback feedback; + + LookupTransformActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h new file mode 100755 index 0000000..d668cd9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionGoal_h +#define _ROS_tf2_msgs_LookupTransformActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "tf2_msgs/LookupTransformGoal.h" + +namespace tf2_msgs +{ + + class LookupTransformActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + tf2_msgs::LookupTransformGoal goal; + + LookupTransformActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionGoal"; }; + const char * getMD5(){ return "f2e7bcdb75c847978d0351a13e699da5"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h new file mode 100755 index 0000000..99298ff --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_tf2_msgs_LookupTransformActionResult_h +#define _ROS_tf2_msgs_LookupTransformActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "tf2_msgs/LookupTransformResult.h" + +namespace tf2_msgs +{ + + class LookupTransformActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + tf2_msgs::LookupTransformResult result; + + LookupTransformActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformActionResult"; }; + const char * getMD5(){ return "ac26ce75a41384fa8bb4dc10f491ab90"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h new file mode 100755 index 0000000..6be0748 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_tf2_msgs_LookupTransformFeedback_h +#define _ROS_tf2_msgs_LookupTransformFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class LookupTransformFeedback : public ros::Msg + { + public: + + LookupTransformFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h new file mode 100755 index 0000000..f498e45 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformGoal.h @@ -0,0 +1,171 @@ +#ifndef _ROS_tf2_msgs_LookupTransformGoal_h +#define _ROS_tf2_msgs_LookupTransformGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/time.h" +#include "ros/duration.h" + +namespace tf2_msgs +{ + + class LookupTransformGoal : public ros::Msg + { + public: + const char* target_frame; + const char* source_frame; + ros::Time source_time; + ros::Duration timeout; + ros::Time target_time; + const char* fixed_frame; + bool advanced; + + LookupTransformGoal(): + target_frame(""), + source_frame(""), + source_time(), + timeout(), + target_time(), + fixed_frame(""), + advanced(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_target_frame = strlen(this->target_frame); + memcpy(outbuffer + offset, &length_target_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->target_frame, length_target_frame); + offset += length_target_frame; + uint32_t length_source_frame = strlen(this->source_frame); + memcpy(outbuffer + offset, &length_source_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->source_frame, length_source_frame); + offset += length_source_frame; + *(outbuffer + offset + 0) = (this->source_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.sec); + *(outbuffer + offset + 0) = (this->source_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->source_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->source_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->source_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->source_time.nsec); + *(outbuffer + offset + 0) = (this->timeout.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.sec); + *(outbuffer + offset + 0) = (this->timeout.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->timeout.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->timeout.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->timeout.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->timeout.nsec); + *(outbuffer + offset + 0) = (this->target_time.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.sec); + *(outbuffer + offset + 0) = (this->target_time.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->target_time.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->target_time.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->target_time.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame = strlen(this->fixed_frame); + memcpy(outbuffer + offset, &length_fixed_frame, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->fixed_frame, length_fixed_frame); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.real = this->advanced; + *(outbuffer + offset + 0) = (u_advanced.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->advanced); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_target_frame; + memcpy(&length_target_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_target_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_target_frame-1]=0; + this->target_frame = (char *)(inbuffer + offset-1); + offset += length_target_frame; + uint32_t length_source_frame; + memcpy(&length_source_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_source_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_source_frame-1]=0; + this->source_frame = (char *)(inbuffer + offset-1); + offset += length_source_frame; + this->source_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.sec); + this->source_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->source_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->source_time.nsec); + this->timeout.sec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.sec); + this->timeout.nsec = ((uint32_t) (*(inbuffer + offset))); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->timeout.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->timeout.nsec); + this->target_time.sec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.sec); + this->target_time.nsec = ((uint32_t) (*(inbuffer + offset))); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->target_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->target_time.nsec); + uint32_t length_fixed_frame; + memcpy(&length_fixed_frame, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_fixed_frame; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_fixed_frame-1]=0; + this->fixed_frame = (char *)(inbuffer + offset-1); + offset += length_fixed_frame; + union { + bool real; + uint8_t base; + } u_advanced; + u_advanced.base = 0; + u_advanced.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->advanced = u_advanced.real; + offset += sizeof(this->advanced); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformGoal"; }; + const char * getMD5(){ return "35e3720468131d675a18bb6f3e5f22f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h new file mode 100755 index 0000000..6dbf6f4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/LookupTransformResult.h @@ -0,0 +1,48 @@ +#ifndef _ROS_tf2_msgs_LookupTransformResult_h +#define _ROS_tf2_msgs_LookupTransformResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" +#include "tf2_msgs/TF2Error.h" + +namespace tf2_msgs +{ + + class LookupTransformResult : public ros::Msg + { + public: + geometry_msgs::TransformStamped transform; + tf2_msgs::TF2Error error; + + LookupTransformResult(): + transform(), + error() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->transform.serialize(outbuffer + offset); + offset += this->error.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->transform.deserialize(inbuffer + offset); + offset += this->error.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "tf2_msgs/LookupTransformResult"; }; + const char * getMD5(){ return "3fe5db6a19ca9cfb675418c5ad875c36"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/TF2Error.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/TF2Error.h new file mode 100755 index 0000000..0fc1a7f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/TF2Error.h @@ -0,0 +1,67 @@ +#ifndef _ROS_tf2_msgs_TF2Error_h +#define _ROS_tf2_msgs_TF2Error_h + +#include +#include +#include +#include "ros/msg.h" + +namespace tf2_msgs +{ + + class TF2Error : public ros::Msg + { + public: + uint8_t error; + const char* error_string; + enum { NO_ERROR = 0 }; + enum { LOOKUP_ERROR = 1 }; + enum { CONNECTIVITY_ERROR = 2 }; + enum { EXTRAPOLATION_ERROR = 3 }; + enum { INVALID_ARGUMENT_ERROR = 4 }; + enum { TIMEOUT_ERROR = 5 }; + enum { TRANSFORM_ERROR = 6 }; + + TF2Error(): + error(0), + error_string("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->error >> (8 * 0)) & 0xFF; + offset += sizeof(this->error); + uint32_t length_error_string = strlen(this->error_string); + memcpy(outbuffer + offset, &length_error_string, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->error_string, length_error_string); + offset += length_error_string; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->error = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->error); + uint32_t length_error_string; + memcpy(&length_error_string, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_error_string; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_error_string-1]=0; + this->error_string = (char *)(inbuffer + offset-1); + offset += length_error_string; + return offset; + } + + const char * getType(){ return "tf2_msgs/TF2Error"; }; + const char * getMD5(){ return "bc6848fd6fd750c92e38575618a4917d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/TFMessage.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/TFMessage.h new file mode 100755 index 0000000..d358efa --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/tf2_msgs/TFMessage.h @@ -0,0 +1,59 @@ +#ifndef _ROS_tf2_msgs_TFMessage_h +#define _ROS_tf2_msgs_TFMessage_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/TransformStamped.h" + +namespace tf2_msgs +{ + + class TFMessage : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::TransformStamped st_transforms; + geometry_msgs::TransformStamped * transforms; + + TFMessage(): + transforms_length(0), transforms(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::TransformStamped*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::TransformStamped)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::TransformStamped)); + } + return offset; + } + + const char * getType(){ return "tf2_msgs/TFMessage"; }; + const char * getMD5(){ return "94810edda583a504dfda3829e70d7eec"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/theora_image_transport/Packet.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/theora_image_transport/Packet.h new file mode 100755 index 0000000..85127b9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/theora_image_transport/Packet.h @@ -0,0 +1,173 @@ +#ifndef _ROS_theora_image_transport_Packet_h +#define _ROS_theora_image_transport_Packet_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" + +namespace theora_image_transport +{ + + class Packet : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t data_length; + uint8_t st_data; + uint8_t * data; + int32_t b_o_s; + int32_t e_o_s; + int64_t granulepos; + int64_t packetno; + + Packet(): + header(), + data_length(0), data(NULL), + b_o_s(0), + e_o_s(0), + granulepos(0), + packetno(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = data_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < data_length; i++){ + *(outbuffer + offset + 0) = (this->data[i] >> (8 * 0)) & 0xFF; + offset += sizeof(this->data[i]); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.real = this->b_o_s; + *(outbuffer + offset + 0) = (u_b_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_b_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_b_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_b_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.real = this->e_o_s; + *(outbuffer + offset + 0) = (u_e_o_s.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_e_o_s.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_e_o_s.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_e_o_s.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.real = this->granulepos; + *(outbuffer + offset + 0) = (u_granulepos.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_granulepos.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_granulepos.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_granulepos.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_granulepos.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_granulepos.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_granulepos.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_granulepos.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.real = this->packetno; + *(outbuffer + offset + 0) = (u_packetno.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_packetno.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_packetno.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_packetno.base >> (8 * 3)) & 0xFF; + *(outbuffer + offset + 4) = (u_packetno.base >> (8 * 4)) & 0xFF; + *(outbuffer + offset + 5) = (u_packetno.base >> (8 * 5)) & 0xFF; + *(outbuffer + offset + 6) = (u_packetno.base >> (8 * 6)) & 0xFF; + *(outbuffer + offset + 7) = (u_packetno.base >> (8 * 7)) & 0xFF; + offset += sizeof(this->packetno); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t data_lengthT = *(inbuffer + offset++); + if(data_lengthT > data_length) + this->data = (uint8_t*)realloc(this->data, data_lengthT * sizeof(uint8_t)); + offset += 3; + data_length = data_lengthT; + for( uint8_t i = 0; i < data_length; i++){ + this->st_data = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->st_data); + memcpy( &(this->data[i]), &(this->st_data), sizeof(uint8_t)); + } + union { + int32_t real; + uint32_t base; + } u_b_o_s; + u_b_o_s.base = 0; + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_b_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->b_o_s = u_b_o_s.real; + offset += sizeof(this->b_o_s); + union { + int32_t real; + uint32_t base; + } u_e_o_s; + u_e_o_s.base = 0; + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_e_o_s.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->e_o_s = u_e_o_s.real; + offset += sizeof(this->e_o_s); + union { + int64_t real; + uint64_t base; + } u_granulepos; + u_granulepos.base = 0; + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_granulepos.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->granulepos = u_granulepos.real; + offset += sizeof(this->granulepos); + union { + int64_t real; + uint64_t base; + } u_packetno; + u_packetno.base = 0; + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6); + u_packetno.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7); + this->packetno = u_packetno.real; + offset += sizeof(this->packetno); + return offset; + } + + const char * getType(){ return "theora_image_transport/Packet"; }; + const char * getMD5(){ return "33ac4e14a7cff32e7e0d65f18bb410f3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/time.cpp b/case_study/arduino_lab/group_34/original/lib/ros_lib/time.cpp new file mode 100755 index 0000000..9341196 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/time.cpp @@ -0,0 +1,68 @@ +/* + * Software License Agreement (BSD License) + * + * Copyright (c) 2011, Willow Garage, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * * Neither the name of Willow Garage, Inc. nor the names of its + * contributors may be used to endorse or promote prducts derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#include "ros/time.h" + +namespace ros +{ + void normalizeSecNSec(uint32_t& sec, uint32_t& nsec){ + uint32_t nsec_part= nsec % 1000000000UL; + uint32_t sec_part = nsec / 1000000000UL; + sec += sec_part; + nsec = nsec_part; + } + + Time& Time::fromNSec(int32_t t) + { + sec = t / 1000000000; + nsec = t % 1000000000; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator +=(const Duration &rhs) + { + sec += rhs.sec; + nsec += rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } + + Time& Time::operator -=(const Duration &rhs){ + sec += -rhs.sec; + nsec += -rhs.nsec; + normalizeSecNSec(sec, nsec); + return *this; + } +} diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxAdd.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxAdd.h new file mode 100755 index 0000000..269912e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxAdd.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_DemuxAdd_h +#define _ROS_SERVICE_DemuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXADD[] = "topic_tools/DemuxAdd"; + + class DemuxAddRequest : public ros::Msg + { + public: + const char* topic; + + DemuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxAddResponse : public ros::Msg + { + public: + + DemuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxAdd { + public: + typedef DemuxAddRequest Request; + typedef DemuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxDelete.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxDelete.h new file mode 100755 index 0000000..af15d3a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxDelete.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_DemuxDelete_h +#define _ROS_SERVICE_DemuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXDELETE[] = "topic_tools/DemuxDelete"; + + class DemuxDeleteRequest : public ros::Msg + { + public: + const char* topic; + + DemuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxDeleteResponse : public ros::Msg + { + public: + + DemuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxDelete { + public: + typedef DemuxDeleteRequest Request; + typedef DemuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxList.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxList.h new file mode 100755 index 0000000..5d0beb9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_DemuxList_h +#define _ROS_SERVICE_DemuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXLIST[] = "topic_tools/DemuxList"; + + class DemuxListRequest : public ros::Msg + { + public: + + DemuxListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class DemuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + DemuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return DEMUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class DemuxList { + public: + typedef DemuxListRequest Request; + typedef DemuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxSelect.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxSelect.h new file mode 100755 index 0000000..449a387 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/DemuxSelect.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_DemuxSelect_h +#define _ROS_SERVICE_DemuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char DEMUXSELECT[] = "topic_tools/DemuxSelect"; + + class DemuxSelectRequest : public ros::Msg + { + public: + const char* topic; + + DemuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class DemuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + DemuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return DEMUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class DemuxSelect { + public: + typedef DemuxSelectRequest Request; + typedef DemuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxAdd.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxAdd.h new file mode 100755 index 0000000..92ffe35 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxAdd.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_MuxAdd_h +#define _ROS_SERVICE_MuxAdd_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXADD[] = "topic_tools/MuxAdd"; + + class MuxAddRequest : public ros::Msg + { + public: + const char* topic; + + MuxAddRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxAddResponse : public ros::Msg + { + public: + + MuxAddResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXADD; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxAdd { + public: + typedef MuxAddRequest Request; + typedef MuxAddResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxDelete.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxDelete.h new file mode 100755 index 0000000..b624e7a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxDelete.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_MuxDelete_h +#define _ROS_SERVICE_MuxDelete_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXDELETE[] = "topic_tools/MuxDelete"; + + class MuxDeleteRequest : public ros::Msg + { + public: + const char* topic; + + MuxDeleteRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxDeleteResponse : public ros::Msg + { + public: + + MuxDeleteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXDELETE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxDelete { + public: + typedef MuxDeleteRequest Request; + typedef MuxDeleteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxList.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxList.h new file mode 100755 index 0000000..011c179 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxList.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_MuxList_h +#define _ROS_SERVICE_MuxList_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXLIST[] = "topic_tools/MuxList"; + + class MuxListRequest : public ros::Msg + { + public: + + MuxListRequest() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class MuxListResponse : public ros::Msg + { + public: + uint8_t topics_length; + char* st_topics; + char* * topics; + + MuxListResponse(): + topics_length(0), topics(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = topics_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_topicsi = strlen(this->topics[i]); + memcpy(outbuffer + offset, &length_topicsi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topics[i], length_topicsi); + offset += length_topicsi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t topics_lengthT = *(inbuffer + offset++); + if(topics_lengthT > topics_length) + this->topics = (char**)realloc(this->topics, topics_lengthT * sizeof(char*)); + offset += 3; + topics_length = topics_lengthT; + for( uint8_t i = 0; i < topics_length; i++){ + uint32_t length_st_topics; + memcpy(&length_st_topics, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_topics; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_topics-1]=0; + this->st_topics = (char *)(inbuffer + offset-1); + offset += length_st_topics; + memcpy( &(this->topics[i]), &(this->st_topics), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return MUXLIST; }; + const char * getMD5(){ return "b0eef9a05d4e829092fc2f2c3c2aad3d"; }; + + }; + + class MuxList { + public: + typedef MuxListRequest Request; + typedef MuxListResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxSelect.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxSelect.h new file mode 100755 index 0000000..b883b8e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/topic_tools/MuxSelect.h @@ -0,0 +1,102 @@ +#ifndef _ROS_SERVICE_MuxSelect_h +#define _ROS_SERVICE_MuxSelect_h +#include +#include +#include +#include "ros/msg.h" + +namespace topic_tools +{ + +static const char MUXSELECT[] = "topic_tools/MuxSelect"; + + class MuxSelectRequest : public ros::Msg + { + public: + const char* topic; + + MuxSelectRequest(): + topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_topic = strlen(this->topic); + memcpy(outbuffer + offset, &length_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->topic, length_topic); + offset += length_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_topic; + memcpy(&length_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_topic-1]=0; + this->topic = (char *)(inbuffer + offset-1); + offset += length_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "d8f94bae31b356b24d0427f80426d0c3"; }; + + }; + + class MuxSelectResponse : public ros::Msg + { + public: + const char* prev_topic; + + MuxSelectResponse(): + prev_topic("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_prev_topic = strlen(this->prev_topic); + memcpy(outbuffer + offset, &length_prev_topic, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->prev_topic, length_prev_topic); + offset += length_prev_topic; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_prev_topic; + memcpy(&length_prev_topic, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_prev_topic; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_prev_topic-1]=0; + this->prev_topic = (char *)(inbuffer + offset-1); + offset += length_prev_topic; + return offset; + } + + const char * getType(){ return MUXSELECT; }; + const char * getMD5(){ return "3db0a473debdbafea387c9e49358c320"; }; + + }; + + class MuxSelect { + public: + typedef MuxSelectRequest Request; + typedef MuxSelectResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h new file mode 100755 index 0000000..13a4f3c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/JointTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectory_h +#define _ROS_trajectory_msgs_JointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/JointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class JointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::JointTrajectoryPoint st_points; + trajectory_msgs::JointTrajectoryPoint * points; + + JointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::JointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectory"; }; + const char * getMD5(){ return "65b4f94a94d1ed67169da35a02f33d3f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h new file mode 100755 index 0000000..20b40e4 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/JointTrajectoryPoint.h @@ -0,0 +1,141 @@ +#ifndef _ROS_trajectory_msgs_JointTrajectoryPoint_h +#define _ROS_trajectory_msgs_JointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class JointTrajectoryPoint : public ros::Msg + { + public: + uint8_t positions_length; + float st_positions; + float * positions; + uint8_t velocities_length; + float st_velocities; + float * velocities; + uint8_t accelerations_length; + float st_accelerations; + float * accelerations; + uint8_t effort_length; + float st_effort; + float * effort; + ros::Duration time_from_start; + + JointTrajectoryPoint(): + positions_length(0), positions(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + effort_length(0), effort(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = positions_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < positions_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->positions[i]); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->velocities[i]); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->accelerations[i]); + } + *(outbuffer + offset++) = effort_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < effort_length; i++){ + offset += serializeAvrFloat64(outbuffer + offset, this->effort[i]); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t positions_lengthT = *(inbuffer + offset++); + if(positions_lengthT > positions_length) + this->positions = (float*)realloc(this->positions, positions_lengthT * sizeof(float)); + offset += 3; + positions_length = positions_lengthT; + for( uint8_t i = 0; i < positions_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_positions)); + memcpy( &(this->positions[i]), &(this->st_positions), sizeof(float)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (float*)realloc(this->velocities, velocities_lengthT * sizeof(float)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_velocities)); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(float)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (float*)realloc(this->accelerations, accelerations_lengthT * sizeof(float)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_accelerations)); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(float)); + } + uint8_t effort_lengthT = *(inbuffer + offset++); + if(effort_lengthT > effort_length) + this->effort = (float*)realloc(this->effort, effort_lengthT * sizeof(float)); + offset += 3; + effort_length = effort_lengthT; + for( uint8_t i = 0; i < effort_length; i++){ + offset += deserializeAvrFloat64(inbuffer + offset, &(this->st_effort)); + memcpy( &(this->effort[i]), &(this->st_effort), sizeof(float)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/JointTrajectoryPoint"; }; + const char * getMD5(){ return "f3cd1e1c4d320c79d6985c904ae5dcd3"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h new file mode 100755 index 0000000..dcecf64 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectory.h @@ -0,0 +1,96 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectory_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectory_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "trajectory_msgs/MultiDOFJointTrajectoryPoint.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectory : public ros::Msg + { + public: + std_msgs::Header header; + uint8_t joint_names_length; + char* st_joint_names; + char* * joint_names; + uint8_t points_length; + trajectory_msgs::MultiDOFJointTrajectoryPoint st_points; + trajectory_msgs::MultiDOFJointTrajectoryPoint * points; + + MultiDOFJointTrajectory(): + header(), + joint_names_length(0), joint_names(NULL), + points_length(0), points(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + *(outbuffer + offset++) = joint_names_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_joint_namesi = strlen(this->joint_names[i]); + memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); + offset += length_joint_namesi; + } + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint8_t joint_names_lengthT = *(inbuffer + offset++); + if(joint_names_lengthT > joint_names_length) + this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); + offset += 3; + joint_names_length = joint_names_lengthT; + for( uint8_t i = 0; i < joint_names_length; i++){ + uint32_t length_st_joint_names; + memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_joint_names-1]=0; + this->st_joint_names = (char *)(inbuffer + offset-1); + offset += length_st_joint_names; + memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); + } + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (trajectory_msgs::MultiDOFJointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::MultiDOFJointTrajectoryPoint)); + } + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectory"; }; + const char * getMD5(){ return "ef145a45a5f47b77b7f5cdde4b16c942"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h new file mode 100755 index 0000000..d665acd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/trajectory_msgs/MultiDOFJointTrajectoryPoint.h @@ -0,0 +1,123 @@ +#ifndef _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h +#define _ROS_trajectory_msgs_MultiDOFJointTrajectoryPoint_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Transform.h" +#include "geometry_msgs/Twist.h" +#include "ros/duration.h" + +namespace trajectory_msgs +{ + + class MultiDOFJointTrajectoryPoint : public ros::Msg + { + public: + uint8_t transforms_length; + geometry_msgs::Transform st_transforms; + geometry_msgs::Transform * transforms; + uint8_t velocities_length; + geometry_msgs::Twist st_velocities; + geometry_msgs::Twist * velocities; + uint8_t accelerations_length; + geometry_msgs::Twist st_accelerations; + geometry_msgs::Twist * accelerations; + ros::Duration time_from_start; + + MultiDOFJointTrajectoryPoint(): + transforms_length(0), transforms(NULL), + velocities_length(0), velocities(NULL), + accelerations_length(0), accelerations(NULL), + time_from_start() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = transforms_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->transforms[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = velocities_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->velocities[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = accelerations_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->accelerations[i].serialize(outbuffer + offset); + } + *(outbuffer + offset + 0) = (this->time_from_start.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.sec); + *(outbuffer + offset + 0) = (this->time_from_start.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->time_from_start.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->time_from_start.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->time_from_start.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t transforms_lengthT = *(inbuffer + offset++); + if(transforms_lengthT > transforms_length) + this->transforms = (geometry_msgs::Transform*)realloc(this->transforms, transforms_lengthT * sizeof(geometry_msgs::Transform)); + offset += 3; + transforms_length = transforms_lengthT; + for( uint8_t i = 0; i < transforms_length; i++){ + offset += this->st_transforms.deserialize(inbuffer + offset); + memcpy( &(this->transforms[i]), &(this->st_transforms), sizeof(geometry_msgs::Transform)); + } + uint8_t velocities_lengthT = *(inbuffer + offset++); + if(velocities_lengthT > velocities_length) + this->velocities = (geometry_msgs::Twist*)realloc(this->velocities, velocities_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + velocities_length = velocities_lengthT; + for( uint8_t i = 0; i < velocities_length; i++){ + offset += this->st_velocities.deserialize(inbuffer + offset); + memcpy( &(this->velocities[i]), &(this->st_velocities), sizeof(geometry_msgs::Twist)); + } + uint8_t accelerations_lengthT = *(inbuffer + offset++); + if(accelerations_lengthT > accelerations_length) + this->accelerations = (geometry_msgs::Twist*)realloc(this->accelerations, accelerations_lengthT * sizeof(geometry_msgs::Twist)); + offset += 3; + accelerations_length = accelerations_lengthT; + for( uint8_t i = 0; i < accelerations_length; i++){ + offset += this->st_accelerations.deserialize(inbuffer + offset); + memcpy( &(this->accelerations[i]), &(this->st_accelerations), sizeof(geometry_msgs::Twist)); + } + this->time_from_start.sec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.sec); + this->time_from_start.nsec = ((uint32_t) (*(inbuffer + offset))); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->time_from_start.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->time_from_start.nsec); + return offset; + } + + const char * getType(){ return "trajectory_msgs/MultiDOFJointTrajectoryPoint"; }; + const char * getMD5(){ return "3ebe08d1abd5b65862d50e09430db776"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeAction.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeAction.h new file mode 100755 index 0000000..76a28dd --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeAction.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeAction_h +#define _ROS_turtle_actionlib_ShapeAction_h + +#include +#include +#include +#include "ros/msg.h" +#include "turtle_actionlib/ShapeActionGoal.h" +#include "turtle_actionlib/ShapeActionResult.h" +#include "turtle_actionlib/ShapeActionFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeAction : public ros::Msg + { + public: + turtle_actionlib::ShapeActionGoal action_goal; + turtle_actionlib::ShapeActionResult action_result; + turtle_actionlib::ShapeActionFeedback action_feedback; + + ShapeAction(): + action_goal(), + action_result(), + action_feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->action_goal.serialize(outbuffer + offset); + offset += this->action_result.serialize(outbuffer + offset); + offset += this->action_feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->action_goal.deserialize(inbuffer + offset); + offset += this->action_result.deserialize(inbuffer + offset); + offset += this->action_feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeAction"; }; + const char * getMD5(){ return "d73b17d6237a925511f5d7727a1dc903"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h new file mode 100755 index 0000000..f6186e3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionFeedback.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionFeedback_h +#define _ROS_turtle_actionlib_ShapeActionFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeFeedback.h" + +namespace turtle_actionlib +{ + + class ShapeActionFeedback : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeFeedback feedback; + + ShapeActionFeedback(): + header(), + status(), + feedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->feedback.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->feedback.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionFeedback"; }; + const char * getMD5(){ return "aae20e09065c3809e8a8e87c4c8953fd"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h new file mode 100755 index 0000000..1d205cc --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionGoal.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionGoal_h +#define _ROS_turtle_actionlib_ShapeActionGoal_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalID.h" +#include "turtle_actionlib/ShapeGoal.h" + +namespace turtle_actionlib +{ + + class ShapeActionGoal : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalID goal_id; + turtle_actionlib::ShapeGoal goal; + + ShapeActionGoal(): + header(), + goal_id(), + goal() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->goal_id.serialize(outbuffer + offset); + offset += this->goal.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->goal_id.deserialize(inbuffer + offset); + offset += this->goal.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionGoal"; }; + const char * getMD5(){ return "dbfccd187f2ec9c593916447ffd6cc77"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h new file mode 100755 index 0000000..e60375a --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeActionResult.h @@ -0,0 +1,53 @@ +#ifndef _ROS_turtle_actionlib_ShapeActionResult_h +#define _ROS_turtle_actionlib_ShapeActionResult_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "actionlib_msgs/GoalStatus.h" +#include "turtle_actionlib/ShapeResult.h" + +namespace turtle_actionlib +{ + + class ShapeActionResult : public ros::Msg + { + public: + std_msgs::Header header; + actionlib_msgs::GoalStatus status; + turtle_actionlib::ShapeResult result; + + ShapeActionResult(): + header(), + status(), + result() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->status.serialize(outbuffer + offset); + offset += this->result.serialize(outbuffer + offset); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->status.deserialize(inbuffer + offset); + offset += this->result.deserialize(inbuffer + offset); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeActionResult"; }; + const char * getMD5(){ return "c8d13d5d140f1047a2e4d3bf5c045822"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h new file mode 100755 index 0000000..6c00c07 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeFeedback.h @@ -0,0 +1,38 @@ +#ifndef _ROS_turtle_actionlib_ShapeFeedback_h +#define _ROS_turtle_actionlib_ShapeFeedback_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeFeedback : public ros::Msg + { + public: + + ShapeFeedback() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeFeedback"; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h new file mode 100755 index 0000000..0e1f10d --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeGoal.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_ShapeGoal_h +#define _ROS_turtle_actionlib_ShapeGoal_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeGoal : public ros::Msg + { + public: + int32_t edges; + float radius; + + ShapeGoal(): + edges(0), + radius(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.real = this->edges; + *(outbuffer + offset + 0) = (u_edges.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_edges.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_edges.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_edges.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.real = this->radius; + *(outbuffer + offset + 0) = (u_radius.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_radius.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_radius.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_radius.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->radius); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + int32_t real; + uint32_t base; + } u_edges; + u_edges.base = 0; + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_edges.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->edges = u_edges.real; + offset += sizeof(this->edges); + union { + float real; + uint32_t base; + } u_radius; + u_radius.base = 0; + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_radius.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->radius = u_radius.real; + offset += sizeof(this->radius); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeGoal"; }; + const char * getMD5(){ return "3b9202ab7292cebe5a95ab2bf6b9c091"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeResult.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeResult.h new file mode 100755 index 0000000..164f65c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/ShapeResult.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_ShapeResult_h +#define _ROS_turtle_actionlib_ShapeResult_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class ShapeResult : public ros::Msg + { + public: + float interior_angle; + float apothem; + + ShapeResult(): + interior_angle(0), + apothem(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.real = this->interior_angle; + *(outbuffer + offset + 0) = (u_interior_angle.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_interior_angle.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_interior_angle.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_interior_angle.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.real = this->apothem; + *(outbuffer + offset + 0) = (u_apothem.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_apothem.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_apothem.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_apothem.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->apothem); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_interior_angle; + u_interior_angle.base = 0; + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_interior_angle.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->interior_angle = u_interior_angle.real; + offset += sizeof(this->interior_angle); + union { + float real; + uint32_t base; + } u_apothem; + u_apothem.base = 0; + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_apothem.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->apothem = u_apothem.real; + offset += sizeof(this->apothem); + return offset; + } + + const char * getType(){ return "turtle_actionlib/ShapeResult"; }; + const char * getMD5(){ return "b06c6e2225f820dbc644270387cd1a7c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/Velocity.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/Velocity.h new file mode 100755 index 0000000..5105eb3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtle_actionlib/Velocity.h @@ -0,0 +1,84 @@ +#ifndef _ROS_turtle_actionlib_Velocity_h +#define _ROS_turtle_actionlib_Velocity_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtle_actionlib +{ + + class Velocity : public ros::Msg + { + public: + float linear; + float angular; + + Velocity(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return "turtle_actionlib/Velocity"; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Color.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Color.h new file mode 100755 index 0000000..90ed1fb --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Color.h @@ -0,0 +1,56 @@ +#ifndef _ROS_turtlesim_Color_h +#define _ROS_turtlesim_Color_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Color : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + + Color(): + r(0), + g(0), + b(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + return offset; + } + + const char * getType(){ return "turtlesim/Color"; }; + const char * getMD5(){ return "353891e354491c51aabe32df673fb446"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Kill.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Kill.h new file mode 100755 index 0000000..c7011bf --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Kill.h @@ -0,0 +1,86 @@ +#ifndef _ROS_SERVICE_Kill_h +#define _ROS_SERVICE_Kill_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char KILL[] = "turtlesim/Kill"; + + class KillRequest : public ros::Msg + { + public: + const char* name; + + KillRequest(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class KillResponse : public ros::Msg + { + public: + + KillResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return KILL; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class Kill { + public: + typedef KillRequest Request; + typedef KillResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Pose.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Pose.h new file mode 100755 index 0000000..a0ab8d8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Pose.h @@ -0,0 +1,153 @@ +#ifndef _ROS_turtlesim_Pose_h +#define _ROS_turtlesim_Pose_h + +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + + class Pose : public ros::Msg + { + public: + float x; + float y; + float theta; + float linear_velocity; + float angular_velocity; + + Pose(): + x(0), + y(0), + theta(0), + linear_velocity(0), + angular_velocity(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.real = this->linear_velocity; + *(outbuffer + offset + 0) = (u_linear_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.real = this->angular_velocity; + *(outbuffer + offset + 0) = (u_angular_velocity.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular_velocity.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular_velocity.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular_velocity.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular_velocity); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + union { + float real; + uint32_t base; + } u_linear_velocity; + u_linear_velocity.base = 0; + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear_velocity = u_linear_velocity.real; + offset += sizeof(this->linear_velocity); + union { + float real; + uint32_t base; + } u_angular_velocity; + u_angular_velocity.base = 0; + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular_velocity.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular_velocity = u_angular_velocity.real; + offset += sizeof(this->angular_velocity); + return offset; + } + + const char * getType(){ return "turtlesim/Pose"; }; + const char * getMD5(){ return "863b248d5016ca62ea2e895ae5265cf9"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/SetPen.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/SetPen.h new file mode 100755 index 0000000..0759f05 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/SetPen.h @@ -0,0 +1,100 @@ +#ifndef _ROS_SERVICE_SetPen_h +#define _ROS_SERVICE_SetPen_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SETPEN[] = "turtlesim/SetPen"; + + class SetPenRequest : public ros::Msg + { + public: + uint8_t r; + uint8_t g; + uint8_t b; + uint8_t width; + uint8_t off; + + SetPenRequest(): + r(0), + g(0), + b(0), + width(0), + off(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->r >> (8 * 0)) & 0xFF; + offset += sizeof(this->r); + *(outbuffer + offset + 0) = (this->g >> (8 * 0)) & 0xFF; + offset += sizeof(this->g); + *(outbuffer + offset + 0) = (this->b >> (8 * 0)) & 0xFF; + offset += sizeof(this->b); + *(outbuffer + offset + 0) = (this->width >> (8 * 0)) & 0xFF; + offset += sizeof(this->width); + *(outbuffer + offset + 0) = (this->off >> (8 * 0)) & 0xFF; + offset += sizeof(this->off); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->r = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->r); + this->g = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->g); + this->b = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->b); + this->width = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->width); + this->off = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->off); + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "9f452acce566bf0c0954594f69a8e41b"; }; + + }; + + class SetPenResponse : public ros::Msg + { + public: + + SetPenResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return SETPEN; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class SetPen { + public: + typedef SetPenRequest Request; + typedef SetPenResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Spawn.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Spawn.h new file mode 100755 index 0000000..416fa95 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/Spawn.h @@ -0,0 +1,171 @@ +#ifndef _ROS_SERVICE_Spawn_h +#define _ROS_SERVICE_Spawn_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char SPAWN[] = "turtlesim/Spawn"; + + class SpawnRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + const char* name; + + SpawnRequest(): + x(0), + y(0), + theta(0), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "57f001c49ab7b11d699f8606c1f4f7ff"; }; + + }; + + class SpawnResponse : public ros::Msg + { + public: + const char* name; + + SpawnResponse(): + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return SPAWN; }; + const char * getMD5(){ return "c1f3d28f1b044c871e6eff2e9fc3c667"; }; + + }; + + class Spawn { + public: + typedef SpawnRequest Request; + typedef SpawnResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/TeleportAbsolute.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/TeleportAbsolute.h new file mode 100755 index 0000000..a75f19e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/TeleportAbsolute.h @@ -0,0 +1,139 @@ +#ifndef _ROS_SERVICE_TeleportAbsolute_h +#define _ROS_SERVICE_TeleportAbsolute_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTABSOLUTE[] = "turtlesim/TeleportAbsolute"; + + class TeleportAbsoluteRequest : public ros::Msg + { + public: + float x; + float y; + float theta; + + TeleportAbsoluteRequest(): + x(0), + y(0), + theta(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.real = this->x; + *(outbuffer + offset + 0) = (u_x.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_x.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_x.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_x.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.real = this->y; + *(outbuffer + offset + 0) = (u_y.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_y.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_y.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_y.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.real = this->theta; + *(outbuffer + offset + 0) = (u_theta.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_theta.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_theta.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_theta.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->theta); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_x; + u_x.base = 0; + u_x.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_x.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->x = u_x.real; + offset += sizeof(this->x); + union { + float real; + uint32_t base; + } u_y; + u_y.base = 0; + u_y.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_y.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->y = u_y.real; + offset += sizeof(this->y); + union { + float real; + uint32_t base; + } u_theta; + u_theta.base = 0; + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_theta.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->theta = u_theta.real; + offset += sizeof(this->theta); + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "a130bc60ee6513855dc62ea83fcc5b20"; }; + + }; + + class TeleportAbsoluteResponse : public ros::Msg + { + public: + + TeleportAbsoluteResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTABSOLUTE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportAbsolute { + public: + typedef TeleportAbsoluteRequest Request; + typedef TeleportAbsoluteResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/TeleportRelative.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/TeleportRelative.h new file mode 100755 index 0000000..7df40d9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/turtlesim/TeleportRelative.h @@ -0,0 +1,116 @@ +#ifndef _ROS_SERVICE_TeleportRelative_h +#define _ROS_SERVICE_TeleportRelative_h +#include +#include +#include +#include "ros/msg.h" + +namespace turtlesim +{ + +static const char TELEPORTRELATIVE[] = "turtlesim/TeleportRelative"; + + class TeleportRelativeRequest : public ros::Msg + { + public: + float linear; + float angular; + + TeleportRelativeRequest(): + linear(0), + angular(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.real = this->linear; + *(outbuffer + offset + 0) = (u_linear.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_linear.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_linear.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_linear.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.real = this->angular; + *(outbuffer + offset + 0) = (u_angular.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_angular.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_angular.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_angular.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->angular); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + union { + float real; + uint32_t base; + } u_linear; + u_linear.base = 0; + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_linear.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->linear = u_linear.real; + offset += sizeof(this->linear); + union { + float real; + uint32_t base; + } u_angular; + u_angular.base = 0; + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_angular.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->angular = u_angular.real; + offset += sizeof(this->angular); + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "9d5c2dcd348ac8f76ce2a4307bd63a13"; }; + + }; + + class TeleportRelativeResponse : public ros::Msg + { + public: + + TeleportRelativeResponse() + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + return offset; + } + + const char * getType(){ return TELEPORTRELATIVE; }; + const char * getMD5(){ return "d41d8cd98f00b204e9800998ecf8427e"; }; + + }; + + class TeleportRelative { + public: + typedef TeleportRelativeRequest Request; + typedef TeleportRelativeResponse Response; + }; + +} +#endif diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/ImageMarker.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/ImageMarker.h new file mode 100755 index 0000000..008ee8e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/ImageMarker.h @@ -0,0 +1,241 @@ +#ifndef _ROS_visualization_msgs_ImageMarker_h +#define _ROS_visualization_msgs_ImageMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Point.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" + +namespace visualization_msgs +{ + + class ImageMarker : public ros::Msg + { + public: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Point position; + float scale; + std_msgs::ColorRGBA outline_color; + uint8_t filled; + std_msgs::ColorRGBA fill_color; + ros::Duration lifetime; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t outline_colors_length; + std_msgs::ColorRGBA st_outline_colors; + std_msgs::ColorRGBA * outline_colors; + enum { CIRCLE = 0 }; + enum { LINE_STRIP = 1 }; + enum { LINE_LIST = 2 }; + enum { POLYGON = 3 }; + enum { POINTS = 4 }; + enum { ADD = 0 }; + enum { REMOVE = 1 }; + + ImageMarker(): + header(), + ns(""), + id(0), + type(0), + action(0), + position(), + scale(0), + outline_color(), + filled(0), + fill_color(), + lifetime(), + points_length(0), points(NULL), + outline_colors_length(0), outline_colors(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->position.serialize(outbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + offset += this->outline_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->filled >> (8 * 0)) & 0xFF; + offset += sizeof(this->filled); + offset += this->fill_color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = outline_colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->outline_colors[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->position.deserialize(inbuffer + offset); + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + offset += this->outline_color.deserialize(inbuffer + offset); + this->filled = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->filled); + offset += this->fill_color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t outline_colors_lengthT = *(inbuffer + offset++); + if(outline_colors_lengthT > outline_colors_length) + this->outline_colors = (std_msgs::ColorRGBA*)realloc(this->outline_colors, outline_colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + outline_colors_length = outline_colors_lengthT; + for( uint8_t i = 0; i < outline_colors_length; i++){ + offset += this->st_outline_colors.deserialize(inbuffer + offset); + memcpy( &(this->outline_colors[i]), &(this->st_outline_colors), sizeof(std_msgs::ColorRGBA)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/ImageMarker"; }; + const char * getMD5(){ return "1de93c67ec8858b831025a08fbf1b35c"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h new file mode 100755 index 0000000..97f9510 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarker.h @@ -0,0 +1,145 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarker_h +#define _ROS_visualization_msgs_InteractiveMarker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "visualization_msgs/MenuEntry.h" +#include "visualization_msgs/InteractiveMarkerControl.h" + +namespace visualization_msgs +{ + + class InteractiveMarker : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + const char* description; + float scale; + uint8_t menu_entries_length; + visualization_msgs::MenuEntry st_menu_entries; + visualization_msgs::MenuEntry * menu_entries; + uint8_t controls_length; + visualization_msgs::InteractiveMarkerControl st_controls; + visualization_msgs::InteractiveMarkerControl * controls; + + InteractiveMarker(): + header(), + pose(), + name(""), + description(""), + scale(0), + menu_entries_length(0), menu_entries(NULL), + controls_length(0), controls(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.real = this->scale; + *(outbuffer + offset + 0) = (u_scale.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_scale.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_scale.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_scale.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->scale); + *(outbuffer + offset++) = menu_entries_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->menu_entries[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = controls_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->controls[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + union { + float real; + uint32_t base; + } u_scale; + u_scale.base = 0; + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_scale.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->scale = u_scale.real; + offset += sizeof(this->scale); + uint8_t menu_entries_lengthT = *(inbuffer + offset++); + if(menu_entries_lengthT > menu_entries_length) + this->menu_entries = (visualization_msgs::MenuEntry*)realloc(this->menu_entries, menu_entries_lengthT * sizeof(visualization_msgs::MenuEntry)); + offset += 3; + menu_entries_length = menu_entries_lengthT; + for( uint8_t i = 0; i < menu_entries_length; i++){ + offset += this->st_menu_entries.deserialize(inbuffer + offset); + memcpy( &(this->menu_entries[i]), &(this->st_menu_entries), sizeof(visualization_msgs::MenuEntry)); + } + uint8_t controls_lengthT = *(inbuffer + offset++); + if(controls_lengthT > controls_length) + this->controls = (visualization_msgs::InteractiveMarkerControl*)realloc(this->controls, controls_lengthT * sizeof(visualization_msgs::InteractiveMarkerControl)); + offset += 3; + controls_length = controls_lengthT; + for( uint8_t i = 0; i < controls_length; i++){ + offset += this->st_controls.deserialize(inbuffer + offset); + memcpy( &(this->controls[i]), &(this->st_controls), sizeof(visualization_msgs::InteractiveMarkerControl)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarker"; }; + const char * getMD5(){ return "311bd5f6cd6a20820ac0ba84315f4e22"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h new file mode 100755 index 0000000..1c2cef0 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerControl.h @@ -0,0 +1,155 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerControl_h +#define _ROS_visualization_msgs_InteractiveMarkerControl_h + +#include +#include +#include +#include "ros/msg.h" +#include "geometry_msgs/Quaternion.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerControl : public ros::Msg + { + public: + const char* name; + geometry_msgs::Quaternion orientation; + uint8_t orientation_mode; + uint8_t interaction_mode; + bool always_visible; + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + bool independent_marker_orientation; + const char* description; + enum { INHERIT = 0 }; + enum { FIXED = 1 }; + enum { VIEW_FACING = 2 }; + enum { NONE = 0 }; + enum { MENU = 1 }; + enum { BUTTON = 2 }; + enum { MOVE_AXIS = 3 }; + enum { MOVE_PLANE = 4 }; + enum { ROTATE_AXIS = 5 }; + enum { MOVE_ROTATE = 6 }; + enum { MOVE_3D = 7 }; + enum { ROTATE_3D = 8 }; + enum { MOVE_ROTATE_3D = 9 }; + + InteractiveMarkerControl(): + name(""), + orientation(), + orientation_mode(0), + interaction_mode(0), + always_visible(0), + markers_length(0), markers(NULL), + independent_marker_orientation(0), + description("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + offset += this->orientation.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->orientation_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->orientation_mode); + *(outbuffer + offset + 0) = (this->interaction_mode >> (8 * 0)) & 0xFF; + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.real = this->always_visible; + *(outbuffer + offset + 0) = (u_always_visible.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->always_visible); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.real = this->independent_marker_orientation; + *(outbuffer + offset + 0) = (u_independent_marker_orientation.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description = strlen(this->description); + memcpy(outbuffer + offset, &length_description, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->description, length_description); + offset += length_description; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + offset += this->orientation.deserialize(inbuffer + offset); + this->orientation_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->orientation_mode); + this->interaction_mode = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->interaction_mode); + union { + bool real; + uint8_t base; + } u_always_visible; + u_always_visible.base = 0; + u_always_visible.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->always_visible = u_always_visible.real; + offset += sizeof(this->always_visible); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + union { + bool real; + uint8_t base; + } u_independent_marker_orientation; + u_independent_marker_orientation.base = 0; + u_independent_marker_orientation.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->independent_marker_orientation = u_independent_marker_orientation.real; + offset += sizeof(this->independent_marker_orientation); + uint32_t length_description; + memcpy(&length_description, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_description; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_description-1]=0; + this->description = (char *)(inbuffer + offset-1); + offset += length_description; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerControl"; }; + const char * getMD5(){ return "e3a939c98cdd4f709d8e1dec2a9c3f37"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h new file mode 100755 index 0000000..7cdd2c3 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerFeedback.h @@ -0,0 +1,142 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerFeedback_h +#define _ROS_visualization_msgs_InteractiveMarkerFeedback_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerFeedback : public ros::Msg + { + public: + std_msgs::Header header; + const char* client_id; + const char* marker_name; + const char* control_name; + uint8_t event_type; + geometry_msgs::Pose pose; + uint32_t menu_entry_id; + geometry_msgs::Point mouse_point; + bool mouse_point_valid; + enum { KEEP_ALIVE = 0 }; + enum { POSE_UPDATE = 1 }; + enum { MENU_SELECT = 2 }; + enum { BUTTON_CLICK = 3 }; + enum { MOUSE_DOWN = 4 }; + enum { MOUSE_UP = 5 }; + + InteractiveMarkerFeedback(): + header(), + client_id(""), + marker_name(""), + control_name(""), + event_type(0), + pose(), + menu_entry_id(0), + mouse_point(), + mouse_point_valid(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_client_id = strlen(this->client_id); + memcpy(outbuffer + offset, &length_client_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->client_id, length_client_id); + offset += length_client_id; + uint32_t length_marker_name = strlen(this->marker_name); + memcpy(outbuffer + offset, &length_marker_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->marker_name, length_marker_name); + offset += length_marker_name; + uint32_t length_control_name = strlen(this->control_name); + memcpy(outbuffer + offset, &length_control_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->control_name, length_control_name); + offset += length_control_name; + *(outbuffer + offset + 0) = (this->event_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->event_type); + offset += this->pose.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->menu_entry_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->menu_entry_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->menu_entry_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->menu_entry_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.serialize(outbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.real = this->mouse_point_valid; + *(outbuffer + offset + 0) = (u_mouse_point_valid.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_client_id; + memcpy(&length_client_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_client_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_client_id-1]=0; + this->client_id = (char *)(inbuffer + offset-1); + offset += length_client_id; + uint32_t length_marker_name; + memcpy(&length_marker_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_marker_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_marker_name-1]=0; + this->marker_name = (char *)(inbuffer + offset-1); + offset += length_marker_name; + uint32_t length_control_name; + memcpy(&length_control_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_control_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_control_name-1]=0; + this->control_name = (char *)(inbuffer + offset-1); + offset += length_control_name; + this->event_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->event_type); + offset += this->pose.deserialize(inbuffer + offset); + this->menu_entry_id = ((uint32_t) (*(inbuffer + offset))); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->menu_entry_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->menu_entry_id); + offset += this->mouse_point.deserialize(inbuffer + offset); + union { + bool real; + uint8_t base; + } u_mouse_point_valid; + u_mouse_point_valid.base = 0; + u_mouse_point_valid.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mouse_point_valid = u_mouse_point_valid.real; + offset += sizeof(this->mouse_point_valid); + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerFeedback"; }; + const char * getMD5(){ return "ab0f1eee058667e28c19ff3ffc3f4b78"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h new file mode 100755 index 0000000..656df9e --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerInit.h @@ -0,0 +1,98 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerInit_h +#define _ROS_visualization_msgs_InteractiveMarkerInit_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerInit : public ros::Msg + { + public: + const char* server_id; + uint64_t seq_num; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + + InteractiveMarkerInit(): + server_id(""), + seq_num(0), + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerInit"; }; + const char * getMD5(){ return "aa2f1dcea79533d1710675195653028d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h new file mode 100755 index 0000000..b94dc8f --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerPose.h @@ -0,0 +1,64 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerPose_h +#define _ROS_visualization_msgs_InteractiveMarkerPose_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerPose : public ros::Msg + { + public: + std_msgs::Header header; + geometry_msgs::Pose pose; + const char* name; + + InteractiveMarkerPose(): + header(), + pose(), + name("") + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + offset += this->pose.serialize(outbuffer + offset); + uint32_t length_name = strlen(this->name); + memcpy(outbuffer + offset, &length_name, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->name, length_name); + offset += length_name; + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + offset += this->pose.deserialize(inbuffer + offset); + uint32_t length_name; + memcpy(&length_name, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_name; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_name-1]=0; + this->name = (char *)(inbuffer + offset-1); + offset += length_name; + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerPose"; }; + const char * getMD5(){ return "a6e6833209a196a38d798dadb02c81f8"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h new file mode 100755 index 0000000..d24ea0c --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/InteractiveMarkerUpdate.h @@ -0,0 +1,159 @@ +#ifndef _ROS_visualization_msgs_InteractiveMarkerUpdate_h +#define _ROS_visualization_msgs_InteractiveMarkerUpdate_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/InteractiveMarker.h" +#include "visualization_msgs/InteractiveMarkerPose.h" + +namespace visualization_msgs +{ + + class InteractiveMarkerUpdate : public ros::Msg + { + public: + const char* server_id; + uint64_t seq_num; + uint8_t type; + uint8_t markers_length; + visualization_msgs::InteractiveMarker st_markers; + visualization_msgs::InteractiveMarker * markers; + uint8_t poses_length; + visualization_msgs::InteractiveMarkerPose st_poses; + visualization_msgs::InteractiveMarkerPose * poses; + uint8_t erases_length; + char* st_erases; + char* * erases; + enum { KEEP_ALIVE = 0 }; + enum { UPDATE = 1 }; + + InteractiveMarkerUpdate(): + server_id(""), + seq_num(0), + type(0), + markers_length(0), markers(NULL), + poses_length(0), poses(NULL), + erases_length(0), erases(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + uint32_t length_server_id = strlen(this->server_id); + memcpy(outbuffer + offset, &length_server_id, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->server_id, length_server_id); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.real = this->seq_num; + *(outbuffer + offset + 0) = (u_seq_num.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_seq_num.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_seq_num.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_seq_num.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->seq_num); + *(outbuffer + offset + 0) = (this->type >> (8 * 0)) & 0xFF; + offset += sizeof(this->type); + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = poses_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->poses[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = erases_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_erasesi = strlen(this->erases[i]); + memcpy(outbuffer + offset, &length_erasesi, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->erases[i], length_erasesi); + offset += length_erasesi; + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint32_t length_server_id; + memcpy(&length_server_id, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_server_id; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_server_id-1]=0; + this->server_id = (char *)(inbuffer + offset-1); + offset += length_server_id; + union { + uint64_t real; + uint32_t base; + } u_seq_num; + u_seq_num.base = 0; + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_seq_num.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->seq_num = u_seq_num.real; + offset += sizeof(this->seq_num); + this->type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->type); + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::InteractiveMarker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::InteractiveMarker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::InteractiveMarker)); + } + uint8_t poses_lengthT = *(inbuffer + offset++); + if(poses_lengthT > poses_length) + this->poses = (visualization_msgs::InteractiveMarkerPose*)realloc(this->poses, poses_lengthT * sizeof(visualization_msgs::InteractiveMarkerPose)); + offset += 3; + poses_length = poses_lengthT; + for( uint8_t i = 0; i < poses_length; i++){ + offset += this->st_poses.deserialize(inbuffer + offset); + memcpy( &(this->poses[i]), &(this->st_poses), sizeof(visualization_msgs::InteractiveMarkerPose)); + } + uint8_t erases_lengthT = *(inbuffer + offset++); + if(erases_lengthT > erases_length) + this->erases = (char**)realloc(this->erases, erases_lengthT * sizeof(char*)); + offset += 3; + erases_length = erases_lengthT; + for( uint8_t i = 0; i < erases_length; i++){ + uint32_t length_st_erases; + memcpy(&length_st_erases, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_st_erases; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_st_erases-1]=0; + this->st_erases = (char *)(inbuffer + offset-1); + offset += length_st_erases; + memcpy( &(this->erases[i]), &(this->st_erases), sizeof(char*)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/InteractiveMarkerUpdate"; }; + const char * getMD5(){ return "83e22f99d3b31fde725e0a338200e036"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/Marker.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/Marker.h new file mode 100755 index 0000000..2219629 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/Marker.h @@ -0,0 +1,288 @@ +#ifndef _ROS_visualization_msgs_Marker_h +#define _ROS_visualization_msgs_Marker_h + +#include +#include +#include +#include "ros/msg.h" +#include "std_msgs/Header.h" +#include "geometry_msgs/Pose.h" +#include "geometry_msgs/Vector3.h" +#include "std_msgs/ColorRGBA.h" +#include "ros/duration.h" +#include "geometry_msgs/Point.h" + +namespace visualization_msgs +{ + + class Marker : public ros::Msg + { + public: + std_msgs::Header header; + const char* ns; + int32_t id; + int32_t type; + int32_t action; + geometry_msgs::Pose pose; + geometry_msgs::Vector3 scale; + std_msgs::ColorRGBA color; + ros::Duration lifetime; + bool frame_locked; + uint8_t points_length; + geometry_msgs::Point st_points; + geometry_msgs::Point * points; + uint8_t colors_length; + std_msgs::ColorRGBA st_colors; + std_msgs::ColorRGBA * colors; + const char* text; + const char* mesh_resource; + bool mesh_use_embedded_materials; + enum { ARROW = 0 }; + enum { CUBE = 1 }; + enum { SPHERE = 2 }; + enum { CYLINDER = 3 }; + enum { LINE_STRIP = 4 }; + enum { LINE_LIST = 5 }; + enum { CUBE_LIST = 6 }; + enum { SPHERE_LIST = 7 }; + enum { POINTS = 8 }; + enum { TEXT_VIEW_FACING = 9 }; + enum { MESH_RESOURCE = 10 }; + enum { TRIANGLE_LIST = 11 }; + enum { ADD = 0 }; + enum { MODIFY = 0 }; + enum { DELETE = 2 }; + + Marker(): + header(), + ns(""), + id(0), + type(0), + action(0), + pose(), + scale(), + color(), + lifetime(), + frame_locked(0), + points_length(0), points(NULL), + colors_length(0), colors(NULL), + text(""), + mesh_resource(""), + mesh_use_embedded_materials(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + offset += this->header.serialize(outbuffer + offset); + uint32_t length_ns = strlen(this->ns); + memcpy(outbuffer + offset, &length_ns, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->ns, length_ns); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.real = this->id; + *(outbuffer + offset + 0) = (u_id.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_id.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_id.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_id.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.real = this->type; + *(outbuffer + offset + 0) = (u_type.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_type.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_type.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_type.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.real = this->action; + *(outbuffer + offset + 0) = (u_action.base >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (u_action.base >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (u_action.base >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (u_action.base >> (8 * 3)) & 0xFF; + offset += sizeof(this->action); + offset += this->pose.serialize(outbuffer + offset); + offset += this->scale.serialize(outbuffer + offset); + offset += this->color.serialize(outbuffer + offset); + *(outbuffer + offset + 0) = (this->lifetime.sec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.sec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.sec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.sec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.sec); + *(outbuffer + offset + 0) = (this->lifetime.nsec >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->lifetime.nsec >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->lifetime.nsec >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->lifetime.nsec >> (8 * 3)) & 0xFF; + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.real = this->frame_locked; + *(outbuffer + offset + 0) = (u_frame_locked.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->frame_locked); + *(outbuffer + offset++) = points_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->points[i].serialize(outbuffer + offset); + } + *(outbuffer + offset++) = colors_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->colors[i].serialize(outbuffer + offset); + } + uint32_t length_text = strlen(this->text); + memcpy(outbuffer + offset, &length_text, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->text, length_text); + offset += length_text; + uint32_t length_mesh_resource = strlen(this->mesh_resource); + memcpy(outbuffer + offset, &length_mesh_resource, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->mesh_resource, length_mesh_resource); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.real = this->mesh_use_embedded_materials; + *(outbuffer + offset + 0) = (u_mesh_use_embedded_materials.base >> (8 * 0)) & 0xFF; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + offset += this->header.deserialize(inbuffer + offset); + uint32_t length_ns; + memcpy(&length_ns, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_ns; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_ns-1]=0; + this->ns = (char *)(inbuffer + offset-1); + offset += length_ns; + union { + int32_t real; + uint32_t base; + } u_id; + u_id.base = 0; + u_id.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_id.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->id = u_id.real; + offset += sizeof(this->id); + union { + int32_t real; + uint32_t base; + } u_type; + u_type.base = 0; + u_type.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_type.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->type = u_type.real; + offset += sizeof(this->type); + union { + int32_t real; + uint32_t base; + } u_action; + u_action.base = 0; + u_action.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + u_action.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + this->action = u_action.real; + offset += sizeof(this->action); + offset += this->pose.deserialize(inbuffer + offset); + offset += this->scale.deserialize(inbuffer + offset); + offset += this->color.deserialize(inbuffer + offset); + this->lifetime.sec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.sec); + this->lifetime.nsec = ((uint32_t) (*(inbuffer + offset))); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->lifetime.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->lifetime.nsec); + union { + bool real; + uint8_t base; + } u_frame_locked; + u_frame_locked.base = 0; + u_frame_locked.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->frame_locked = u_frame_locked.real; + offset += sizeof(this->frame_locked); + uint8_t points_lengthT = *(inbuffer + offset++); + if(points_lengthT > points_length) + this->points = (geometry_msgs::Point*)realloc(this->points, points_lengthT * sizeof(geometry_msgs::Point)); + offset += 3; + points_length = points_lengthT; + for( uint8_t i = 0; i < points_length; i++){ + offset += this->st_points.deserialize(inbuffer + offset); + memcpy( &(this->points[i]), &(this->st_points), sizeof(geometry_msgs::Point)); + } + uint8_t colors_lengthT = *(inbuffer + offset++); + if(colors_lengthT > colors_length) + this->colors = (std_msgs::ColorRGBA*)realloc(this->colors, colors_lengthT * sizeof(std_msgs::ColorRGBA)); + offset += 3; + colors_length = colors_lengthT; + for( uint8_t i = 0; i < colors_length; i++){ + offset += this->st_colors.deserialize(inbuffer + offset); + memcpy( &(this->colors[i]), &(this->st_colors), sizeof(std_msgs::ColorRGBA)); + } + uint32_t length_text; + memcpy(&length_text, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_text; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_text-1]=0; + this->text = (char *)(inbuffer + offset-1); + offset += length_text; + uint32_t length_mesh_resource; + memcpy(&length_mesh_resource, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_mesh_resource; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_mesh_resource-1]=0; + this->mesh_resource = (char *)(inbuffer + offset-1); + offset += length_mesh_resource; + union { + bool real; + uint8_t base; + } u_mesh_use_embedded_materials; + u_mesh_use_embedded_materials.base = 0; + u_mesh_use_embedded_materials.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0); + this->mesh_use_embedded_materials = u_mesh_use_embedded_materials.real; + offset += sizeof(this->mesh_use_embedded_materials); + return offset; + } + + const char * getType(){ return "visualization_msgs/Marker"; }; + const char * getMD5(){ return "18326976df9d29249efc939e00342cde"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/MarkerArray.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/MarkerArray.h new file mode 100755 index 0000000..97e32df --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/MarkerArray.h @@ -0,0 +1,59 @@ +#ifndef _ROS_visualization_msgs_MarkerArray_h +#define _ROS_visualization_msgs_MarkerArray_h + +#include +#include +#include +#include "ros/msg.h" +#include "visualization_msgs/Marker.h" + +namespace visualization_msgs +{ + + class MarkerArray : public ros::Msg + { + public: + uint8_t markers_length; + visualization_msgs::Marker st_markers; + visualization_msgs::Marker * markers; + + MarkerArray(): + markers_length(0), markers(NULL) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset++) = markers_length; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + *(outbuffer + offset++) = 0; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->markers[i].serialize(outbuffer + offset); + } + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + uint8_t markers_lengthT = *(inbuffer + offset++); + if(markers_lengthT > markers_length) + this->markers = (visualization_msgs::Marker*)realloc(this->markers, markers_lengthT * sizeof(visualization_msgs::Marker)); + offset += 3; + markers_length = markers_lengthT; + for( uint8_t i = 0; i < markers_length; i++){ + offset += this->st_markers.deserialize(inbuffer + offset); + memcpy( &(this->markers[i]), &(this->st_markers), sizeof(visualization_msgs::Marker)); + } + return offset; + } + + const char * getType(){ return "visualization_msgs/MarkerArray"; }; + const char * getMD5(){ return "90da67007c26525f655c1c269094e39f"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/MenuEntry.h b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/MenuEntry.h new file mode 100755 index 0000000..8ba43e8 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/lib/ros_lib/visualization_msgs/MenuEntry.h @@ -0,0 +1,103 @@ +#ifndef _ROS_visualization_msgs_MenuEntry_h +#define _ROS_visualization_msgs_MenuEntry_h + +#include +#include +#include +#include "ros/msg.h" + +namespace visualization_msgs +{ + + class MenuEntry : public ros::Msg + { + public: + uint32_t id; + uint32_t parent_id; + const char* title; + const char* command; + uint8_t command_type; + enum { FEEDBACK = 0 }; + enum { ROSRUN = 1 }; + enum { ROSLAUNCH = 2 }; + + MenuEntry(): + id(0), + parent_id(0), + title(""), + command(""), + command_type(0) + { + } + + virtual int serialize(unsigned char *outbuffer) const + { + int offset = 0; + *(outbuffer + offset + 0) = (this->id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->id >> (8 * 3)) & 0xFF; + offset += sizeof(this->id); + *(outbuffer + offset + 0) = (this->parent_id >> (8 * 0)) & 0xFF; + *(outbuffer + offset + 1) = (this->parent_id >> (8 * 1)) & 0xFF; + *(outbuffer + offset + 2) = (this->parent_id >> (8 * 2)) & 0xFF; + *(outbuffer + offset + 3) = (this->parent_id >> (8 * 3)) & 0xFF; + offset += sizeof(this->parent_id); + uint32_t length_title = strlen(this->title); + memcpy(outbuffer + offset, &length_title, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->title, length_title); + offset += length_title; + uint32_t length_command = strlen(this->command); + memcpy(outbuffer + offset, &length_command, sizeof(uint32_t)); + offset += 4; + memcpy(outbuffer + offset, this->command, length_command); + offset += length_command; + *(outbuffer + offset + 0) = (this->command_type >> (8 * 0)) & 0xFF; + offset += sizeof(this->command_type); + return offset; + } + + virtual int deserialize(unsigned char *inbuffer) + { + int offset = 0; + this->id = ((uint32_t) (*(inbuffer + offset))); + this->id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->id); + this->parent_id = ((uint32_t) (*(inbuffer + offset))); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); + this->parent_id |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); + offset += sizeof(this->parent_id); + uint32_t length_title; + memcpy(&length_title, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_title; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_title-1]=0; + this->title = (char *)(inbuffer + offset-1); + offset += length_title; + uint32_t length_command; + memcpy(&length_command, (inbuffer + offset), sizeof(uint32_t)); + offset += 4; + for(unsigned int k= offset; k< offset+length_command; ++k){ + inbuffer[k-1]=inbuffer[k]; + } + inbuffer[offset+length_command-1]=0; + this->command = (char *)(inbuffer + offset-1); + offset += length_command; + this->command_type = ((uint8_t) (*(inbuffer + offset))); + offset += sizeof(this->command_type); + return offset; + } + + const char * getType(){ return "visualization_msgs/MenuEntry"; }; + const char * getMD5(){ return "b90ec63024573de83b57aa93eb39be2d"; }; + + }; + +} +#endif \ No newline at end of file diff --git a/case_study/arduino_lab/group_34/original/output.txt b/case_study/arduino_lab/group_34/original/output.txt new file mode 100755 index 0000000..bf04726 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/output.txt @@ -0,0 +1,8 @@ +============================= test session starts ============================== +platform linux -- Python 3.4.3, pytest-3.4.0, py-1.5.2, pluggy-0.6.0 +rootdir: /home/qianqianzhu/test_robot/mutation_python/group_34, inifile: +collected 5 items + +../run_test.py ..... [100%] + +========================== 5 passed in 31.57 seconds =========================== diff --git a/case_study/arduino_lab/group_34/original/platformio.ini b/case_study/arduino_lab/group_34/original/platformio.ini new file mode 100755 index 0000000..9be67b6 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/platformio.ini @@ -0,0 +1,19 @@ +; PlatformIO Project Configuration File +; +; Build options: build flags, source filter, extra scripting +; Upload options: custom port, speed and extra flags +; Library options: dependencies, extra library storages +; +; Please visit documentation for the other options and examples +; http://docs.platformio.org/page/projectconf.html + +[platformio] +env_default = megaADK + +[env:megaADK] +platform = atmelavr +framework = arduino +board = megaADK +upload_port = /dev/ttyACM0 +test_speed = 57600 + diff --git a/case_study/arduino_lab/group_34/original/speed_log.txt b/case_study/arduino_lab/group_34/original/speed_log.txt new file mode 100755 index 0000000..0ff6771 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/speed_log.txt @@ -0,0 +1,3296 @@ +0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 diff --git a/case_study/arduino_lab/group_34/original/src/.robotbase_1.ino.swp b/case_study/arduino_lab/group_34/original/src/.robotbase_1.ino.swp new file mode 100755 index 0000000..8fc9929 Binary files /dev/null and b/case_study/arduino_lab/group_34/original/src/.robotbase_1.ino.swp differ diff --git a/case_study/arduino_lab/group_34/original/src/robotbase_34.ino b/case_study/arduino_lab/group_34/original/src/robotbase_34.ino new file mode 100755 index 0000000..6b126c9 --- /dev/null +++ b/case_study/arduino_lab/group_34/original/src/robotbase_34.ino @@ -0,0 +1,199 @@ +/** + * Group number: 34 + * Student 1: + * Tom van der Meulen, 4189558 + * Student 2: + * Levi Dekker, 4224175 + */ + +#include +//#include +#include + +// Arduino MEGA connected pins +#define HB_1REV 7 +#define HB_1EN 24 +#define HB_1FWD 6 +#define HB_2REV 3 +#define HB_2EN 25 +#define HB_2FWD 2 +#define trigPin 23 +#define echoPin 22 +#define led 13 + + +/** + * Declarations + */ + +class NewHardware : public ArduinoHardware { + public: NewHardware():ArduinoHardware(&Serial1 , 57600){}; +}; + +// ROS parameters +//ros::NodeHandle nh; +ros::NodeHandle_ nh; + +// Global parameters +double vmax_ = 0.16; +double vl_, vr_; +unsigned long t_ = millis(); +int time_ok_; + +// Function declarations +void clip_v(double *vl, double *vr); +void convert2motor(geometry_msgs::Twist twist); +void messageCb(const geometry_msgs::Twist &twist); +long getdistance(); +double distancefactor(); +void writespeed(double vl, double vr); + +//ros::Subscriber sub("toggle_led", &messageCb ); +ros::Subscriber sub("/cmd_vel", &messageCb ); + + +/** + * Implementation + */ + +void clip_v(double *vl, double *vr) { + int isclipped = 0; + + if (abs(*vl) > vmax_) { + *vr = *vr * vmax_/ abs(*vl); + *vl = *vl * vmax_/ abs(*vl); + isclipped = 1; + } + + if (abs(*vr) > vmax_) { + *vl = *vl * vmax_ / abs(*vr); + *vr = *vr * vmax_ / abs(*vr); + isclipped = 1; + } + + if (isclipped) { + //nh.logwarn("Motor speeds have been scaled down to ensure that they do not exceed vmax"); + } +} + +void convert2motor(geometry_msgs::Twist twist) { + + double lx = twist.linear.x; + double az = twist.angular.z; + + double rotsp = az * 0.0475; + + digitalWrite(HB_1EN, HIGH); + digitalWrite(HB_2EN, HIGH); + + double vl = (-rotsp + lx); + double vr = (rotsp + lx); + + //Serial.println("Hoi"); + //nh.loginfo("Hoi"); + + clip_v(&vl, &vr); + + vl_ = vl; + vr_ = vr; +} + +void messageCb(const geometry_msgs::Twist &twist) { // const std_msgs::Empty& toggle_msg){ + t_ = millis(); + time_ok_ = 1; + + convert2motor(twist); +} + +long getdistance(){ + long duration, distance; + + digitalWrite(trigPin, LOW); + delayMicroseconds(2); + digitalWrite(trigPin, HIGH); + delayMicroseconds(10); + digitalWrite(trigPin, LOW); + duration = pulseIn(echoPin, HIGH); + distance = (duration/58); + + return distance; +} + +double distancefactor(){ + double distance = (double) getdistance(); + double df; + + if (distance < 15) { + df = 0; + } else if (distance < 30) { + digitalWrite(led,HIGH); + df = ( distance)/30; + } + else { + digitalWrite(led,LOW); + df = 1; + } + + return df; +} + +void writespeed(double vl, double vr) { + if (1) { //(millis()-t_) < 100 + if (vl >= 0) { + analogWrite(HB_1FWD, 255*vl/vmax_); + analogWrite(HB_1REV, 0); + } else { + analogWrite(HB_1FWD, 0); + analogWrite(HB_1REV, -255*vl/vmax_); + } + if (vr >= 0) { + analogWrite(HB_2FWD, 255*vr/vmax_); + analogWrite(HB_2REV, 0); + } else { + analogWrite(HB_2FWD, 0); + analogWrite(HB_2REV, -255*vr/vmax_); + } + } else { + analogWrite(HB_1FWD, 0); + analogWrite(HB_1REV, 0); + analogWrite(HB_2FWD, 0); + analogWrite(HB_2REV, 0); + } +} + +void checkTime() { + int dt = millis() - t_; + + if (dt > 500) { + time_ok_ = 0; + } +} + +void setup() +{ + pinMode(HB_1REV, OUTPUT); + pinMode(HB_1EN, OUTPUT); + pinMode(HB_1FWD, OUTPUT); + pinMode(HB_2REV, OUTPUT); + pinMode(HB_2EN, OUTPUT); + pinMode(HB_2FWD, OUTPUT); + + //Serial.begin (9600); + pinMode(trigPin, OUTPUT); + pinMode(echoPin, INPUT); + pinMode(led, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + time_ok_ = 0; +} + +void loop() +{ + nh.spinOnce(); + checkTime(); + double df = (double) distancefactor(); + writespeed(vl_*df*time_ok_, vr_*df*time_ok_); + delay(1); +} diff --git a/case_study/arduino_lab/group_34/robotbase_34/robotbase_34.ino b/case_study/arduino_lab/group_34/robotbase_34/robotbase_34.ino new file mode 100755 index 0000000..6b126c9 --- /dev/null +++ b/case_study/arduino_lab/group_34/robotbase_34/robotbase_34.ino @@ -0,0 +1,199 @@ +/** + * Group number: 34 + * Student 1: + * Tom van der Meulen, 4189558 + * Student 2: + * Levi Dekker, 4224175 + */ + +#include +//#include +#include + +// Arduino MEGA connected pins +#define HB_1REV 7 +#define HB_1EN 24 +#define HB_1FWD 6 +#define HB_2REV 3 +#define HB_2EN 25 +#define HB_2FWD 2 +#define trigPin 23 +#define echoPin 22 +#define led 13 + + +/** + * Declarations + */ + +class NewHardware : public ArduinoHardware { + public: NewHardware():ArduinoHardware(&Serial1 , 57600){}; +}; + +// ROS parameters +//ros::NodeHandle nh; +ros::NodeHandle_ nh; + +// Global parameters +double vmax_ = 0.16; +double vl_, vr_; +unsigned long t_ = millis(); +int time_ok_; + +// Function declarations +void clip_v(double *vl, double *vr); +void convert2motor(geometry_msgs::Twist twist); +void messageCb(const geometry_msgs::Twist &twist); +long getdistance(); +double distancefactor(); +void writespeed(double vl, double vr); + +//ros::Subscriber sub("toggle_led", &messageCb ); +ros::Subscriber sub("/cmd_vel", &messageCb ); + + +/** + * Implementation + */ + +void clip_v(double *vl, double *vr) { + int isclipped = 0; + + if (abs(*vl) > vmax_) { + *vr = *vr * vmax_/ abs(*vl); + *vl = *vl * vmax_/ abs(*vl); + isclipped = 1; + } + + if (abs(*vr) > vmax_) { + *vl = *vl * vmax_ / abs(*vr); + *vr = *vr * vmax_ / abs(*vr); + isclipped = 1; + } + + if (isclipped) { + //nh.logwarn("Motor speeds have been scaled down to ensure that they do not exceed vmax"); + } +} + +void convert2motor(geometry_msgs::Twist twist) { + + double lx = twist.linear.x; + double az = twist.angular.z; + + double rotsp = az * 0.0475; + + digitalWrite(HB_1EN, HIGH); + digitalWrite(HB_2EN, HIGH); + + double vl = (-rotsp + lx); + double vr = (rotsp + lx); + + //Serial.println("Hoi"); + //nh.loginfo("Hoi"); + + clip_v(&vl, &vr); + + vl_ = vl; + vr_ = vr; +} + +void messageCb(const geometry_msgs::Twist &twist) { // const std_msgs::Empty& toggle_msg){ + t_ = millis(); + time_ok_ = 1; + + convert2motor(twist); +} + +long getdistance(){ + long duration, distance; + + digitalWrite(trigPin, LOW); + delayMicroseconds(2); + digitalWrite(trigPin, HIGH); + delayMicroseconds(10); + digitalWrite(trigPin, LOW); + duration = pulseIn(echoPin, HIGH); + distance = (duration/58); + + return distance; +} + +double distancefactor(){ + double distance = (double) getdistance(); + double df; + + if (distance < 15) { + df = 0; + } else if (distance < 30) { + digitalWrite(led,HIGH); + df = ( distance)/30; + } + else { + digitalWrite(led,LOW); + df = 1; + } + + return df; +} + +void writespeed(double vl, double vr) { + if (1) { //(millis()-t_) < 100 + if (vl >= 0) { + analogWrite(HB_1FWD, 255*vl/vmax_); + analogWrite(HB_1REV, 0); + } else { + analogWrite(HB_1FWD, 0); + analogWrite(HB_1REV, -255*vl/vmax_); + } + if (vr >= 0) { + analogWrite(HB_2FWD, 255*vr/vmax_); + analogWrite(HB_2REV, 0); + } else { + analogWrite(HB_2FWD, 0); + analogWrite(HB_2REV, -255*vr/vmax_); + } + } else { + analogWrite(HB_1FWD, 0); + analogWrite(HB_1REV, 0); + analogWrite(HB_2FWD, 0); + analogWrite(HB_2REV, 0); + } +} + +void checkTime() { + int dt = millis() - t_; + + if (dt > 500) { + time_ok_ = 0; + } +} + +void setup() +{ + pinMode(HB_1REV, OUTPUT); + pinMode(HB_1EN, OUTPUT); + pinMode(HB_1FWD, OUTPUT); + pinMode(HB_2REV, OUTPUT); + pinMode(HB_2EN, OUTPUT); + pinMode(HB_2FWD, OUTPUT); + + //Serial.begin (9600); + pinMode(trigPin, OUTPUT); + pinMode(echoPin, INPUT); + pinMode(led, OUTPUT); + + nh.initNode(); + nh.subscribe(sub); + + time_ok_ = 0; +} + +void loop() +{ + nh.spinOnce(); + checkTime(); + double df = (double) distancefactor(); + writespeed(vl_*df*time_ok_, vr_*df*time_ok_); + delay(1); +} diff --git a/case_study/arduino_lab/group_34/run.sh b/case_study/arduino_lab/group_34/run.sh new file mode 100755 index 0000000..b1f3c58 --- /dev/null +++ b/case_study/arduino_lab/group_34/run.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +rm -f mut*/output.txt +cd original +platformio run -t clean +platformio run -t upload +python3 -m pytest ../run_test.py | tee "output.txt" +cd .. + +for mut_dir in $(ls -d mut*/); do + echo $mut_dir + cd $mut_dir + platformio run -t clean + platformio run -t upload + python3 -m pytest ../run_test.py -x| tee "output.txt" + cd .. + mv $mut_dir executed +done + +egrep -lir --include=*.txt "FAILED" . > "failed.txt" diff --git a/case_study/arduino_lab/group_34/run_test.py b/case_study/arduino_lab/group_34/run_test.py new file mode 100755 index 0000000..78bd93b --- /dev/null +++ b/case_study/arduino_lab/group_34/run_test.py @@ -0,0 +1,126 @@ +import subprocess,os,signal +import serial,io,time +import pytest +import string +from operator import add + +#----------------------------- +# test helper functions +#----------------------------- +def send_image(image_path): + # source ros file + output = subprocess.check_output('source /home/qianqianzhu/image_transport_ws/devel/setup.bash;env -0' + ,shell=True, executable="/bin/bash") + # replace env + #os.environ.clear() + lines = output.decode().split('\0') + for line in lines: + (key, _, value) = line.partition("=") + os.environ[key] = value + + #image = '/home/qianqianzhu/Pictures/straight.jpg' + #image = '/home/qianqianzhu/Pictures/left.jpg' + #image = '/home/qianqianzhu/Pictures/right.jpeg' + ros_command = 'rosrun image_transport_tutorial my_publisher '+ image_path + pro = subprocess.Popen(ros_command,shell=True,preexec_fn=os.setsid) + + # record pwm + subprocess.call('rm -f speed_log.txt',shell=True) + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + filename = 'speed_log.txt' # log file to save data in + + with serial.Serial(device,baud) as serialPort, open(filename,'wb') as outFile: + print("start recording serial...") + timer = time.time() + while(time.time()-timer<=5): + line = serialPort.readline() # must send \n! get a line of log + #print (line) # show line on screen + outFile.write(line) # write line of text to file + outFile.flush() # make sure it actually gets written out + print("stop recording serial...") + + # stop sending an image + os.killpg(os.getpgid(pro.pid), signal.SIGTERM) + + # read speed from pwm log + f = open(filename,"rb") + + total = [0,0,0,0] + #print("hello") + + for line in f: + if len(line) == 9: + line = line.decode('utf-8') + columns = line.strip().split(',') + if len(columns) == 4: + delta = list(map(int,columns)) + total = list(map(add,total,delta)) + #print(total) + f.close() + return total + +def send_ultrasensor(signal): + device = '/dev/ttyACM1' # serial port + baud = 57600 # baud rate + with serial.Serial(device,baud,timeout=5) as ard: + time.sleep(0.5) # wait for Arduino + # Serial write section + ard.flush() + print ("send STOP signal!") + ard.write(str.encode(signal)) + time.sleep(0.5) + +#----------------------------- +# test cases +#----------------------------- +def test_straight(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/straight.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == pytest.approx(right_speed,rel=5e-2) + +def test_turn_left(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/left.jpeg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed < right_speed + +def test_turn_right(): + send_ultrasensor("go") + image_path = '/home/qianqianzhu/Pictures/right.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed > right_speed + +def test_stop_obstacle(): + send_ultrasensor("stop") + time.sleep(0.5) + image_path = '/home/qianqianzhu/Pictures/straight.jpg' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == 0 + assert right_speed == 0 + +def test_stop_no_image(): + time.sleep(0.5) + send_ultrasensor("go") + image_path = '' + speed = send_image(image_path) + left_speed = speed[1] + right_speed = speed[3] + print(speed) + assert left_speed == 0 + assert right_speed == 0 + + diff --git a/case_study/arduino_lab/group_34/speed_log.txt b/case_study/arduino_lab/group_34/speed_log.txt new file mode 100755 index 0000000..30ef077 --- /dev/null +++ b/case_study/arduino_lab/group_34/speed_log.txt @@ -0,0 +1,6559 @@ + +0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 +0,0,0,0 diff --git a/case_study/arduino_lab/robot-manual.pdf b/case_study/arduino_lab/robot-manual.pdf new file mode 100644 index 0000000..9ffeff6 Binary files /dev/null and b/case_study/arduino_lab/robot-manual.pdf differ diff --git a/case_study/hcsr04sensor b/case_study/hcsr04sensor new file mode 160000 index 0000000..311977b --- /dev/null +++ b/case_study/hcsr04sensor @@ -0,0 +1 @@ +Subproject commit 311977b75c6bb284fc1bbe6733ef61dbb86f9277 diff --git a/case_study/jean-pierre b/case_study/jean-pierre new file mode 160000 index 0000000..a245405 --- /dev/null +++ b/case_study/jean-pierre @@ -0,0 +1 @@ +Subproject commit a2454053e55bb3c00cff11a45c5f893be8e452be diff --git a/case_study/kompline_lorry/__init__.py b/case_study/kompline_lorry/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/case_study/kompline_lorry/arm.py b/case_study/kompline_lorry/arm.py new file mode 100644 index 0000000..d32f149 --- /dev/null +++ b/case_study/kompline_lorry/arm.py @@ -0,0 +1,206 @@ +import RPi.GPIO as GPIO +import time + +# motors +plift0 = 20 +plift1 = 21 +phand = 2 +prot0 = 12 # anti-clockwise +prot1 = 16 # clockwise + +# sensor +pheight = 6 +protate = 5 +pvertical = 11 + +# rotator +rotspeed = 50 +ninety_timeout = 4.6*(rotspeed/50) + +class Arm: + def __init__(self): + GPIO.setmode(GPIO.BCM) + GPIO.setup(plift0,GPIO.OUT,initial=1) + GPIO.setup(plift1,GPIO.OUT,initial=1) + GPIO.setup(phand,GPIO.OUT,initial=0) + GPIO.setup(prot0,GPIO.OUT,initial=0) + GPIO.setup(prot1,GPIO.OUT,initial=0) + GPIO.setup(pheight,GPIO.IN,pull_up_down=GPIO.PUD_UP) + GPIO.setup(protate,GPIO.IN,pull_up_down=GPIO.PUD_UP) + GPIO.setup(pvertical,GPIO.IN,pull_up_down=GPIO.PUD_UP) + + def lift(self,direction, at): + ''' + direction: 1-up, 0-down + at: action time, 4cm per second + ''' + GPIO.output(plift0, direction) + GPIO.output(plift1, 1-direction) + time.sleep(at) + GPIO.output(plift0, 1) + GPIO.output(plift1, 1) + return direction + + def grab(self,direction): + ''' + direction: range-[4.8-7.8], 4.8-tight, 7.8-loose + ''' + pwm=GPIO.PWM(phand,50) + pwm.start(direction) + print('direction no: '+str(direction)) + pwm.stop() + return direction + + def get_rotators(self): + pwms=[] + pwm0=GPIO.PWM(prot0,100) + pwm1=GPIO.PWM(prot1,100) + pwms.append(pwm0) + pwms.append(pwm1) + return pwms + + def rotate(self,direction,speed,rot_time): + ''' + direction: 0-anti-clockwise,1-clockwise + ''' + pwms=self.get_rotators() + pwms[direction].start(speed) + time.sleep(rot_time) + #input() + pwms[direction].stop() + + def flipover(self): + if(GPIO.input(pvertical)==0): + self.rotate2pos1() + time.sleep(0.2) + self.rotate2pos1() + else: + self.rotate2pos0() + time.sleep(0.2) + self.rotate2pos0() + + def rotate2pos0(self): + ''' + the rotator must be reset before calling this function + posid: 0-A face up;clockwise, 1-A face down;anti-clockwisw + ''' + pwms=self.get_rotators() + timeout=ninety_timeout + start=time.time() + pwms[1].start(rotspeed) + time.sleep(0.8) + detected_sensor=pvertical + while((GPIO.input(detected_sensor)==1) \ + and (time.time()-start<=timeout)): + pass + time.sleep(0.01) + if(time.time()-start>timeout): + print('somthing went wrong...') + else: + print('reached POS 0!') + pwms[1].stop() + #return time.time()-start + + def rotate2pos1(self): + ''' + the rotator must be reset before calling this function + posid: 0-A face up;clockwise, 1-A face down;anti-clockwisw + ''' + pwms=self.get_rotators() + timeout=ninety_timeout + start=time.time() + pwms[0].start(rotspeed) + time.sleep(0.8) + detected_sensor=protate + while((GPIO.input(detected_sensor)==1) \ + and (time.time()-start<=timeout)): + pass + time.sleep(0.01) + if(time.time()-start>timeout): + print('somthing went wrong...') + else: + print('reached POS 1!') + pwms[0].stop() + #return time.time()-start + + def resetrotate(self): + pwms=self.get_rotators() + # first rotate anti-clockwise for 1/4 pi, then clockwise for anthor 1/2 pi + timeout = 1/2 * ninety_timeout + pos = -1 + print('first rotate anti-clockwise') + start0 = time.time() + pwms[1].start(rotspeed) + while((time.time()-start0)<=timeout): + time.sleep(0.01) + if(GPIO.input(pvertical)==0): + print('reached POS 0!') + pos=0 + break + if(GPIO.input(protate)==0): + print('reached POS 1!') + pos=1 + break + pwms[1].stop() + time.sleep(0.2) + if(pos<0): + print('then rotate clockwise') + start1 = time.time() + pwms[0].start(rotspeed) + while((pos<0) and ((time.time()-start1)<=2*timeout)): + time.sleep(0.01) + if(GPIO.input(pvertical)==0): + print('reached POS 0!') + pos=0 + break + if(GPIO.input(protate)==0): + print('reached POS 1!') + pos=1 + break + pwms[0].stop() + time.sleep(0.2) + if(pos >= 0): + self.rotate2reset(pos) + #print('reached a predefined pos!') + + def rotate2reset(self,direction): + ''' + direction: 0-anti-clockwise, 1-clockwise + ''' + pwms=self.get_rotators() + timeout=ninety_timeout + start=time.time() + pwms[direction].start(rotspeed) + while((not((GPIO.input(pvertical)==0)\ + and (GPIO.input(protate)==0)))\ + and (time.time()-start<=timeout)): + pass + time.sleep(0.01) + if(time.time()-start>timeout): + print('something went wrong...') + else: + print('reached POS RET!') + pwms[direction].stop() + + def resetheight(self): + # lift direction: move down to the default height + # down + timeout = 3 + start = time.time() + while ((GPIO.input(pheight)==1)\ + and (time.time()-start<=timeout)): + GPIO.output(plift0,0) + GPIO.output(plift1,1) + if(time.time()-start>timeout): + print('something went wrong...') + else: + print('reached the default height!') + GPIO.output(plift0, 1) + GPIO.output(plift1, 1) + + def read_current_pheight(self): + return GPIO.input(pheight) + + def cleanup(self): + GPIO.cleanup() + diff --git a/case_study/kompline_lorry/chassis.py b/case_study/kompline_lorry/chassis.py new file mode 100755 index 0000000..88a02a2 --- /dev/null +++ b/case_study/kompline_lorry/chassis.py @@ -0,0 +1,197 @@ +import RPi.GPIO as GPIO +import time +import math +import sys + +class Chassis: + # actions: + # 0 forward + # 1 backward + # 2 strafe left + # 3 strafe right + # 4 left turn + # 5 right turn + + # Steppers + _lfdir=14 + _lfpul=15 + _lfact=[1,0,0,1,1,0] + + _ltdir=18 + _ltpul=23 + _ltact=[1,0,1,0,1,0] + + _rfdir=24 + _rfpul=25 + _rfact=[0,1,0,1,1,0] + + _rtdir=8 + _rtpul=7 + _rtact=[0,1,1,0,1,0] + + # Sensors + _lfbw=19 + _rfbw=26 + _rmbw=13 + + _srate = 1200/314.159 + _turnrate = 10838 + _stepperunit = [_srate,_srate,_srate+0.1,_srate+0.1,_turnrate,_turnrate] + + _sigint=2.5 + + def __init__(self): + GPIO.setmode(GPIO.BCM) + GPIO.setup(Chassis._ltdir,GPIO.OUT,initial=0) + GPIO.setup(Chassis._rtdir,GPIO.OUT,initial=0) + GPIO.setup(Chassis._lfdir,GPIO.OUT,initial=0) + GPIO.setup(Chassis._rfdir,GPIO.OUT,initial=0) + GPIO.setup(Chassis._ltpul,GPIO.OUT,initial=0) + GPIO.setup(Chassis._rtpul,GPIO.OUT,initial=0) + GPIO.setup(Chassis._lfpul,GPIO.OUT,initial=0) + GPIO.setup(Chassis._rfpul,GPIO.OUT,initial=0) + GPIO.setup(Chassis._lfbw,GPIO.IN) + GPIO.setup(Chassis._rfbw,GPIO.IN) + GPIO.setup(Chassis._rmbw,GPIO.IN) + + def move(self, act, lenu, v0u, v1u, cond): + ''' + act: action id + lenu: length (0-3: mm & 4-5: round) + v0u: initial speed unit/s + v1u: final speed unit/s + cond: enable condition + ''' + GPIO.output(Chassis._lfdir, Chassis._lfact[act]) + GPIO.output(Chassis._ltdir, Chassis._ltact[act]) + GPIO.output(Chassis._rfdir, Chassis._rfact[act]) + GPIO.output(Chassis._rtdir, Chassis._rtact[act]) + + print(self.read_current_stepper_states()) + + v0 = v0u * Chassis._stepperunit[act] + v1 = v1u * Chassis._stepperunit[act] + dv = v1 - v0 + nstep = int(lenu * Chassis._stepperunit[act]) + + i = 0 + while (cond() and i= errortol): + nstep = 0 + GPIO.output(Chassis._lfdir, Chassis._lfact[direct]) + GPIO.output(Chassis._ltdir, Chassis._ltact[direct]) + GPIO.output(Chassis._rfdir, Chassis._rfact[direct]) + GPIO.output(Chassis._rtdir, Chassis._rtact[direct]) + while(GPIO.input(Chassis._lfbw)==stat\ + or GPIO.input(Chassis._rfbw)==stat): + if GPIO.input(Chassis._lfbw)==stat: + GPIO.output(Chassis._lfpul,1) + GPIO.output(Chassis._ltpul,1) + if GPIO.input(Chassis._rfbw)==stat: + GPIO.output(Chassis._rfpul,1) + GPIO.output(Chassis._rtpul,1) + time.sleep(stepdelay) + GPIO.output(Chassis._rtpul,0) + GPIO.output(Chassis._ltpul,0) + GPIO.output(Chassis._rfpul,0) + GPIO.output(Chassis._lfpul,0) + time.sleep(stepdelay) + nstep = nstep + 1 + print(nstep) + time.sleep(0.5) + direct = 1 - direct + stat = 1 - stat + + #move(0,1000, 50, 50, lscond) + #align() + #time.sleep(1) + + def alignmiddle(self): + ''' + read rmbw's state: 1-black(strate left-2), 0-white(strate right-3) + ''' + initdir = [3,2] + initstate = GPIO.input(Chassis._rmbw) + self.move(initdir[initstate],300,20,20,(lambda:(GPIO.input(Chassis._rmbw)==initstate))) + print('reached the middle line!') + + def mymove(self,direction,distance): + if direction in range(4): + self.move(direction,distance,50,50, (lambda: True)) + else: + self.move(direction,0.05,0.01,0.01,(lambda:True)) + + def myalignline(self): + self.alignline(1,0,10) + self.alignmiddle() + + def __str__(self): + return str(GPIO.input(Chassis._lfbw))+' '+str(GPIO.input(Chassis._rfbw)) + + def cleanup(self): + GPIO.cleanup() + + def read_current_stepper_states(self): + states = [] + for pin in self.get_stepper_pins(): + states.append(GPIO.input(pin)) + return states + + def read_current_front_light_sensor(self): + states = [] + for pin in self.get_front_light_sensor_pins(): + states.append(GPIO.input(pin)) + return states + def read_current_middle_light_sensor(self): + return GPIO.input(Chassis._rmbw) + + def get_stepper_pins(self): + pins = [] + pins.append(Chassis._lfdir) + pins.append(Chassis._lfpul) + pins.append(Chassis._ltdir) + pins.append(Chassis._ltpul) + pins.append(Chassis._rfdir) + pins.append(Chassis._rfpul) + pins.append(Chassis._rtdir) + pins.append(Chassis._rtpul) + return pins + + def get_front_light_sensor_pins(self): + pins = [] + pins.append(Chassis._lfbw) + pins.append(Chassis._rfbw) + return pins + + def get_sensor_pins(self): + pins = [] + pins.append(Chassis._lfbw) + pins.append(Chassis._rfbw) + pins.append(Chassis._rmbw) + return pins + diff --git a/case_study/kompline_lorry/test_arm.py b/case_study/kompline_lorry/test_arm.py new file mode 100644 index 0000000..eb7786e --- /dev/null +++ b/case_study/kompline_lorry/test_arm.py @@ -0,0 +1,167 @@ +import RPi.GPIO as GPIO +import pytest +from arm import * +import time + +rotspeed=50 +ninety_timeout=4.5*rotspeed/50 + +def test_lift(): + #pytest.skip('test_lift') + # 1-up + arm = Arm() + time.sleep(0.5) + start=time.time() + dir = arm.lift(1,1) + duration=time.time()-start + assert duration == pytest.approx(1,rel=1e-1) + assert dir==1 + # 0-down + time.sleep(0.5) + dir = arm.lift(0,1) + assert dir==0 + time.sleep(0.1) + arm.cleanup() + +def test_grab(): + #pytest.skip('test_grab') + arm = Arm() + time.sleep(0.5) + dir=arm.grab(5) + assert dir==5 + time.sleep(0.1) + arm.cleanup() + +def test_resetheight(): + #pytest.skip('pass') + arm = Arm() + time.sleep(0.5) + arm.lift(1,1) + time.sleep(0.5) + arm.resetheight() + #arm.lift(0,0.1) + #assert arm.read_current_pheight() == 0 + time.sleep(0.5) + arm.lift(1,1) + assert arm.read_current_pheight() == 1 + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_at_1(capsys): + ##pytest.skip('test_resetrotate_at_1') + arm = Arm() + arm.rotate2pos1() + out,err = capsys.readouterr() + assert out == 'reached POS 1!\n' + time.sleep(1) + arm.resetrotate() + out,err = capsys.readouterr() + assert out == 'first rotate anti-clockwise\nreached POS 1!\nreached POS RET!\n' + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_at_0(capsys): + #pytest.skip('test_resetrotate_at_0') + arm = Arm() + arm.rotate2pos0() + out,err = capsys.readouterr() + assert out == 'reached POS 0!\n' + time.sleep(1) + arm.resetrotate() + out,err = capsys.readouterr() + assert out == 'first rotate anti-clockwise\nreached POS 0!\nreached POS RET!\n' + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_between_ret_1_case1(capsys): + #pytest.skip('pass') + arm = Arm() + arm.resetrotate() + time.sleep(0.5) + # case 1: close to 1 + arm.rotate(0,rotspeed,ninety_timeout*0.8) + out,err = capsys.readouterr() + time.sleep(0.5) + arm.resetrotate() + out,err = capsys.readouterr() + assert out == 'first rotate anti-clockwise\nthen rotate clockwise\nreached POS 1!\nreached POS RET!\n' + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_between_ret_1_case2(capsys): + #pytest.skip('pass') + # case 2: close to RET + arm = Arm() + time.sleep(0.5) + arm.rotate(0,rotspeed,ninety_timeout*0.1) + time.sleep(0.5) + out,err = capsys.readouterr() + arm.resetrotate() + out,err = capsys.readouterr() + assert out == 'first rotate anti-clockwise\nreached POS 1!\nreached POS RET!\n' + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_between_0_ret_case1(capsys): + #pytest.skip('pass') + # case 1: close to RET + arm = Arm() + time.sleep(0.5) + arm.rotate(1,rotspeed,ninety_timeout*0.2) + out,err=capsys.readouterr() + time.sleep(0.5) + arm.resetrotate() + out,err=capsys.readouterr() + assert out == 'first rotate anti-clockwise\nthen rotate clockwise\nreached POS 0!\nreached POS RET!\n' + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_between_0_ret_case2(capsys): + #pytest.skip('pass') + # case 2: close to 0 + arm = Arm() + time.sleep(0.5) + arm.rotate(1,rotspeed,ninety_timeout*0.8) + out,err = capsys.readouterr() + time.sleep(0.5) + arm.resetrotate() + out,err=capsys.readouterr() + assert out == 'first rotate anti-clockwise\nreached POS 0!\nreached POS RET!\n' + time.sleep(0.1) + arm.cleanup() + +def test_resetrotate_at_ret(capsys): + #pytest.skip('pass') + arm=Arm() + time.sleep(0.5) + arm.resetrotate() + out,err = capsys.readouterr() + time.sleep(0.5) + start = time.time() + arm.resetrotate() + duration = time.time()-start + assert duration < 1 + out,err = capsys.readouterr() + assert 'then rotate clockwise' not in out + arm.cleanup() + +def test_flipover(capsys): + #pytest.skip('pass') + arm = Arm() + time.sleep(0.5) + out,err=capsys.readouterr() + arm.rotate2pos0() + out,err=capsys.readouterr() + assert out == 'reached POS 0!\n' + time.sleep(0.5) + arm.flipover() + out,err=capsys.readouterr() + assert out =='reached POS 1!\nreached POS 1!\n' + time.sleep(0.5) + arm.flipover() + out,err=capsys.readouterr() + assert out == 'reached POS 0!\nreached POS 0!\n' + time.sleep(0.5) + arm.resetrotate() + arm.cleanup() + diff --git a/case_study/kompline_lorry/test_chassis.py b/case_study/kompline_lorry/test_chassis.py new file mode 100755 index 0000000..00b9ea5 --- /dev/null +++ b/case_study/kompline_lorry/test_chassis.py @@ -0,0 +1,77 @@ +import RPi.GPIO as GPIO +import pytest +from chassis import * + +#chassis = Chassis() + +def test_gpio_setup(): + chassis = Chassis() + for pin in chassis.get_stepper_pins(): + assert GPIO.gpio_function(pin) == GPIO.OUT + for pin in chassis.get_sensor_pins(): + assert GPIO.gpio_function(pin) == GPIO.IN + chassis.cleanup() + +def test_move_direction(capsys): + chassis = Chassis() + # 0: forward + chassis.move(0, 20, 20, 20, (lambda:True)) + out, err = capsys.readouterr() + assert out == '[1, 0, 1, 0, 0, 0, 0, 0]\n' + time.sleep(0.5) + # 1: backward + chassis.move(1, 20, 20, 20, (lambda: True)) + out, err = capsys.readouterr() + assert out == '[0, 0, 0, 0, 1, 0, 1, 0]\n' + time.sleep(0.5) + # 2: strate left + chassis.move(2, 20, 20, 20, (lambda: True)) + out, err = capsys.readouterr() + assert out == '[0, 0, 1, 0, 0, 0, 1, 0]\n' + time.sleep(0.5) + # 3: strate right + chassis.move(3, 20, 20, 20, (lambda: True)) + out, err = capsys.readouterr() + assert out == '[1, 0, 0, 0, 1, 0, 0, 0]\n' + time.sleep(0.5) + # 4: left turn + chassis.move(4, 0.02, 0.02, 0.02, (lambda: True)) + out, err = capsys.readouterr() + assert out == '[1, 0, 1, 0, 1, 0, 1, 0]\n' + time.sleep(0.5) + # 5: right turn + time.sleep(0.5) + chassis.move(5, 0.02, 0.02, 0.02, (lambda: True)) + out, err = capsys.readouterr() + assert out == '[0, 0, 0, 0, 0, 0, 0, 0]\n' + chassis.cleanup() + +def test_alignline(): + chassis = Chassis() + #pytest.skip('cannot test now') + # black to white + chassis.alignline(1,0,10) + time.sleep(0.5) + chassis.move(0,20,20,20, (lambda: True)) + for state in chassis.read_current_front_light_sensor(): + assert state == 0 + time.sleep(0.5) + chassis.move(1,50,20,20, (lambda: True)) + for state in chassis.read_current_front_light_sensor(): + assert state == 1 + #time.sleep(0.5) + #chassis.move(0,20,20,20, (lambda: True)) + chassis.cleanup() + +def test_alignmiddle(): + chassis = Chassis() + chassis.alignmiddle() + time.sleep(0.5) + chassis.move(2,20,20,20,(lambda:True)) + assert chassis.read_current_middle_light_sensor()==0 + time.sleep(0.5) + chassis.move(3,40,20,20,(lambda:True)) + assert chassis.read_current_middle_light_sensor()==1 + #time.sleep(0.5) + #chassis.move(2,20,20,20,(lambda:True)) + chassis.cleanup() diff --git a/case_study/python-gpiozero b/case_study/python-gpiozero new file mode 160000 index 0000000..4a9771f --- /dev/null +++ b/case_study/python-gpiozero @@ -0,0 +1 @@ +Subproject commit 4a9771fa828dcb31800269edec3c0bfa6a27c673