RAFCON (RMC advanced Flow Control) State machines can easily be reused in form of library states. All you have to do for this is telling RAFCON the path to your state machine and give this path a name.
Important
- Always update your librarys before you start Rafcon (rtl_rafcon_lib and rtl_rafcon_sm!
- Make sure you are working on correct branch, where your state machines are!
- open a Terminal
- (optional) activate a virtual enviorment (e.g. for FollowMe)
- Enter
rafcon
in the Terminal
- Rafcon with Simulation - Then you need Ubuntu 16.04 with ROS Kinetic
- If you don't want/need the simulation - Ubuntu 18.04 and/or ROS Melodic is also fine
- Install Rafcon and follow the Instructions
- Importnat notices
- If you use a virtual envioremnt don't use --user option
- If you use Anaconda you still have to install it with pip
- open
RAFCON
- in
LIBRARIES
right-click (the left top pane) Add library root
- navigate to this repository folder
- ATTENTION NOW
make sure you put this exact folder name (rtl_rafcon_lib) as the
Name: insert your mounting key here
-->Name: rtl_rafcon_lib
at the top in the dialog, else things will explode!
- Open Preferences
- Go to core config
- Check Library_Recovery_Mode
- Important notice If this is not activated, it can happen that you can't load a state machine anymore if there was a change in a library you used, e.g. if there was an input type change (int to str). If enabled, Rafcon will delete the connection and will print a notify in the 'Debug Console' and can then load the complete state machine.
It is possible to add external editors in rafcon for programming the states, e.g. visual studio code
-
Open preferences
-
Go to GUI Config
-
Insert
code
into DEFAULT_EXTERNAL_EDITORThe code argument will open the file with visual studio code, when you the user clicks on open externally.
During the installation multiple errors can occur. Here are the most common ones:
-
error: invalid command ’bdist wheel' - Check this out
-
error: command ’x86-64-linux-gnu-gcc’ failed with exit status 1
Install this:
sudo apt-get install python3-dev
(if you use python 3)More about this here
-
ERROR: Could not build wheels for PyGObject which use PEP 517 and cannot be installed directly
Try installing this:
sudo apt install libgirepository1.0-de
-
Required gtk+ version 3.20, current version is 3.X (While starting Rafcon)
Do this:
sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo add-apt-repository ppa:gnome3-team/gnome
sudo apt update
sudo apt dist-upgrade
More infos about this here
-
TypeError: Couldn’t find foreign struct converter for ’cairo.Context
Do this:
sudo apt-get install python-gi-cairo
This section highlights the most important documentary about Rafcon, which you should read to get started.
-
Concepts - Read this to understand the concepts of Rafcon, e.g. the states and how data is being transmitted between states.
-
Basic Tutorial - To get to know the basic workflow of Rafcon.
-
ROS Tutorial - o get know how a connection can be established between Rafcon and ROS.
-
mportant to learn is how to use states as a Library. There is a Tutorial but it is not so clear. Try to make a state machine and save it and re-use it again in another state machine as a library. This concept is very important because re-using library's is a key concept of Rafcon.
Todo
tw 2019-06-11T11:37