|
1 |
| -HAROS Tutorials |
2 |
| -=============== |
| 1 | +# HAROS Tutorials |
3 | 2 |
|
4 |
| -This is a repository with example code to try out [HAROS](http://github.com/git-afsantos/haros). |
| 3 | +This is a repository with example code to try out the various features of the [HAROS framework](http://github.com/git-afsantos/haros). |
5 | 4 |
|
6 |
| -* clone the repo: `https://github.com/git-afsantos/haros_tutorials.git` |
7 |
| -* add the repository root directory to the `ROS_PACKAGE_PATH` (replace `<repo-root-directory>`): `ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:<repo-root-directory>/haros_tutorials` |
8 |
| -* cd into the repository directory: `cd haros_tutorials/` |
9 |
| -* run the full analysis and visualize the results: `haros full -p my_index.yaml` |
| 5 | +## What Is In The Box |
| 6 | + |
| 7 | +This repository contains ROS packages that serve no particular purpose, other than to try out HAROS. |
| 8 | +The `minimal_example` package is a minimal ROS package composed of two nodes with a ROS publisher, a ROS subscriber, a ROS service server, a ROS service client and a ROS parameter. |
| 9 | +The remaining four packages, `fictibot_drivers`, `fictibot_controller`, `fictibot_multiplex` and `fictibot_msgs` make up a fictitious mobile robot system, called Fictibot. |
| 10 | +The packages provide software drivers for the mobile base, a random walker controller, a multiplexer to filter commands by priority and message definitions, respectively. |
| 11 | +Despite being a fictitious robot, the system can be executed normally, using `rosrun`, or `roslaunch` with the various launch files contained in the packages. |
| 12 | + |
| 13 | +In addition to the ROS packages, this repository also contains [example project files for HAROS](./projects) and [scripts](./scripts) to help execute HAROS. |
| 14 | + |
| 15 | +## Installing |
| 16 | + |
| 17 | +You can automate much of the installation of HAROS and this repository with [make-haros-easy](https://github.com/git-afsantos/make-haros-easy). |
| 18 | + |
| 19 | +For a manual installation, the first step is to ensure that you have a working [catkin workspace](http://wiki.ros.org/catkin/Tutorials/create_a_workspace). |
| 20 | +Depending on your setup, you might want to work with multiple workspaces, and create a new workspace for this tutorial. |
| 21 | +Let us call it `haros_ws`. |
| 22 | + |
| 23 | +Clone this repository into the source space of this workspace, by default `src`. |
| 24 | + |
| 25 | +```bash |
| 26 | +cd haros_ws/src |
| 27 | +git clone https://github.com/git-afsantos/haros_tutorials.git |
| 28 | +``` |
| 29 | + |
| 30 | +Simply build the packages with `catkin_make`, and you are ready to use the packages in a ROS environment. |
| 31 | + |
| 32 | +```bash |
| 33 | +cd .. |
| 34 | +catkin_make |
| 35 | +source devel/setup.bash |
| 36 | +``` |
| 37 | + |
| 38 | +To use these packages with HAROS and Clang, an additional step is required. |
| 39 | +You have to create a `compile_commands.json` file in the `build` directory of the workspace. |
| 40 | +You can do it either with `catkin` or with `cmake`. |
| 41 | + |
| 42 | +```bash |
| 43 | +cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-3.8 src |
| 44 | +``` |
| 45 | + |
| 46 | +Or |
| 47 | + |
| 48 | +```bash |
| 49 | +catkin_make -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-3.8 |
| 50 | +``` |
| 51 | + |
| 52 | +Replace `src` in the first command with the source space of your workspace, if it is named differently. |
| 53 | +Replace `/usr/bin/clang++-3.8` with the correct path to your `clang++` version. |
| 54 | + |
| 55 | +## Standalone Usage |
| 56 | + |
| 57 | +To try out the ROS packages on their own, use any of the provided launch files. |
| 58 | +They set up different use scenarios, sometimes showcasing some ROS features and quirks that might not be well known. |
| 59 | + |
| 60 | +A normal use case, using the three Fictibot nodes: |
| 61 | + |
| 62 | +```bash |
| 63 | +roslaunch fictibot_controller multiplexer.launch |
| 64 | +``` |
| 65 | + |
| 66 | +Two Fictibot systems at the same time: |
| 67 | + |
| 68 | +```bash |
| 69 | +roslaunch fictibot_controller dual_bots.launch |
| 70 | +``` |
| 71 | + |
| 72 | +Some quirks with `rosparam` that might not be obvious from the documentation (read the launch file's comments as well): |
| 73 | + |
| 74 | +```bash |
| 75 | +roslaunch fictibot_controller test_rosparam.launch |
| 76 | +``` |
| 77 | + |
| 78 | +## Usage With HAROS |
| 79 | + |
| 80 | +You can try out HAROS manually with any of the provided [project files](./projects). |
| 81 | +Alternatively, feel free to use some pre-made [scripts](./scripts) that test out different features. |
| 82 | + |
| 83 | +- [`scripts/minimal.sh`](./scripts/minimal.sh) runs model extraction on `minimal_example` and any available plugins. |
| 84 | +- [`scripts/fictibot.sh`](./scripts/fictibot.sh) runs model extraction on various configurations of Fictibot and any available plugins. |
| 85 | +- [`scripts/queries.sh`](./scripts/queries.sh) defines architectural queries for some configurations of Fictibot and executes [`haros_plugin_pyflwor`](https://github.com/git-afsantos/haros-plugin-pyflwor). |
| 86 | +- [`scripts/hpl.sh`](./scripts/hpl.sh) defines [HPL properties](https://github.com/git-afsantos/hpl-specs) for the various Fictibot nodes and runs test generation with [`haros_plugin_pbt_gen`](https://github.com/git-afsantos/haros-plugin-pbt-gen). |
| 87 | +- [`scripts/perf.sh`](./scripts/perf.sh) defines the ground truth of the `multiplex` computation graph and evaluates the model extractor's accuracy with [`haros_plugin_model_ged`](https://github.com/git-afsantos/haros-plugin-model-ged). |
| 88 | + |
| 89 | +## Bugs, Questions and Support |
| 90 | + |
| 91 | +Please use the [issue tracker](https://github.com/git-afsantos/haros_tutorials/issues). |
| 92 | + |
| 93 | +## Contributing |
| 94 | + |
| 95 | +See [CONTRIBUTING](./CONTRIBUTING.md). |
| 96 | + |
| 97 | +## Acknowledgment |
| 98 | + |
| 99 | +This work is financed by the ERDF – European Regional Development Fund through the Operational Programme for Competitiveness and Internationalisation - COMPETE 2020 Programme and by National Funds through the Portuguese funding agency, FCT - Fundação para a Ciência e a Tecnologia within project PTDC/CCI-INF/29583/2017 (POCI-01-0145-FEDER-029583). |
0 commit comments